From d3b4d1131395d0413bd904579a310f6d9f7382f7 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sat, 19 Dec 1998 12:38:52 +0000 Subject: [PATCH] wxPython updates (SWIG really works, cannot believe it) wxRadioBox now has multi column layout (the wxPython sample still doesn't do that correctly) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/radiobox.h | 2 + include/wx/gtk1/radiobox.h | 2 + src/gtk/radiobox.cpp | 203 +++++++++++++--------------- src/gtk/window.cpp | 4 +- src/gtk1/radiobox.cpp | 203 +++++++++++++--------------- src/gtk1/window.cpp | 4 +- utils/wxPython/src/Setup | 3 +- utils/wxPython/src/gtk/gdi.cpp | 152 +++++++++++++++++++++ utils/wxPython/src/gtk/gdi.py | 18 +++ utils/wxPython/src/gtk/windows.cpp | 25 ++++ utils/wxPython/src/gtk/windows.py | 4 + utils/wxPython/src/gtk/windows2.cpp | 4 + 12 files changed, 405 insertions(+), 219 deletions(-) diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index cfd3a0242a..09b518b732 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -86,8 +86,10 @@ class wxRadioBox: public wxControl bool IsOwnGtkWindow( GdkWindow *window ); void ApplyWidgetStyle(); + wxSize LayoutItems(); bool m_alreadySent; + int m_majorDim; wxList m_boxes; DECLARE_EVENT_TABLE() diff --git a/include/wx/gtk1/radiobox.h b/include/wx/gtk1/radiobox.h index cfd3a0242a..09b518b732 100644 --- a/include/wx/gtk1/radiobox.h +++ b/include/wx/gtk1/radiobox.h @@ -86,8 +86,10 @@ class wxRadioBox: public wxControl bool IsOwnGtkWindow( GdkWindow *window ); void ApplyWidgetStyle(); + wxSize LayoutItems(); bool m_alreadySent; + int m_majorDim; wxList m_boxes; DECLARE_EVENT_TABLE() diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 255d17c125..58c3867d01 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -64,8 +64,7 @@ wxRadioBox::wxRadioBox(void) bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint &pos, const wxSize &size, - int n, const wxString choices[], - int WXUNUSED(majorDim), + int n, const wxString choices[], int majorDim, long style, const wxValidator& validator, const wxString &name ) { @@ -79,86 +78,35 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, m_widget = gtk_frame_new( title ); - int x = m_x+5; - int y = m_y+15; - int maxLen = 0; - int height = 20; - int width = 0; + m_majorDim = majorDim; GtkRadioButton *m_radio = (GtkRadioButton*) NULL; - if (m_windowStyle & wxRA_HORIZONTAL) + GSList *radio_button_group = (GSList *) NULL; + for (int i = 0; i < n; i++) { - GSList *radio_button_group = (GSList *) NULL; - for (int i = 0; i < n; i++) - { - if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); + if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); - m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); + m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); - m_boxes.Append( (wxObject*) m_radio ); + m_boxes.Append( (wxObject*) m_radio ); - ConnectWidget( GTK_WIDGET(m_radio) ); + ConnectWidget( GTK_WIDGET(m_radio) ); - if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); + if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); - gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", + GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); - gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), x, y ); - - int tmp = 25+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] ); - if (tmp > maxLen) maxLen = tmp; + gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), m_x+10, m_y+10+(i*24) ); - width = m_width-10; - if (size.x == -1) width = tmp; - gtk_widget_set_usize( GTK_WIDGET(m_radio), width, 20 ); - - y += 20; - height += 20; - } - width = maxLen + 10; } - else - { - int max = 0; - for (int i = 0; i < n; i++) - { - GdkFont *font = m_widget->style->font; - int len = 27+gdk_string_measure( font, choices[i] ); - if (len > max) max = len; - } - - GSList *radio_button_group = (GSList *) NULL; - for (int i = 0; i < n; i++) - { - if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); - - m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); - - m_boxes.Append( (wxObject*) m_radio ); - - ConnectWidget( GTK_WIDGET(m_radio) ); - - if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); - - gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); - - gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), x, y ); - - gtk_widget_set_usize( GTK_WIDGET(m_radio), max, 20 ); - - x += max; - } - width = max*n + 10; - height = 40; - } + wxSize ls = LayoutItems(); wxSize newSize = size; - if (newSize.x == -1) newSize.x = width; - if (newSize.y == -1) newSize.y = height; + if (newSize.x == -1) newSize.x = ls.x; + if (newSize.y == -1) newSize.y = ls.y; SetSize( newSize.x, newSize.y ); m_parent->AddChild( this ); @@ -190,57 +138,98 @@ wxRadioBox::~wxRadioBox(void) void wxRadioBox::OnSize( wxSizeEvent &event ) { - wxControl::OnSize( event ); - - int x = m_x+5; - int y = m_y+15; + wxControl::OnSize( event ); - if (m_windowStyle & wxRA_HORIZONTAL) - { - wxNode *node = m_boxes.First(); - while (node) - { - GtkWidget *button = GTK_WIDGET( node->Data() ); + LayoutItems(); +} + +wxSize wxRadioBox::LayoutItems() +{ + int x = m_x+7; + int y = m_y+15; - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); - y += 20; + int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1; - int w = m_width-10; - if (w < 15) w = 15; - gtk_widget_set_usize( button, w, 20 ); - - node = node->Next(); + wxSize res( 0, 0 ); + + if (m_windowStyle & wxRA_HORIZONTAL) + { + + for (int j = 0; j < m_majorDim; j++) + { + y = m_y+15; + + int max_len = 0; + wxNode *node = m_boxes.Nth( j*num_per_major ); + for (int i = 0; i< num_per_major; i++) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); + GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child ); + GdkFont *font = m_widget->style->font; + int len = 27+gdk_string_measure( font, label->label ); + if (len > max_len) max_len = len; + + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); + y += 22; + + node = node->Next(); + if (!node) break; + } + + // we don't know the max_len before + + node = m_boxes.Nth( j*num_per_major ); + for (int i = 0; i< num_per_major; i++) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); + + gtk_widget_set_usize( button, max_len, 22 ); + + node = node->Next(); + if (!node) break; + } + + if (y > res.y) res.y = y; + + x += max_len + 2; + } + + res.y -= 3; + res.x = x-2; } - } - else - { - int max = 0; - - wxNode *node = m_boxes.First(); - while (node) + else { - GtkButton *button = GTK_BUTTON( node->Data() ); - GtkLabel *label = GTK_LABEL( button->child ); + int max = 0; + + wxNode *node = m_boxes.First(); + while (node) + { + GtkButton *button = GTK_BUTTON( node->Data() ); + GtkLabel *label = GTK_LABEL( button->child ); - GdkFont *font = m_widget->style->font; - int len = 27+gdk_string_measure( font, label->label ); - if (len > max) max = len; + GdkFont *font = m_widget->style->font; + int len = 27+gdk_string_measure( font, label->label ); + if (len > max) max = len; - node = node->Next(); - } + node = node->Next(); + } - node = m_boxes.First(); - while (node) - { - GtkWidget *button = GTK_WIDGET( node->Data() ); + node = m_boxes.First(); + while (node) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); - x += max; - gtk_widget_set_usize( button, max, 20 ); + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); + x += max; + gtk_widget_set_usize( button, max, 20 ); - node = node->Next(); + node = node->Next(); + } + res.x = x-2; + res.y = 42; } - } + + return res; } bool wxRadioBox::Show( bool show ) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index f9de7711aa..2d1683c26d 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -1616,8 +1616,8 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth; if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; - if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth; - if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight; + 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 ); diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 255d17c125..58c3867d01 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -64,8 +64,7 @@ wxRadioBox::wxRadioBox(void) bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint &pos, const wxSize &size, - int n, const wxString choices[], - int WXUNUSED(majorDim), + int n, const wxString choices[], int majorDim, long style, const wxValidator& validator, const wxString &name ) { @@ -79,86 +78,35 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, m_widget = gtk_frame_new( title ); - int x = m_x+5; - int y = m_y+15; - int maxLen = 0; - int height = 20; - int width = 0; + m_majorDim = majorDim; GtkRadioButton *m_radio = (GtkRadioButton*) NULL; - if (m_windowStyle & wxRA_HORIZONTAL) + GSList *radio_button_group = (GSList *) NULL; + for (int i = 0; i < n; i++) { - GSList *radio_button_group = (GSList *) NULL; - for (int i = 0; i < n; i++) - { - if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); + if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); - m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); + m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); - m_boxes.Append( (wxObject*) m_radio ); + m_boxes.Append( (wxObject*) m_radio ); - ConnectWidget( GTK_WIDGET(m_radio) ); + ConnectWidget( GTK_WIDGET(m_radio) ); - if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); + if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); - gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); + gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", + GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); - gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), x, y ); - - int tmp = 25+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] ); - if (tmp > maxLen) maxLen = tmp; + gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), m_x+10, m_y+10+(i*24) ); - width = m_width-10; - if (size.x == -1) width = tmp; - gtk_widget_set_usize( GTK_WIDGET(m_radio), width, 20 ); - - y += 20; - height += 20; - } - width = maxLen + 10; } - else - { - int max = 0; - for (int i = 0; i < n; i++) - { - GdkFont *font = m_widget->style->font; - int len = 27+gdk_string_measure( font, choices[i] ); - if (len > max) max = len; - } - - GSList *radio_button_group = (GSList *) NULL; - for (int i = 0; i < n; i++) - { - if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) ); - - m_radio = GTK_RADIO_BUTTON( gtk_radio_button_new_with_label( radio_button_group, choices[i] ) ); - - m_boxes.Append( (wxObject*) m_radio ); - - ConnectWidget( GTK_WIDGET(m_radio) ); - - if (!i) gtk_toggle_button_set_state( GTK_TOGGLE_BUTTON(m_radio), TRUE ); - - gtk_signal_connect( GTK_OBJECT(m_radio), "clicked", - GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); - - gtk_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), x, y ); - - gtk_widget_set_usize( GTK_WIDGET(m_radio), max, 20 ); - - x += max; - } - width = max*n + 10; - height = 40; - } + wxSize ls = LayoutItems(); wxSize newSize = size; - if (newSize.x == -1) newSize.x = width; - if (newSize.y == -1) newSize.y = height; + if (newSize.x == -1) newSize.x = ls.x; + if (newSize.y == -1) newSize.y = ls.y; SetSize( newSize.x, newSize.y ); m_parent->AddChild( this ); @@ -190,57 +138,98 @@ wxRadioBox::~wxRadioBox(void) void wxRadioBox::OnSize( wxSizeEvent &event ) { - wxControl::OnSize( event ); - - int x = m_x+5; - int y = m_y+15; + wxControl::OnSize( event ); - if (m_windowStyle & wxRA_HORIZONTAL) - { - wxNode *node = m_boxes.First(); - while (node) - { - GtkWidget *button = GTK_WIDGET( node->Data() ); + LayoutItems(); +} + +wxSize wxRadioBox::LayoutItems() +{ + int x = m_x+7; + int y = m_y+15; - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); - y += 20; + int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1; - int w = m_width-10; - if (w < 15) w = 15; - gtk_widget_set_usize( button, w, 20 ); - - node = node->Next(); + wxSize res( 0, 0 ); + + if (m_windowStyle & wxRA_HORIZONTAL) + { + + for (int j = 0; j < m_majorDim; j++) + { + y = m_y+15; + + int max_len = 0; + wxNode *node = m_boxes.Nth( j*num_per_major ); + for (int i = 0; i< num_per_major; i++) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); + GtkLabel *label = GTK_LABEL( GTK_BUTTON(button)->child ); + GdkFont *font = m_widget->style->font; + int len = 27+gdk_string_measure( font, label->label ); + if (len > max_len) max_len = len; + + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); + y += 22; + + node = node->Next(); + if (!node) break; + } + + // we don't know the max_len before + + node = m_boxes.Nth( j*num_per_major ); + for (int i = 0; i< num_per_major; i++) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); + + gtk_widget_set_usize( button, max_len, 22 ); + + node = node->Next(); + if (!node) break; + } + + if (y > res.y) res.y = y; + + x += max_len + 2; + } + + res.y -= 3; + res.x = x-2; } - } - else - { - int max = 0; - - wxNode *node = m_boxes.First(); - while (node) + else { - GtkButton *button = GTK_BUTTON( node->Data() ); - GtkLabel *label = GTK_LABEL( button->child ); + int max = 0; + + wxNode *node = m_boxes.First(); + while (node) + { + GtkButton *button = GTK_BUTTON( node->Data() ); + GtkLabel *label = GTK_LABEL( button->child ); - GdkFont *font = m_widget->style->font; - int len = 27+gdk_string_measure( font, label->label ); - if (len > max) max = len; + GdkFont *font = m_widget->style->font; + int len = 27+gdk_string_measure( font, label->label ); + if (len > max) max = len; - node = node->Next(); - } + node = node->Next(); + } - node = m_boxes.First(); - while (node) - { - GtkWidget *button = GTK_WIDGET( node->Data() ); + node = m_boxes.First(); + while (node) + { + GtkWidget *button = GTK_WIDGET( node->Data() ); - gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); - x += max; - gtk_widget_set_usize( button, max, 20 ); + gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); + x += max; + gtk_widget_set_usize( button, max, 20 ); - node = node->Next(); + node = node->Next(); + } + res.x = x-2; + res.y = 42; } - } + + return res; } bool wxRadioBox::Show( bool show ) diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index f9de7711aa..2d1683c26d 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -1616,8 +1616,8 @@ void wxWindow::SetSize( int x, int y, int width, int height, int sizeFlags ) if ((m_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth; if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; - if ((m_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_minWidth; - if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight; + 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 ); diff --git a/utils/wxPython/src/Setup b/utils/wxPython/src/Setup index c6c17419b3..f009589daa 100644 --- a/utils/wxPython/src/Setup +++ b/utils/wxPython/src/Setup @@ -30,8 +30,9 @@ MY_LINKCC=$(CCC) ## Pick one of these, or set your own. This is where the ## wxPython module should be installed. It should be a ## subdirectory named wxPython. -TARGETDIR=.. +#TARGETDIR=.. #TARGETDIR=$(BINLIBDEST)/site-packages/wxPython +TARGETDIR=$(BINLIBDEST)/wxPython wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \ diff --git a/utils/wxPython/src/gtk/gdi.cpp b/utils/wxPython/src/gtk/gdi.cpp index 87f4fd2664..619cfa10dd 100644 --- a/utils/wxPython/src/gtk/gdi.cpp +++ b/utils/wxPython/src/gtk/gdi.cpp @@ -1783,6 +1783,152 @@ static PyObject *_wrap_wxFont_GetWeight(PyObject *self, PyObject *args) { return _resultobj; } +#define wxFont_SetFaceName(_swigobj,_swigarg0) (_swigobj->SetFaceName(_swigarg0)) +static PyObject *_wrap_wxFont_SetFaceName(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + wxString * _arg1; + char * _argc0 = 0; + PyObject * _obj1 = 0; + + self = self; + if(!PyArg_ParseTuple(args,"sO:wxFont_SetFaceName",&_argc0,&_obj1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFaceName. Expected _wxFont_p."); + return NULL; + } + } +{ + if (!PyString_Check(_obj1)) { + PyErr_SetString(PyExc_TypeError, wxStringErrorMsg); + return NULL; + } + _arg1 = new wxString(PyString_AsString(_obj1)); +} + wxFont_SetFaceName(_arg0,*_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; +{ + if (_obj1) + delete _arg1; +} + return _resultobj; +} + +#define wxFont_SetFamily(_swigobj,_swigarg0) (_swigobj->SetFamily(_swigarg0)) +static PyObject *_wrap_wxFont_SetFamily(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + int _arg1; + char * _argc0 = 0; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxFont_SetFamily",&_argc0,&_arg1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetFamily. Expected _wxFont_p."); + return NULL; + } + } + wxFont_SetFamily(_arg0,_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFont_SetPointSize(_swigobj,_swigarg0) (_swigobj->SetPointSize(_swigarg0)) +static PyObject *_wrap_wxFont_SetPointSize(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + int _arg1; + char * _argc0 = 0; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxFont_SetPointSize",&_argc0,&_arg1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetPointSize. Expected _wxFont_p."); + return NULL; + } + } + wxFont_SetPointSize(_arg0,_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFont_SetStyle(_swigobj,_swigarg0) (_swigobj->SetStyle(_swigarg0)) +static PyObject *_wrap_wxFont_SetStyle(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + int _arg1; + char * _argc0 = 0; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxFont_SetStyle",&_argc0,&_arg1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetStyle. Expected _wxFont_p."); + return NULL; + } + } + wxFont_SetStyle(_arg0,_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFont_SetUnderlined(_swigobj,_swigarg0) (_swigobj->SetUnderlined(_swigarg0)) +static PyObject *_wrap_wxFont_SetUnderlined(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + bool _arg1; + char * _argc0 = 0; + int tempbool1; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxFont_SetUnderlined",&_argc0,&tempbool1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetUnderlined. Expected _wxFont_p."); + return NULL; + } + } + _arg1 = (bool ) tempbool1; + wxFont_SetUnderlined(_arg0,_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + +#define wxFont_SetWeight(_swigobj,_swigarg0) (_swigobj->SetWeight(_swigarg0)) +static PyObject *_wrap_wxFont_SetWeight(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxFont * _arg0; + int _arg1; + char * _argc0 = 0; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxFont_SetWeight",&_argc0,&_arg1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxFont_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxFont_SetWeight. Expected _wxFont_p."); + return NULL; + } + } + wxFont_SetWeight(_arg0,_arg1); + Py_INCREF(Py_None); + _resultobj = Py_None; + return _resultobj; +} + #define new_wxColour(_swigarg0,_swigarg1,_swigarg2) (new wxColour(_swigarg0,_swigarg1,_swigarg2)) static PyObject *_wrap_new_wxColour(PyObject *self, PyObject *args) { PyObject * _resultobj; @@ -4795,6 +4941,12 @@ static PyMethodDef gdicMethods[] = { { "wxColour_Red", _wrap_wxColour_Red, 1 }, { "delete_wxColour", _wrap_delete_wxColour, 1 }, { "new_wxColour", _wrap_new_wxColour, 1 }, + { "wxFont_SetWeight", _wrap_wxFont_SetWeight, 1 }, + { "wxFont_SetUnderlined", _wrap_wxFont_SetUnderlined, 1 }, + { "wxFont_SetStyle", _wrap_wxFont_SetStyle, 1 }, + { "wxFont_SetPointSize", _wrap_wxFont_SetPointSize, 1 }, + { "wxFont_SetFamily", _wrap_wxFont_SetFamily, 1 }, + { "wxFont_SetFaceName", _wrap_wxFont_SetFaceName, 1 }, { "wxFont_GetWeight", _wrap_wxFont_GetWeight, 1 }, { "wxFont_GetUnderlined", _wrap_wxFont_GetUnderlined, 1 }, { "wxFont_GetStyle", _wrap_wxFont_GetStyle, 1 }, diff --git a/utils/wxPython/src/gtk/gdi.py b/utils/wxPython/src/gtk/gdi.py index 81f3b53819..dac504bd6d 100644 --- a/utils/wxPython/src/gtk/gdi.py +++ b/utils/wxPython/src/gtk/gdi.py @@ -162,6 +162,24 @@ class wxFontPtr : def GetWeight(self): val = gdic.wxFont_GetWeight(self.this) return val + def SetFaceName(self,arg0): + val = gdic.wxFont_SetFaceName(self.this,arg0) + return val + def SetFamily(self,arg0): + val = gdic.wxFont_SetFamily(self.this,arg0) + return val + def SetPointSize(self,arg0): + val = gdic.wxFont_SetPointSize(self.this,arg0) + return val + def SetStyle(self,arg0): + val = gdic.wxFont_SetStyle(self.this,arg0) + return val + def SetUnderlined(self,arg0): + val = gdic.wxFont_SetUnderlined(self.this,arg0) + return val + def SetWeight(self,arg0): + val = gdic.wxFont_SetWeight(self.this,arg0) + return val def __repr__(self): return "" class wxFont(wxFontPtr): diff --git a/utils/wxPython/src/gtk/windows.cpp b/utils/wxPython/src/gtk/windows.cpp index 3c937f1b85..6a7de6835a 100644 --- a/utils/wxPython/src/gtk/windows.cpp +++ b/utils/wxPython/src/gtk/windows.cpp @@ -3826,6 +3826,30 @@ static PyObject *_wrap_wxMenuBar_FindMenuItem(PyObject *self, PyObject *args) { return _resultobj; } +#define wxMenuBar_FindItemForId(_swigobj,_swigarg0) (_swigobj->FindItemForId(_swigarg0)) +static PyObject *_wrap_wxMenuBar_FindItemForId(PyObject *self, PyObject *args) { + PyObject * _resultobj; + wxMenuItem * _result; + wxMenuBar * _arg0; + int _arg1; + char * _argc0 = 0; + char _ptemp[128]; + + self = self; + if(!PyArg_ParseTuple(args,"si:wxMenuBar_FindItemForId",&_argc0,&_arg1)) + return NULL; + if (_argc0) { + if (SWIG_GetPtr(_argc0,(void **) &_arg0,"_wxMenuBar_p")) { + PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxMenuBar_FindItemForId. Expected _wxMenuBar_p."); + return NULL; + } + } + _result = (wxMenuItem *)wxMenuBar_FindItemForId(_arg0,_arg1); + SWIG_MakePtr(_ptemp, (char *) _result,"_wxMenuItem_p"); + _resultobj = Py_BuildValue("s",_ptemp); + return _resultobj; +} + #define wxMenuBar_GetMenuCount(_swigobj) (_swigobj->GetMenuCount()) static PyObject *_wrap_wxMenuBar_GetMenuCount(PyObject *self, PyObject *args) { PyObject * _resultobj; @@ -4178,6 +4202,7 @@ static PyMethodDef windowscMethods[] = { { "wxMenuItem_IsSeparator", _wrap_wxMenuItem_IsSeparator, 1 }, { "wxMenuBar_GetMenu", _wrap_wxMenuBar_GetMenu, 1 }, { "wxMenuBar_GetMenuCount", _wrap_wxMenuBar_GetMenuCount, 1 }, + { "wxMenuBar_FindItemForId", _wrap_wxMenuBar_FindItemForId, 1 }, { "wxMenuBar_FindMenuItem", _wrap_wxMenuBar_FindMenuItem, 1 }, { "wxMenuBar_Enabled", _wrap_wxMenuBar_Enabled, 1 }, { "wxMenuBar_Enable", _wrap_wxMenuBar_Enable, 1 }, diff --git a/utils/wxPython/src/gtk/windows.py b/utils/wxPython/src/gtk/windows.py index d94d67f061..b2b4bf1095 100644 --- a/utils/wxPython/src/gtk/windows.py +++ b/utils/wxPython/src/gtk/windows.py @@ -546,6 +546,10 @@ class wxMenuBarPtr(wxEvtHandlerPtr): def FindMenuItem(self,arg0,arg1): val = windowsc.wxMenuBar_FindMenuItem(self.this,arg0,arg1) return val + def FindItemForId(self,arg0): + val = windowsc.wxMenuBar_FindItemForId(self.this,arg0) + val = wxMenuItemPtr(val) + return val def GetMenuCount(self): val = windowsc.wxMenuBar_GetMenuCount(self.this) return val diff --git a/utils/wxPython/src/gtk/windows2.cpp b/utils/wxPython/src/gtk/windows2.cpp index 62c8b46bf4..1ea15389da 100644 --- a/utils/wxPython/src/gtk/windows2.cpp +++ b/utils/wxPython/src/gtk/windows2.cpp @@ -3514,6 +3514,7 @@ SWIGEXPORT(void,initwindows2c)() { SWIG_RegisterMapping("_class_wxEvent","_class_wxGridEvent",SwigwxGridEventTowxEvent); SWIG_RegisterMapping("_class_wxEvent","_wxGridEvent",SwigwxGridEventTowxEvent); SWIG_RegisterMapping("_class_wxEvent","_wxEvent",0); + SWIG_RegisterMapping("_wxCheckListBox","_class_wxCheckListBox",0); SWIG_RegisterMapping("_wxGridEvent","_class_wxGridEvent",0); SWIG_RegisterMapping("_wxRect","_class_wxRect",0); SWIG_RegisterMapping("_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); @@ -3525,6 +3526,7 @@ SWIGEXPORT(void,initwindows2c)() { SWIG_RegisterMapping("_wxRadioBox","_class_wxRadioBox",0); SWIG_RegisterMapping("_wxBitmap","_class_wxBitmap",0); SWIG_RegisterMapping("_wxPyTimer","_class_wxPyTimer",0); + SWIG_RegisterMapping("_wxWindowDC","_class_wxWindowDC",0); SWIG_RegisterMapping("_wxScrollBar","_class_wxScrollBar",0); SWIG_RegisterMapping("_wxSpinButton","_class_wxSpinButton",0); SWIG_RegisterMapping("_class_wxIndividualLayoutConstraint","_wxIndividualLayoutConstraint",0); @@ -3592,6 +3594,7 @@ SWIGEXPORT(void,initwindows2c)() { SWIG_RegisterMapping("_signed_short","_short",0); SWIG_RegisterMapping("_wxMemoryDC","_class_wxMemoryDC",0); SWIG_RegisterMapping("_wxPaintDC","_class_wxPaintDC",0); + SWIG_RegisterMapping("_class_wxWindowDC","_wxWindowDC",0); SWIG_RegisterMapping("_class_wxFocusEvent","_wxFocusEvent",0); SWIG_RegisterMapping("_class_wxMaximizeEvent","_wxMaximizeEvent",0); SWIG_RegisterMapping("_class_wxAcceleratorEntry","_wxAcceleratorEntry",0); @@ -3659,6 +3662,7 @@ SWIGEXPORT(void,initwindows2c)() { SWIG_RegisterMapping("_class_wxShowEvent","_wxShowEvent",0); SWIG_RegisterMapping("_wxActivateEvent","_class_wxActivateEvent",0); SWIG_RegisterMapping("_wxGauge","_class_wxGauge",0); + SWIG_RegisterMapping("_class_wxCheckListBox","_wxCheckListBox",0); SWIG_RegisterMapping("_class_wxGridEvent","_wxGridEvent",0); SWIG_RegisterMapping("_class_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); SWIG_RegisterMapping("_class_wxCommandEvent","_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); -- 2.45.2