]> git.saurik.com Git - wxWidgets.git/commitdiff
list ctrl and tree ctrl didn't like the new focus code,
authorRobert Roebling <robert@roebling.de>
Tue, 15 Feb 2000 18:38:19 +0000 (18:38 +0000)
committerRobert Roebling <robert@roebling.de>
Tue, 15 Feb 2000 18:38:19 +0000 (18:38 +0000)
  mem clean uop crash fixed.

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

samples/treectrl/icon2.xpm
samples/treectrl/icon3.xpm
samples/treectrl/icon5.xpm
src/generic/listctrl.cpp
src/generic/treectrl.cpp
src/gtk/window.cpp
src/gtk1/window.cpp

index 998ed1ec4bfd43afbfc78e14837b7a7491ac009d..d3d76ec8e48b55cdf42b54cc6fe3236ce680102a 100644 (file)
@@ -5,7 +5,7 @@ static char *icon2_xpm[] = {
 /* colors */
 ". c #000000",
 "# c #ff0000",
-"a c #ffffff",
+"a c None",
 /* pixels */
 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
index efd67292fdffe05beb0817197a178f3936b7522d..0dba5bef0dc4f295e4157746471834eef86f8214 100644 (file)
@@ -7,7 +7,7 @@ static char *icon3_xpm[] = {
 "# c #c0c0c0",
 "a c #808080",
 "b c #ffff00",
-"c c #ffffff",
+"c c None",
 /* pixels */
 "cccccccccccccccccccccccccccccccc",
 "cccccccccccccccccccccccccccccccc",
index 557536a65072e0ecc7f41b2909556c1da681705a..63820ef10fb8dff1eaa10cce0a28f50a57067d9b 100644 (file)
@@ -5,7 +5,7 @@ static char *icon5_xpm[] = {
 /* colors */
 ". c #000000",
 "# c #808000",
-"a c #ffffff",
+"a c None",
 "b c #ffff00",
 /* pixels */
 "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
index 1ba7eda09dfe5966eedc28421a2299539096887b..e05166317813a0df95bb3baf1b53d28a2b578332 100644 (file)
@@ -1060,24 +1060,33 @@ void wxListTextCtrl::OnChar( wxKeyEvent &event )
     {
         (*m_accept) = TRUE;
         (*m_res) = GetValue();
-        m_owner->SetFocus();
+        
+        if (!wxPendingDelete.Member(this))
+            wxPendingDelete.Append(this);
+
+        if ((*m_accept) && ((*m_res) != m_startValue))
+            m_owner->OnRenameAccept();
+            
         return;
     }
     if (event.m_keyCode == WXK_ESCAPE)
     {
         (*m_accept) = FALSE;
         (*m_res) = "";
-        m_owner->SetFocus();
+        
+        if (!wxPendingDelete.Member(this))
+            wxPendingDelete.Append(this);
+            
         return;
     }
+    
     event.Skip();
 }
 
 void wxListTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
 {
-    if (wxPendingDelete.Member(this)) return;
-
-    wxPendingDelete.Append(this);
+    if (!wxPendingDelete.Member(this))
+        wxPendingDelete.Append(this);
 
     if ((*m_accept) && ((*m_res) != m_startValue))
         m_owner->OnRenameAccept();
index 0f45e548b7c38fa01250cd9ed5b4b0c1babf82e6..3586419f4ad13d64e21bd93b6a94b2c2bae7b759 100644 (file)
@@ -252,14 +252,23 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
     {
         (*m_accept) = TRUE;
         (*m_res) = GetValue();
-        m_owner->SetFocus();
+        
+        if (!wxPendingDelete.Member(this))
+            wxPendingDelete.Append(this);
+
+        if ((*m_accept) && ((*m_res) != m_startValue))
+            m_owner->OnRenameAccept();
+            
         return;
     }
     if (event.m_keyCode == WXK_ESCAPE)
     {
         (*m_accept) = FALSE;
         (*m_res) = "";
-        m_owner->SetFocus();
+        
+        if (!wxPendingDelete.Member(this))
+            wxPendingDelete.Append(this);
+            
         return;
     }
     event.Skip();
@@ -267,9 +276,8 @@ void wxTreeTextCtrl::OnChar( wxKeyEvent &event )
 
 void wxTreeTextCtrl::OnKillFocus( wxFocusEvent &WXUNUSED(event) )
 {
-    if (wxPendingDelete.Member(this)) return;
-
-    wxPendingDelete.Append(this);
+    if (!wxPendingDelete.Member(this))
+        wxPendingDelete.Append(this);
 
     if ((*m_accept) && ((*m_res) != m_startValue))
         m_owner->OnRenameAccept();
index 13b9e503133d1e49c1c085b8d2003d7bf30a7294..5e09f6f528311003e350e0ab6d8b067d4b9d6544 100644 (file)
@@ -2147,7 +2147,10 @@ wxWindow::~wxWindow()
 
     if (m_widgetStyle)
     {
-        gtk_style_unref( m_widgetStyle );
+        // don't delete if it's a pixmap theme style
+        if (!m_widgetStyle->engine_data)
+            gtk_style_unref( m_widgetStyle );
+            
         m_widgetStyle = (GtkStyle*) NULL;
     }
 
index 13b9e503133d1e49c1c085b8d2003d7bf30a7294..5e09f6f528311003e350e0ab6d8b067d4b9d6544 100644 (file)
@@ -2147,7 +2147,10 @@ wxWindow::~wxWindow()
 
     if (m_widgetStyle)
     {
-        gtk_style_unref( m_widgetStyle );
+        // don't delete if it's a pixmap theme style
+        if (!m_widgetStyle->engine_data)
+            gtk_style_unref( m_widgetStyle );
+            
         m_widgetStyle = (GtkStyle*) NULL;
     }