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
This commit is contained in:
Robert Roebling
1998-12-19 12:38:52 +00:00
parent c2a6abc077
commit d3b4d11313
12 changed files with 413 additions and 227 deletions

View File

@@ -86,8 +86,10 @@ class wxRadioBox: public wxControl
bool IsOwnGtkWindow( GdkWindow *window ); bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle(); void ApplyWidgetStyle();
wxSize LayoutItems();
bool m_alreadySent; bool m_alreadySent;
int m_majorDim;
wxList m_boxes; wxList m_boxes;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()

View File

@@ -86,8 +86,10 @@ class wxRadioBox: public wxControl
bool IsOwnGtkWindow( GdkWindow *window ); bool IsOwnGtkWindow( GdkWindow *window );
void ApplyWidgetStyle(); void ApplyWidgetStyle();
wxSize LayoutItems();
bool m_alreadySent; bool m_alreadySent;
int m_majorDim;
wxList m_boxes; wxList m_boxes;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()

View File

@@ -64,8 +64,7 @@ wxRadioBox::wxRadioBox(void)
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size, const wxPoint &pos, const wxSize &size,
int n, const wxString choices[], int n, const wxString choices[], int majorDim,
int WXUNUSED(majorDim),
long style, const wxValidator& validator, long style, const wxValidator& validator,
const wxString &name ) const wxString &name )
{ {
@@ -79,86 +78,35 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
m_widget = gtk_frame_new( title ); m_widget = gtk_frame_new( title );
int x = m_x+5; m_majorDim = majorDim;
int y = m_y+15;
int maxLen = 0;
int height = 20;
int width = 0;
GtkRadioButton *m_radio = (GtkRadioButton*) NULL; 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; if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) );
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_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_connect( GTK_OBJECT(m_radio), "clicked",
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); 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_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), m_x+10, m_y+10+(i*24) );
int tmp = 25+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] );
if (tmp > maxLen) maxLen = tmp;
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; wxSize ls = LayoutItems();
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 newSize = size; wxSize newSize = size;
if (newSize.x == -1) newSize.x = width; if (newSize.x == -1) newSize.x = ls.x;
if (newSize.y == -1) newSize.y = height; if (newSize.y == -1) newSize.y = ls.y;
SetSize( newSize.x, newSize.y ); SetSize( newSize.x, newSize.y );
m_parent->AddChild( this ); m_parent->AddChild( this );
@@ -190,57 +138,98 @@ wxRadioBox::~wxRadioBox(void)
void wxRadioBox::OnSize( wxSizeEvent &event ) void wxRadioBox::OnSize( wxSizeEvent &event )
{ {
wxControl::OnSize( event ); wxControl::OnSize( event );
int x = m_x+5; LayoutItems();
int y = m_y+15; }
if (m_windowStyle & wxRA_HORIZONTAL) wxSize wxRadioBox::LayoutItems()
{ {
wxNode *node = m_boxes.First(); int x = m_x+7;
while (node) int y = m_y+15;
int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1;
wxSize res( 0, 0 );
if (m_windowStyle & wxRA_HORIZONTAL)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); for (int j = 0; j < m_majorDim; j++)
y += 20; {
y = m_y+15;
int w = m_width-10; int max_len = 0;
if (w < 15) w = 15; wxNode *node = m_boxes.Nth( j*num_per_major );
gtk_widget_set_usize( button, w, 20 ); 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;
node = node->Next(); 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
else
{
int max = 0;
wxNode *node = m_boxes.First();
while (node)
{ {
GtkButton *button = GTK_BUTTON( node->Data() ); int max = 0;
GtkLabel *label = GTK_LABEL( button->child );
GdkFont *font = m_widget->style->font; wxNode *node = m_boxes.First();
int len = 27+gdk_string_measure( font, label->label ); while (node)
if (len > max) max = len; {
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
node = node->Next(); GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
if (len > max) max = len;
node = node->Next();
}
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 );
node = node->Next();
}
res.x = x-2;
res.y = 42;
} }
node = m_boxes.First(); return res;
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 );
node = node->Next();
}
}
} }
bool wxRadioBox::Show( bool show ) bool wxRadioBox::Show( bool show )

View File

@@ -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_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
wxPoint pt( m_parent->GetClientAreaOrigin() ); wxPoint pt( m_parent->GetClientAreaOrigin() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y ); gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );

View File

@@ -64,8 +64,7 @@ wxRadioBox::wxRadioBox(void)
bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title, bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
const wxPoint &pos, const wxSize &size, const wxPoint &pos, const wxSize &size,
int n, const wxString choices[], int n, const wxString choices[], int majorDim,
int WXUNUSED(majorDim),
long style, const wxValidator& validator, long style, const wxValidator& validator,
const wxString &name ) const wxString &name )
{ {
@@ -79,86 +78,35 @@ bool wxRadioBox::Create( wxWindow *parent, wxWindowID id, const wxString& title,
m_widget = gtk_frame_new( title ); m_widget = gtk_frame_new( title );
int x = m_x+5; m_majorDim = majorDim;
int y = m_y+15;
int maxLen = 0;
int height = 20;
int width = 0;
GtkRadioButton *m_radio = (GtkRadioButton*) NULL; 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; if (i) radio_button_group = gtk_radio_button_group( GTK_RADIO_BUTTON(m_radio) );
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_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_connect( GTK_OBJECT(m_radio), "clicked",
GTK_SIGNAL_FUNC(gtk_radiobutton_clicked_callback), (gpointer*)this ); 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_myfixed_put( GTK_MYFIXED(m_parent->m_wxwindow), GTK_WIDGET(m_radio), m_x+10, m_y+10+(i*24) );
int tmp = 25+gdk_string_measure( GTK_WIDGET(m_radio)->style->font, choices[i] );
if (tmp > maxLen) maxLen = tmp;
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; wxSize ls = LayoutItems();
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 newSize = size; wxSize newSize = size;
if (newSize.x == -1) newSize.x = width; if (newSize.x == -1) newSize.x = ls.x;
if (newSize.y == -1) newSize.y = height; if (newSize.y == -1) newSize.y = ls.y;
SetSize( newSize.x, newSize.y ); SetSize( newSize.x, newSize.y );
m_parent->AddChild( this ); m_parent->AddChild( this );
@@ -190,57 +138,98 @@ wxRadioBox::~wxRadioBox(void)
void wxRadioBox::OnSize( wxSizeEvent &event ) void wxRadioBox::OnSize( wxSizeEvent &event )
{ {
wxControl::OnSize( event ); wxControl::OnSize( event );
int x = m_x+5; LayoutItems();
int y = m_y+15; }
if (m_windowStyle & wxRA_HORIZONTAL) wxSize wxRadioBox::LayoutItems()
{ {
wxNode *node = m_boxes.First(); int x = m_x+7;
while (node) int y = m_y+15;
int num_per_major = (m_boxes.GetCount() - 1) / m_majorDim +1;
wxSize res( 0, 0 );
if (m_windowStyle & wxRA_HORIZONTAL)
{ {
GtkWidget *button = GTK_WIDGET( node->Data() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), button, x, y ); for (int j = 0; j < m_majorDim; j++)
y += 20; {
y = m_y+15;
int w = m_width-10; int max_len = 0;
if (w < 15) w = 15; wxNode *node = m_boxes.Nth( j*num_per_major );
gtk_widget_set_usize( button, w, 20 ); 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;
node = node->Next(); 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
else
{
int max = 0;
wxNode *node = m_boxes.First();
while (node)
{ {
GtkButton *button = GTK_BUTTON( node->Data() ); int max = 0;
GtkLabel *label = GTK_LABEL( button->child );
GdkFont *font = m_widget->style->font; wxNode *node = m_boxes.First();
int len = 27+gdk_string_measure( font, label->label ); while (node)
if (len > max) max = len; {
GtkButton *button = GTK_BUTTON( node->Data() );
GtkLabel *label = GTK_LABEL( button->child );
node = node->Next(); GdkFont *font = m_widget->style->font;
int len = 27+gdk_string_measure( font, label->label );
if (len > max) max = len;
node = node->Next();
}
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 );
node = node->Next();
}
res.x = x-2;
res.y = 42;
} }
node = m_boxes.First(); return res;
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 );
node = node->Next();
}
}
} }
bool wxRadioBox::Show( bool show ) bool wxRadioBox::Show( bool show )

View File

@@ -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_minWidth != -1) && (m_width < m_minWidth)) m_width = m_minWidth;
if ((m_minHeight != -1) && (m_height < m_minHeight)) m_height = m_minHeight; 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_maxWidth != -1) && (m_width > m_maxWidth)) m_width = m_maxWidth;
if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_minHeight; if ((m_maxHeight != -1) && (m_height > m_maxHeight)) m_height = m_maxHeight;
wxPoint pt( m_parent->GetClientAreaOrigin() ); wxPoint pt( m_parent->GetClientAreaOrigin() );
gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y ); gtk_myfixed_move( GTK_MYFIXED(m_parent->m_wxwindow), m_widget, m_x+pt.x, m_y+pt.y );

View File

@@ -30,8 +30,9 @@ MY_LINKCC=$(CCC)
## Pick one of these, or set your own. This is where the ## Pick one of these, or set your own. This is where the
## wxPython module should be installed. It should be a ## wxPython module should be installed. It should be a
## subdirectory named wxPython. ## subdirectory named wxPython.
TARGETDIR=.. #TARGETDIR=..
#TARGETDIR=$(BINLIBDEST)/site-packages/wxPython #TARGETDIR=$(BINLIBDEST)/site-packages/wxPython
TARGETDIR=$(BINLIBDEST)/wxPython
wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \ wxc wx.cpp helpers.cpp windows.cpp events.cpp misc.cpp gdi.cpp \

View File

@@ -1783,6 +1783,152 @@ static PyObject *_wrap_wxFont_GetWeight(PyObject *self, PyObject *args) {
return _resultobj; 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)) #define new_wxColour(_swigarg0,_swigarg1,_swigarg2) (new wxColour(_swigarg0,_swigarg1,_swigarg2))
static PyObject *_wrap_new_wxColour(PyObject *self, PyObject *args) { static PyObject *_wrap_new_wxColour(PyObject *self, PyObject *args) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -4795,6 +4941,12 @@ static PyMethodDef gdicMethods[] = {
{ "wxColour_Red", _wrap_wxColour_Red, 1 }, { "wxColour_Red", _wrap_wxColour_Red, 1 },
{ "delete_wxColour", _wrap_delete_wxColour, 1 }, { "delete_wxColour", _wrap_delete_wxColour, 1 },
{ "new_wxColour", _wrap_new_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_GetWeight", _wrap_wxFont_GetWeight, 1 },
{ "wxFont_GetUnderlined", _wrap_wxFont_GetUnderlined, 1 }, { "wxFont_GetUnderlined", _wrap_wxFont_GetUnderlined, 1 },
{ "wxFont_GetStyle", _wrap_wxFont_GetStyle, 1 }, { "wxFont_GetStyle", _wrap_wxFont_GetStyle, 1 },

View File

@@ -162,6 +162,24 @@ class wxFontPtr :
def GetWeight(self): def GetWeight(self):
val = gdic.wxFont_GetWeight(self.this) val = gdic.wxFont_GetWeight(self.this)
return val 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): def __repr__(self):
return "<C wxFont instance>" return "<C wxFont instance>"
class wxFont(wxFontPtr): class wxFont(wxFontPtr):

View File

@@ -3826,6 +3826,30 @@ static PyObject *_wrap_wxMenuBar_FindMenuItem(PyObject *self, PyObject *args) {
return _resultobj; 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()) #define wxMenuBar_GetMenuCount(_swigobj) (_swigobj->GetMenuCount())
static PyObject *_wrap_wxMenuBar_GetMenuCount(PyObject *self, PyObject *args) { static PyObject *_wrap_wxMenuBar_GetMenuCount(PyObject *self, PyObject *args) {
PyObject * _resultobj; PyObject * _resultobj;
@@ -4178,6 +4202,7 @@ static PyMethodDef windowscMethods[] = {
{ "wxMenuItem_IsSeparator", _wrap_wxMenuItem_IsSeparator, 1 }, { "wxMenuItem_IsSeparator", _wrap_wxMenuItem_IsSeparator, 1 },
{ "wxMenuBar_GetMenu", _wrap_wxMenuBar_GetMenu, 1 }, { "wxMenuBar_GetMenu", _wrap_wxMenuBar_GetMenu, 1 },
{ "wxMenuBar_GetMenuCount", _wrap_wxMenuBar_GetMenuCount, 1 }, { "wxMenuBar_GetMenuCount", _wrap_wxMenuBar_GetMenuCount, 1 },
{ "wxMenuBar_FindItemForId", _wrap_wxMenuBar_FindItemForId, 1 },
{ "wxMenuBar_FindMenuItem", _wrap_wxMenuBar_FindMenuItem, 1 }, { "wxMenuBar_FindMenuItem", _wrap_wxMenuBar_FindMenuItem, 1 },
{ "wxMenuBar_Enabled", _wrap_wxMenuBar_Enabled, 1 }, { "wxMenuBar_Enabled", _wrap_wxMenuBar_Enabled, 1 },
{ "wxMenuBar_Enable", _wrap_wxMenuBar_Enable, 1 }, { "wxMenuBar_Enable", _wrap_wxMenuBar_Enable, 1 },

View File

@@ -546,6 +546,10 @@ class wxMenuBarPtr(wxEvtHandlerPtr):
def FindMenuItem(self,arg0,arg1): def FindMenuItem(self,arg0,arg1):
val = windowsc.wxMenuBar_FindMenuItem(self.this,arg0,arg1) val = windowsc.wxMenuBar_FindMenuItem(self.this,arg0,arg1)
return val return val
def FindItemForId(self,arg0):
val = windowsc.wxMenuBar_FindItemForId(self.this,arg0)
val = wxMenuItemPtr(val)
return val
def GetMenuCount(self): def GetMenuCount(self):
val = windowsc.wxMenuBar_GetMenuCount(self.this) val = windowsc.wxMenuBar_GetMenuCount(self.this)
return val return val

View File

@@ -3514,6 +3514,7 @@ SWIGEXPORT(void,initwindows2c)() {
SWIG_RegisterMapping("_class_wxEvent","_class_wxGridEvent",SwigwxGridEventTowxEvent); SWIG_RegisterMapping("_class_wxEvent","_class_wxGridEvent",SwigwxGridEventTowxEvent);
SWIG_RegisterMapping("_class_wxEvent","_wxGridEvent",SwigwxGridEventTowxEvent); SWIG_RegisterMapping("_class_wxEvent","_wxGridEvent",SwigwxGridEventTowxEvent);
SWIG_RegisterMapping("_class_wxEvent","_wxEvent",0); SWIG_RegisterMapping("_class_wxEvent","_wxEvent",0);
SWIG_RegisterMapping("_wxCheckListBox","_class_wxCheckListBox",0);
SWIG_RegisterMapping("_wxGridEvent","_class_wxGridEvent",0); SWIG_RegisterMapping("_wxGridEvent","_class_wxGridEvent",0);
SWIG_RegisterMapping("_wxRect","_class_wxRect",0); SWIG_RegisterMapping("_wxRect","_class_wxRect",0);
SWIG_RegisterMapping("_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); SWIG_RegisterMapping("_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent);
@@ -3525,6 +3526,7 @@ SWIGEXPORT(void,initwindows2c)() {
SWIG_RegisterMapping("_wxRadioBox","_class_wxRadioBox",0); SWIG_RegisterMapping("_wxRadioBox","_class_wxRadioBox",0);
SWIG_RegisterMapping("_wxBitmap","_class_wxBitmap",0); SWIG_RegisterMapping("_wxBitmap","_class_wxBitmap",0);
SWIG_RegisterMapping("_wxPyTimer","_class_wxPyTimer",0); SWIG_RegisterMapping("_wxPyTimer","_class_wxPyTimer",0);
SWIG_RegisterMapping("_wxWindowDC","_class_wxWindowDC",0);
SWIG_RegisterMapping("_wxScrollBar","_class_wxScrollBar",0); SWIG_RegisterMapping("_wxScrollBar","_class_wxScrollBar",0);
SWIG_RegisterMapping("_wxSpinButton","_class_wxSpinButton",0); SWIG_RegisterMapping("_wxSpinButton","_class_wxSpinButton",0);
SWIG_RegisterMapping("_class_wxIndividualLayoutConstraint","_wxIndividualLayoutConstraint",0); SWIG_RegisterMapping("_class_wxIndividualLayoutConstraint","_wxIndividualLayoutConstraint",0);
@@ -3592,6 +3594,7 @@ SWIGEXPORT(void,initwindows2c)() {
SWIG_RegisterMapping("_signed_short","_short",0); SWIG_RegisterMapping("_signed_short","_short",0);
SWIG_RegisterMapping("_wxMemoryDC","_class_wxMemoryDC",0); SWIG_RegisterMapping("_wxMemoryDC","_class_wxMemoryDC",0);
SWIG_RegisterMapping("_wxPaintDC","_class_wxPaintDC",0); SWIG_RegisterMapping("_wxPaintDC","_class_wxPaintDC",0);
SWIG_RegisterMapping("_class_wxWindowDC","_wxWindowDC",0);
SWIG_RegisterMapping("_class_wxFocusEvent","_wxFocusEvent",0); SWIG_RegisterMapping("_class_wxFocusEvent","_wxFocusEvent",0);
SWIG_RegisterMapping("_class_wxMaximizeEvent","_wxMaximizeEvent",0); SWIG_RegisterMapping("_class_wxMaximizeEvent","_wxMaximizeEvent",0);
SWIG_RegisterMapping("_class_wxAcceleratorEntry","_wxAcceleratorEntry",0); SWIG_RegisterMapping("_class_wxAcceleratorEntry","_wxAcceleratorEntry",0);
@@ -3659,6 +3662,7 @@ SWIGEXPORT(void,initwindows2c)() {
SWIG_RegisterMapping("_class_wxShowEvent","_wxShowEvent",0); SWIG_RegisterMapping("_class_wxShowEvent","_wxShowEvent",0);
SWIG_RegisterMapping("_wxActivateEvent","_class_wxActivateEvent",0); SWIG_RegisterMapping("_wxActivateEvent","_class_wxActivateEvent",0);
SWIG_RegisterMapping("_wxGauge","_class_wxGauge",0); SWIG_RegisterMapping("_wxGauge","_class_wxGauge",0);
SWIG_RegisterMapping("_class_wxCheckListBox","_wxCheckListBox",0);
SWIG_RegisterMapping("_class_wxGridEvent","_wxGridEvent",0); SWIG_RegisterMapping("_class_wxGridEvent","_wxGridEvent",0);
SWIG_RegisterMapping("_class_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); SWIG_RegisterMapping("_class_wxCommandEvent","_class_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent);
SWIG_RegisterMapping("_class_wxCommandEvent","_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent); SWIG_RegisterMapping("_class_wxCommandEvent","_wxNotebookEvent",SwigwxNotebookEventTowxCommandEvent);