]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.cpp
no message
[wxWidgets.git] / samples / treectrl / treetest.cpp
index eb946008a7e1762f0a396e5474701c3acc9ebaaa..e5fd1c4b564e2200b624f5f687941a9b3144a26c 100644 (file)
 #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;
 }