X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e3e65dac0c4e7ad19e3c270caa1e0eea138e5d8d..ff5a1c54e8ad8884230ec9253cb0e1e4b7c3cb35:/samples/treectrl/treetest.cpp diff --git a/samples/treectrl/treetest.cpp b/samples/treectrl/treetest.cpp index eb946008a7..e5fd1c4b56 100644 --- a/samples/treectrl/treetest.cpp +++ b/samples/treectrl/treetest.cpp @@ -25,6 +25,12 @@ #include "wx/wx.h" #endif +#ifndef __WXMSW__ + #include "icon1.xpm" + #include "icon2.xpm" + #include "mondrian.xpm" +#endif + #include "wx/treectrl.h" #include "treetest.h" @@ -52,10 +58,10 @@ END_EVENT_TABLE() IMPLEMENT_APP(MyApp) // `Main program' equivalent, creating windows and returning main app frame -bool MyApp::OnInit(void) +bool MyApp::OnInit() { // Create the main frame window - MyFrame *frame = new MyFrame(NULL, "wxTreeCtrl Test", 50, 50, 450, 340); + MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxTreeCtrl Test", 50, 50, 450, 340); // This reduces flicker effects - even better would be to define OnEraseBackground // to do nothing. When the tree control's scrollbars are show or hidden, the @@ -63,23 +69,13 @@ bool MyApp::OnInit(void) frame->SetBackgroundColour(wxColour(255, 255, 255)); // Give it an icon -#ifdef __WXMSW__ - frame->SetIcon(wxIcon("mondrian")); -#endif -#ifdef __X__ - frame->SetIcon(wxIcon("aiai.xbm")); -#endif + frame->SetIcon(wxICON(mondrian)); // Make an image list containing small icons m_imageListNormal = new wxImageList(16, 16, TRUE); -#ifdef __WXMSW__ - wxIcon icon1("icon1", wxBITMAP_TYPE_ICO_RESOURCE); - m_imageListNormal->Add(icon1); - wxIcon icon2("icon2", wxBITMAP_TYPE_ICO_RESOURCE); - m_imageListNormal->Add(icon2); -#else -#endif + m_imageListNormal->Add(wxICON(icon1)); + m_imageListNormal->Add(wxICON(icon2)); // Make a menubar wxMenu *file_menu = new wxMenu; @@ -154,11 +150,11 @@ bool MyApp::OnInit(void) MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h): wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)) { - m_treeCtrl = NULL; - m_logWindow = NULL; + m_treeCtrl = (MyTreeCtrl *) NULL; + m_logWindow = (wxTextCtrl *) NULL; } -MyFrame::~MyFrame(void) +MyFrame::~MyFrame() { delete wxGetApp().m_imageListNormal; }