X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/289532452089421ddadbd4726a8469511a19ab76..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 1aa82a3fff..41e10d0526 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -114,11 +114,11 @@ gtk_insert_text_callback(GtkEditable *editable, gtk_signal_emit_stop_by_name(GTK_OBJECT(editable), "insert_text"); // remember that the next changed signal is to be ignored to avoid - // generating a dummy wxEVT_COMMAND_TEXT_UPDATED event + // generating a dummy wxEVT_TEXT event win->IgnoreNextTextUpdate(); // and generate the correct one ourselves - wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId()); + wxCommandEvent event(wxEVT_TEXT_MAXLEN, win->GetId()); event.SetEventObject(win); event.SetString(win->GetValue()); win->HandleWindowEvent( event ); @@ -145,7 +145,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) win->SetModified(); win->UpdateFontIfNeeded(); - wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() ); + wxCommandEvent event( wxEVT_TEXT, win->GetId() ); event.SetEventObject( win ); win->HandleWindowEvent( event ); } @@ -714,29 +714,6 @@ void wxTextCtrl::DoEnable( bool enable ) } } -// wxGTK-specific: called recursively by Enable, -// to give widgets an oppprtunity to correct their colours after they -// have been changed by Enable -void wxTextCtrl::OnEnabled( bool WXUNUSED(enable) ) -{ - if ( IsSingleLine() ) - return; - - // If we have a custom background colour, we use this colour in both - // disabled and enabled mode, or we end up with a different colour under the - // text. - wxColour oldColour = GetBackgroundColour(); - if (oldColour.Ok()) - { - // Need to set twice or it'll optimize the useful stuff out - if (oldColour == * wxWHITE) - SetBackgroundColour(*wxBLACK); - else - SetBackgroundColour(*wxWHITE); - SetBackgroundColour(oldColour); - } -} - void wxTextCtrl::MarkDirty() { m_modified = true; @@ -995,7 +972,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event ) if ((key_event.GetKeyCode() == WXK_RETURN) && (m_windowStyle & wxTE_PROCESS_ENTER)) { - wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId); + wxCommandEvent event(wxEVT_TEXT_ENTER, m_windowId); event.SetEventObject(this); event.SetString(GetValue()); if (HandleWindowEvent(event)) return; @@ -1110,7 +1087,7 @@ bool wxTextCtrl::SetBackgroundColour( const wxColour &colour ) if (!m_widget->window) return false; - if (!m_backgroundColour.Ok()) + if (!m_backgroundColour.IsOk()) return false; if (m_windowStyle & wxTE_MULTILINE) @@ -1242,9 +1219,9 @@ void wxTextCtrl::OnUpdateRedo(wxUpdateUIEvent& event) void wxTextCtrl::OnInternalIdle() { wxCursor cursor = m_cursor; - if (g_globalCursor.Ok()) cursor = g_globalCursor; + if (g_globalCursor.IsOk()) cursor = g_globalCursor; - if (cursor.Ok()) + if (cursor.IsOk()) { GdkWindow *window = NULL; if (HasFlag(wxTE_MULTILINE)) @@ -1255,7 +1232,7 @@ void wxTextCtrl::OnInternalIdle() if (window) gdk_window_set_cursor( window, cursor.GetCursor() ); - if (!g_globalCursor.Ok()) + if (!g_globalCursor.IsOk()) cursor = *wxSTANDARD_CURSOR; window = m_widget->window;