2. small bug fixes for recent fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4154
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
-WX_DEFINE_EXPORTED_ARRAY(wxTreeItemId, wxArrayTreeItemIds);
+WX_DEFINE_EXPORTED_ARRAY(WXHTREEITEM, wxArrayTreeItemIds);
// ----------------------------------------------------------------------------
// wxTreeItemData is some (arbitrary) user class associated with some item. The
// ----------------------------------------------------------------------------
// wxTreeItemData is some (arbitrary) user class associated with some item. The
{
wxMenu* menu = (wxMenu*) node->Data();
{
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];
// delete the element from the array (could use memmove() too...)
delete [] m_fileHistory[i];
+
+ // 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)
+ int n = GetSelection();
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
wxCommandEvent event(wxEVT_COMMAND_CHOICE_SELECTED, m_windowId);
- event.SetInt(GetSelection());
event.SetEventObject(this);
event.SetString(GetStringSelection());
event.SetEventObject(this);
event.SetString(GetStringSelection());
+ if ( HasClientObjectData() )
+ event.SetClientObject( GetClientObject(n) );
+ else if ( HasClientUntypedData() )
+ event.SetClientData( GetClientData(n) );
ProcessCommand(event);
return TRUE;
ProcessCommand(event);
return TRUE;
#if wxUSE_OWNER_DRAWN
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {
#if wxUSE_OWNER_DRAWN
size_t uiCount = m_aItems.Count();
while ( uiCount-- != 0 ) {