]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/textctrl.cpp
fixes for Raise() to work correctly with both top level and child windows
[wxWidgets.git] / src / mac / carbon / textctrl.cpp
index ddd40ad9d5acc9c2b41bedad9a826186c1a7ed7f..f522366b3204fe4ce60e0bb6186f17c0ba2119f7 100644 (file)
@@ -624,10 +624,10 @@ wxString wxTextCtrl::GetLineText(long lineNo) const
                
                for (int j = i; j < actualsize; j++)
                {
-                   tmp += wxBuffer[j];
-                   
                    if (wxBuffer[j] == '\r')
                        return tmp;
+                       
+                   tmp += wxBuffer[j];
                }
                
                return tmp;
@@ -680,12 +680,15 @@ void wxTextCtrl::OnChar(wxKeyEvent& event)
                        }
                        if ( panel && panel->GetDefaultItem() )
                        {
-                               wxButton *def = panel->GetDefaultItem() ;
-                               wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
-                                       event.SetEventObject(def);
-                                       def->Command(event);
-                               event.Skip() ;
-                       return ;
+                    wxButton *def = wxDynamicCast(panel->GetDefaultItem(),
+                                                          wxButton);
+                               if ( def && def->IsEnabled() )
+                               {
+                                   wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, def->GetId() );
+                                           event.SetEventObject(def);
+                                           def->Command(event);
+                       return ;
+                   }
                        }
             }
             //else: multiline controls need Enter for themselves