X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c663fbea6851207b4e0ac3e362868c23b1494a46..a43ed08aa8f39c31feebd5cc0d079b0a855082b6:/src/gtk1/textctrl.cpp?ds=sidebyside diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index be60f4def2..1a9ae3ca2d 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -414,6 +414,16 @@ bool wxTextCtrl::Create( wxWindow *parent, gtk_entry_set_editable( GTK_ENTRY(m_text), FALSE ); #ifdef __WXGTK20__ else + gtk_text_view_set_editable( GTK_TEXT_VIEW( m_text), FALSE); +#else + } + else + { + if (multi_line) + gtk_text_set_editable( GTK_TEXT(m_text), 1 ); +#endif + } + #ifdef __WXGTK20__ if (multi_line) { @@ -434,16 +444,6 @@ bool wxTextCtrl::Create( wxWindow *parent, } #endif // gtk+-2.3.5 #endif // __WXGTK20__ - gtk_text_view_set_editable( GTK_TEXT_VIEW( m_text), FALSE); -#else - } - else - { - if (multi_line) - gtk_text_set_editable( GTK_TEXT(m_text), 1 ); -#endif - } - // We want to be notified about text changes. #ifdef __WXGTK20__ @@ -1416,14 +1416,6 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) if (!m_widget->window) return FALSE; - wxColour sysbg = wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ); - if (sysbg.Red() == colour.Red() && - sysbg.Green() == colour.Green() && - sysbg.Blue() == colour.Blue()) - { - return FALSE; // FIXME or TRUE? - } - if (!m_backgroundColour.Ok()) return FALSE; @@ -1535,10 +1527,9 @@ bool wxTextCtrl::SetStyle( long start, long end, const wxTextAttr& style ) } } -void wxTextCtrl::ApplyWidgetStyle() +void wxTextCtrl::DoApplyWidgetStyle(GtkRcStyle *style) { - SetWidgetStyle(); - gtk_widget_set_style( m_text, m_widgetStyle ); + gtk_widget_modify_style(m_text, style); } void wxTextCtrl::OnCut(wxCommandEvent& WXUNUSED(event)) @@ -1634,7 +1625,9 @@ wxSize wxTextCtrl::DoGetBestSize() const { // FIXME should be different for multi-line controls... wxSize ret( wxControl::DoGetBestSize() ); - return wxSize(80, ret.y); + wxSize best(80, ret.y); + CacheBestSize(best); + return best; } // ----------------------------------------------------------------------------