]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/treectrl.cpp
wxChoice and wxListBox GTK+ changes (wxChoice works, wxListBox still doesn't)
[wxWidgets.git] / src / msw / treectrl.cpp
index 8517884f189738dc1b5d4bf63f95e0d0af691798..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
@@ -1342,22 +1348,24 @@ 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)!=NULL) {
-               if(tvhti.flags & TVHT_ONITEM) {
-                   event.m_item = (WXHTREEITEM) tvhti.hItem;
-                   eventType=wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK;
-               }
-           }
-           break;
-       }
-       
+        {
+            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
@@ -1444,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;