diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index ff584dbaf6..38bf36bcc6 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -748,7 +748,7 @@ void MyFrame::OnToggleAlternateStates(wxCommandEvent& WXUNUSED(event)) void MyFrame::OnToggleButtons(wxCommandEvent& WXUNUSED(event)) { -#if USE_GENERIC_TREECTRL || !defined(__WXMSW__) +#ifdef HAS_GENERIC_TREECTRL if ( wxGetApp().ShowButtons() ) { m_treeCtrl->CreateButtonsImageList(-1); @@ -1064,9 +1064,9 @@ void MyTreeCtrl::CreateStateImageList(bool del) AssignStateImageList(states); } -#if USE_GENERIC_TREECTRL || (!defined(__WXMSW__) && !defined(__WXQT__)) void MyTreeCtrl::CreateButtonsImageList(int size) { +#ifdef HAS_GENERIC_TREECTRL if ( size == -1 ) { SetButtonsImageList(NULL); @@ -1112,8 +1112,7 @@ void MyTreeCtrl::CreateButtonsImageList(int size) AssignButtonsImageList(images); #else -void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size)) -{ + wxUnusedVar(size); #endif } diff --git a/samples/treectrl/treetest.h b/samples/treectrl/treetest.h index 43439ea8d5..865a39d1fa 100644 --- a/samples/treectrl/treetest.h +++ b/samples/treectrl/treetest.h @@ -8,6 +8,8 @@ // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// +// This can be defined to 1 to force using wxGenericTreeCtrl even on the +// platforms where the native controls would normally be used (wxMSW and wxQt). #define USE_GENERIC_TREECTRL 0 #if USE_GENERIC_TREECTRL @@ -18,6 +20,13 @@ #endif #endif +// This one is defined if we're actually using the generic control, either +// because it was explicitly requested above or because there is no other one +// on this platform anyhow. +#if USE_GENERIC_TREECTRL || (!defined(__WXMSW__) && !defined(__WXQT__)) + #define HAS_GENERIC_TREECTRL +#endif + // Define a new application type class MyApp : public wxApp {