X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b02da6b18713d069cc9f4077f9b43df7a11bc7fb..b4d1ebf058c64f5b9e0ddf3264ce8a801eae4f79:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index d7a5312e13..3fc3e5386c 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -182,10 +182,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, m_text = gtk_entry_new(); } - wxSize newSize = size; - if (newSize.x == -1) newSize.x = 80; - if (newSize.y == -1) newSize.y = 26; - SetSize( newSize.x, newSize.y ); + SetSizeOrDefault( size ); m_parent->DoAddChild( this ); @@ -782,7 +779,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) if ((key_event.KeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE)) { wxWindow *top_frame = m_parent; - while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame)) + while (top_frame->GetParent() && !(top_frame->IsTopLevel())) top_frame = top_frame->GetParent(); GtkWindow *window = GTK_WINDOW(top_frame->m_widget); @@ -963,4 +960,12 @@ void wxTextCtrl::OnInternalIdle() if ((window) && !(GTK_WIDGET_NO_WINDOW(m_widget))) gdk_window_set_cursor( window, cursor.GetCursor() ); } + + UpdateWindowUI(); +} + +wxSize wxTextCtrl::DoGetBestSize() const +{ + // FIXME should be different for multi-line controls... + return wxSize(80, 26); }