From: Robert Roebling Date: Fri, 28 May 1999 10:30:57 +0000 (+0000) Subject: Small correction to list ctrl and default button size. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/012a03e09227258b4ac66745feea617605d7c088 Small correction to list ctrl and default button size. text ctrl doesn't inherit BG colour anymore added missing file. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/samples/image/horse.bmp b/samples/image/horse.bmp new file mode 100644 index 0000000000..bcb7a05906 Binary files /dev/null and b/samples/image/horse.bmp differ diff --git a/samples/notebook/test.cpp b/samples/notebook/test.cpp index 2a60668983..9a35002ed6 100644 --- a/samples/notebook/test.cpp +++ b/samples/notebook/test.cpp @@ -178,7 +178,7 @@ void MyFrame::OnAddPage(wxCommandEvent& WXUNUSED(event)) wxPanel *panel = new wxPanel( m_notebook, -1 ); (void)new wxButton( panel, -1, "Button", wxPoint( 10,10 ), wxSize(-1,-1) ); m_notebook->AddPage( panel, "Added" ); - m_notebook->SetSelection( m_notebook->GetPageCount()-1 ); +// m_notebook->SetSelection( m_notebook->GetPageCount()-1 ); } void MyFrame::OnDeletePage(wxCommandEvent& WXUNUSED(event)) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index e2109c176c..c64f7e4229 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1424,6 +1424,14 @@ void wxListMainWindow::OnChar( wxKeyEvent &event ) ke.SetEventObject( parent ); if (parent->GetEventHandler()->ProcessEvent( ke )) return; + if (event.KeyCode() == WXK_TAB) + { + wxNavigationKeyEvent nevent; + nevent.SetDirection( !event.ShiftDown() ); + nevent.SetCurrentFocus( m_parent ); + if (m_parent->GetEventHandler()->ProcessEvent( nevent )) return; + } + /* no item -> nothing to do */ if (!m_current) { diff --git a/src/gtk/textctrl.cpp b/src/gtk/textctrl.cpp index de650285b7..e5c9c881a2 100644 --- a/src/gtk/textctrl.cpp +++ b/src/gtk/textctrl.cpp @@ -256,7 +256,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, gtk_text_set_editable( GTK_TEXT(m_text), 1 ); } - SetBackgroundColour( parent->GetBackgroundColour() ); + SetBackgroundColour( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ); SetForegroundColour( parent->GetForegroundColour() ); Show( TRUE ); diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index fdce311eec..433694c88c 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1980,11 +1980,13 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; int border = 0; + int bottom_border = 0; if (GTK_WIDGET_CAN_DEFAULT(m_widget)) { /* the default button has a border around it */ - border = 5; + border = 6; + bottom_border = 5; } /* this is the result of hours of debugging: the following code @@ -2013,7 +2015,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) m_x-border, m_y-border, m_width+2*border, - m_height+2*border ); + m_height+border+bottom_border ); } m_sizeSet = TRUE; diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index de650285b7..e5c9c881a2 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -256,7 +256,7 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value, gtk_text_set_editable( GTK_TEXT(m_text), 1 ); } - SetBackgroundColour( parent->GetBackgroundColour() ); + SetBackgroundColour( wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW) ); SetForegroundColour( parent->GetForegroundColour() ); Show( TRUE ); diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index fdce311eec..433694c88c 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1980,11 +1980,13 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight; int border = 0; + int bottom_border = 0; if (GTK_WIDGET_CAN_DEFAULT(m_widget)) { /* the default button has a border around it */ - border = 5; + border = 6; + bottom_border = 5; } /* this is the result of hours of debugging: the following code @@ -2013,7 +2015,7 @@ void wxWindow::DoSetSize( int x, int y, int width, int height, int sizeFlags ) m_x-border, m_y-border, m_width+2*border, - m_height+2*border ); + m_height+border+bottom_border ); } m_sizeSet = TRUE;