diff --git a/samples/scroll/scroll.cpp b/samples/scroll/scroll.cpp index b7f00e71dc..8adf62231c 100644 --- a/samples/scroll/scroll.cpp +++ b/samples/scroll/scroll.cpp @@ -77,12 +77,12 @@ END_EVENT_TABLE() MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, const wxPoint &pos, const wxSize &size ) - : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER ) + : wxScrolledWindow( parent, id, pos, size, wxSUNKEN_BORDER | wxTAB_TRAVERSAL ) { -// (void) new wxButton( this, -1, "wxButton", wxPoint(10,10) ); + (void) new wxButton( this, -1, "wxButton", wxPoint(10,10) ); -// (void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) ); + (void) new wxTextCtrl( this, -1, "wxTextCtrl", wxPoint(10,50) ); (void) new wxRadioButton( this, -1, "Disable", wxPoint(10,90) ); @@ -95,9 +95,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id, "examples." }; -// (void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices ); + (void) new wxComboBox( this, -1, "This", wxPoint(10,130), wxDefaultSize, 5, choices ); -// (void) new wxRadioBox( this, -1, "This", wxPoint(10,200), wxDefaultSize, 5, choices ); + (void) new wxRadioBox( this, -1, "This", wxPoint(10,200), wxDefaultSize, 5, choices ); } MyCanvas::~MyCanvas() diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index dc24fa7301..c46e779f20 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -130,7 +130,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi m_label = ""; m_widget = gtk_button_new(); - + +#if (GTK_MINOR_VERSION > 0) + if (style & wxNO_BORDER) + gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); +#endif + if (m_bitmap.Ok()) { GdkBitmap *mask = (GdkBitmap *) NULL; @@ -141,8 +146,10 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi gtk_container_add( GTK_CONTAINER(m_widget), pixmap ); } - if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10; - if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10; + int border = 10; + if (style & wxNO_BORDER) border = 4; + if (newSize.x == -1) newSize.x = m_bitmap.GetWidth()+border; + if (newSize.y == -1) newSize.y = m_bitmap.GetHeight()+border; SetSize( newSize.x, newSize.y ); gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", @@ -202,25 +209,25 @@ void wxBitmapButton::SetBitmap() wxBitmap the_one; - if ( ! m_isEnabled ) + if (!m_isEnabled) the_one = m_disabled; else { - if ( m_isSelected ) + if (m_isSelected) { the_one = m_selected; } else { - if ( m_hasFocus ) + if (m_hasFocus) the_one = m_focus; else the_one = m_bitmap; } } - if ( ! the_one.Ok() ) the_one = m_bitmap; - if ( ! the_one.Ok() ) return; + if (!the_one.Ok()) the_one = m_bitmap; + if (!the_one.Ok()) return; GtkButton *bin = GTK_BUTTON( m_widget ); GtkPixmap *g_pixmap = GTK_PIXMAP( bin->child ); diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index 1347e6ddae..fa337974de 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -80,7 +80,13 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, SetValidator( validator ); - m_widget = gtk_button_new_with_label( m_label.mbc_str() ); + m_widget = gtk_button_new_with_label( "" ); + +#if (GTK_MINOR_VERSION > 0) + if (style & wxNO_BORDER) + gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); +#endif + SetLabel(label); if (newSize.x == -1) newSize.x = 15+gdk_string_measure( m_widget->style->font, label.mbc_str() ); diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 894f22bf1e..d6ca0dd9a3 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -212,10 +212,12 @@ bool wxDialog::Create( wxWindow *parent, PreCreation( parent, id, pos, size, style, name ); m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + + if (!name.IsEmpty()) + gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); + GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); - gtk_widget_set( m_widget, "GtkWindow::allow_shrink", TRUE, NULL); - gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event", GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this ); diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 5bc43e0bb8..c65d52a01c 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -369,6 +369,9 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP; m_widget = gtk_window_new( win_type ); + + if (!name.IsEmpty()) + gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); #ifdef __WXDEBUG__ debug_focus_in( m_widget, _T("wxFrame::m_widget"), name ); diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index dc24fa7301..c46e779f20 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -130,7 +130,12 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi m_label = ""; m_widget = gtk_button_new(); - + +#if (GTK_MINOR_VERSION > 0) + if (style & wxNO_BORDER) + gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); +#endif + if (m_bitmap.Ok()) { GdkBitmap *mask = (GdkBitmap *) NULL; @@ -141,8 +146,10 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi gtk_container_add( GTK_CONTAINER(m_widget), pixmap ); } - if (newSize.x == -1) newSize.x = m_bitmap.GetHeight()+10; - if (newSize.y == -1) newSize.y = m_bitmap.GetWidth()+10; + int border = 10; + if (style & wxNO_BORDER) border = 4; + if (newSize.x == -1) newSize.x = m_bitmap.GetWidth()+border; + if (newSize.y == -1) newSize.y = m_bitmap.GetHeight()+border; SetSize( newSize.x, newSize.y ); gtk_signal_connect( GTK_OBJECT(m_widget), "clicked", @@ -202,25 +209,25 @@ void wxBitmapButton::SetBitmap() wxBitmap the_one; - if ( ! m_isEnabled ) + if (!m_isEnabled) the_one = m_disabled; else { - if ( m_isSelected ) + if (m_isSelected) { the_one = m_selected; } else { - if ( m_hasFocus ) + if (m_hasFocus) the_one = m_focus; else the_one = m_bitmap; } } - if ( ! the_one.Ok() ) the_one = m_bitmap; - if ( ! the_one.Ok() ) return; + if (!the_one.Ok()) the_one = m_bitmap; + if (!the_one.Ok()) return; GtkButton *bin = GTK_BUTTON( m_widget ); GtkPixmap *g_pixmap = GTK_PIXMAP( bin->child ); diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 1347e6ddae..fa337974de 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -80,7 +80,13 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, SetValidator( validator ); - m_widget = gtk_button_new_with_label( m_label.mbc_str() ); + m_widget = gtk_button_new_with_label( "" ); + +#if (GTK_MINOR_VERSION > 0) + if (style & wxNO_BORDER) + gtk_button_set_relief( GTK_BUTTON(m_widget), GTK_RELIEF_NONE ); +#endif + SetLabel(label); if (newSize.x == -1) newSize.x = 15+gdk_string_measure( m_widget->style->font, label.mbc_str() ); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 894f22bf1e..d6ca0dd9a3 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -212,10 +212,12 @@ bool wxDialog::Create( wxWindow *parent, PreCreation( parent, id, pos, size, style, name ); m_widget = gtk_window_new( GTK_WINDOW_TOPLEVEL ); + + if (!name.IsEmpty()) + gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); + GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); - gtk_widget_set( m_widget, "GtkWindow::allow_shrink", TRUE, NULL); - gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event", GTK_SIGNAL_FUNC(gtk_dialog_delete_callback), (gpointer)this ); diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 5bc43e0bb8..c65d52a01c 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -369,6 +369,9 @@ bool wxFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title, if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP; m_widget = gtk_window_new( win_type ); + + if (!name.IsEmpty()) + gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); #ifdef __WXDEBUG__ debug_focus_in( m_widget, _T("wxFrame::m_widget"), name );