]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/treectrl/treetest.cpp
Moved Clear() implementation into wxDC using a new virtual CocoaGetBounds()
[wxWidgets.git] / samples / treectrl / treetest.cpp
index 6ab96a4285cfb2720c604c97d1a461bfded326f7..dfa0ad4229e50b4f4f32a41141e7ef32ce591620 100644 (file)
@@ -32,8 +32,7 @@
 #include "wx/image.h"
 #include "wx/imaglist.h"
 #include "wx/treectrl.h"
-
-#include "math.h"
+#include "wx/math.h"
 
 #ifdef __WIN32__
     // this is not supported by native control
@@ -137,7 +136,6 @@ BEGIN_EVENT_TABLE(MyTreeCtrl, wxTreeCtrl)
     EVT_TREE_ITEM_EXPANDING(TreeTest_Ctrl, MyTreeCtrl::OnItemExpanding)
     EVT_TREE_ITEM_COLLAPSED(TreeTest_Ctrl, MyTreeCtrl::OnItemCollapsed)
     EVT_TREE_ITEM_COLLAPSING(TreeTest_Ctrl, MyTreeCtrl::OnItemCollapsing)
-    //EVT_TREE_ITEM_RIGHT_CLICK(TreeTest_Ctrl, MyTreeCtrl::OnItemRightClick)
 
     EVT_CONTEXT_MENU(MyTreeCtrl::OnContextMenu)
     EVT_TREE_SEL_CHANGED(TreeTest_Ctrl, MyTreeCtrl::OnSelChanged)
@@ -363,9 +361,9 @@ void MyFrame::OnIdle(wxIdleEvent& event)
 
 void MyFrame::OnSize(wxSizeEvent& event)
 {
-    if ( m_treeCtrl 
+    if ( m_treeCtrl
 #if wxUSE_LOG
-                    && m_textCtrl 
+                    && m_textCtrl
 #endif // wxUSE_LOG
                                   )
     {
@@ -411,7 +409,7 @@ void MyFrame::OnRename(wxCommandEvent& WXUNUSED(event))
     static wxString s_text;
     s_text = wxGetTextFromUser(wxT("New name: "), wxT("Tree sample question"),
             s_text, this);
-    if ( !s_text.IsEmpty() )
+    if ( !s_text.empty() )
     {
         m_treeCtrl->SetItemText(item, s_text);
     }
@@ -758,10 +756,6 @@ void MyTreeCtrl::CreateButtonsImageList(int WXUNUSED(size))
 #endif
 }
 
-MyTreeCtrl::~MyTreeCtrl()
-{
-}
-
 int MyTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
                                const wxTreeItemId& item2)
 {
@@ -1152,11 +1146,6 @@ void MyTreeCtrl::OnItemActivated(wxTreeEvent& event)
     wxLogMessage(wxT("OnItemActivated"));
 }
 
-void MyTreeCtrl::OnItemRightClick(wxTreeEvent& event)
-{
-    ShowMenu(event.GetItem(), event.GetPoint());
-}
-
 void MyTreeCtrl::OnContextMenu(wxContextMenuEvent& event)
 {
     wxPoint pt = event.GetPosition();
@@ -1168,7 +1157,7 @@ void MyTreeCtrl::OnContextMenu(wxContextMenuEvent& event)
     {
         //attempt to guess where to show the menu
         if (item.IsOk())
-        {   
+        {
             //if an item was clicked, show menu to the right of it
             wxRect rect;
             GetBoundingRect(item, rect, true); //true = only the label
@@ -1184,7 +1173,7 @@ void MyTreeCtrl::OnContextMenu(wxContextMenuEvent& event)
         //event was generated by mouse, use supplied coords
         pt = ScreenToClient(pt);
     }
-    
+
     ShowMenu(item, pt);
 }