wxTabEvent and tab styles now in keeping with wxNotebook, for future
reference. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17950 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1173,8 +1173,12 @@ enum wxBorder
|
||||
*/
|
||||
#define wxTC_RIGHTJUSTIFY 0x0010
|
||||
#define wxTC_FIXEDWIDTH 0x0020
|
||||
#define wxTC_OWNERDRAW 0x0040
|
||||
#define wxTC_TOP 0x0000 // default
|
||||
#define wxTC_LEFT 0x0020
|
||||
#define wxTC_RIGHT 0x0040
|
||||
#define wxTC_BOTTOM 0x0080
|
||||
#define wxTC_MULTILINE wxNB_MULTILINE
|
||||
#define wxTC_OWNERDRAW 0x0200
|
||||
|
||||
// wxToolBar style flags
|
||||
#define wxTB_HORIZONTAL wxHORIZONTAL // == 0x0004
|
||||
|
@@ -128,10 +128,28 @@ DECLARE_EVENT_TABLE()
|
||||
|
||||
class WXDLLEXPORT wxTabEvent : public wxNotifyEvent
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
|
||||
public:
|
||||
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
|
||||
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
|
||||
int nSel = -1, int nOldSel = -1)
|
||||
: wxNotifyEvent(commandType, id)
|
||||
{
|
||||
m_nSel = nSel;
|
||||
m_nOldSel = nOldSel;
|
||||
}
|
||||
|
||||
// accessors
|
||||
// the currently selected page (-1 if none)
|
||||
int GetSelection() const { return m_nSel; }
|
||||
void SetSelection(int nSel) { m_nSel = nSel; }
|
||||
// the page that was selected before the change (-1 if none)
|
||||
int GetOldSelection() const { return m_nOldSel; }
|
||||
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
|
||||
|
||||
private:
|
||||
int m_nSel, // currently selected page
|
||||
m_nOldSel; // previously selected page
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxTabEvent)
|
||||
};
|
||||
|
||||
typedef void (wxEvtHandler::*wxTabEventFunction)(wxTabEvent&);
|
||||
|
@@ -45,6 +45,7 @@
|
||||
#include "wx/msw/imaglist.h"
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabCtrl, wxControl)
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxNotifyEvent)
|
||||
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGED)
|
||||
DEFINE_EVENT_TYPE(wxEVT_COMMAND_TAB_SEL_CHANGING)
|
||||
@@ -158,6 +159,7 @@ bool wxTabCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
|
||||
event.SetEventObject( this );
|
||||
event.SetEventType(eventType);
|
||||
event.SetInt(idCtrl) ;
|
||||
event.SetSelection(idCtrl);
|
||||
|
||||
return ProcessEvent(event);
|
||||
}
|
||||
@@ -439,14 +441,5 @@ void wxMapBitmap(HBITMAP hBitmap, int width, int height)
|
||||
}
|
||||
#endif
|
||||
|
||||
// Tab event
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxTabEvent, wxNotifyEvent)
|
||||
|
||||
wxTabEvent::wxTabEvent(wxEventType commandType, int id):
|
||||
wxNotifyEvent(commandType, id)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
// __WIN95__
|
||||
|
Reference in New Issue
Block a user