1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: msw/notebook.cpp
3 // Purpose: implementation of wxNotebook
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "notebook.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
27 #include "wx/string.h"
31 #include "wx/imaglist.h"
33 #include "wx/control.h"
34 #include "wx/notebook.h"
37 #include "wx/msw/private.h"
39 // Windows standard headers
41 #error "wxNotebook is only supported Windows 95 and above"
44 #include <windowsx.h> // for SetWindowFont
46 #ifdef __GNUWIN32_OLD__
47 #include "wx/msw/gnuwin32/extra.h"
50 #if defined(__WIN95__) && !(defined(__GNUWIN32_OLD__) && !defined(__CYGWIN10__))
54 #include "wx/msw/winundef.h"
57 #include "wx/msw/uxtheme.h"
59 #include "wx/radiobut.h"
60 #include "wx/radiobox.h"
61 #include "wx/checkbox.h"
62 #include "wx/bmpbuttn.h"
63 #include "wx/statline.h"
64 #include "wx/statbox.h"
65 #include "wx/stattext.h"
66 #include "wx/slider.h"
67 #include "wx/scrolwin.h"
71 // ----------------------------------------------------------------------------
73 // ----------------------------------------------------------------------------
75 // check that the page index is valid
76 #define IS_VALID_PAGE(nPage) (((nPage) >= 0) && ((nPage) < GetPageCount()))
79 #define m_hwnd (HWND)GetHWND()
81 // ----------------------------------------------------------------------------
83 // ----------------------------------------------------------------------------
85 // This is a work-around for missing defines in gcc-2.95 headers
87 #define TCS_RIGHT 0x0002
91 #define TCS_VERTICAL 0x0080
95 #define TCS_BOTTOM TCS_RIGHT
98 // ----------------------------------------------------------------------------
100 // ----------------------------------------------------------------------------
102 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
)
103 DEFINE_EVENT_TYPE(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
)
105 BEGIN_EVENT_TABLE(wxNotebook
, wxControl
)
106 EVT_NOTEBOOK_PAGE_CHANGED(-1, wxNotebook::OnSelChange
)
108 EVT_SIZE(wxNotebook::OnSize
)
110 EVT_SET_FOCUS(wxNotebook::OnSetFocus
)
112 EVT_NAVIGATION_KEY(wxNotebook::OnNavigationKey
)
115 #if wxUSE_EXTENDED_RTTI
116 IMPLEMENT_DYNAMIC_CLASS_XTI(wxNotebook
, wxControl
,"wx/notebook.h")
118 WX_BEGIN_PROPERTIES_TABLE(wxNotebook
)
119 WX_END_PROPERTIES_TABLE()
121 WX_BEGIN_HANDLERS_TABLE(wxNotebook
)
122 WX_END_HANDLERS_TABLE()
124 WX_CONSTRUCTOR_4( wxNotebook
, wxWindow
* , Parent
, wxWindowID
, Id
, wxPoint
, Position
, wxSize
, Size
)
127 IMPLEMENT_DYNAMIC_CLASS(wxNotebook
, wxControl
)
129 IMPLEMENT_DYNAMIC_CLASS(wxNotebookEvent
, wxNotifyEvent
)
131 // ============================================================================
133 // ============================================================================
135 // ----------------------------------------------------------------------------
136 // wxNotebook construction
137 // ----------------------------------------------------------------------------
139 // common part of all ctors
140 void wxNotebook::Init()
146 // default for dynamic class
147 wxNotebook::wxNotebook()
152 // the same arguments as for wxControl
153 wxNotebook::wxNotebook(wxWindow
*parent
,
158 const wxString
& name
)
162 Create(parent
, id
, pos
, size
, style
, name
);
166 bool wxNotebook::Create(wxWindow
*parent
,
171 const wxString
& name
)
173 // Does ComCtl32 support non-top tabs?
174 int verComCtl32
= wxApp::GetComCtl32Version();
175 if ( verComCtl32
< 470 || verComCtl32
>= 600 )
177 if (style
& wxNB_BOTTOM
)
178 style
&= ~wxNB_BOTTOM
;
180 if (style
& wxNB_LEFT
)
183 if (style
& wxNB_RIGHT
)
184 style
&= ~wxNB_RIGHT
;
187 if ( !CreateControl(parent
, id
, pos
, size
, style
| wxTAB_TRAVERSAL
,
188 wxDefaultValidator
, name
) )
191 if ( !MSWCreateControl(WC_TABCONTROL
, wxEmptyString
, pos
, size
) )
194 SetBackgroundColour(wxColour(::GetSysColor(COLOR_BTNFACE
)));
199 WXDWORD
wxNotebook::MSWGetStyle(long style
, WXDWORD
*exstyle
) const
201 WXDWORD tabStyle
= wxControl::MSWGetStyle(style
, exstyle
);
203 tabStyle
|= WS_TABSTOP
| TCS_TABS
;
205 if ( style
& wxNB_MULTILINE
)
206 tabStyle
|= TCS_MULTILINE
;
207 if ( style
& wxNB_FIXEDWIDTH
)
208 tabStyle
|= TCS_FIXEDWIDTH
;
210 if ( style
& wxNB_BOTTOM
)
211 tabStyle
|= TCS_RIGHT
;
212 else if ( style
& wxNB_LEFT
)
213 tabStyle
|= TCS_VERTICAL
;
214 else if ( style
& wxNB_RIGHT
)
215 tabStyle
|= TCS_VERTICAL
| TCS_RIGHT
;
220 // note that we never want to have the default WS_EX_CLIENTEDGE style
221 // as it looks too ugly for the notebooks
228 // ----------------------------------------------------------------------------
229 // wxNotebook accessors
230 // ----------------------------------------------------------------------------
232 int wxNotebook::GetPageCount() const
235 wxASSERT( (int)m_pages
.Count() == TabCtrl_GetItemCount(m_hwnd
) );
237 return m_pages
.Count();
240 int wxNotebook::GetRowCount() const
242 return TabCtrl_GetRowCount(m_hwnd
);
245 int wxNotebook::SetSelection(int nPage
)
247 wxCHECK_MSG( IS_VALID_PAGE(nPage
), -1, wxT("notebook page out of range") );
249 if ( nPage
!= m_nSelection
)
251 wxNotebookEvent
event(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
, m_windowId
);
252 event
.SetSelection(nPage
);
253 event
.SetOldSelection(m_nSelection
);
254 event
.SetEventObject(this);
255 if ( !GetEventHandler()->ProcessEvent(event
) || event
.IsAllowed() )
257 // program allows the page change
258 event
.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
);
259 (void)GetEventHandler()->ProcessEvent(event
);
261 TabCtrl_SetCurSel(m_hwnd
, nPage
);
268 bool wxNotebook::SetPageText(int nPage
, const wxString
& strText
)
270 wxCHECK_MSG( IS_VALID_PAGE(nPage
), FALSE
, wxT("notebook page out of range") );
273 tcItem
.mask
= TCIF_TEXT
;
274 tcItem
.pszText
= (wxChar
*)strText
.c_str();
276 return TabCtrl_SetItem(m_hwnd
, nPage
, &tcItem
) != 0;
279 wxString
wxNotebook::GetPageText(int nPage
) const
281 wxCHECK_MSG( IS_VALID_PAGE(nPage
), wxEmptyString
, wxT("notebook page out of range") );
285 tcItem
.mask
= TCIF_TEXT
;
286 tcItem
.pszText
= buf
;
287 tcItem
.cchTextMax
= WXSIZEOF(buf
);
290 if ( TabCtrl_GetItem(m_hwnd
, nPage
, &tcItem
) )
291 str
= tcItem
.pszText
;
296 int wxNotebook::GetPageImage(int nPage
) const
298 wxCHECK_MSG( IS_VALID_PAGE(nPage
), -1, wxT("notebook page out of range") );
301 tcItem
.mask
= TCIF_IMAGE
;
303 return TabCtrl_GetItem(m_hwnd
, nPage
, &tcItem
) ? tcItem
.iImage
: -1;
306 bool wxNotebook::SetPageImage(int nPage
, int nImage
)
308 wxCHECK_MSG( IS_VALID_PAGE(nPage
), FALSE
, wxT("notebook page out of range") );
311 tcItem
.mask
= TCIF_IMAGE
;
312 tcItem
.iImage
= nImage
;
314 return TabCtrl_SetItem(m_hwnd
, nPage
, &tcItem
) != 0;
317 void wxNotebook::SetImageList(wxImageList
* imageList
)
319 wxNotebookBase::SetImageList(imageList
);
323 TabCtrl_SetImageList(m_hwnd
, (HIMAGELIST
)imageList
->GetHIMAGELIST());
327 // ----------------------------------------------------------------------------
328 // wxNotebook size settings
329 // ----------------------------------------------------------------------------
331 void wxNotebook::SetPageSize(const wxSize
& size
)
333 // transform the page size into the notebook size
340 TabCtrl_AdjustRect(GetHwnd(), TRUE
, &rc
);
343 SetSize(rc
.right
- rc
.left
, rc
.bottom
- rc
.top
);
346 void wxNotebook::SetPadding(const wxSize
& padding
)
348 TabCtrl_SetPadding(GetHwnd(), padding
.x
, padding
.y
);
351 // Windows-only at present. Also, you must use the wxNB_FIXEDWIDTH
353 void wxNotebook::SetTabSize(const wxSize
& sz
)
355 ::SendMessage(GetHwnd(), TCM_SETITEMSIZE
, 0, MAKELPARAM(sz
.x
, sz
.y
));
358 wxSize
wxNotebook::CalcSizeFromPage(const wxSize
& sizePage
) const
360 wxSize sizeTotal
= sizePage
;
362 // We need to make getting tab size part of the wxWindows API.
363 wxSize
tabSize(0, 0);
364 if (GetPageCount() > 0)
367 TabCtrl_GetItemRect((HWND
) GetHWND(), 0, & rect
);
368 tabSize
.x
= rect
.right
- rect
.left
;
369 tabSize
.y
= rect
.bottom
- rect
.top
;
371 if ( HasFlag(wxNB_LEFT
) || HasFlag(wxNB_RIGHT
) )
373 sizeTotal
.x
+= tabSize
.x
+ 7;
379 sizeTotal
.y
+= tabSize
.y
+ 7;
385 void wxNotebook::AdjustPageSize(wxNotebookPage
*page
)
387 wxCHECK_RET( page
, _T("NULL page in wxNotebook::AdjustPageSize") );
393 // get the page size from the notebook size
394 GetSize((int *)&rc
.right
, (int *)&rc
.bottom
);
395 TabCtrl_AdjustRect(m_hwnd
, FALSE
, &rc
);
397 page
->SetSize(rc
.left
, rc
.top
, rc
.right
- rc
.left
, rc
.bottom
- rc
.top
);
400 // ----------------------------------------------------------------------------
401 // wxNotebook operations
402 // ----------------------------------------------------------------------------
404 // remove one page from the notebook, without deleting
405 wxNotebookPage
*wxNotebook::DoRemovePage(int nPage
)
407 wxNotebookPage
*pageRemoved
= wxNotebookBase::DoRemovePage(nPage
);
411 TabCtrl_DeleteItem(m_hwnd
, nPage
);
413 if ( m_pages
.IsEmpty() )
415 // no selection any more, the notebook becamse empty
418 else // notebook still not empty
420 // change the selected page if it was deleted or became invalid
422 if ( m_nSelection
== GetPageCount() )
424 // last page deleted, make the new last page the new selection
425 selNew
= m_nSelection
- 1;
427 else if ( nPage
<= m_nSelection
)
429 // we must show another page, even if it has the same index
430 selNew
= m_nSelection
;
432 else // nothing changes for the currently selected page
436 // we still must refresh the current page: this needs to be done
437 // for some unknown reason if the tab control shows the up-down
438 // control (i.e. when there are too many pages) -- otherwise after
439 // deleting a page nothing at all is shown
440 if (m_nSelection
>= 0)
441 m_pages
[m_nSelection
]->Refresh();
446 // m_nSelection must be always valid so reset it before calling
449 SetSelection(selNew
);
457 bool wxNotebook::DeleteAllPages()
459 int nPageCount
= GetPageCount();
461 for ( nPage
= 0; nPage
< nPageCount
; nPage
++ )
462 delete m_pages
[nPage
];
466 TabCtrl_DeleteAllItems(m_hwnd
);
473 // same as AddPage() but does it at given position
474 bool wxNotebook::InsertPage(int nPage
,
475 wxNotebookPage
*pPage
,
476 const wxString
& strText
,
480 wxCHECK_MSG( pPage
!= NULL
, FALSE
, _T("NULL page in wxNotebook::InsertPage") );
481 wxCHECK_MSG( IS_VALID_PAGE(nPage
) || nPage
== GetPageCount(), FALSE
,
482 _T("invalid index in wxNotebook::InsertPage") );
484 wxASSERT_MSG( pPage
->GetParent() == this,
485 _T("notebook pages must have notebook as parent") );
487 #if wxUSE_UXTHEME && wxUSE_UXTHEME_AUTO
488 static bool g_TestedForTheme
= FALSE
;
489 static bool g_UseTheme
= FALSE
;
490 if (!g_TestedForTheme
)
492 int commCtrlVersion
= wxTheApp
->GetComCtl32Version() ;
494 g_UseTheme
= (commCtrlVersion
>= 600);
495 g_TestedForTheme
= TRUE
;
498 // Automatically apply the theme background,
499 // changing the colour of the panel to match the
500 // tab page colour. This won't work well with all
501 // themes but it's a start.
502 if (g_UseTheme
&& wxUxThemeEngine::Get() && pPage
->IsKindOf(CLASSINFO(wxPanel
)))
504 ApplyThemeBackground(pPage
, GetThemeBackgroundColour());
508 // add a new tab to the control
509 // ----------------------------
511 // init all fields to 0
513 wxZeroMemory(tcItem
);
515 // set the image, if any
518 tcItem
.mask
|= TCIF_IMAGE
;
519 tcItem
.iImage
= imageId
;
523 if ( !strText
.IsEmpty() )
525 tcItem
.mask
|= TCIF_TEXT
;
526 tcItem
.pszText
= (wxChar
*)strText
.c_str(); // const_cast
529 // fit the notebook page to the tab control's display area: this should be
530 // done before adding it to the notebook or TabCtrl_InsertItem() will
531 // change the notebooks size itself!
532 AdjustPageSize(pPage
);
534 // finally do insert it
535 if ( TabCtrl_InsertItem(m_hwnd
, nPage
, &tcItem
) == -1 )
537 wxLogError(wxT("Can't create the notebook page '%s'."), strText
.c_str());
542 // succeeded: save the pointer to the page
543 m_pages
.Insert(pPage
, nPage
);
545 // for the first page (only) we need to adjust the size again because the
546 // notebook size changed: the tabs which hadn't been there before are now
548 if ( m_pages
.GetCount() == 1 )
550 AdjustPageSize(pPage
);
553 // hide the page: unless it is selected, it shouldn't be shown (and if it
554 // is selected it will be shown later)
555 HWND hwnd
= GetWinHwnd(pPage
);
556 SetWindowLong(hwnd
, GWL_STYLE
, GetWindowLong(hwnd
, GWL_STYLE
) & ~WS_VISIBLE
);
558 // this updates internal flag too -- otherwise it would get out of sync
559 // with the real state
563 // now deal with the selection
564 // ---------------------------
566 // if the inserted page is before the selected one, we must update the
567 // index of the selected page
568 if ( nPage
<= m_nSelection
)
570 // one extra page added
574 // some page should be selected: either this one or the first one if there
575 // is still no selection
579 else if ( m_nSelection
== -1 )
583 SetSelection(selNew
);
588 int wxNotebook::HitTest(const wxPoint
& pt
, long *flags
) const
590 TC_HITTESTINFO hitTestInfo
;
591 hitTestInfo
.pt
.x
= pt
.x
;
592 hitTestInfo
.pt
.y
= pt
.y
;
593 int item
= TabCtrl_HitTest(GetHwnd(), &hitTestInfo
);
599 if ((hitTestInfo
.flags
& TCHT_NOWHERE
) == TCHT_NOWHERE
)
600 *flags
|= wxNB_HITTEST_NOWHERE
;
601 if ((hitTestInfo
.flags
& TCHT_ONITEM
) == TCHT_ONITEM
)
602 *flags
|= wxNB_HITTEST_ONITEM
;
603 if ((hitTestInfo
.flags
& TCHT_ONITEMICON
) == TCHT_ONITEMICON
)
604 *flags
|= wxNB_HITTEST_ONICON
;
605 if ((hitTestInfo
.flags
& TCHT_ONITEMLABEL
) == TCHT_ONITEMLABEL
)
606 *flags
|= wxNB_HITTEST_ONLABEL
;
613 // ----------------------------------------------------------------------------
614 // wxNotebook callbacks
615 // ----------------------------------------------------------------------------
617 void wxNotebook::OnSize(wxSizeEvent
& event
)
619 // fit the notebook page to the tab control's display area
621 rc
.left
= rc
.top
= 0;
622 GetSize((int *)&rc
.right
, (int *)&rc
.bottom
);
624 TabCtrl_AdjustRect(m_hwnd
, FALSE
, &rc
);
626 int width
= rc
.right
- rc
.left
,
627 height
= rc
.bottom
- rc
.top
;
628 size_t nCount
= m_pages
.Count();
629 for ( size_t nPage
= 0; nPage
< nCount
; nPage
++ ) {
630 wxNotebookPage
*pPage
= m_pages
[nPage
];
631 pPage
->SetSize(rc
.left
, rc
.top
, width
, height
);
637 void wxNotebook::OnSelChange(wxNotebookEvent
& event
)
639 // is it our tab control?
640 if ( event
.GetEventObject() == this )
642 int sel
= event
.GetOldSelection();
644 m_pages
[sel
]->Show(FALSE
);
646 sel
= event
.GetSelection();
649 wxNotebookPage
*pPage
= m_pages
[sel
];
657 // we want to give others a chance to process this message as well
661 void wxNotebook::OnSetFocus(wxFocusEvent
& event
)
663 // this function is only called when the focus is explicitly set (i.e. from
664 // the program) to the notebook - in this case we don't need the
665 // complicated OnNavigationKey() logic because the programmer knows better
668 // set focus to the currently selected page if any
669 if ( m_nSelection
!= -1 )
670 m_pages
[m_nSelection
]->SetFocus();
675 void wxNotebook::OnNavigationKey(wxNavigationKeyEvent
& event
)
677 if ( event
.IsWindowChange() ) {
679 AdvanceSelection(event
.GetDirection());
682 // we get this event in 2 cases
684 // a) one of our pages might have generated it because the user TABbed
685 // out from it in which case we should propagate the event upwards and
686 // our parent will take care of setting the focus to prev/next sibling
690 // b) the parent panel wants to give the focus to us so that we
691 // forward it to our selected page. We can't deal with this in
692 // OnSetFocus() because we don't know which direction the focus came
693 // from in this case and so can't choose between setting the focus to
694 // first or last panel child
695 wxWindow
*parent
= GetParent();
696 // the cast is here to fic a GCC ICE
697 if ( ((wxWindow
*)event
.GetEventObject()) == parent
)
699 // no, it doesn't come from child, case (b): forward to a page
700 if ( m_nSelection
!= -1 )
702 // so that the page knows that the event comes from it's parent
703 // and is being propagated downwards
704 event
.SetEventObject(this);
706 wxWindow
*page
= m_pages
[m_nSelection
];
707 if ( !page
->GetEventHandler()->ProcessEvent(event
) )
711 //else: page manages focus inside it itself
715 // we have no pages - still have to give focus to _something_
721 // it comes from our child, case (a), pass to the parent
723 event
.SetCurrentFocus(this);
724 parent
->GetEventHandler()->ProcessEvent(event
);
730 // ----------------------------------------------------------------------------
731 // wxNotebook base class virtuals
732 // ----------------------------------------------------------------------------
734 #if wxUSE_CONSTRAINTS
736 // override these 2 functions to do nothing: everything is done in OnSize
738 void wxNotebook::SetConstraintSizes(bool WXUNUSED(recurse
))
740 // don't set the sizes of the pages - their correct size is not yet known
741 wxControl::SetConstraintSizes(FALSE
);
744 bool wxNotebook::DoPhase(int WXUNUSED(nPhase
))
749 #endif // wxUSE_CONSTRAINTS
751 // ----------------------------------------------------------------------------
752 // wxNotebook Windows message handlers
753 // ----------------------------------------------------------------------------
755 bool wxNotebook::MSWOnScroll(int orientation
, WXWORD nSBCode
,
756 WXWORD pos
, WXHWND control
)
758 // don't generate EVT_SCROLLWIN events for the WM_SCROLLs coming from the
763 return wxNotebookBase::MSWOnScroll(orientation
, nSBCode
, pos
, control
);
766 bool wxNotebook::MSWOnNotify(int idCtrl
, WXLPARAM lParam
, WXLPARAM
* result
)
768 wxNotebookEvent
event(wxEVT_NULL
, m_windowId
);
770 NMHDR
* hdr
= (NMHDR
*)lParam
;
771 switch ( hdr
->code
) {
773 event
.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED
);
776 case TCN_SELCHANGING
:
777 event
.SetEventType(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING
);
781 return wxControl::MSWOnNotify(idCtrl
, lParam
, result
);
784 event
.SetSelection(TabCtrl_GetCurSel(m_hwnd
));
785 event
.SetOldSelection(m_nSelection
);
786 event
.SetEventObject(this);
787 event
.SetInt(idCtrl
);
789 bool processed
= GetEventHandler()->ProcessEvent(event
);
790 *result
= !event
.IsAllowed();
794 // Windows only: attempts to get colour for UX theme page background
795 wxColour
wxNotebook::GetThemeBackgroundColour()
798 if (wxUxThemeEngine::Get())
800 wxUxThemeHandle
hTheme(this, L
"TAB");
803 // This is total guesswork.
804 // See PlatformSDK\Include\Tmschema.h for values
806 wxUxThemeEngine::Get()->GetThemeColor
811 3821, /* FILLCOLORHINT */
815 wxColour
colour(GetRValue(themeColor
), GetGValue(themeColor
), GetBValue(themeColor
));
819 #endif // wxUSE_UXTHEME
821 return GetBackgroundColour();
824 // Windows only: attempts to apply the UX theme page background to this page
826 void wxNotebook::ApplyThemeBackground(wxWindow
* window
, const wxColour
& colour
)
828 void wxNotebook::ApplyThemeBackground(wxWindow
*, const wxColour
&)
832 // Don't set the background for buttons since this will
833 // switch it into ownerdraw mode
834 if (window
->IsKindOf(CLASSINFO(wxButton
)) && !window
->IsKindOf(CLASSINFO(wxBitmapButton
)))
835 // This is essential, otherwise you'll see dark grey
836 // corners in the buttons.
837 ((wxButton
*)window
)->wxControl::SetBackgroundColour(colour
);
838 else if (window
->IsKindOf(CLASSINFO(wxStaticText
)) ||
839 window
->IsKindOf(CLASSINFO(wxStaticBox
)) ||
840 window
->IsKindOf(CLASSINFO(wxStaticLine
)) ||
841 window
->IsKindOf(CLASSINFO(wxRadioButton
)) ||
842 window
->IsKindOf(CLASSINFO(wxRadioBox
)) ||
843 window
->IsKindOf(CLASSINFO(wxCheckBox
)) ||
844 window
->IsKindOf(CLASSINFO(wxBitmapButton
)) ||
845 window
->IsKindOf(CLASSINFO(wxSlider
)) ||
846 window
->IsKindOf(CLASSINFO(wxPanel
)) ||
847 (window
->IsKindOf(CLASSINFO(wxNotebook
)) && (window
!= this)) ||
848 window
->IsKindOf(CLASSINFO(wxScrolledWindow
))
851 window
->SetBackgroundColour(colour
);
854 for ( wxWindowList::compatibility_iterator node
= window
->GetChildren().GetFirst(); node
; node
= node
->GetNext() )
856 wxWindow
*child
= node
->GetData();
857 ApplyThemeBackground(child
, colour
);
862 long wxNotebook::MSWWindowProc(WXUINT nMsg
, WXWPARAM wParam
, WXLPARAM lParam
)
864 static bool g_TestedForTheme
= FALSE
;
865 static bool g_UseTheme
= FALSE
;
870 if (!g_TestedForTheme
)
872 int commCtrlVersion
= wxTheApp
->GetComCtl32Version() ;
874 g_UseTheme
= (commCtrlVersion
>= 600);
875 g_TestedForTheme
= TRUE
;
878 // If using XP themes, it seems we can get away
879 // with not drawing a background, which reduces flicker.
885 return wxControl::MSWWindowProc(nMsg
, wParam
, lParam
);
889 #endif // wxUSE_NOTEBOOK