]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/treectlg.cpp
fix for wxComboBox::GetSelection from inside event handler
[wxWidgets.git] / src / generic / treectlg.cpp
index deede8e3e2879c3c20f5709837313f38fda88cee..3176b1eb9280dd407f86ef7e2933c929381d3e47 100644 (file)
@@ -360,21 +360,6 @@ void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
         m_owner->OnRenameAccept();
 }
 
         m_owner->OnRenameAccept();
 }
 
-#if 0
-// -----------------------------------------------------------------------------
-// wxTreeEvent
-// -----------------------------------------------------------------------------
-
-IMPLEMENT_DYNAMIC_CLASS(wxTreeEvent, wxNotifyEvent)
-
-wxTreeEvent::wxTreeEvent( wxEventType commandType, int id )
-           : wxNotifyEvent( commandType, id )
-{
-    m_code = 0;
-    m_itemOld = (wxGenericTreeItem *)NULL;
-}
-#endif
-
 // -----------------------------------------------------------------------------
 // wxGenericTreeItem
 // -----------------------------------------------------------------------------
 // -----------------------------------------------------------------------------
 // wxGenericTreeItem
 // -----------------------------------------------------------------------------
@@ -679,7 +664,7 @@ bool wxGenericTreeCtrl::Create(wxWindow *parent,
     SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
 
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
     SetBackgroundColour( wxSystemSettings::GetSystemColour( wxSYS_COLOUR_LISTBOX ) );
 
 //  m_dottedPen = wxPen( "grey", 0, wxDOT );  too slow under XFree86
-    m_dottedPen = wxPen( "grey", 0, 0 );
+    m_dottedPen = wxPen( wxT("grey"), 0, 0 );
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -2172,7 +2157,7 @@ void wxGenericTreeCtrl::OnKillFocus( wxFocusEvent &event )
 void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
 {
     wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
 void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
 {
     wxTreeEvent te( wxEVT_COMMAND_TREE_KEY_DOWN, GetId() );
-    te.m_code = (int)event.KeyCode();
+    te.m_evtKey = event;
     te.SetEventObject( this );
     if ( GetEventHandler()->ProcessEvent( te ) )
     {
     te.SetEventObject( this );
     if ( GetEventHandler()->ProcessEvent( te ) )
     {
@@ -2236,7 +2221,6 @@ void wxGenericTreeCtrl::OnChar( wxKeyEvent &event )
             {
                 wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
                 event.m_item = (long) m_current;
             {
                 wxTreeEvent event( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
                 event.m_item = (long) m_current;
-                event.m_code = 0;
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }
                 event.SetEventObject( this );
                 GetEventHandler()->ProcessEvent( event );
             }
@@ -2661,7 +2645,6 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
         {
             wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
             nevent.m_item = (long) item;
         {
             wxTreeEvent nevent(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, GetId());
             nevent.m_item = (long) item;
-            nevent.m_code = 0;
             CalcScrolledPosition(x, y,
                                  &nevent.m_pointDrag.x,
                                  &nevent.m_pointDrag.y);
             CalcScrolledPosition(x, y,
                                  &nevent.m_pointDrag.x,
                                  &nevent.m_pointDrag.y);
@@ -2725,7 +2708,6 @@ void wxGenericTreeCtrl::OnMouse( wxMouseEvent &event )
                 // send activate event first
                 wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
                 nevent.m_item = (long) item;
                 // send activate event first
                 wxTreeEvent nevent( wxEVT_COMMAND_TREE_ITEM_ACTIVATED, GetId() );
                 nevent.m_item = (long) item;
-                nevent.m_code = 0;
                 CalcScrolledPosition(x, y,
                                      &nevent.m_pointDrag.x,
                                      &nevent.m_pointDrag.y);
                 CalcScrolledPosition(x, y,
                                      &nevent.m_pointDrag.x,
                                      &nevent.m_pointDrag.y);
@@ -2931,7 +2913,7 @@ bool wxGenericTreeCtrl::SetBackgroundColour(const wxColour& colour)
     return TRUE;
 }
 
     return TRUE;
 }
 
-}bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour)
+bool wxGenericTreeCtrl::SetForegroundColour(const wxColour& colour)
 {
     if ( !wxWindow::SetForegroundColour(colour) )
         return FALSE;
 {
     if ( !wxWindow::SetForegroundColour(colour) )
         return FALSE;