1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/nbkbase.cpp
3 // Purpose: common wxNotebook methods
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 Vadim Zeitlin
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // For compilers that support precompilation, includes "wx.h".
21 #include "wx/wxprec.h"
32 #include "wx/notebook.h"
34 // ============================================================================
36 // ============================================================================
38 // ----------------------------------------------------------------------------
40 // ----------------------------------------------------------------------------
42 wxSize
wxNotebookBase::CalcSizeFromPage(const wxSize
& sizePage
) const
44 // this is, of course, totally bogus -- but we must do something by
45 // default because not all ports implement this
46 wxSize sizeTotal
= sizePage
;
48 if ( HasFlag(wxBK_LEFT
) || HasFlag(wxBK_RIGHT
) )
53 else // tabs on top/bottom side
62 // ----------------------------------------------------------------------------
64 // ----------------------------------------------------------------------------
66 bool wxNotebookBase::SendPageChangingEvent(int nPage
)
68 wxBookCtrlEvent
event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
, GetId());
69 event
.SetSelection(nPage
);
70 event
.SetOldSelection(GetSelection());
71 event
.SetEventObject(this);
72 return !GetEventHandler()->ProcessEvent(event
) || event
.IsAllowed();
75 void wxNotebookBase::SendPageChangedEvent(int nPageOld
, int nPageNew
)
77 wxBookCtrlEvent
event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
, GetId());
78 event
.SetSelection(nPageNew
== -1 ? GetSelection() : nPageNew
);
79 event
.SetOldSelection(nPageOld
);
80 event
.SetEventObject(this);
81 GetEventHandler()->ProcessEvent(event
);
84 #endif // wxUSE_NOTEBOOK