Small cleanup of wxGenericTreeCtrl-specific parts of the sample

Use HAS_GENERIC_TREECTRL for testing whether we're actually using it or
not instead of checking for USE_GENERIC_TREECTRL and then port names
with a native control, which was done inconsistently, as it included
wxQt in one place, but not the other one.

Also avoid repeating CreateButtonsImageList() declaration twice, as this
resulted in having unbalanced curly braces in this file, which was just
unpleasant.

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-11-07 16:36:43 +00:00
parent 725c3d5608
commit 34a730f89c
2 changed files with 12 additions and 4 deletions

View File

@@ -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
}