Renamed GtkMyFixed to GtkPizza,
Made default button work more often than before. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@4256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -85,6 +85,10 @@ static void gtk_spinctrl_callback( GtkWidget *WXUNUSED(widget), wxSpinCtrl *win
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxSpinCtrl,wxControl)
|
||||
|
||||
BEGIN_EVENT_TABLE(wxSpinCtrl, wxControl)
|
||||
EVT_CHAR(wxSpinCtrl::OnChar)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
bool wxSpinCtrl::Create(wxWindow *parent, wxWindowID id,
|
||||
const wxString& value,
|
||||
const wxPoint& pos, const wxSize& size,
|
||||
@@ -205,6 +209,27 @@ void wxSpinCtrl::SetRange(int minVal, int maxVal)
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
{
|
||||
wxCHECK_RET( m_widget != NULL, wxT("invalid spin ctrl") );
|
||||
|
||||
if (event.KeyCode() == WXK_RETURN)
|
||||
{
|
||||
wxWindow *top_frame = m_parent;
|
||||
while (top_frame->GetParent() && !(top_frame->GetParent()->m_isFrame))
|
||||
top_frame = top_frame->GetParent();
|
||||
GtkWindow *window = GTK_WINDOW(top_frame->m_widget);
|
||||
|
||||
if (window->default_widget)
|
||||
{
|
||||
gtk_widget_activate (window->default_widget);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel == window;
|
||||
|
Reference in New Issue
Block a user