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:
Julian Smart
2002-11-23 00:00:21 +00:00
parent dbad89ddf6
commit 35c9aadc34
3 changed files with 29 additions and 14 deletions

View File

@@ -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

View File

@@ -126,12 +126,30 @@ protected:
DECLARE_EVENT_TABLE()
};
class WXDLLEXPORT wxTabEvent: public wxNotifyEvent
class WXDLLEXPORT wxTabEvent : public wxNotifyEvent
{
DECLARE_DYNAMIC_CLASS(wxTabEvent)
public:
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0,
int nSel = -1, int nOldSel = -1)
: wxNotifyEvent(commandType, id)
{
m_nSel = nSel;
m_nOldSel = nOldSel;
}
public:
wxTabEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
// 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&);

View File

@@ -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__