1998-08-15 00:23:28 +00:00
|
|
|
#ifndef _WX_NOTEBOOK_H_BASE_
|
|
|
|
#define _WX_NOTEBOOK_H_BASE_
|
1998-06-02 19:04:33 +00:00
|
|
|
|
1999-05-25 13:38:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// headers
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include "wx/event.h" // the base class: wxNotifyEvent
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// notebook event class (used by NOTEBOOK_PAGE_CHANGED/ING events)
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
class WXDLLEXPORT wxNotebookEvent : public wxNotifyEvent
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
wxNotebookEvent(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(wxNotebookEvent)
|
|
|
|
};
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// event macros
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
typedef void (wxEvtHandler::*wxNotebookEventFunction)(wxNotebookEvent&);
|
|
|
|
|
1999-06-09 18:16:38 +00:00
|
|
|
// Truncation in 16-bit BC++ means we need to define these differently
|
|
|
|
#if defined(__BORLANDC__) && defined(__WIN16__)
|
|
|
|
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
|
|
|
|
{ \
|
|
|
|
wxEVT_COMMAND_NB_PAGE_CHANGED, \
|
|
|
|
id, \
|
|
|
|
-1, \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
|
|
|
NULL \
|
|
|
|
},
|
|
|
|
|
|
|
|
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
|
|
|
|
{ \
|
|
|
|
wxEVT_COMMAND_NB_PAGE_CHANGING, \
|
|
|
|
id, \
|
|
|
|
-1, \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
|
|
|
NULL \
|
|
|
|
},
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
1999-05-25 13:38:50 +00:00
|
|
|
#define EVT_NOTEBOOK_PAGE_CHANGED(id, fn) \
|
|
|
|
{ \
|
|
|
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, \
|
|
|
|
id, \
|
|
|
|
-1, \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
|
|
|
NULL \
|
|
|
|
},
|
|
|
|
|
|
|
|
#define EVT_NOTEBOOK_PAGE_CHANGING(id, fn) \
|
|
|
|
{ \
|
|
|
|
wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, \
|
|
|
|
id, \
|
|
|
|
-1, \
|
|
|
|
(wxObjectEventFunction)(wxEventFunction)(wxNotebookEventFunction) &fn, \
|
|
|
|
NULL \
|
|
|
|
},
|
|
|
|
|
1999-06-09 18:16:38 +00:00
|
|
|
#endif
|
|
|
|
|
1999-05-25 13:38:50 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// wxNotebook class itself
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
1998-07-10 14:15:17 +00:00
|
|
|
#if defined(__WXMSW__)
|
1998-12-20 23:49:21 +00:00
|
|
|
#ifdef __WIN16__
|
|
|
|
#include "wx/generic/notebook.h"
|
|
|
|
#else
|
1998-06-22 21:50:11 +00:00
|
|
|
#include "wx/msw/notebook.h"
|
1998-12-20 23:49:21 +00:00
|
|
|
#endif
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXMOTIF__)
|
1998-12-23 21:35:51 +00:00
|
|
|
#include "wx/generic/notebook.h"
|
1998-07-10 14:15:17 +00:00
|
|
|
#elif defined(__WXGTK__)
|
1998-06-02 19:04:33 +00:00
|
|
|
#include "wx/gtk/notebook.h"
|
1998-08-07 20:23:17 +00:00
|
|
|
#elif defined(__WXQT__)
|
|
|
|
#include "wx/qt/notebook.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXMAC__)
|
1999-11-09 15:24:52 +00:00
|
|
|
#include "wx/generic/notebook.h"
|
1999-07-28 03:38:12 +00:00
|
|
|
#elif defined(__WXPM__)
|
|
|
|
#include "wx/os2/notebook.h"
|
1998-08-15 00:23:28 +00:00
|
|
|
#elif defined(__WXSTUBS__)
|
|
|
|
#include "wx/stubs/notebook.h"
|
1998-06-02 19:04:33 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
1998-08-15 00:23:28 +00:00
|
|
|
// _WX_NOTEBOOK_H_BASE_
|