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
32 files changed:
src/Makefile
src/Makefile.in
src/Makefile
src/Makefile.in
src/make.env
src/makelib.env
src/makeprog.env
src/make.env
src/makelib.env
src/makeprog.env
src/Makefile
src/Makefile.in
src/Makefile
src/Makefile.in
src/motif/*.cpp
src/motif/*.c
src/motif/*.cpp
src/motif/*.c
GTK installed, which you may need to removed including
other versions of glib (and its headers).
GTK installed, which you may need to removed including
other versions of glib (and its headers).
+You get errors during compilation. The reason is that you
+probably have a broken compiler, which includes almost
+everything that is called gcc. If there is just any way
+for you to use egcs, use egcs. We are sorry, but we cannot
+fix gcc for the moment.
+
* The most simple program
-------------------------
* The most simple program
-------------------------
wxWindows/GTK requires the GTK+ library to be installed on your system.
It has to be a stable version, preferebly version 1.0.6. When using
wxWindows/GTK requires the GTK+ library to be installed on your system.
It has to be a stable version, preferebly version 1.0.6. When using
-a version previous to 1.0.6 you'll get crashes here and there.
+a version previous to 1.0.6 you'll might get crashes here and there.
wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library
and we will wait until the 1.2 version comes out and has stabilized
wxWindows/GTK does NOT work with the 1.1.X versions of the GTK+ library
and we will wait until the 1.2 version comes out and has stabilized
Linux Variants have moved to glibc 2. Also, the Linux
Base Standard will include glibc 2 and Posix threads.
Linux Variants have moved to glibc 2. Also, the Linux
Base Standard will include glibc 2 and Posix threads.
+NB: DO NOT COMPILE WXGTK WITH GCC AND THREADS, SINCE
+ALL PROGRAMS WILL CRASH UPON START-UP. Just always
+use egcs and be happy.
+
* Create your configuration
-----------------------------
* Create your configuration
-----------------------------
# if you're feeling brave, you may wish to compile with threads.
# -- Julian Smart
chmod a+x configure config.sub config.guess setup/general/* setup/shared/*
# if you're feeling brave, you may wish to compile with threads.
# -- Julian Smart
chmod a+x configure config.sub config.guess setup/general/* setup/shared/*
-./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads -without-odbc
+./configure --with-shared --with-gtk --with-debug_flag --with-debug_info --without-threads
- Welcome to wxWindows/Gtk 2.01 (beta 3),
+ Welcome to wxWindows/Gtk 2.01 (beta 4),
you have downloaded version 2.01 of the GTK+ 1.0 port of
the wxWindows GUI library.
you have downloaded version 2.01 of the GTK+ 1.0 port of
the wxWindows GUI library.
- -> Must be rewritten for GTK+ 1.1.3
+ -> Must be rewritten for GTK+ 1.2
wxDebugContext <-> wxLogXXX functions
-> Remove either
wxDebugContext <-> wxLogXXX functions
-> Remove either
Implement wxPalette
-> I never understood that. Postponed.
Implement wxPalette
-> I never understood that. Postponed.
+Implement different visuals and displays
+ -> I never understood that. Postponed.
+
Show accelerator in menus
Show accelerator in menus
- -> Changed in GTK 1.1.X. Postponed.
+ -> Changed in GTK 1.2. Postponed.
Cooperation with Qt
-> Would be nice.
Cooperation with Qt
-> Would be nice.
/*
* wxToolBar style flags
*/
/*
* wxToolBar style flags
*/
#define wxTB_3DBUTTONS 0x8000
#define wxTB_HORIZONTAL 0x0002
#define wxTB_VERTICAL 0x0004
// Flatbar/Coolbar under Win98
#define wxTB_FLAT 0x0008
#define wxTB_3DBUTTONS 0x8000
#define wxTB_HORIZONTAL 0x0002
#define wxTB_VERTICAL 0x0004
// Flatbar/Coolbar under Win98
#define wxTB_FLAT 0x0008
+// use native docking
+#define wxTB_DOCKABLE 0x0010
- * Apply to all panel items
+ * wxMenuBar style flags
+// use native docking
+#define wxMB_DOCKABLE 0x0001
+
+/*
+ * Apply to all panel items
+ */
#define wxCOLOURED 0x0800
// Alignment for panel item labels: replaces characters with zeros
// when creating label, so spaces can be included in string for alignment.
#define wxCOLOURED 0x0800
// Alignment for panel item labels: replaces characters with zeros
// when creating label, so spaces can be included in string for alignment.
/*
* Styles for wxListBox
*/
/*
* Styles for wxListBox
*/
#define wxLB_SORT 0x0010
#define wxLB_SINGLE 0x0020
#define wxLB_MULTIPLE 0x0040
#define wxLB_SORT 0x0010
#define wxLB_SINGLE 0x0020
#define wxLB_MULTIPLE 0x0040
#define wxSL_HORIZONTAL wxHORIZONTAL
#define wxSL_VERTICAL wxVERTICAL
// The next one is obsolete - use scroll events instead
#define wxSL_HORIZONTAL wxHORIZONTAL
#define wxSL_VERTICAL wxVERTICAL
// The next one is obsolete - use scroll events instead
/*
* wxScrollBar flags
*/
/*
* wxScrollBar flags
*/
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
/*
* wxButton flags
*/
#define wxSB_HORIZONTAL wxHORIZONTAL
#define wxSB_VERTICAL wxVERTICAL
/*
* wxButton flags
*/
#define wxBU_AUTODRAW 0x0004
#define wxBU_NOAUTODRAW 0x0000
/*
* wxTreeCtrl flags
*/
#define wxBU_AUTODRAW 0x0004
#define wxBU_NOAUTODRAW 0x0000
/*
* wxTreeCtrl flags
*/
#define wxTR_HAS_BUTTONS 0x0004
#define wxTR_EDIT_LABELS 0x0008
#define wxTR_LINES_AT_ROOT 0x0010
#define wxTR_HAS_BUTTONS 0x0004
#define wxTR_EDIT_LABELS 0x0008
#define wxTR_LINES_AT_ROOT 0x0010
#define wxLC_ICON 0x0004
#define wxLC_SMALL_ICON 0x0008
#define wxLC_LIST 0x0010
#define wxLC_ICON 0x0004
#define wxLC_SMALL_ICON 0x0008
#define wxLC_LIST 0x0010
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
+ wxMenuBar( long style );
wxMenuBar();
void Append( wxMenu *menu, const wxString &title );
wxMenuBar();
void Append( wxMenu *menu, const wxString &title );
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
DECLARE_DYNAMIC_CLASS(wxMenuBar)
public:
+ wxMenuBar( long style );
wxMenuBar();
void Append( wxMenu *menu, const wxString &title );
wxMenuBar();
void Append( wxMenu *menu, const wxString &title );
#define wxRELEASE_NUMBER 1
#define wxVERSION_STRING "wxWindows 2.0.1"
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
#define wxRELEASE_NUMBER 1
#define wxVERSION_STRING "wxWindows 2.0.1"
#define wxVERSION_NUMBER (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER
#define wxVERSION_FLOAT wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)
#endif
#define wxVERSION_FLOAT wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0)
#endif
{
if (event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED)
{
{
if (event.GetEventType() == wxEVT_COMMAND_LISTBOX_SELECTED)
{
-#ifdef __WXGTK__
- if (event.IsSelection())
-#endif
+// if (event.IsSelection())
m_textField->SetValue(event.GetString());
}
}
m_textField->SetValue(event.GetString());
}
}
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP, "&About", "About toolbar sample");
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_HELP, "&About", "About toolbar sample");
- wxMenuBar* menuBar = new wxMenuBar;
+ wxMenuBar* menuBar = new wxMenuBar( wxMB_DOCKABLE );
menuBar->Append(fileMenu, "&File");
menuBar->Append(helpMenu, "&Help");
menuBar->Append(fileMenu, "&File");
menuBar->Append(helpMenu, "&Help");
frame->SetMenuBar(menuBar);
// Create the toolbar
frame->SetMenuBar(menuBar);
// Create the toolbar
- frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, ID_TOOLBAR);
+ frame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT|wxTB_DOCKABLE, ID_TOOLBAR);
frame->GetToolBar()->SetMargins( 2, 2 );
frame->GetToolBar()->SetMargins( 2, 2 );
// Insert a sizer for the buttons
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer");
// Insert a sizer for the buttons
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer");
+ buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer
wxLayoutConstraints *c = new wxLayoutConstraints;
// Specify constraints for the button sizer
wxLayoutConstraints *c = new wxLayoutConstraints;
wxButton *cancel = NULL;
if (style & wxOK) {
wxButton *cancel = NULL;
if (style & wxOK) {
- ok = new wxButton(this, wxID_OK, _("OK"));
+ ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1) );
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
- cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+ cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
buttonSizer->AddSizerChild(cancel);
}
buttonSizer->AddSizerChild(cancel);
}
- wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(okButtonX, buttonY));
+ wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(okButtonX, buttonY), wxSize(75,-1) );
int bw, bh;
okButton->GetSize(&bw, &bh);
int bw, bh;
okButton->GetSize(&bw, &bh);
- (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY));
+ (void) new wxButton(this, wxID_CANCEL, _("Cancel"), wxPoint(okButtonX + bw + 20, buttonY), wxSize(75,-1));
(void) new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours"),
wxPoint(customButtonX, buttonY));
(void) new wxButton(this, wxID_ADD_CUSTOM, _("Add to custom colours"),
wxPoint(customButtonX, buttonY));
m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
// m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") );
m_ok = new wxButton( this, ID_OK, _("OK") );
m_input = new wxTextCtrl( this, ID_TEXTCTRL, m_path, wxDefaultPosition );
// m_check = new wxCheckBox( this, ID_CHECK, _("Show hidden") );
m_ok = new wxButton( this, ID_OK, _("OK") );
- m_cancel = new wxButton( this, ID_CANCEL, _("Cancel") );
+ m_cancel = new wxButton( this, ID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1) );
m_new = new wxButton( this, ID_NEW, _("New...") );
// m_check->SetValue(TRUE);
m_new = new wxButton( this, ID_NEW, _("New...") );
// m_check->SetValue(TRUE);
m_input->GetSize(&w,&h2); h -= h2;
m_ok->GetSize(&w, &h2); h -= h2;
//m_check->GetSize(&w, &h2); h -= h2;
m_input->GetSize(&w,&h2); h -= h2;
m_ok->GetSize(&w, &h2); h -= h2;
//m_check->GetSize(&w, &h2); h -= h2;
wxLayoutConstraints *c = new wxLayoutConstraints;
c->left.SameAs (this, wxLeft,5);
wxLayoutConstraints *c = new wxLayoutConstraints;
c->left.SameAs (this, wxLeft,5);
c = new wxLayoutConstraints;
c->width.SameAs (m_cancel, wxWidth);
c->height.AsIs ();
c = new wxLayoutConstraints;
c->width.SameAs (m_cancel, wxWidth);
c->height.AsIs ();
- c->top.Below (m_input,5);
- c->centreX.PercentOf (this, wxWidth, 25);
+ c->top.Below (m_input,10);
+ c->centreX.PercentOf (this, wxWidth, 20);
m_ok->SetConstraints(c);
c = new wxLayoutConstraints;
c->width.SameAs (m_cancel, wxWidth);
c->height.AsIs ();
m_ok->SetConstraints(c);
c = new wxLayoutConstraints;
c->width.SameAs (m_cancel, wxWidth);
c->height.AsIs ();
- c->top.Below (m_input,5);
+ c->top.Below (m_input,10);
c->bottom.SameAs (this, wxBottom, 5);
c->centreX.PercentOf (this, wxWidth, 50);
m_new->SetConstraints(c);
c->bottom.SameAs (this, wxBottom, 5);
c->centreX.PercentOf (this, wxWidth, 50);
m_new->SetConstraints(c);
c = new wxLayoutConstraints;
c->width.AsIs ();
c->height.AsIs ();
c = new wxLayoutConstraints;
c->width.AsIs ();
c->height.AsIs ();
- c->top.Below (m_input,5);
- c->centreX.PercentOf (this, wxWidth, 75);
+ c->top.Below (m_input,10);
+ c->centreX.PercentOf (this, wxWidth, 80);
m_cancel->SetConstraints(c);
Layout();
m_cancel->SetConstraints(c);
Layout();
fontRect.y+=y+5; //NL mod
fontRect.y+=y+5; //NL mod
- int by = (fontRect.y + fontRect.height + 10);
+ int by = (fontRect.y + fontRect.height + 15);
- wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(220, by), wxSize(100,-1));
- (void) new wxButton(this, wxID_OK, _("Cancel"), wxPoint(340, by), wxSize(100,-1));
+ wxButton *okButton = new wxButton(this, wxID_OK, _("OK"), wxPoint(230, by), wxSize(75,-1));
+ (void) new wxButton(this, wxID_OK, _("Cancel"), wxPoint(330, by), wxSize(75,-1));
familyChoice->SetStringSelection( wxFontFamilyIntToString(dialogFont.GetFamily()) );
styleChoice->SetStringSelection(wxFontStyleIntToString(dialogFont.GetStyle()));
familyChoice->SetStringSelection( wxFontFamilyIntToString(dialogFont.GetFamily()) );
styleChoice->SetStringSelection(wxFontStyleIntToString(dialogFont.GetStyle()));
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer");
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer");
+ buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer
wxLayoutConstraints *c = new wxLayoutConstraints;
// Specify constraints for the button sizer
wxLayoutConstraints *c = new wxLayoutConstraints;
wxButton *no = (wxButton *) NULL;
if (style & wxYES_NO) {
wxButton *no = (wxButton *) NULL;
if (style & wxYES_NO) {
- yes = new wxButton(this, wxID_YES, _("Yes"));
- no = new wxButton(this, wxID_NO, _("No"));
+ yes = new wxButton(this, wxID_YES, _("Yes"), wxDefaultPosition, wxSize(75,-1) );
+ no = new wxButton(this, wxID_NO, _("No"), wxDefaultPosition, wxSize(75,-1) );
buttonSizer->AddSizerChild(yes);
buttonSizer->AddSizerChild(no);
}
if (style & wxOK) {
buttonSizer->AddSizerChild(yes);
buttonSizer->AddSizerChild(no);
}
if (style & wxOK) {
- ok = new wxButton(this, wxID_OK, _("OK"));
+ ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1) );
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
- cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+ cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1) );
buttonSizer->AddSizerChild(cancel);
}
buttonSizer->AddSizerChild(cancel);
}
c->top.Below (spacingSizer2);
c->centreX.SameAs (textSizer, wxCentreX);
buttonSizer->SetConstraints(c);
c->top.Below (spacingSizer2);
c->centreX.SameAs (textSizer, wxCentreX);
buttonSizer->SetConstraints(c);
+ buttonSizer->SetSpacing(12,0);
wxButton *ok = NULL;
wxButton *cancel = NULL;
if (style & wxOK) {
wxButton *ok = NULL;
wxButton *cancel = NULL;
if (style & wxOK) {
- ok = new wxButton(this, wxID_OK, _("OK"));
+ ok = new wxButton(this, wxID_OK, _("OK"), wxDefaultPosition, wxSize(75,-1));
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
buttonSizer->AddSizerChild(ok);
}
if (style & wxCANCEL) {
- cancel = new wxButton(this, wxID_CANCEL, _("Cancel"));
+ cancel = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(75,-1));
buttonSizer->AddSizerChild(cancel);
}
buttonSizer->AddSizerChild(cancel);
}
void wxBitmapButton::SetDefault()
{
void wxBitmapButton::SetDefault()
{
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 wxBitmapButton::SetLabel( const wxString &label )
}
void wxBitmapButton::SetLabel( const wxString &label )
void wxButton::SetDefault(void)
{
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 )
}
void wxButton::SetLabel( const wxString &label )
gtk_widget_set_uposition( m_widget, x, y );
GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
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('/');
m_path.Append(m_dir);
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
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 );
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 );
}
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
}
list_item = gtk_list_item_new_with_label( 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 );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
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),
if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item),
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
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
wxMenuBar::wxMenuBar()
{
m_needParent = FALSE; // hmmm
m_menubar = gtk_menu_bar_new();
m_menubar = gtk_menu_bar_new();
- m_widget = GTK_WIDGET(m_menubar);
+ m_widget = GTK_WIDGET(m_menubar);
m_separation = 5;
gtk_toolbar_set_space_size( m_toolbar, m_separation );
m_hasToolAlready = FALSE;
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 );
gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
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 ((old_width != m_width) || (old_height != m_height))
- gtk_widget_set_usize( m_widget, m_width, m_height );
+ 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 );
+
+ 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 );
+ }
void wxBitmapButton::SetDefault()
{
void wxBitmapButton::SetDefault()
{
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 wxBitmapButton::SetLabel( const wxString &label )
}
void wxBitmapButton::SetLabel( const wxString &label )
void wxButton::SetDefault(void)
{
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 )
}
void wxButton::SetLabel( const wxString &label )
gtk_widget_set_uposition( m_widget, x, y );
GtkFileSelection *sel = GTK_FILE_SELECTION(m_widget);
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('/');
m_path.Append(m_dir);
if(! m_path.IsEmpty() && m_path.Last()!='/') m_path.Append('/');
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
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 );
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 );
}
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
}
list_item = gtk_list_item_new_with_label( 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 );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
gtk_signal_connect( GTK_OBJECT(list_item), "deselect",
GTK_SIGNAL_FUNC(gtk_listitem_select_callback), (gpointer)this );
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),
if (m_widgetStyle) ApplyWidgetStyle();
gtk_signal_connect( GTK_OBJECT(list_item),
IMPLEMENT_DYNAMIC_CLASS(wxMenuBar,wxWindow)
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
wxMenuBar::wxMenuBar()
{
m_needParent = FALSE; // hmmm
m_menubar = gtk_menu_bar_new();
m_menubar = gtk_menu_bar_new();
- m_widget = GTK_WIDGET(m_menubar);
+ m_widget = GTK_WIDGET(m_menubar);
m_separation = 5;
gtk_toolbar_set_space_size( m_toolbar, m_separation );
m_hasToolAlready = FALSE;
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 );
gtk_toolbar_set_tooltips( GTK_TOOLBAR(m_toolbar), TRUE );
if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
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 ((old_width != m_width) || (old_height != m_height))
- gtk_widget_set_usize( m_widget, m_width, m_height );
+ 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 );
+
+ 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 );
+ }