+{
+ wxNotebookBase::SetImageList(imageList);
+
+ if ( imageList )
+ {
+ TabCtrl_SetImageList(m_hwnd, (HIMAGELIST)imageList->GetHIMAGELIST());
+ }
+}
+
+// ----------------------------------------------------------------------------
+// wxNotebook size settings
+// ----------------------------------------------------------------------------
+
+void wxNotebook::SetPageSize(const wxSize& size)
+{
+ // transform the page size into the notebook size
+ RECT rc;
+ rc.left =
+ rc.top = 0;
+ rc.right = size.x;
+ rc.bottom = size.y;
+
+ TabCtrl_AdjustRect(GetHwnd(), TRUE, &rc);
+
+ // and now set it
+ SetSize(rc.right - rc.left, rc.bottom - rc.top);
+}
+
+void wxNotebook::SetPadding(const wxSize& padding)
+{
+ TabCtrl_SetPadding(GetHwnd(), padding.x, padding.y);
+}
+
+// Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
+// style.
+void wxNotebook::SetTabSize(const wxSize& sz)
+{
+ ::SendMessage(GetHwnd(), TCM_SETITEMSIZE, 0, MAKELPARAM(sz.x, sz.y));
+}
+
+wxSize wxNotebook::CalcSizeFromPage(const wxSize& sizePage) const
+{
+ wxSize sizeTotal = sizePage;
+
+ // We need to make getting tab size part of the wxWindows API.
+ wxSize tabSize(0, 0);
+ if (GetPageCount() > 0)
+ {
+ RECT rect;
+ TabCtrl_GetItemRect((HWND) GetHWND(), 0, & rect);
+ tabSize.x = rect.right - rect.left;
+ tabSize.y = rect.bottom - rect.top;
+ }
+ if ( HasFlag(wxNB_LEFT) || HasFlag(wxNB_RIGHT) )
+ {
+ sizeTotal.x += tabSize.x + 7;
+ sizeTotal.y += 7;
+ }
+ else
+ {
+ sizeTotal.x += 7;
+ sizeTotal.y += tabSize.y + 7;
+ }
+
+ return sizeTotal;
+}
+
+void wxNotebook::AdjustPageSize(wxNotebookPage *page)
+{
+ wxCHECK_RET( page, _T("NULL page in wxNotebook::AdjustPageSize") );
+
+ RECT rc;
+ rc.left =
+ rc.top = 0;
+
+ // get the page size from the notebook size
+ GetSize((int *)&rc.right, (int *)&rc.bottom);
+ TabCtrl_AdjustRect(m_hwnd, FALSE, &rc);
+
+ page->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top);