]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
wxT() for a Spanish(?) debug message
[wxWidgets.git] / src / msw / treectrl.cpp
index f7ac36c71812b1b460ea323da67cea980345e84b..44c408406b6d03bb6d221ec415a45200bce43ba4 100644 (file)
 // ----------------------------------------------------------------------------
 
 // a convenient wrapper around TV_ITEM struct which adds a ctor
+#ifdef __VISUALC__
 #pragma warning( disable : 4097 )
+#endif
+
 struct wxTreeViewItem : public TV_ITEM
 {
     wxTreeViewItem(const wxTreeItemId& item,    // the item handle
@@ -80,7 +83,10 @@ struct wxTreeViewItem : public TV_ITEM
         hItem = (HTREEITEM) (WXHTREEITEM) item;
     }
 };
+
+#ifdef __VISUALC__
 #pragma warning( default : 4097 )
+#endif
 
 // a class which encapsulates the tree traversal logic: it vists all (unless
 // OnVisit() returns FALSE) items under the given one
@@ -1341,6 +1347,25 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 
     switch ( hdr->code )
     {
+        case NM_RCLICK:
+        {
+            if ( wxControl::MSWOnNotify(idCtrl, lParam, result) )
+                return TRUE;
+
+            TV_HITTESTINFO tvhti;
+            ::GetCursorPos(&(tvhti.pt));
+            ::ScreenToClient(GetHwnd(),&(tvhti.pt));
+            if ( TreeView_HitTest(GetHwnd(),&tvhti) )
+            {
+                if( tvhti.flags & TVHT_ONITEM )
+                {
+                    event.m_item = (WXHTREEITEM) tvhti.hItem;
+                    eventType=wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
+                }
+            }
+            break;
+        }
+
         case TVN_BEGINDRAG:
             eventType = wxEVT_COMMAND_TREE_BEGIN_DRAG;
             // fall through
@@ -1427,7 +1452,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
                                       "message"), tv->action);
                 }
 
-                bool ing = (hdr->code == TVN_ITEMEXPANDING);
+                bool ing = ((int)hdr->code == TVN_ITEMEXPANDING);
                 eventType = g_events[expand][ing];
 
                 event.m_item = (WXHTREEITEM) tv->itemNew.hItem;