-1->wxID_ANY, TRUE->true and FALSE->false replacements.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27368 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -155,16 +155,16 @@ bool MyApp::OnInit()
|
|||||||
MyFrame *frame = new MyFrame(wxT("wxTreeCtrl Test"), 50, 50, 450, 600);
|
MyFrame *frame = new MyFrame(wxT("wxTreeCtrl Test"), 50, 50, 450, 600);
|
||||||
|
|
||||||
// Show the frame
|
// Show the frame
|
||||||
frame->Show(TRUE);
|
frame->Show(true);
|
||||||
SetTopWindow(frame);
|
SetTopWindow(frame);
|
||||||
|
|
||||||
return TRUE;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// My frame constructor
|
// My frame constructor
|
||||||
MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
||||||
: wxFrame((wxFrame *)NULL, -1, title, wxPoint(x, y), wxSize(w, h)),
|
: wxFrame((wxFrame *)NULL, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)),
|
||||||
m_treeCtrl(NULL), m_textCtrl(NULL)
|
m_treeCtrl(NULL), m_textCtrl(NULL)
|
||||||
{
|
{
|
||||||
// This reduces flicker effects - even better would be to define
|
// This reduces flicker effects - even better would be to define
|
||||||
@@ -186,20 +186,20 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
|||||||
file_menu->AppendSeparator();
|
file_menu->AppendSeparator();
|
||||||
file_menu->Append(TreeTest_Quit, wxT("E&xit\tAlt-X"));
|
file_menu->Append(TreeTest_Quit, wxT("E&xit\tAlt-X"));
|
||||||
|
|
||||||
style_menu->Append(TreeTest_TogButtons, wxT("Toggle &normal buttons"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogButtons, wxT("Toggle &normal buttons"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogTwist, wxT("Toggle &twister buttons"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogTwist, wxT("Toggle &twister buttons"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_ToggleButtons, wxT("Toggle image &buttons"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_ToggleButtons, wxT("Toggle image &buttons"), wxT(""), true);
|
||||||
style_menu->AppendSeparator();
|
style_menu->AppendSeparator();
|
||||||
style_menu->Append(TreeTest_TogLines, wxT("Toggle &connecting lines"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogLines, wxT("Toggle &connecting lines"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogRootLines, wxT("Toggle &lines at root"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogRootLines, wxT("Toggle &lines at root"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogHideRoot, wxT("Toggle &hidden root"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogHideRoot, wxT("Toggle &hidden root"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogBorder, wxT("Toggle &item border"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogBorder, wxT("Toggle &item border"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogFullHighlight, wxT("Toggle &full row highlight"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogFullHighlight, wxT("Toggle &full row highlight"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_TogEdit, wxT("Toggle &edit mode"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_TogEdit, wxT("Toggle &edit mode"), wxT(""), true);
|
||||||
#ifndef NO_MULTIPLE_SELECTION
|
#ifndef NO_MULTIPLE_SELECTION
|
||||||
style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"), wxT(""), true);
|
||||||
#endif // NO_MULTIPLE_SELECTION
|
#endif // NO_MULTIPLE_SELECTION
|
||||||
style_menu->Append(TreeTest_ToggleImages, wxT("Toggle show ima&ges"), wxT(""), TRUE);
|
style_menu->Append(TreeTest_ToggleImages, wxT("Toggle show ima&ges"), wxT(""), true);
|
||||||
style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze..."));
|
style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze..."));
|
||||||
style_menu->AppendSeparator();
|
style_menu->AppendSeparator();
|
||||||
style_menu->Append(TreeTest_SetFgColour, wxT("Set &foreground colour..."));
|
style_menu->Append(TreeTest_SetFgColour, wxT("Set &foreground colour..."));
|
||||||
@@ -256,13 +256,13 @@ MyFrame::MyFrame(const wxString& title, int x, int y, int w, int h)
|
|||||||
#endif // wxUSE_MENUS
|
#endif // wxUSE_MENUS
|
||||||
|
|
||||||
// create the controls
|
// create the controls
|
||||||
m_textCtrl = new wxTextCtrl(this, -1, wxT(""),
|
m_textCtrl = new wxTextCtrl(this, wxID_ANY, wxT(""),
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
wxTE_MULTILINE | wxSUNKEN_BORDER);
|
wxTE_MULTILINE | wxSUNKEN_BORDER);
|
||||||
|
|
||||||
CreateTreeWithDefStyle();
|
CreateTreeWithDefStyle();
|
||||||
|
|
||||||
menu_bar->Check(TreeTest_ToggleImages, TRUE);
|
menu_bar->Check(TreeTest_ToggleImages, true);
|
||||||
|
|
||||||
#if wxUSE_STATUSBAR
|
#if wxUSE_STATUSBAR
|
||||||
// create a status bar
|
// create a status bar
|
||||||
@@ -371,7 +371,7 @@ void MyFrame::Resize()
|
|||||||
|
|
||||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||||
{
|
{
|
||||||
Close(TRUE);
|
Close(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -409,7 +409,7 @@ void MyFrame::OnCount(wxCommandEvent& WXUNUSED(event))
|
|||||||
|
|
||||||
CHECK_ITEM( item );
|
CHECK_ITEM( item );
|
||||||
|
|
||||||
int i = m_treeCtrl->GetChildrenCount( item, FALSE );
|
int i = m_treeCtrl->GetChildrenCount( item, false );
|
||||||
|
|
||||||
wxLogMessage(wxT("%d children"), i);
|
wxLogMessage(wxT("%d children"), i);
|
||||||
}
|
}
|
||||||
@@ -528,7 +528,7 @@ void MyFrame::OnSetImageSize(wxCommandEvent& WXUNUSED(event))
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
m_treeCtrl->CreateImageList(size);
|
m_treeCtrl->CreateImageList(size);
|
||||||
wxGetApp().SetShowImages(TRUE);
|
wxGetApp().SetShowImages(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyFrame::OnToggleImages(wxCommandEvent& WXUNUSED(event))
|
void MyFrame::OnToggleImages(wxCommandEvent& WXUNUSED(event))
|
||||||
@@ -536,12 +536,12 @@ void MyFrame::OnToggleImages(wxCommandEvent& WXUNUSED(event))
|
|||||||
if ( wxGetApp().ShowImages() )
|
if ( wxGetApp().ShowImages() )
|
||||||
{
|
{
|
||||||
m_treeCtrl->CreateImageList(-1);
|
m_treeCtrl->CreateImageList(-1);
|
||||||
wxGetApp().SetShowImages(FALSE);
|
wxGetApp().SetShowImages(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_treeCtrl->CreateImageList(0);
|
m_treeCtrl->CreateImageList(0);
|
||||||
wxGetApp().SetShowImages(TRUE);
|
wxGetApp().SetShowImages(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -551,12 +551,12 @@ void MyFrame::OnToggleButtons(wxCommandEvent& WXUNUSED(event))
|
|||||||
if ( wxGetApp().ShowButtons() )
|
if ( wxGetApp().ShowButtons() )
|
||||||
{
|
{
|
||||||
m_treeCtrl->CreateButtonsImageList(-1);
|
m_treeCtrl->CreateButtonsImageList(-1);
|
||||||
wxGetApp().SetShowButtons(FALSE);
|
wxGetApp().SetShowButtons(false);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_treeCtrl->CreateButtonsImageList(15);
|
m_treeCtrl->CreateButtonsImageList(15);
|
||||||
wxGetApp().SetShowButtons(TRUE);
|
wxGetApp().SetShowButtons(true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -652,7 +652,7 @@ MyTreeCtrl::MyTreeCtrl(wxWindow *parent, const wxWindowID id,
|
|||||||
long style)
|
long style)
|
||||||
: wxTreeCtrl(parent, id, pos, size, style)
|
: wxTreeCtrl(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
m_reverseSort = FALSE;
|
m_reverseSort = false;
|
||||||
|
|
||||||
CreateImageList();
|
CreateImageList();
|
||||||
|
|
||||||
@@ -673,7 +673,7 @@ void MyTreeCtrl::CreateImageList(int size)
|
|||||||
m_imageSize = size;
|
m_imageSize = size;
|
||||||
|
|
||||||
// Make an image list containing small icons
|
// Make an image list containing small icons
|
||||||
wxImageList *images = new wxImageList(size, size, TRUE);
|
wxImageList *images = new wxImageList(size, size, true);
|
||||||
|
|
||||||
// should correspond to TreeCtrlIcon_xxx enum
|
// should correspond to TreeCtrlIcon_xxx enum
|
||||||
wxBusyCursor wait;
|
wxBusyCursor wait;
|
||||||
@@ -710,7 +710,7 @@ void MyTreeCtrl::CreateButtonsImageList(int size)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make an image list containing small icons
|
// Make an image list containing small icons
|
||||||
wxImageList *images = new wxImageList(size, size, TRUE);
|
wxImageList *images = new wxImageList(size, size, true);
|
||||||
|
|
||||||
// should correspond to TreeCtrlIcon_xxx enum
|
// should correspond to TreeCtrlIcon_xxx enum
|
||||||
wxBusyCursor wait;
|
wxBusyCursor wait;
|
||||||
@@ -1218,5 +1218,5 @@ void MyTreeItemData::ShowInfo(wxTreeCtrl *tree)
|
|||||||
Bool2String(tree->IsExpanded(GetId())),
|
Bool2String(tree->IsExpanded(GetId())),
|
||||||
Bool2String(tree->IsBold(GetId())),
|
Bool2String(tree->IsBold(GetId())),
|
||||||
tree->GetChildrenCount(GetId()),
|
tree->GetChildrenCount(GetId()),
|
||||||
tree->GetChildrenCount(GetId(), FALSE));
|
tree->GetChildrenCount(GetId(), false));
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,7 @@
|
|||||||
class MyApp : public wxApp
|
class MyApp : public wxApp
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MyApp() { m_showImages = TRUE; m_showButtons = FALSE; }
|
MyApp() { m_showImages = true; m_showButtons = false; }
|
||||||
|
|
||||||
bool OnInit();
|
bool OnInit();
|
||||||
|
|
||||||
@@ -96,7 +96,7 @@ public:
|
|||||||
|
|
||||||
void AddTestItemsToTree(size_t numChildren, size_t depth);
|
void AddTestItemsToTree(size_t numChildren, size_t depth);
|
||||||
|
|
||||||
void DoSortChildren(const wxTreeItemId& item, bool reverse = FALSE)
|
void DoSortChildren(const wxTreeItemId& item, bool reverse = false)
|
||||||
{ m_reverseSort = reverse; wxTreeCtrl::SortChildren(item); }
|
{ m_reverseSort = reverse; wxTreeCtrl::SortChildren(item); }
|
||||||
void DoEnsureVisible() { if (m_lastItem.IsOk()) EnsureVisible(m_lastItem); }
|
void DoEnsureVisible() { if (m_lastItem.IsOk()) EnsureVisible(m_lastItem); }
|
||||||
|
|
||||||
@@ -190,8 +190,8 @@ public:
|
|||||||
void OnSetImageSize(wxCommandEvent& event);
|
void OnSetImageSize(wxCommandEvent& event);
|
||||||
void OnCollapseAndReset(wxCommandEvent& event);
|
void OnCollapseAndReset(wxCommandEvent& event);
|
||||||
|
|
||||||
void OnSetBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(TRUE); }
|
void OnSetBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(true); }
|
||||||
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(FALSE); }
|
void OnClearBold(wxCommandEvent& WXUNUSED(event)) { DoSetBold(false); }
|
||||||
|
|
||||||
void OnEnsureVisible(wxCommandEvent& event);
|
void OnEnsureVisible(wxCommandEvent& event);
|
||||||
|
|
||||||
@@ -200,7 +200,7 @@ public:
|
|||||||
|
|
||||||
void OnRename(wxCommandEvent& event);
|
void OnRename(wxCommandEvent& event);
|
||||||
void OnSort(wxCommandEvent& WXUNUSED(event)) { DoSort(); }
|
void OnSort(wxCommandEvent& WXUNUSED(event)) { DoSort(); }
|
||||||
void OnSortRev(wxCommandEvent& WXUNUSED(event)) { DoSort(TRUE); }
|
void OnSortRev(wxCommandEvent& WXUNUSED(event)) { DoSort(true); }
|
||||||
|
|
||||||
void OnAddItem(wxCommandEvent& event);
|
void OnAddItem(wxCommandEvent& event);
|
||||||
void OnInsertItem(wxCommandEvent& event);
|
void OnInsertItem(wxCommandEvent& event);
|
||||||
@@ -219,7 +219,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
void TogStyle(int id, long flag);
|
void TogStyle(int id, long flag);
|
||||||
|
|
||||||
void DoSort(bool reverse = FALSE);
|
void DoSort(bool reverse = false);
|
||||||
|
|
||||||
void Resize();
|
void Resize();
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ private:
|
|||||||
MyTreeCtrl *m_treeCtrl;
|
MyTreeCtrl *m_treeCtrl;
|
||||||
wxTextCtrl *m_textCtrl;
|
wxTextCtrl *m_textCtrl;
|
||||||
|
|
||||||
void DoSetBold(bool bold = TRUE);
|
void DoSetBold(bool bold = true);
|
||||||
|
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user