missing functions implemented in wxMSW tree ctrl (custom sorting,
GetChildrenCount(), DeleteChildren()). git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -265,6 +265,8 @@ void MyFrame::OnRecreate(wxCommandEvent& event)
|
||||
}
|
||||
|
||||
// MyTreeCtrl implementation
|
||||
IMPLEMENT_DYNAMIC_CLASS(MyTreeCtrl, wxTreeCtrl)
|
||||
|
||||
MyTreeCtrl::MyTreeCtrl(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style)
|
||||
|
@@ -36,6 +36,7 @@ public:
|
||||
TreeCtrlIcon_Folder
|
||||
};
|
||||
|
||||
MyTreeCtrl() { }
|
||||
MyTreeCtrl(wxWindow *parent, const wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
long style);
|
||||
@@ -78,6 +79,11 @@ private:
|
||||
wxImageList *m_imageListNormal;
|
||||
bool m_reverseSort; // flag for OnCompareItems
|
||||
|
||||
// NB: due to an ugly wxMSW hack you _must_ use DECLARE_DYNAMIC_CLASS()
|
||||
// if you want your overloaded OnCompareItems() to be called.
|
||||
// OTOH, if you don't want it you may omit the next line - this will
|
||||
// make default (alphabetical) sorting much faster under wxMSW.
|
||||
DECLARE_DYNAMIC_CLASS(MyTreeCtrl)
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
@@ -131,10 +137,4 @@ enum
|
||||
TreeTest_DeleteAll,
|
||||
TreeTest_Recreate,
|
||||
TreeTest_Ctrl = 100
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
TreeCtrlIcon_File,
|
||||
TreeCtrlIcon_Folder
|
||||
};
|
||||
};
|
@@ -2,6 +2,6 @@ mondrian ICON "mondrian.ico"
|
||||
aaaa ICON "mondrian.ico"
|
||||
#include "wx/msw/wx.rc"
|
||||
|
||||
icon1 ICON "bitmaps\\folder1.ico"
|
||||
icon2 ICON "bitmaps\\file1.ico"
|
||||
icon1 ICON "bitmaps\\file1.ico"
|
||||
icon2 ICON "bitmaps\\folder1.ico"
|
||||
|
||||
|
Reference in New Issue
Block a user