]> git.saurik.com Git - wxWidgets.git/commitdiff
1. compilation fix for wxArrayTreeItemIds
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Oct 1999 00:30:53 +0000 (00:30 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 24 Oct 1999 00:30:53 +0000 (00:30 +0000)
2. small bug fixes for recent fixes

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4154 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/treectrl.h
src/common/docview.cpp
src/msw/choice.cpp
src/msw/listbox.cpp

index c143a0bf392cdeaef9e58b7207d0ee06c129f2e2..48881c46f617e0eb63cc059aa087c5069335d22d 100644 (file)
@@ -122,7 +122,7 @@ protected:
     long m_itemId;
 };
 
-WX_DEFINE_EXPORTED_ARRAY(wxTreeItemId, wxArrayTreeItemIds);
+WX_DEFINE_EXPORTED_ARRAY(WXHTREEITEM, wxArrayTreeItemIds);
 
 // ----------------------------------------------------------------------------
 // wxTreeItemData is some (arbitrary) user class associated with some item. The
index e21cda1fc91abae90261a39dc9a3787ce466ca35..93f4e5e81e815d749d1338bea25667e93ebe04c6 100644 (file)
@@ -1909,9 +1909,6 @@ void wxFileHistory::RemoveFileFromHistory(int i)
     {
         wxMenu* menu = (wxMenu*) node->Data();
 
-        // delete the menu items
-        menu->Delete(wxID_FILE1 + i);
-
         // delete the element from the array (could use memmove() too...)
         delete [] m_fileHistory[i];
 
@@ -1930,7 +1927,17 @@ void wxFileHistory::RemoveFileFromHistory(int i)
         }
 
         node = node->Next();
+
+        // delete the last menu item which is unused now
+        menu->Delete(wxID_FILE1 + m_fileHistoryN - 1);
+
+        // unfortunately, we can't delete separator (there is no function to
+        // delete item by position, only by id - and what if there are several
+        // separators in this menu?) - so we will be always left with at least
+        // one and, even worse, we will add another one if this was the last
+        // file... (FIXME)
     }
+
     m_fileHistoryN--;
 }
 
index 9c7c335392f680ea16ac986d63231d27178dc207..c6a9f7909f1286279a058759f7965290cddc90df 100644 (file)
@@ -317,10 +317,15 @@ bool wxChoice::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
         return FALSE;
     }
 
+    int n = GetSelection();
     wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
-    event.SetInt(GetSelection());
+    event.SetInt(n);
     event.SetEventObject(this);
     event.SetString(GetStringSelection());
+    if ( HasClientObjectData() )
+        event.SetClientObject( GetClientObject(n) );
+    else if ( HasClientUntypedData() )
+        event.SetClientData( GetClientData(n) );
     ProcessCommand(event);
 
     return TRUE;
index 71d0b7c75ed0bf18e7fbd015d5c27790087ea3ca..985187379eef99e368c858b3e9346cce028dfdf1 100644 (file)
@@ -357,6 +357,7 @@ void wxListBox::Clear()
 }
 
 void wxListBox::Free()
+{
 #if wxUSE_OWNER_DRAWN
     size_t uiCount = m_aItems.Count();
     while ( uiCount-- != 0 ) {