Remove confusing boolean parameter from treectrl sample
Don't use CreateStateImageList(true) to delete the image list. No real changes, just make the code more understandable.
This commit is contained in:
parent
9bae94022c
commit
366d06847b
2 changed files with 4 additions and 10 deletions
|
|
@ -703,12 +703,12 @@ void MyFrame::OnToggleStates(wxCommandEvent& WXUNUSED(event))
|
|||
{
|
||||
if ( wxGetApp().ShowStates() )
|
||||
{
|
||||
m_treeCtrl->CreateStateImageList(true);
|
||||
m_treeCtrl->SetStateImageList(nullptr);
|
||||
wxGetApp().SetShowStates(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
m_treeCtrl->CreateStateImageList(false);
|
||||
m_treeCtrl->CreateStateImageList();
|
||||
wxGetApp().SetShowStates(true);
|
||||
}
|
||||
}
|
||||
|
|
@ -1035,14 +1035,8 @@ void MyTreeCtrl::CreateImages(int size)
|
|||
SetImages(images);
|
||||
}
|
||||
|
||||
void MyTreeCtrl::CreateStateImageList(bool del)
|
||||
void MyTreeCtrl::CreateStateImageList()
|
||||
{
|
||||
if ( del )
|
||||
{
|
||||
SetStateImageList(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
wxImageList *states;
|
||||
wxBusyCursor wait;
|
||||
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ public:
|
|||
void CreateImages(int size);
|
||||
|
||||
void CreateButtonsImageList(int size = 11);
|
||||
void CreateStateImageList(bool del = false);
|
||||
void CreateStateImageList();
|
||||
|
||||
void AddTestItemsToTree(size_t numChildren, size_t depth);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue