1. added wxEvtHandler::SafelyProcessEvent() and wxWindow::HandleWindowEvent() to correctly handle exceptions in even handlers in wxGTK
2. use HandleWindowEvent() everywhere as more obvious and convenient shortcut for GetEventHandler()->ProcessEvent(); also for consistency with wxGTK where it's required git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@50329 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -50,7 +50,7 @@ static void gtk_bmpbutton_clicked_callback( GtkWidget *WXUNUSED(widget), wxBitma
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
|
||||
event.SetEventObject(button);
|
||||
button->GetEventHandler()->ProcessEvent(event);
|
||||
button->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
|
||||
event.SetEventObject(button);
|
||||
button->GetEventHandler()->ProcessEvent(event);
|
||||
button->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ static void gtk_checkbox_toggled_callback(GtkWidget *WXUNUSED(widget),
|
||||
wxCommandEvent event(wxEVT_COMMAND_CHECKBOX_CLICKED, cb->GetId());
|
||||
event.SetInt(cb->GetValue());
|
||||
event.SetEventObject(cb);
|
||||
cb->GetEventHandler()->ProcessEvent(event);
|
||||
cb->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice *
|
||||
else if ( choice->HasClientUntypedData() )
|
||||
event.SetClientData( choice->GetClientData(n) );
|
||||
|
||||
choice->GetEventHandler()->ProcessEvent(event);
|
||||
choice->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxComboBox *combo )
|
||||
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
|
||||
event.SetString( combo->GetValue() );
|
||||
event.SetEventObject( combo );
|
||||
combo->GetEventHandler()->ProcessEvent( event );
|
||||
combo->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,13 +91,13 @@ gtk_popup_hide_callback(GtkCombo *WXUNUSED(gtk_combo), wxComboBox *combo)
|
||||
event.SetInt( curSelection );
|
||||
event.SetString( combo->GetStringSelection() );
|
||||
event.SetEventObject( combo );
|
||||
combo->GetEventHandler()->ProcessEvent( event );
|
||||
combo->HandleWindowEvent( event );
|
||||
|
||||
// for consistency with the other ports, send TEXT event
|
||||
wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
|
||||
event2.SetString( combo->GetStringSelection() );
|
||||
event2.SetEventObject( combo );
|
||||
combo->GetEventHandler()->ProcessEvent( event2 );
|
||||
combo->HandleWindowEvent( event2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -154,14 +154,14 @@ gtk_combo_select_child_callback( GtkList *WXUNUSED(list), GtkWidget *WXUNUSED(wi
|
||||
event.SetInt( curSelection );
|
||||
event.SetString( combo->GetStringSelection() );
|
||||
event.SetEventObject( combo );
|
||||
combo->GetEventHandler()->ProcessEvent( event );
|
||||
combo->HandleWindowEvent( event );
|
||||
|
||||
// for consistency with the other ports, don't generate text update
|
||||
// events while the user is browsing the combobox neither
|
||||
wxCommandEvent event2( wxEVT_COMMAND_TEXT_UPDATED, combo->GetId() );
|
||||
event2.SetString( combo->GetValue() );
|
||||
event2.SetEventObject( combo );
|
||||
combo->GetEventHandler()->ProcessEvent( event2 );
|
||||
combo->HandleWindowEvent( event2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -789,7 +789,7 @@ void wxComboBox::OnChar( wxKeyEvent &event )
|
||||
eventEnter.SetInt( GetSelection() );
|
||||
eventEnter.SetEventObject( this );
|
||||
|
||||
if (!GetEventHandler()->ProcessEvent( eventEnter ))
|
||||
if (!HandleWindowEvent( eventEnter ))
|
||||
{
|
||||
// This will invoke the dialog default action, such
|
||||
// as the clicking the default button.
|
||||
|
||||
@@ -141,7 +141,7 @@ void wxDialog::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
|
||||
wxCommandEvent cancelEvent(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
cancelEvent.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent(cancelEvent);
|
||||
HandleWindowEvent(cancelEvent);
|
||||
s_closing.DeleteObject(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ void gtk_fontdialog_ok_callback( GtkWidget *WXUNUSED(widget), wxFontDialog *dial
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK);
|
||||
event.SetEventObject( dialog );
|
||||
dialog->GetEventHandler()->ProcessEvent( event );
|
||||
dialog->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ void gtk_fontdialog_cancel_callback( GtkWidget *WXUNUSED(w), wxFontDialog *dialo
|
||||
|
||||
wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
event.SetEventObject( dialog );
|
||||
dialog->GetEventHandler()->ProcessEvent( event );
|
||||
dialog->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -495,7 +495,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
||||
// send size event to frame
|
||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
HandleWindowEvent( event );
|
||||
|
||||
#if wxUSE_STATUSBAR
|
||||
// send size event to status bar
|
||||
@@ -503,7 +503,7 @@ void wxFrame::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
||||
{
|
||||
wxSizeEvent event2( wxSize(m_frameStatusBar->m_width,m_frameStatusBar->m_height), m_frameStatusBar->GetId() );
|
||||
event2.SetEventObject( m_frameStatusBar );
|
||||
m_frameStatusBar->GetEventHandler()->ProcessEvent( event2 );
|
||||
m_frameStatusBar->HandleWindowEvent( event2 );
|
||||
}
|
||||
#endif // wxUSE_STATUSBAR
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ gtk_glwindow_map_callback( GtkWidget * WXUNUSED(widget), wxGLCanvas *win )
|
||||
{
|
||||
wxPaintEvent event( win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
|
||||
win->GetUpdateRegion().Clear();
|
||||
|
||||
@@ -126,7 +126,7 @@ gtk_glcanvas_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, w
|
||||
|
||||
wxSizeEvent event( wxSize(win->m_width,win->m_height), win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -271,7 +271,7 @@ void wxGLCanvas::OnInternalIdle()
|
||||
{
|
||||
wxPaintEvent event( GetId() );
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
HandleWindowEvent( event );
|
||||
|
||||
GetUpdateRegion().Clear();
|
||||
}
|
||||
|
||||
@@ -110,12 +110,12 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *WXUNUSED(widget),
|
||||
win->m_hasFocus = true;
|
||||
|
||||
wxChildFocusEvent eventChildFocus(win);
|
||||
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus);
|
||||
(void)win->HandleWindowEvent(eventChildFocus);
|
||||
|
||||
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
|
||||
eventFocus.SetEventObject(win);
|
||||
|
||||
(void)win->GetEventHandler()->ProcessEvent(eventFocus);
|
||||
(void)win->HandleWindowEvent(eventFocus);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -149,7 +149,7 @@ static gint gtk_listitem_focus_out_callback( GtkWidget *WXUNUSED(widget),
|
||||
// process it too as otherwise bad things happen, especially in GTK2
|
||||
// where the text control simply aborts the program if it doesn't get
|
||||
// the matching focus out event
|
||||
(void)win->GetEventHandler()->ProcessEvent( event );
|
||||
(void)win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -202,7 +202,7 @@ gtk_listbox_button_release_callback( GtkWidget * WXUNUSED(widget),
|
||||
|
||||
event.SetInt(n);
|
||||
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
listbox->HandleWindowEvent( event );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -237,7 +237,7 @@ gtk_listbox_button_press_callback( GtkWidget *widget,
|
||||
wxCommandEvent event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
event.SetEventObject( listbox );
|
||||
event.SetInt( sel );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
listbox->HandleWindowEvent( event );
|
||||
}
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
@@ -288,7 +288,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
|
||||
/* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
|
||||
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
|
||||
new_event.SetCurrentFocus( listbox );
|
||||
ret = listbox->GetEventHandler()->ProcessEvent( new_event );
|
||||
ret = listbox->HandleWindowEvent( new_event );
|
||||
}
|
||||
|
||||
if ((gdk_event->keyval == GDK_Return) && (!ret))
|
||||
@@ -309,7 +309,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
|
||||
wxCommandEvent new_event( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, listbox->GetId() );
|
||||
new_event.SetEventObject( listbox );
|
||||
new_event.SetInt( sel );
|
||||
ret = listbox->GetEventHandler()->ProcessEvent( new_event );
|
||||
ret = listbox->HandleWindowEvent( new_event );
|
||||
}
|
||||
#endif // wxUSE_CHECKLISTBOX
|
||||
|
||||
@@ -347,7 +347,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxLis
|
||||
n = -1;
|
||||
}
|
||||
new_event.SetInt(n);
|
||||
listbox->GetEventHandler()->ProcessEvent( new_event );
|
||||
listbox->HandleWindowEvent( new_event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,7 +412,7 @@ static void gtk_listitem_select_cb( GtkWidget *widget,
|
||||
|
||||
// No longer required with new code in wxLB_SINGLE
|
||||
// listbox->GetEventHandler()->AddPendingEvent( event );
|
||||
listbox->GetEventHandler()->ProcessEvent( event );
|
||||
listbox->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -66,7 +66,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
{
|
||||
wxActivateEvent event1( wxEVT_ACTIVATE, false, child->GetId() );
|
||||
event1.SetEventObject( child);
|
||||
child->GetEventHandler()->ProcessEvent( event1 );
|
||||
child->HandleWindowEvent( event1 );
|
||||
}
|
||||
|
||||
// send activate event to new child
|
||||
@@ -100,7 +100,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget),
|
||||
|
||||
wxActivateEvent event2( wxEVT_ACTIVATE, true, child->GetId() );
|
||||
event2.SetEventObject( child);
|
||||
child->GetEventHandler()->ProcessEvent( event2 );
|
||||
child->HandleWindowEvent( event2 );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event)
|
||||
|
||||
wxWindow *win = menu->GetInvokingWindow();
|
||||
if (win)
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
@@ -632,7 +632,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
|
||||
commandEvent.SetInt(item->IsChecked());
|
||||
commandEvent.SetEventObject(menu);
|
||||
|
||||
frame->GetEventHandler()->ProcessEvent(commandEvent);
|
||||
frame->HandleWindowEvent(commandEvent);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -666,7 +666,7 @@ static void gtk_menu_hilight_callback( GtkWidget *widget, wxMenu *menu )
|
||||
return;
|
||||
|
||||
wxWindow *win = menu->GetInvokingWindow();
|
||||
if (win) win->GetEventHandler()->ProcessEvent( event );
|
||||
if (win) win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ static void gtk_menu_nolight_callback( GtkWidget *widget, wxMenu *menu )
|
||||
|
||||
wxWindow *win = menu->GetInvokingWindow();
|
||||
if (win)
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ static gint gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk
|
||||
event.SetCurrentFocus( notebook );
|
||||
|
||||
wxNotebookPage *client = notebook->GetPage(sel);
|
||||
if ( !client->GetEventHandler()->ProcessEvent( event ) )
|
||||
if ( !client->HandleWindowEvent( event ) )
|
||||
{
|
||||
client->SetFocus();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ static gint gtk_popup_button_press (GtkWidget *widget, GdkEvent *gdk_event, wxPo
|
||||
wxFocusEvent event( wxEVT_KILL_FOCUS, win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
|
||||
(void)win->GetEventHandler()->ProcessEvent( event );
|
||||
(void)win->HandleWindowEvent( event );
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
@@ -337,7 +337,7 @@ void wxPopupWindow::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int
|
||||
|
||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
void wxPopupWindow::OnInternalIdle()
|
||||
|
||||
@@ -57,7 +57,7 @@ static void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioBo
|
||||
event.SetInt( rb->GetSelection() );
|
||||
event.SetString( rb->GetStringSelection() );
|
||||
event.SetEventObject( rb );
|
||||
rb->GetEventHandler()->ProcessEvent(event);
|
||||
rb->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ static gint gtk_radiobutton_focus_in( GtkWidget *WXUNUSED(widget),
|
||||
|
||||
// never stop the signal emission, it seems to break the kbd handling
|
||||
// inside the radiobox
|
||||
(void)win->GetEventHandler()->ProcessEvent( event );
|
||||
(void)win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -586,7 +586,7 @@ void wxRadioBox::OnInternalIdle()
|
||||
wxFocusEvent event( wxEVT_KILL_FOCUS, GetId() );
|
||||
event.SetEventObject( this );
|
||||
|
||||
(void)GetEventHandler()->ProcessEvent( event );
|
||||
(void)HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
if (g_delayedFocus == this)
|
||||
|
||||
@@ -52,7 +52,7 @@ void gtk_radiobutton_clicked_callback( GtkToggleButton *button, wxRadioButton *r
|
||||
wxCommandEvent event( wxEVT_COMMAND_RADIOBUTTON_SELECTED, rb->GetId());
|
||||
event.SetInt( rb->GetValue() );
|
||||
event.SetEventObject( rb );
|
||||
rb->GetEventHandler()->ProcessEvent( event );
|
||||
rb->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,13 +70,13 @@ static void gtk_scrollbar_callback( GtkAdjustment *adjust,
|
||||
{
|
||||
wxScrollEvent event( g_currentUpDownEvent, win->GetId(), value, orient );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
// throw other event (wxEVT_SCROLL_THUMBTRACK)
|
||||
wxScrollEvent event( command, win->GetId(), value, orient );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
|
||||
/*
|
||||
wxCommandEvent cevent( wxEVT_COMMAND_SCROLLBAR_UPDATED, win->GetId() );
|
||||
@@ -149,7 +149,7 @@ gtk_scrollbar_button_release_callback( GtkRange *WXUNUSED(widget),
|
||||
|
||||
wxScrollEvent event( command, win->GetId(), value, orient );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
win->m_isScrolling = false;
|
||||
|
||||
@@ -54,19 +54,19 @@ ProcessScrollEvent(wxSlider *win, wxEventType evtType, double dvalue)
|
||||
int value = (int)(dvalue < 0 ? dvalue - 0.5 : dvalue + 0.5);
|
||||
wxScrollEvent event( evtType, win->GetId(), value, orient );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
|
||||
if ( evtType != wxEVT_SCROLL_THUMBTRACK )
|
||||
{
|
||||
wxScrollEvent event2(wxEVT_SCROLL_CHANGED, win->GetId(), value, orient);
|
||||
event2.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event2 );
|
||||
win->HandleWindowEvent( event2 );
|
||||
}
|
||||
|
||||
wxCommandEvent cevent( wxEVT_COMMAND_SLIDER_UPDATED, win->GetId() );
|
||||
cevent.SetEventObject( win );
|
||||
cevent.SetInt( value );
|
||||
win->GetEventHandler()->ProcessEvent( cevent );
|
||||
win->HandleWindowEvent( cevent );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
@@ -66,7 +66,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
|
||||
event.SetPosition( value );
|
||||
event.SetEventObject( win );
|
||||
|
||||
if ((win->GetEventHandler()->ProcessEvent( event )) &&
|
||||
if ((win->HandleWindowEvent( event )) &&
|
||||
!event.IsAllowed() )
|
||||
{
|
||||
/* program has vetoed */
|
||||
@@ -94,7 +94,7 @@ static void gtk_spinbutt_callback( GtkWidget *WXUNUSED(widget), wxSpinButton *wi
|
||||
wxSpinEvent event2( command, win->GetId());
|
||||
event2.SetPosition( value );
|
||||
event2.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event2 );
|
||||
win->HandleWindowEvent( event2 );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
// values in range 5..50 is then, ummm, quite challenging (hint: you can't
|
||||
// enter 1!) (VZ)
|
||||
event.SetInt( (int)ceil(win->m_adjust->value) );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ gtk_spinctrl_text_changed_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
|
||||
// see above
|
||||
event.SetInt( (int)ceil(win->m_adjust->value) );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
GtkSpinButton *gsb = GTK_SPIN_BUTTON(m_widget);
|
||||
wxString val = wxGTK_CONV_BACK( gtk_entry_get_text( &gsb->entry ) );
|
||||
evt.SetString( val );
|
||||
if (GetEventHandler()->ProcessEvent(evt)) return;
|
||||
if (HandleWindowEvent(evt)) return;
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
|
||||
@@ -119,7 +119,7 @@ gtk_insert_text_callback(GtkEditable *editable,
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_MAXLEN, win->GetId());
|
||||
event.SetEventObject(win);
|
||||
event.SetString(win->GetValue());
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -145,7 +145,7 @@ gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
|
||||
|
||||
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -999,7 +999,7 @@ void wxTextCtrl::OnChar( wxKeyEvent &key_event )
|
||||
wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, m_windowId);
|
||||
event.SetEventObject(this);
|
||||
event.SetString(GetValue());
|
||||
if (GetEventHandler()->ProcessEvent(event)) return;
|
||||
if (HandleWindowEvent(event)) return;
|
||||
}
|
||||
|
||||
if ((key_event.GetKeyCode() == WXK_RETURN) && !(m_windowStyle & wxTE_MULTILINE))
|
||||
|
||||
@@ -43,7 +43,7 @@ static void gtk_togglebutton_clicked_callback(GtkWidget *WXUNUSED(widget), wxTog
|
||||
wxCommandEvent event(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, cb->GetId());
|
||||
event.SetInt(cb->GetValue());
|
||||
event.SetEventObject(cb);
|
||||
cb->GetEventHandler()->ProcessEvent(event);
|
||||
cb->HandleWindowEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget,
|
||||
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, true, g_activeFrame->GetId());
|
||||
event.SetEventObject(g_activeFrame);
|
||||
g_activeFrame->GetEventHandler()->ProcessEvent(event);
|
||||
g_activeFrame->HandleWindowEvent(event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -191,7 +191,7 @@ static gint gtk_frame_focus_out_callback( GtkWidget *WXUNUSED(widget),
|
||||
wxLogTrace(wxT("activate"), wxT("Activating frame %p (from focus_in)"), g_activeFrame);
|
||||
wxActivateEvent event(wxEVT_ACTIVATE, false, g_activeFrame->GetId());
|
||||
event.SetEventObject(g_activeFrame);
|
||||
g_activeFrame->GetEventHandler()->ProcessEvent(event);
|
||||
g_activeFrame->HandleWindowEvent(event);
|
||||
|
||||
g_activeFrame = NULL;
|
||||
}
|
||||
@@ -291,7 +291,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WX
|
||||
|
||||
wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() );
|
||||
mevent.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( mevent );
|
||||
win->HandleWindowEvent( mevent );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -1020,7 +1020,7 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
||||
// send size event to frame
|
||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
HandleWindowEvent( event );
|
||||
|
||||
m_resizing = false;
|
||||
}
|
||||
|
||||
@@ -1066,7 +1066,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
if ( wxTranslateGTKKeyEventToWx(event, win, gdk_event) )
|
||||
{
|
||||
// Emit KEY_DOWN event
|
||||
ret = win->GetEventHandler()->ProcessEvent( event );
|
||||
ret = win->HandleWindowEvent( event );
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1122,12 +1122,12 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
if (parent)
|
||||
{
|
||||
event.SetEventType( wxEVT_CHAR_HOOK );
|
||||
ret = parent->GetEventHandler()->ProcessEvent( event );
|
||||
ret = parent->HandleWindowEvent( event );
|
||||
}
|
||||
if (!ret)
|
||||
{
|
||||
event.SetEventType(wxEVT_CHAR);
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
return true;
|
||||
@@ -1146,7 +1146,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
if (command != -1)
|
||||
{
|
||||
wxCommandEvent command_event( wxEVT_COMMAND_MENU_SELECTED, command );
|
||||
ret = ancestor->GetEventHandler()->ProcessEvent( command_event );
|
||||
ret = ancestor->HandleWindowEvent( command_event );
|
||||
break;
|
||||
}
|
||||
if (ancestor->IsTopLevel())
|
||||
@@ -1191,13 +1191,13 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
if (parent)
|
||||
{
|
||||
event.SetEventType( wxEVT_CHAR_HOOK );
|
||||
ret = parent->GetEventHandler()->ProcessEvent( event );
|
||||
ret = parent->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
{
|
||||
event.SetEventType(wxEVT_CHAR);
|
||||
ret = win->GetEventHandler()->ProcessEvent( event );
|
||||
ret = win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1227,7 +1227,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
// CTRL-TAB changes the (parent) window, i.e. switch notebook page
|
||||
new_event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
|
||||
new_event.SetCurrentFocus( win );
|
||||
ret = win->GetParent()->GetEventHandler()->ProcessEvent( new_event );
|
||||
ret = win->GetParent()->HandleWindowEvent( new_event );
|
||||
}
|
||||
|
||||
// generate wxID_CANCEL if <esc> has been pressed (typically in dialogs)
|
||||
@@ -1263,7 +1263,7 @@ static gint gtk_window_key_press_callback( GtkWidget *widget,
|
||||
{
|
||||
wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
|
||||
eventClick.SetEventObject(btnCancel);
|
||||
ret = btnCancel->GetEventHandler()->ProcessEvent(eventClick);
|
||||
ret = btnCancel->HandleWindowEvent(eventClick);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1304,7 +1304,7 @@ static gint gtk_window_key_release_callback( GtkWidget *widget,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if ( !win->GetEventHandler()->ProcessEvent( event ) )
|
||||
if ( !win->HandleWindowEvent( event ) )
|
||||
return FALSE;
|
||||
|
||||
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_release_event" );
|
||||
@@ -1616,7 +1616,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
|
||||
}
|
||||
}
|
||||
|
||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||
if (win->HandleWindowEvent( event ))
|
||||
{
|
||||
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_press_event" );
|
||||
g_lastMouseEvent = NULL;
|
||||
@@ -1638,7 +1638,7 @@ static gint gtk_window_button_press_callback( GtkWidget *widget,
|
||||
win->GetId(),
|
||||
win->ClientToScreen(event.GetPosition()));
|
||||
evtCtx.SetEventObject(win);
|
||||
return win->GetEventHandler()->ProcessEvent(evtCtx);
|
||||
return win->HandleWindowEvent(evtCtx);
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -1701,7 +1701,7 @@ static gint gtk_window_button_release_callback( GtkWidget *widget,
|
||||
if ( !g_captureWindow )
|
||||
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
|
||||
|
||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||
if (win->HandleWindowEvent( event ))
|
||||
{
|
||||
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "button_release_event" );
|
||||
return TRUE;
|
||||
@@ -1771,7 +1771,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
|
||||
: wxEVT_LEAVE_WINDOW);
|
||||
InitMouseEvent(win, eventM, gdk_event);
|
||||
eventM.SetEventObject(win);
|
||||
win->GetEventHandler()->ProcessEvent(eventM);
|
||||
win->HandleWindowEvent(eventM);
|
||||
}
|
||||
}
|
||||
else // no capture
|
||||
@@ -1779,7 +1779,7 @@ static gint gtk_window_motion_notify_callback( GtkWidget *widget,
|
||||
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
|
||||
}
|
||||
|
||||
bool ret = win->GetEventHandler()->ProcessEvent( event );
|
||||
bool ret = win->HandleWindowEvent( event );
|
||||
g_lastMouseEvent = NULL;
|
||||
|
||||
if ( ret )
|
||||
@@ -1802,12 +1802,12 @@ static bool DoSendFocusEvents(wxWindow *win)
|
||||
// Notify the parent keeping track of focus for the kbd navigation
|
||||
// purposes that we got it.
|
||||
wxChildFocusEvent eventChildFocus(win);
|
||||
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus);
|
||||
(void)win->HandleWindowEvent(eventChildFocus);
|
||||
|
||||
wxFocusEvent eventFocus(wxEVT_SET_FOCUS, win->GetId());
|
||||
eventFocus.SetEventObject(win);
|
||||
|
||||
return win->GetEventHandler()->ProcessEvent(eventFocus);
|
||||
return win->HandleWindowEvent(eventFocus);
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
@@ -1908,7 +1908,7 @@ static gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget),
|
||||
// process it too as otherwise bad things happen, especially in GTK2
|
||||
// where the text control simply aborts the program if it doesn't get
|
||||
// the matching focus out event
|
||||
(void)win->GetEventHandler()->ProcessEvent( event );
|
||||
(void)win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
@@ -1950,7 +1950,7 @@ gint gtk_window_enter_callback( GtkWidget *widget,
|
||||
event.m_x = x + pt.x;
|
||||
event.m_y = y + pt.y;
|
||||
|
||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||
if (win->HandleWindowEvent( event ))
|
||||
{
|
||||
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "enter_notify_event" );
|
||||
return TRUE;
|
||||
@@ -2002,7 +2002,7 @@ static gint gtk_window_leave_callback( GtkWidget *widget, GdkEventCrossing *gdk_
|
||||
event.m_x = x + pt.x;
|
||||
event.m_y = y + pt.y;
|
||||
|
||||
if (win->GetEventHandler()->ProcessEvent( event ))
|
||||
if (win->HandleWindowEvent( event ))
|
||||
{
|
||||
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "leave_notify_event" );
|
||||
return TRUE;
|
||||
@@ -2042,7 +2042,7 @@ static void gtk_window_vscroll_callback( GtkAdjustment *adjust,
|
||||
|
||||
wxScrollWinEvent event( command, value, wxVERTICAL );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2075,7 +2075,7 @@ static void gtk_window_hscroll_callback( GtkAdjustment *adjust,
|
||||
|
||||
wxScrollWinEvent event( command, value, wxHORIZONTAL );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2141,7 +2141,7 @@ static gint gtk_scrollbar_button_release_callback( GtkRange *widget,
|
||||
|
||||
wxScrollWinEvent event( command, value, dir );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
win->m_isScrolling = false;
|
||||
@@ -2179,7 +2179,7 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(widget), wxWindow *win )
|
||||
|
||||
wxWindowCreateEvent event( win );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
@@ -2213,7 +2213,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget),
|
||||
{
|
||||
wxSizeEvent event( win->GetSize(), win->GetId() );
|
||||
event.SetEventObject( win );
|
||||
win->GetEventHandler()->ProcessEvent( event );
|
||||
win->HandleWindowEvent( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2917,7 +2917,7 @@ void wxWindowGTK::DoSetSize( int x, int y, int width, int height, int sizeFlags
|
||||
{
|
||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
||||
event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( event );
|
||||
HandleWindowEvent( event );
|
||||
}
|
||||
|
||||
m_resizing = false;
|
||||
@@ -3208,7 +3208,7 @@ bool wxWindowGTK::Show( bool show )
|
||||
wxShowEvent eventShow(GetId(), show);
|
||||
eventShow.SetEventObject(this);
|
||||
|
||||
GetEventHandler()->ProcessEvent(eventShow);
|
||||
HandleWindowEvent(eventShow);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -3596,7 +3596,7 @@ void wxWindowGTK::GtkSendPaintEvents()
|
||||
wxEraseEvent erase_event( GetId(), &dc );
|
||||
erase_event.SetEventObject( this );
|
||||
|
||||
if (!GetEventHandler()->ProcessEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM)
|
||||
if (!HandleWindowEvent(erase_event) && GetBackgroundStyle() != wxBG_STYLE_CUSTOM)
|
||||
{
|
||||
if (!g_eraseGC)
|
||||
{
|
||||
@@ -3618,11 +3618,11 @@ void wxWindowGTK::GtkSendPaintEvents()
|
||||
|
||||
wxNcPaintEvent nc_paint_event( GetId() );
|
||||
nc_paint_event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( nc_paint_event );
|
||||
HandleWindowEvent( nc_paint_event );
|
||||
|
||||
wxPaintEvent paint_event( GetId() );
|
||||
paint_event.SetEventObject( this );
|
||||
GetEventHandler()->ProcessEvent( paint_event );
|
||||
HandleWindowEvent( paint_event );
|
||||
|
||||
m_clipPaintRegion = false;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user