X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fb46a9a6c6f291806a5fecbb848930c344e17e11..bd996abe63a8ed6aa07b26856a0d7935002e3e81:/src/os2/notebook.cpp diff --git a/src/os2/notebook.cpp b/src/os2/notebook.cpp index 9d105d5ae9..a32e88326e 100644 --- a/src/os2/notebook.cpp +++ b/src/os2/notebook.cpp @@ -56,17 +56,18 @@ // event table // ---------------------------------------------------------------------------- -#if !USE_SHARED_LIBRARIES - BEGIN_EVENT_TABLE(wxNotebook, wxControl) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED) +DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING) + +BEGIN_EVENT_TABLE(wxNotebook, wxControl) EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange) EVT_SIZE(wxNotebook::OnSize) EVT_SET_FOCUS(wxNotebook::OnSetFocus) EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey) - END_EVENT_TABLE() +END_EVENT_TABLE() - IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) - IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent) -#endif +IMPLEMENT_DYNAMIC_CLASS(wxNotebook, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent, wxNotifyEvent) // ============================================================================ // implementation @@ -247,6 +248,25 @@ void wxNotebook::SetTabSize(const wxSize& sz) // wxNotebook operations // ---------------------------------------------------------------------------- +void wxNotebook::SetPageSize(const wxSize& size) +{ + // transform the page size into the notebook size + RECT rc; + rc.xLeft = rc.yTop = 0; + rc.xRight = size.x; + rc.yBottom = size.y; + +// TabCtrl_AdjustRect(GetHwnd(), TRUE, &rc); + + // and now set it + SetSize(rc.xRight - rc.xLeft, rc.yBottom - rc.yTop); +} + +void wxNotebook::SetPadding(const wxSize& padding) +{ +// TabCtrl_SetPadding(GetHwnd(), padding.x, padding.y); +} + // remove one page from the notebook bool wxNotebook::DeletePage(int nPage) { @@ -255,7 +275,7 @@ bool wxNotebook::DeletePage(int nPage) // TODO: delete native widget page delete m_aPages[nPage]; - m_aPages.Remove(nPage); + m_aPages.RemoveAt(nPage); return TRUE; } @@ -265,7 +285,7 @@ bool wxNotebook::RemovePage(int nPage) { wxCHECK_MSG( IS_VALID_PAGE(nPage), FALSE, wxT("notebook page out of range") ); - m_aPages.Remove(nPage); + m_aPages.RemoveAt(nPage); return TRUE; } @@ -349,8 +369,11 @@ void wxNotebook::OnSize(wxSizeEvent& event) for ( unsigned int nPage = 0; nPage < nCount; nPage++ ) { wxNotebookPage *pPage = m_aPages[nPage]; pPage->SetSize(0, 0, w, h); +#if wxUSE_CONSTRAINTS if ( pPage->GetAutoLayout() ) pPage->Layout(); +#endif //wxUSE_CONSTRAINTS + } // Processing continues to next OnSize @@ -412,8 +435,10 @@ void wxNotebook::OnNavigationKey(wxNavigationKeyEvent& event) void wxNotebook::SetConstraintSizes(bool /* recurse */) { +#if wxUSE_CONSTRAINTS // don't set the sizes of the pages - their correct size is not yet known wxControl::SetConstraintSizes(FALSE); +#endif } bool wxNotebook::DoPhase(int /* nPhase */)