distribution things
implemented native docking for menus and toolbars
(see toolbar sample) someone may have to create
the new wxMenuBar constructor
corrected wxFileDlg appearance and made it i18n
implemented defaults buttons
improved look of all common dlgs except print setup
corrected forty's player dlg
added wxMB_DOCKABLE and wxTB_DOCKABLE flags
augmented BETA_VERSION to 4
prevent wxListBox from sending a list_item_selected
event when adding the first item to a list that
is a single selection list using AppendXX()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1673 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -163,10 +163,10 @@ bool wxBitmapButton::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi
|
||||
|
||||
void wxBitmapButton::SetDefault()
|
||||
{
|
||||
/*
|
||||
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
|
||||
gtk_widget_grab_default( m_widget );
|
||||
*/
|
||||
|
||||
SetSize( m_x, m_y, m_width, m_height );
|
||||
}
|
||||
|
||||
void wxBitmapButton::SetLabel( const wxString &label )
|
||||
|
||||
@@ -97,10 +97,10 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label,
|
||||
|
||||
void wxButton::SetDefault(void)
|
||||
{
|
||||
/*
|
||||
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
|
||||
gtk_widget_grab_default( m_widget );
|
||||
*/
|
||||
GTK_WIDGET_SET_FLAGS( m_widget, GTK_CAN_DEFAULT );
|
||||
gtk_widget_grab_default( m_widget );
|
||||
|
||||
SetSize( m_x, m_y, m_width, m_height );
|
||||
}
|
||||
|
||||
void wxButton::SetLabel( const wxString &label )
|
||||
|
||||
@@ -110,6 +110,7 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
|
||||
gtk_widget_set_uposition( m_widget, x, y );
|
||||
|
||||
GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
|
||||
gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
|
||||
|
||||
m_path.Append(m_dir);
|
||||
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
|
||||
@@ -120,9 +121,15 @@ wxFileDialog::wxFileDialog( wxWindow *parent, const wxString& message,
|
||||
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
|
||||
|
||||
// strange way to internationalize
|
||||
gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), _("OK") );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
|
||||
|
||||
|
||||
// strange way to internationalize
|
||||
gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), _("Cancel") );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
|
||||
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
|
||||
}
|
||||
|
||||
@@ -316,6 +316,8 @@ void wxListBox::AppendCommon( const wxString &item )
|
||||
list_item = gtk_list_item_new_with_label( item );
|
||||
}
|
||||
|
||||
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item), "select",
|
||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||
|
||||
@@ -323,8 +325,6 @@ void wxListBox::AppendCommon( const wxString &item )
|
||||
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
|
||||
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
|
||||
|
||||
gtk_container_add( GTK_CONTAINER(m_list), list_item );
|
||||
|
||||
if (m_widgetStyle) ApplyWidgetStyle();
|
||||
|
||||
gtk_signal_connect( GTK_OBJECT(list_item),
|
||||
|
||||
@@ -26,6 +26,32 @@
|
||||
|
||||
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
|
||||
|
||||
wxMenuBar::wxMenuBar( long style )
|
||||
{
|
||||
m_needParent = FALSE; // hmmm
|
||||
|
||||
PreCreation( (wxWindow *) NULL, -1, wxDefaultPosition, wxDefaultSize, 0, "menu" );
|
||||
|
||||
m_menus.DeleteContents( TRUE );
|
||||
|
||||
m_menubar = gtk_menu_bar_new();
|
||||
|
||||
if (style & wxMB_DOCKABLE)
|
||||
{
|
||||
m_widget = gtk_handle_box_new();
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_menubar) );
|
||||
gtk_widget_show( GTK_WIDGET(m_menubar) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_widget = GTK_WIDGET(m_menubar);
|
||||
}
|
||||
|
||||
PostCreation();
|
||||
|
||||
Show( TRUE );
|
||||
}
|
||||
|
||||
wxMenuBar::wxMenuBar()
|
||||
{
|
||||
m_needParent = FALSE; // hmmm
|
||||
@@ -36,7 +62,7 @@ wxMenuBar::wxMenuBar()
|
||||
|
||||
m_menubar = gtk_menu_bar_new();
|
||||
|
||||
m_widget = GTK_WIDGET(m_menubar);
|
||||
m_widget = GTK_WIDGET(m_menubar);
|
||||
|
||||
PostCreation();
|
||||
|
||||
|
||||
@@ -123,8 +123,17 @@ bool wxToolBar::Create( wxWindow *parent, wxWindowID id,
|
||||
m_separation = 5;
|
||||
gtk_toolbar_set_space_size( m_toolbar, m_separation );
|
||||
m_hasToolAlready = FALSE;
|
||||
|
||||
m_widget = GTK_WIDGET(m_toolbar);
|
||||
|
||||
if (style & wxTB_DOCKABLE)
|
||||
{
|
||||
m_widget = gtk_handle_box_new();
|
||||
gtk_container_add( GTK_CONTAINER(m_widget), GTK_WIDGET(m_toolbar) );
|
||||
gtk_widget_show( GTK_WIDGET(m_toolbar) );
|
||||
}
|
||||
else
|
||||
{
|
||||
m_widget = GTK_WIDGET(m_toolbar);
|
||||
}
|
||||
|
||||
gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
|
||||
|
||||
|
||||
@@ -1828,11 +1828,24 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags )
|
||||
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
|
||||
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
|
||||
|
||||
wxPoint pt( m_parent->GetClientAreaOrigin() );
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
|
||||
if (GTK_WIDGET_HAS_DEFAULT(m_widget))
|
||||
{
|
||||
/* the default button has a border around it */
|
||||
int border = 5;
|
||||
|
||||
wxPoint pt( m_parent->GetClientAreaOrigin() );
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x-border, m_y+pt.y-border );
|
||||
|
||||
if ((old_width != m_width) || (old_height != m_height))
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
gtk_widget_set_usize( m_widget, m_width+2*border, m_height+2*border );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxPoint pt( m_parent->GetClientAreaOrigin() );
|
||||
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );
|
||||
|
||||
if ((old_width != m_width) || (old_height != m_height))
|
||||
gtk_widget_set_usize( m_widget, m_width, m_height );
|
||||
}
|
||||
}
|
||||
|
||||
m_sizeSet = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user