Removed automatic "Magic Event Methods" bindings

Added explicit bindings where needed
other assorted odds and ends


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2000-06-02 01:50:43 +00:00
parent c1af1ea6b5
commit a95ee79d9c
75 changed files with 494 additions and 238 deletions

View File

@@ -21,6 +21,28 @@ Added wxDateTime, wxTimeSpan, and wxDateSpan to wxPython.utils.
Added wxCalendarCtrl.
WARNING: A while back I asked what should be done about the Magic
Method Names. (Methods that are automatically turned into event
handlers by virtue of their name.) The consensus was that it is more
confusing to have them than to try and expand them to have greater
coverage. I am finally getting around to removing the code that
generates the event binding. This means that if you are using any of
the following method names without a EVT_* call that you need to
modify your code to add the EVT_* to hook the event to the method.
OnChar
OnSize
OnEraseBackground
OnSysColourChanged
OnInitDialog
OnPaint
OnIdle
OnActivate
OnMenuHighlight
OnCloseWindow
OnScroll
@@ -47,11 +69,11 @@ consistent with each other now so you may be able to guess pretty
good...)
Updated filebrowsebutton.py and calendar.py with changes from their
authors. There is now a FileBrowseButtonWithhistory class (what a
authors. There is now a FileBrowseButtonWithHistory class (what a
mouthful!) and wxCalendar has printing support.
Added ActiveXWrapper to the library, and some good demos of it too.
It works great for embedding a COM (a.k.a OCX, a.k.a Activex) control
It works great for embedding a COM (a.k.a OCX, a.k.a ActiveX) control
in a window and calling its methods. It actually creates a new class
on the fly that derives from wxWindow, the COM CoClass and others
needed to make it all work. The resulting class can be instantiated

View File

@@ -85,7 +85,7 @@ public:
int *attribList = 0,
const wxPalette& palette = wxNullPalette);
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void SetCurrent();
void SetColour(const char *colour);

View File

@@ -580,9 +580,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0},
{ "_wxCursor","_class_wxCursor",0},
{ "_wxNotifyEvent","_class_wxNotifyEvent",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_class_wxTreeCtrl","_wxTreeCtrl",0},
{ "_wxMask","_class_wxMask",0},
{ "_wxToolTip","_class_wxToolTip",0},
{ "_wxPNGHandler","_class_wxPNGHandler",0},
@@ -651,6 +651,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPanel","_class_wxPanel",0},
{ "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
{ "_wxCheckBox","_class_wxCheckBox",0},
{ "_class_wxPyTreeCtrl","_wxPyTreeCtrl",0},
{ "_wxPyEvent","_class_wxPyEvent",0},
{ "_wxTextCtrl","_class_wxTextCtrl",0},
{ "_class_wxMask","_wxMask",0},
@@ -685,6 +686,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_wxPyValidator","_class_wxPyValidator",0},
{ "_class_wxEvent","_wxEvent",0},
{ "_wxCheckListBox","_class_wxCheckListBox",0},
@@ -700,11 +702,13 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFontData","_wxFontData",0},
{ "_class_wxPNMHandler","_wxPNMHandler",0},
{ "_wxBoxSizer","_class_wxBoxSizer",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxTaskBarIcon","_class_wxTaskBarIcon",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyTimer","_class_wxPyTimer",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
{ "_wxPyTimer","_class_wxPyTimer",0},
{ "_wxScrollBar","_class_wxScrollBar",0},
{ "_wxSpinButton","_class_wxSpinButton",0},
{ "_wxColourDialog","_class_wxColourDialog",0},
@@ -755,9 +759,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMDIParentFrame","_class_wxMDIParentFrame",0},
{ "_class_wxTreeEvent","_wxTreeEvent",0},
{ "_class_wxDirDialog","_wxDirDialog",0},
{ "_class_wxPyTimer","_wxPyTimer",0},
{ "_wxFocusEvent","_class_wxFocusEvent",0},
{ "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
{ "_class_wxTimerEvent","_wxTimerEvent",0},
{ "_class_wxPyTimer","_wxPyTimer",0},
{ "_class_wxSpinButton","_wxSpinButton",0},
{ "_wxAcceleratorEntry","_class_wxAcceleratorEntry",0},
{ "_class_wxPanel","_class_wxGLCanvas",SwigwxGLCanvasTowxPanel},
@@ -920,7 +925,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxValidator","_class_wxValidator",0},
{ "_wxToolBarBase","_class_wxToolBarBase",0},
{ "_class_wxTreeItemId","_wxTreeItemId",0},
{ "_wxTreeCtrl","_class_wxTreeCtrl",0},
{ "_class_wxLayoutConstraints","_wxLayoutConstraints",0},
{ "_wxIconizeEvent","_class_wxIconizeEvent",0},
{ "_class_wxControl","_wxControl",0},

View File

@@ -88,7 +88,7 @@ class wxGLCanvas(wxGLCanvasPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(glcanvasc.new_wxGLCanvas,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)

View File

@@ -2014,9 +2014,9 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxIndividualLayoutConstraint","_class_wxIndividualLayoutConstraint",0},
{ "_wxCursor","_class_wxCursor",0},
{ "_wxNotifyEvent","_class_wxNotifyEvent",0},
{ "_wxPyTreeCtrl","_class_wxPyTreeCtrl",0},
{ "_wxImageHandler","_class_wxImageHandler",0},
{ "_class_wxToolBarBase","_wxToolBarBase",0},
{ "_class_wxTreeCtrl","_wxTreeCtrl",0},
{ "_wxMask","_class_wxMask",0},
{ "_wxToolTip","_class_wxToolTip",0},
{ "_wxPNGHandler","_class_wxPNGHandler",0},
@@ -2086,6 +2086,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxPanel","_class_wxPanel",0},
{ "_wxInitDialogEvent","_class_wxInitDialogEvent",0},
{ "_wxCheckBox","_class_wxCheckBox",0},
{ "_class_wxPyTreeCtrl","_wxPyTreeCtrl",0},
{ "_wxPyEvent","_class_wxPyEvent",0},
{ "_wxTextCtrl","_class_wxTextCtrl",0},
{ "_class_wxMask","_wxMask",0},
@@ -2120,6 +2121,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_uint","_unsigned_int",0},
{ "_uint","_int",0},
{ "_uint","_wxWindowID",0},
{ "_wxChar","_char",0},
{ "_wxPyValidator","_class_wxPyValidator",0},
{ "_class_wxEvent","_wxEvent",0},
{ "_wxCheckListBox","_class_wxCheckListBox",0},
@@ -2136,10 +2138,12 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxFontData","_wxFontData",0},
{ "_class_wxPNMHandler","_wxPNMHandler",0},
{ "_wxBoxSizer","_class_wxBoxSizer",0},
{ "_char","_wxChar",0},
{ "_wxBitmap","_class_wxBitmap",0},
{ "_wxPrintDialog","_class_wxPrintDialog",0},
{ "_wxPyTimer","_class_wxPyTimer",0},
{ "_wxWindowDC","_class_wxWindowDC",0},
{ "_wxTimerEvent","_class_wxTimerEvent",0},
{ "_wxPyTimer","_class_wxPyTimer",0},
{ "_wxScrollBar","_class_wxScrollBar",0},
{ "_wxSpinButton","_class_wxSpinButton",0},
{ "_wxColourDialog","_class_wxColourDialog",0},
@@ -2192,9 +2196,10 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMDIParentFrame","_class_wxMDIParentFrame",0},
{ "_class_wxTreeEvent","_wxTreeEvent",0},
{ "_class_wxDirDialog","_wxDirDialog",0},
{ "_class_wxPyTimer","_wxPyTimer",0},
{ "_wxFocusEvent","_class_wxFocusEvent",0},
{ "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
{ "_class_wxTimerEvent","_wxTimerEvent",0},
{ "_class_wxPyTimer","_wxPyTimer",0},
{ "_class_wxSpinButton","_wxSpinButton",0},
{ "_wxAcceleratorEntry","_class_wxAcceleratorEntry",0},
{ "_class_wxPanel","_class_wxPyShapeCanvas",SwigwxPyShapeCanvasTowxPanel},
@@ -2354,7 +2359,6 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxValidator","_class_wxValidator",0},
{ "_wxToolBarBase","_class_wxToolBarBase",0},
{ "_class_wxTreeItemId","_wxTreeItemId",0},
{ "_wxTreeCtrl","_class_wxTreeCtrl",0},
{ "_class_wxLayoutConstraints","_wxLayoutConstraints",0},
{ "_wxIconizeEvent","_class_wxIconizeEvent",0},
{ "_class_wxControl","_wxControl",0},

View File

@@ -119,8 +119,8 @@ public:
void _setSelf(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxPyShapeCanvas)"
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
void AddShape(wxPyShape *shape, wxPyShape *addAfter = NULL);

View File

@@ -210,8 +210,8 @@ class wxPyShapeCanvas(wxPyShapeCanvasPtr):
self.this = apply(oglcanvasc.new_wxPyShapeCanvas,_args,_kwargs)
self.thisown = 1
self._setSelf(self, wxPyShapeCanvas)
wx._StdWindowCallbacks(self)
wx._StdOnScrollCallbacks(self)
#wx._StdWindowCallbacks(self)
#wx._StdOnScrollCallbacks(self)

View File

@@ -140,7 +140,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb
wxPoint * _arg2 = (wxPoint *) &wxDefaultPosition;
wxSize * _arg3 = (wxSize *) &wxDefaultSize;
long _arg4 = (long ) 0;
char * _arg5;
char * _arg5 = (char *) "styledtext";
PyObject * _argo0 = 0;
wxPoint temp;
PyObject * _obj2 = 0;
@@ -150,7 +150,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OiO|Ols:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5))
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oi|OOls:new_wxStyledTextCtrl",_kwnames,&_argo0,&_arg1,&_obj2,&_obj3,&_arg4,&_arg5))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
@@ -159,6 +159,7 @@ static PyObject *_wrap_new_wxStyledTextCtrl(PyObject *self, PyObject *args, PyOb
return NULL;
}
}
if (_obj2)
{
_arg2 = &temp;
if (! wxPoint_helper(_obj2, &_arg2))

View File

@@ -32,6 +32,7 @@ class TestPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
self.log = log
self.pdf = None
sizer = wxBoxSizer(wxVERTICAL)
btnSizer = wxBoxSizer(wxHORIZONTAL)
@@ -65,10 +66,12 @@ class TestPanel(wxPanel):
self.SetAutoLayout(true)
def __del__(self):
if self.pdf:
self.pdf.Cleanup()
self.pdf = None
def OnOpenButton(self, event):
dlg = wxFileDialog(self, wildcard="*.pdf")
if dlg.ShowModal() == wxID_OK:
@@ -112,6 +115,7 @@ if __name__ == '__main__':
wxFrame.__init__(self, None, -1, "ActiveX test -- Acrobat", size=(640, 480),
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.tp = TestPanel(self, sys.stdout)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.pdf.Cleanup()

View File

@@ -1,15 +1,20 @@
"""
<html><body>
This demo shows how to embed an ActiveX control in a wxPython application, (Win32 only.)
This demo shows how to embed an ActiveX control in a wxPython
application, (Win32 only.)
<p>
The MakeActiveXClass function dynamically builds a new Class on the fly, that has the
same signature and semantics as wxWindow. This means that when you call the function
you get back a new class that you can use just like wxWindow, (set the size and position,
use in a sizer, etc.) except its contents will be the COM control.
The MakeActiveXClass function dynamically builds a new Class on the
fly, that has the same signature and semantics as wxWindow. This
means that when you call the function you get back a new class that
you can use just like wxWindow, (set the size and position, use in a
sizer, etc.) except its contents will be the COM control.
<p>
This demo embeds the Internet Exploer WebBrowser control, and shows how to receive events
from the COM control. (The title bar and status bar are updated as pages change, in addition
to the log messages being shown.)
This demo embeds the Internet Exploer WebBrowser control, and shows
how to receive events from the COM control. (The title bar and status
bar are updated as pages change, in addition to the log messages being
shown.)
</body></html>
"""
@@ -30,6 +35,7 @@ if wxPlatform == '__WXMSW__':
class TestPanel(wxWindow):
def __init__(self, parent, log, frame=None):
wxWindow.__init__(self, parent, -1)#, style=wxCLIP_CHILDREN)
self.ie = None
self.log = log
self.current = "http://alldunn.com/"
self.frame = frame
@@ -83,12 +89,14 @@ class TestPanel(wxWindow):
self.SetSizer(sizer)
self.SetAutoLayout(true)
EVT_SIZE(self, self.OnSize)
def OnSize(self, evt):
self.Layout()
def __del__(self):
if self.ie:
self.ie.Cleanup()
self.ie = None
@@ -181,6 +189,7 @@ if __name__ == '__main__':
style=wxDEFAULT_FRAME_STYLE|wxNO_FULL_REPAINT_ON_RESIZE)
self.CreateStatusBar()
self.tp = TestPanel(self, sys.stdout, self)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.tp.ie.Cleanup()

View File

@@ -19,6 +19,7 @@ class DoodlePad(wxWindow):
EVT_LEFT_UP(self, self.OnLeftUp)
EVT_RIGHT_UP(self, self.OnRightUp)
EVT_MOTION(self, self.OnMotion)
EVT_PAINT(self, self.OnPaint)
def OnPaint(self, event):
@@ -153,6 +154,7 @@ class DoodleViewer(wxWindow):
self.x = self.y = 0
dt = DoodleDropTarget(self, log)
self.SetDropTarget(dt)
EVT_PAINT(self, self.OnPaint)
def SetLines(self, lines):
self.lines = lines

View File

@@ -29,6 +29,7 @@ class MyFrame(wxFrame):
# Associate some events with methods of this class
EVT_SIZE(self, self.OnSize)
EVT_MOVE(self, self.OnMove)
EVT_CLOSE(self, self.OnCloseWindow)
# Add a panel and some controls to display the size and position
panel = wxPanel(self, -1)

View File

@@ -78,6 +78,7 @@ class wxPythonDemo(wxFrame):
self.otherWin = None
EVT_IDLE(self, self.OnIdle)
EVT_CLOSE(self, self.OnCloseWindow)
self.Centre(wxBOTH)
self.CreateStatusBar(1, wxST_SIZEGRIP)

View File

@@ -292,6 +292,8 @@ class TestFrame(wxFrame):
self.CreateStatusBar()
self.SetStatusText("Resize this frame to see how the sizers respond...")
self.sizer.FitWindow(self)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_SIZE(self, self.OnSize)
def OnSize(self, event):
@@ -378,6 +380,7 @@ if __name__ == '__main__':
EVT_MENU(self, 200, self.OnExit)
self.panel = TestSelectionPanel(self, self)
self.SetSize(wxSize(400, 380))
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.Destroy()

View File

@@ -481,6 +481,7 @@ class TestFrame(wxFrame):
self.SetAutoLayout(true)
self.SetSizer(self.sizer)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.MakeModal(false)
@@ -563,6 +564,7 @@ if __name__ == '__main__':
EVT_MENU(self, 200, self.OnExit)
self.panel = TestSelectionPanel(self, self)
self.SetSize(wxSize(400, 380))
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.Destroy()

View File

@@ -43,6 +43,7 @@ class HTMLTextView(wxFrame):
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition,
wxSize(600,400))
EVT_CLOSE(self, self.OnCloseWindow)
self.mainmenu = wxMenuBar()
menu = wxMenu()
@@ -155,6 +156,7 @@ class AppStatusBar(wxStatusBar):
self.SetStatusWidths([-1, 100])
self.but = wxButton(self, 1001, "Refresh")
EVT_BUTTON(self, 1001, parent.OnViewRefresh)
EVT_SIZE(self, self.OnSize)
self.OnSize(None)
def logprint(self,x):

View File

@@ -77,6 +77,9 @@ class GraphWindow(wxWindow):
self.colors = [ wxRED, wxGREEN, wxBLUE, wxCYAN,
wxNamedColour("Yellow"), wxNamedColor("Navy") ]
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_PAINT(self, self.OnPaint)
def SetValue(self, index, value):
assert index < len(self.values)
@@ -185,6 +188,7 @@ class TestFrame(wxFrame):
for t in self.threads:
t.Start()
EVT_CLOSE(self, self.OnCloseWindow)
def OnUpdate(self, evt):

View File

@@ -124,6 +124,8 @@ class HangmanWnd(wxWindow):
else:
self.font = wxFont(10, wxMODERN, wxNORMAL, wxNORMAL)
self.SetFocus()
EVT_PAINT(self, self.OnPaint)
def StartGame(self, word):
self.word = word
@@ -252,6 +254,7 @@ class HangmanDemoFrame(wxFrame):
def __init__(self, wf, parent, id, pos, size):
wxFrame.__init__(self, parent, id, "Hangman demo", pos, size)
self.demo = HangmanDemo(wf, self, -1, wxDefaultPosition, wxDefaultSize)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.demo.timer.Stop()

View File

@@ -37,7 +37,8 @@ class RunDemoApp(wxApp):
def OnInit(self):
wxInitAllImageHandlers()
frame = wxFrame(None, -1, "RunDemo: " + self.name, size=(0,0))
frame = wxFrame(None, -1, "RunDemo: " + self.name, size=(0,0),
style=wxNO_FULL_REPAINT_ON_RESIZE|wxDEFAULT_FRAME_STYLE)
frame.CreateStatusBar()
frame.Show(true)
win = self.demoModule.runTest(frame, frame, Log())
@@ -80,7 +81,6 @@ def main(argv):
name = argv[1]
if name[-3:] == '.py':
name = name[:-3]
print name
module = __import__(name)

View File

@@ -175,8 +175,6 @@ class TestPanel(wxPanel):
text = '%s CLICK %02d/%02d/%d' % (evt.click, evt.day, evt.month, evt.year) # format date
self.log.WriteText('Date Selected: ' + text + '\n')
def OnCloseWindow(self, event):
self.Destroy()
# set the highlighted days for the calendar
@@ -317,6 +315,7 @@ class CalenDlg(wxDialog):
class CalendFrame(wxFrame):
def __init__(self, parent, id, title, log):
wxFrame.__init__(self, parent, id, title, wxPyDefaultPosition, wxSize(400, 400))
EVT_CLOSE(self, self.OnCloseWindow)
self.log = log
self.CreateStatusBar()
@@ -574,9 +573,6 @@ class PrintCalend:
return year, month
def OnCloseWindow(self, event):
self.Destroy()
def GetTotalPages(self):
self.pg_cnt = 1
return self.pg_cnt

View File

@@ -49,6 +49,7 @@ class TestFloatBar(wxFrame):
tb.Realize()
self.tb = tb
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):

View File

@@ -11,6 +11,8 @@ class MyFrame(wxFrame):
button = wxButton(panel, 1003, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, 1003, self.OnCloseMe)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
self.Close(true)

View File

@@ -59,6 +59,8 @@ else:
def __init__(self, parent):
wxGLCanvas.__init__(self, parent, -1)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_SIZE(self, self.OnSize)
EVT_PAINT(self, self.OnPaint)
self.init = false
def OnEraseBackground(self, event):
@@ -148,6 +150,8 @@ else:
def __init__(self, parent):
wxGLCanvas.__init__(self, parent, -1)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_SIZE(self, self.OnSize)
EVT_PAINT(self, self.OnPaint)
self.init = false
def OnEraseBackground(self, event):

View File

@@ -93,6 +93,7 @@ class TestListCtrlPanel(wxPanel):
self.list.SetItemState(5, wxLIST_STATE_SELECTED, wxLIST_STATE_SELECTED)
self.currentItem = 0
EVT_SIZE(self, self.OnSize)
EVT_LIST_ITEM_SELECTED(self, tID, self.OnItemSelected)
EVT_LIST_DELETE_ITEM(self, tID, self.OnItemDelete)
EVT_LIST_COL_CLICK(self, tID, self.OnColClick)

View File

@@ -53,6 +53,7 @@ class TestMaskWindow(wxScrolledWindow):
self.SetScrollbars(20, 20, 700/20, 460/20)
EVT_PAINT(self, self.OnPaint)
def OnPaint (self, e):

View File

@@ -10,6 +10,7 @@ class MyMiniFrame(wxMiniFrame):
button = wxButton(panel, 1003, "Close Me")
button.SetPosition(wxPoint(15, 15))
EVT_BUTTON(self, 1003, self.OnCloseMe)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseMe(self, event):
self.Close(true)

View File

@@ -17,6 +17,7 @@ class TestSashWindow(wxPanel):
EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP,
self.ID_WINDOW_BOTTOM, self.OnSashDrag)
EVT_SIZE(self, self.OnSize)
# Create some layout windows

View File

@@ -12,9 +12,12 @@ class MyCanvas(wxScrolledWindow):
self.maxHeight = 1000
self.SetBackgroundColour(wxNamedColor("WHITE"))
self.Connect(-1, -1, wxEVT_LEFT_DOWN, self.OnLeftButtonEvent)
self.Connect(-1, -1, wxEVT_LEFT_UP, self.OnLeftButtonEvent)
self.Connect(-1, -1, wxEVT_MOTION, self.OnLeftButtonEvent)
EVT_LEFT_DOWN(self, self.OnLeftButtonEvent)
EVT_LEFT_UP(self, self.OnLeftButtonEvent)
EVT_MOTION(self, self.OnLeftButtonEvent)
EVT_PAINT(self, self.OnPaint)
self.SetCursor(wxStockCursor(wxCURSOR_PENCIL))
bmp = wxBitmap('bitmaps/test2.bmp', wxBITMAP_TYPE_BMP)
@@ -109,7 +112,6 @@ class MyCanvas(wxScrolledWindow):
self.CaptureMouse()
elif event.Dragging():
print event.GetPosition()
dc = wxClientDC(self)
self.PrepareDC(dc)
dc.BeginDrawing()

View File

@@ -10,6 +10,7 @@ class CustomStatusBar(wxStatusBar):
wxStatusBar.__init__(self, parent, -1)
self.SetFieldsCount(3)
self.log = log
EVT_SIZE(self, self.OnSize)
self.SetStatusText("A Custom StatusBar...", 0)
@@ -62,6 +63,7 @@ class TestCustomStatusBar(wxFrame):
self.sb = CustomStatusBar(self, log)
self.SetStatusBar(self.sb)
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.sb.timer.Stop()

View File

@@ -9,7 +9,8 @@ class TestPanel(wxPanel):
self.log = log
wxStaticText(self, -1, "wxTextCtrl", wxPoint(5, 25), wxSize(75, 20))
wxTextCtrl(self, 10, "", wxPoint(80, 25), wxSize(150, 20))
t = wxTextCtrl(self, 10, "Test it out and see", wxPoint(80, 25), wxSize(150, 20))
t.SetInsertionPoint(0)
EVT_TEXT(self, 10, self.EvtText)
wxStaticText(self, -1, "Passsword", wxPoint(5, 50), wxSize(75, 20))
@@ -17,7 +18,8 @@ class TestPanel(wxPanel):
EVT_TEXT(self, 20, self.EvtText)
wxStaticText(self, -1, "Multi-line", wxPoint(5, 75), wxSize(75, 20))
wxTextCtrl(self, 30, "", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
t = wxTextCtrl(self, 30, "How does it work with a long line of text set in the control", wxPoint(80, 75), wxSize(200, 150), wxTE_MULTILINE)
t.SetInsertionPoint(0)
EVT_TEXT(self, 30, self.EvtText)
def EvtText(self, event):

View File

@@ -55,6 +55,7 @@ class TestToolBar(wxFrame):
size=(150,-1), style=wxCB_DROPDOWN))
tb.Realize()
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):

View File

@@ -22,6 +22,7 @@ class MyTreeCtrl(wxTreeCtrl):
class TestTreeCtrlPanel(wxPanel):
def __init__(self, parent, log):
wxPanel.__init__(self, parent, -1)
EVT_SIZE(self, self.OnSize)
self.log = log
tID = NewId()

View File

@@ -24,41 +24,41 @@ _wxSetDictionary(vars())
# Helper function to link python methods to wxWindows virtual
# functions by name.
def _checkForCallback(obj, name, event, theID=-1):
try: cb = getattr(obj, name)
except: pass
else: obj.Connect(theID, -1, event, cb)
## def _checkForCallback(obj, name, event, theID=-1):
## try: cb = getattr(obj, name)
## except: pass
## else: obj.Connect(theID, -1, event, cb)
def _StdWindowCallbacks(win):
_checkForCallback(win, "OnChar", wxEVT_CHAR)
_checkForCallback(win, "OnSize", wxEVT_SIZE)
_checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
_checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
_checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
_checkForCallback(win, "OnPaint", wxEVT_PAINT)
_checkForCallback(win, "OnIdle", wxEVT_IDLE)
## def _StdWindowCallbacks(win):
## _checkForCallback(win, "OnChar", wxEVT_CHAR)
## _checkForCallback(win, "OnSize", wxEVT_SIZE)
## _checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
## _checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
## _checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
## _checkForCallback(win, "OnPaint", wxEVT_PAINT)
## _checkForCallback(win, "OnIdle", wxEVT_IDLE)
def _StdFrameCallbacks(win):
_StdWindowCallbacks(win)
_checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
_checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
_checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
## def _StdFrameCallbacks(win):
## _StdWindowCallbacks(win)
## _checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
## _checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
def _StdDialogCallbacks(win):
_StdWindowCallbacks(win)
_checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
_checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
_checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
_checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
_checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
## def _StdDialogCallbacks(win):
## _StdWindowCallbacks(win)
## _checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
## _checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
## _checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
## _checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
def _StdOnScrollCallbacks(win):
try: cb = getattr(win, "OnScroll")
except: pass
else: EVT_SCROLL(win, cb)
## def _StdOnScrollCallbacks(win):
## try: cb = getattr(win, "OnScroll")
## except: pass
## else: EVT_SCROLL(win, cb)
@@ -529,12 +529,6 @@ def EVT_SPIN_DOWN(win, id, func):
win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
def EVT_SPIN(win, id, func):
win.Connect(id, -1, wxEVT_SCROLL_TOP, func)
win.Connect(id, -1, wxEVT_SCROLL_BOTTOM, func)
win.Connect(id, -1, wxEVT_SCROLL_LINEUP, func)
win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
win.Connect(id, -1, wxEVT_SCROLL_PAGEUP, func)
win.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN, func)
win.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK,func)

View File

@@ -54,7 +54,7 @@ class wxColourDialog : public wxDialog {
public:
wxColourDialog(wxWindow* parent, wxColourData* data = NULL);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxColourData& GetColourData();
int ShowModal();
@@ -71,7 +71,7 @@ public:
long style = 0,
const wxPoint& pos = wxPyDefaultPosition);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetPath();
wxString GetMessage();
@@ -93,7 +93,7 @@ public:
long style = 0,
const wxPoint& pos = wxPyDefaultPosition);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetDirectory();
wxString GetFilename();
@@ -162,7 +162,7 @@ public:
}
}
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
int GetSelection();
wxString GetStringSelection();
@@ -182,7 +182,7 @@ public:
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxPyDefaultPosition);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxString GetValue();
void SetValue(const wxString& value);
@@ -216,7 +216,7 @@ class wxFontDialog : public wxDialog {
public:
wxFontDialog(wxWindow* parent, wxFontData* data);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxFontData& GetFontData();
int ShowModal();
@@ -233,7 +233,7 @@ public:
long style = wxOK | wxCANCEL | wxCENTRE,
const wxPoint& pos = wxPyDefaultPosition);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
int ShowModal();
};

View File

@@ -68,7 +68,7 @@ public:
const wxValidator& validator=wxPyDefaultValidator,
const char* name="control");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Command(wxCommandEvent& event);
wxString GetLabel();
@@ -87,7 +87,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "button");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void SetDefault();
void SetBackgroundColour(const wxColour& colour);
@@ -112,7 +112,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "button");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxBitmap& GetBitmapLabel();
wxBitmap& GetBitmapDisabled();
@@ -161,7 +161,7 @@ public:
const wxValidator& val = wxPyDefaultValidator,
char* name = "checkBox");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool GetValue();
void SetValue(const bool state);
@@ -179,7 +179,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "choice");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
void Clear();
@@ -206,7 +206,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "comboBox");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
@@ -246,7 +246,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "gauge");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetBezelFace();
int GetRange();
@@ -293,7 +293,7 @@ public:
long style = 0,
char* name = "staticText");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxString GetLabel();
void SetLabel(const wxString& label);
@@ -311,7 +311,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listBox");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Append(const wxString& item);
// TODO: void Append(const wxString& item, char* clientData);
@@ -364,7 +364,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listBox");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool IsChecked(int uiIndex);
void Check(int uiIndex, int bCheck = TRUE);
@@ -384,7 +384,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "text");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Clear();
void Copy();
@@ -441,7 +441,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "scrollBar");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetRange();
int GetPageSize();
@@ -482,7 +482,7 @@ public:
long style = 0,
char* name = "staticBitmap");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
const wxBitmap& GetBitmap();
void SetBitmap(const wxBitmap& bitmap);
@@ -503,7 +503,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "radioBox");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void Enable(bool enable);
%name(EnableItem)void Enable(int n, bool enable);
@@ -536,7 +536,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "radioButton");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool GetValue();
void SetValue(bool value);
@@ -554,7 +554,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "slider");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void ClearSel();
void ClearTicks();

View File

@@ -220,7 +220,7 @@ public:
const wxValidator& validator = wxPyDefaultValidator,
char* name = "listCtrl");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool Arrange(int flag = wxLIST_ALIGN_DEFAULT);
bool DeleteItem(long item);
@@ -491,7 +491,7 @@ public:
char* name = "wxTreeCtrl");
void _setSelf(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxTreeCtrl)"
size_t GetCount();
@@ -710,7 +710,7 @@ public:
long style = 0,
char* name = "tabCtrl");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool DeleteAllItems();
bool DeleteItem(int item);

View File

@@ -42,7 +42,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
char* name = "frame");
%pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void Centre(int direction = wxBOTH);
wxStatusBar* CreateStatusBar(int number = 1,
@@ -87,7 +87,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
char* name = "frame");
%pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
};

View File

@@ -523,6 +523,8 @@ public:
void GetDeviceOrigin(int *OUTPUT, int *OUTPUT);
void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
void CalcBoundingBox(int x, int y);
void ResetBoundingBox();
};

View File

@@ -456,8 +456,8 @@ public:
void _setSelf(PyObject* self, PyObject* _class);
%pragma(python) addtomethod = "__init__:self._setSelf(self, wxHtmlWindow)"
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
bool SetPage(const char* source);

View File

@@ -42,7 +42,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const char* name = "frame");
%pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void ActivateNext();
void ActivatePrevious();
@@ -73,7 +73,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
const char* name = "frame");
%pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void Activate();
void Maximize(bool maximize);
@@ -87,8 +87,8 @@ public:
class wxMDIClientWindow : public wxWindow {
public:
wxMDIClientWindow(wxMDIParentFrame* parent, long style = 0);
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
};
//---------------------------------------------------------------------------

View File

@@ -71,7 +71,7 @@ class wxColourDialog(wxColourDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxColourDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -104,7 +104,7 @@ class wxDirDialog(wxDirDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxDirDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -170,7 +170,7 @@ class wxFileDialog(wxFileDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxFileDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -197,7 +197,7 @@ class wxSingleChoiceDialog(wxSingleChoiceDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxSingleChoiceDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -221,7 +221,7 @@ class wxTextEntryDialog(wxTextEntryDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxTextEntryDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -302,7 +302,7 @@ class wxFontDialog(wxFontDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxFontDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -320,7 +320,7 @@ class wxMessageDialog(wxMessageDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(cmndlgsc.new_wxMessageDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)

View File

@@ -30,7 +30,7 @@ class wxControl(wxControlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxControl,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -54,7 +54,7 @@ class wxButton(wxButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxButton,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -97,7 +97,7 @@ class wxBitmapButton(wxBitmapButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxBitmapButton,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -118,7 +118,7 @@ class wxCheckBox(wxCheckBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxCheckBox,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -166,7 +166,7 @@ class wxChoice(wxChoicePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxChoice,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -244,7 +244,7 @@ class wxComboBox(wxComboBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxComboBox,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -283,7 +283,7 @@ class wxGauge(wxGaugePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxGauge,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -332,7 +332,7 @@ class wxStaticText(wxStaticTextPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxStaticText,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -401,7 +401,7 @@ class wxListBox(wxListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxListBox,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -428,7 +428,7 @@ class wxCheckListBox(wxCheckListBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxCheckListBox,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -551,7 +551,7 @@ class wxTextCtrl(wxTextCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxTextCtrl,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -587,7 +587,7 @@ class wxScrollBar(wxScrollBarPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxScrollBar,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -641,7 +641,7 @@ class wxStaticBitmap(wxStaticBitmapPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxStaticBitmap,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -695,7 +695,7 @@ class wxRadioBox(wxRadioBoxPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxRadioBox,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -716,7 +716,7 @@ class wxRadioButton(wxRadioButtonPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxRadioButton,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -788,7 +788,7 @@ class wxSlider(wxSliderPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controlsc.new_wxSlider,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)

View File

@@ -485,7 +485,7 @@ class wxListCtrl(wxListCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controls2c.new_wxListCtrl,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -814,7 +814,7 @@ class wxTreeCtrl(wxTreeCtrlPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(controls2c.new_wxTreeCtrl,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
self._setSelf(self, wxTreeCtrl)

View File

@@ -107,7 +107,7 @@ class wxFrame(wxFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(framesc.new_wxFrame,_args,_kwargs)
self.thisown = 1
wx._StdFrameCallbacks(self)
#wx._StdFrameCallbacks(self)
@@ -122,7 +122,7 @@ class wxMiniFrame(wxMiniFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(framesc.new_wxMiniFrame,_args,_kwargs)
self.thisown = 1
wx._StdFrameCallbacks(self)
#wx._StdFrameCallbacks(self)

View File

@@ -6991,6 +6991,62 @@ static PyObject *_wrap_wxDC_SetAxisOrientation(PyObject *self, PyObject *args, P
return _resultobj;
}
#define wxDC_CalcBoundingBox(_swigobj,_swigarg0,_swigarg1) (_swigobj->CalcBoundingBox(_swigarg0,_swigarg1))
static PyObject *_wrap_wxDC_CalcBoundingBox(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDC * _arg0;
int _arg1;
int _arg2;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self","x","y", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"Oii:wxDC_CalcBoundingBox",_kwnames,&_argo0,&_arg1,&_arg2))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_CalcBoundingBox. Expected _wxDC_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxDC_CalcBoundingBox(_arg0,_arg1,_arg2);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
#define wxDC_ResetBoundingBox(_swigobj) (_swigobj->ResetBoundingBox())
static PyObject *_wrap_wxDC_ResetBoundingBox(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDC * _arg0;
PyObject * _argo0 = 0;
char *_kwnames[] = { "self", NULL };
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"O:wxDC_ResetBoundingBox",_kwnames,&_argo0))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDC_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDC_ResetBoundingBox. Expected _wxDC_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxDC_ResetBoundingBox(_arg0);
wxPy_END_ALLOW_THREADS;
} Py_INCREF(Py_None);
_resultobj = Py_None;
return _resultobj;
}
static void *SwigwxMemoryDCTowxDC(void *ptr) {
wxMemoryDC *src;
wxDC *dest;
@@ -8100,6 +8156,8 @@ static PyMethodDef gdicMethods[] = {
{ "new_wxScreenDC", (PyCFunction) _wrap_new_wxScreenDC, METH_VARARGS | METH_KEYWORDS },
{ "wxMemoryDC_SelectObject", (PyCFunction) _wrap_wxMemoryDC_SelectObject, METH_VARARGS | METH_KEYWORDS },
{ "new_wxMemoryDC", (PyCFunction) _wrap_new_wxMemoryDC, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_ResetBoundingBox", (PyCFunction) _wrap_wxDC_ResetBoundingBox, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_CalcBoundingBox", (PyCFunction) _wrap_wxDC_CalcBoundingBox, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_SetAxisOrientation", (PyCFunction) _wrap_wxDC_SetAxisOrientation, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_GetDeviceOrigin", (PyCFunction) _wrap_wxDC_GetDeviceOrigin, METH_VARARGS | METH_KEYWORDS },
{ "wxDC_SetLogicalOrigin", (PyCFunction) _wrap_wxDC_SetLogicalOrigin, METH_VARARGS | METH_KEYWORDS },

View File

@@ -682,6 +682,12 @@ class wxDCPtr :
def SetAxisOrientation(self, *_args, **_kwargs):
val = apply(gdic.wxDC_SetAxisOrientation,(self,) + _args, _kwargs)
return val
def CalcBoundingBox(self, *_args, **_kwargs):
val = apply(gdic.wxDC_CalcBoundingBox,(self,) + _args, _kwargs)
return val
def ResetBoundingBox(self, *_args, **_kwargs):
val = apply(gdic.wxDC_ResetBoundingBox,(self,) + _args, _kwargs)
return val
def __repr__(self):
return "<C wxDC instance at %s>" % (self.this,)
class wxDC(wxDCPtr):

View File

@@ -5888,6 +5888,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMDIParentFrame","_class_wxMDIParentFrame",0},
{ "_class_wxTreeEvent","_wxTreeEvent",0},
{ "_class_wxDirDialog","_wxDirDialog",0},
{ "_wxTimeSpan","_class_wxTimeSpan",0},
{ "_wxFocusEvent","_class_wxFocusEvent",0},
{ "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
{ "_class_wxTimerEvent","_wxTimerEvent",0},
@@ -5940,6 +5941,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxWindow","_wxPyHtmlWindow",SwigwxPyHtmlWindowTowxWindow},
{ "_class_wxWindow","_wxWindow",0},
{ "_wxSplitterWindow","_class_wxSplitterWindow",0},
{ "_wxDateSpan","_class_wxDateSpan",0},
{ "_class_wxStaticText","_wxStaticText",0},
{ "_wxPrintDialogData","_class_wxPrintDialogData",0},
{ "_class_wxFont","_wxFont",0},
@@ -6069,6 +6071,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxMDIParentFrame","_wxMDIParentFrame",0},
{ "_wxPyTreeItemData","_class_wxPyTreeItemData",0},
{ "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0},
{ "_class_wxTimeSpan","_wxTimeSpan",0},
{ "_wxHtmlDCRenderer","_class_wxHtmlDCRenderer",0},
{ "_class_wxPaintDC","_wxPaintDC",0},
{ "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0},
@@ -6108,6 +6111,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxSplitterWindow","_wxSplitterWindow",0},
{ "_wxPreviewFrame","_class_wxPreviewFrame",0},
{ "_wxSizer","_class_wxSizer",0},
{ "_class_wxDateSpan","_wxDateSpan",0},
{ "_class_wxShowEvent","_wxShowEvent",0},
{ "_class_wxPyTipProvider","_wxPyTipProvider",0},
{ "_class_wxPCXHandler","_wxPCXHandler",0},

View File

@@ -570,8 +570,8 @@ class wxHtmlWindow(wxHtmlWindowPtr):
self.this = apply(htmlc.new_wxHtmlWindow,_args,_kwargs)
self.thisown = 1
self._setSelf(self, wxHtmlWindow)
wx._StdWindowCallbacks(self)
wx._StdOnScrollCallbacks(self)
#wx._StdWindowCallbacks(self)
#wx._StdOnScrollCallbacks(self)

View File

@@ -2871,6 +2871,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_wxMDIParentFrame","_class_wxMDIParentFrame",0},
{ "_class_wxTreeEvent","_wxTreeEvent",0},
{ "_class_wxDirDialog","_wxDirDialog",0},
{ "_wxTimeSpan","_class_wxTimeSpan",0},
{ "_wxFocusEvent","_class_wxFocusEvent",0},
{ "_wxMaximizeEvent","_class_wxMaximizeEvent",0},
{ "_class_wxTimerEvent","_wxTimerEvent",0},
@@ -2921,6 +2922,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxWindow","_wxHtmlHelpFrame",SwigwxHtmlHelpFrameTowxWindow},
{ "_class_wxWindow","_wxWindow",0},
{ "_wxSplitterWindow","_class_wxSplitterWindow",0},
{ "_wxDateSpan","_class_wxDateSpan",0},
{ "_class_wxStaticText","_wxStaticText",0},
{ "_wxPrintDialogData","_class_wxPrintDialogData",0},
{ "_class_wxFont","_wxFont",0},
@@ -3049,6 +3051,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxMDIParentFrame","_wxMDIParentFrame",0},
{ "_wxPyTreeItemData","_class_wxPyTreeItemData",0},
{ "_wxStaticBoxSizer","_class_wxStaticBoxSizer",0},
{ "_class_wxTimeSpan","_wxTimeSpan",0},
{ "_wxHtmlDCRenderer","_class_wxHtmlDCRenderer",0},
{ "_class_wxPaintDC","_wxPaintDC",0},
{ "_class_wxSysColourChangedEvent","_wxSysColourChangedEvent",0},
@@ -3089,6 +3092,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
{ "_class_wxSplitterWindow","_wxSplitterWindow",0},
{ "_wxPreviewFrame","_class_wxPreviewFrame",0},
{ "_wxSizer","_class_wxSizer",0},
{ "_class_wxDateSpan","_wxDateSpan",0},
{ "_class_wxShowEvent","_wxShowEvent",0},
{ "_class_wxPyTipProvider","_wxPyTipProvider",0},
{ "_class_wxPCXHandler","_wxPCXHandler",0},

View File

@@ -57,7 +57,7 @@ class wxMDIParentFrame(wxMDIParentFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(mdic.new_wxMDIParentFrame,_args,_kwargs)
self.thisown = 1
wx._StdFrameCallbacks(self)
#wx._StdFrameCallbacks(self)
@@ -81,7 +81,7 @@ class wxMDIChildFrame(wxMDIChildFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(mdic.new_wxMDIChildFrame,_args,_kwargs)
self.thisown = 1
wx._StdFrameCallbacks(self)
#wx._StdFrameCallbacks(self)
@@ -96,8 +96,8 @@ class wxMDIClientWindow(wxMDIClientWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(mdic.new_wxMDIClientWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
wx._StdOnScrollCallbacks(self)
#wx._StdWindowCallbacks(self)
#wx._StdOnScrollCallbacks(self)

View File

@@ -215,7 +215,7 @@ class wxPageSetupDialog(wxPageSetupDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(printfwc.new_wxPageSetupDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -325,7 +325,7 @@ class wxPrintDialog(wxPrintDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(printfwc.new_wxPrintDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -508,7 +508,7 @@ class wxPreviewFrame(wxPreviewFramePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(printfwc.new_wxPreviewFrame,_args,_kwargs)
self.thisown = 1
wx._StdFrameCallbacks(self)
#wx._StdFrameCallbacks(self)

View File

@@ -51,7 +51,7 @@ class wxStatusBar(wxStatusBarPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(stattoolc.new_wxStatusBar,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -308,7 +308,7 @@ class wxToolBar(wxToolBarPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(stattoolc.new_wxToolBar,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -327,7 +327,7 @@ class wxToolBarSimple(wxToolBarSimplePtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(stattoolc.new_wxToolBarSimple,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)

View File

@@ -6795,6 +6795,94 @@ static PyObject *_wrap_wxDateSpan_GetTotalDays(PyObject *self, PyObject *args, P
return _resultobj;
}
#define wxDateSpan_Add(_swigobj,_swigarg0) (_swigobj->Add(_swigarg0))
static PyObject *_wrap_wxDateSpan_Add(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDateSpan * _result;
wxDateSpan * _arg0;
wxDateSpan * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","other", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateSpan_Add",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateSpan_Add. Expected _wxDateSpan_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Add. Expected _wxDateSpan_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxDateSpan & _result_ref = wxDateSpan_Add(_arg0,*_arg1);
_result = (wxDateSpan *) &_result_ref;
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxDateSpan_Subtract(_swigobj,_swigarg0) (_swigobj->Subtract(_swigarg0))
static PyObject *_wrap_wxDateSpan_Subtract(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
wxDateSpan * _result;
wxDateSpan * _arg0;
wxDateSpan * _arg1;
PyObject * _argo0 = 0;
PyObject * _argo1 = 0;
char *_kwnames[] = { "self","other", NULL };
char _ptemp[128];
self = self;
if(!PyArg_ParseTupleAndKeywords(args,kwargs,"OO:wxDateSpan_Subtract",_kwnames,&_argo0,&_argo1))
return NULL;
if (_argo0) {
if (_argo0 == Py_None) { _arg0 = NULL; }
else if (SWIG_GetPtrObj(_argo0,(void **) &_arg0,"_wxDateSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 1 of wxDateSpan_Subtract. Expected _wxDateSpan_p.");
return NULL;
}
}
if (_argo1) {
if (_argo1 == Py_None) { _arg1 = NULL; }
else if (SWIG_GetPtrObj(_argo1,(void **) &_arg1,"_wxDateSpan_p")) {
PyErr_SetString(PyExc_TypeError,"Type error in argument 2 of wxDateSpan_Subtract. Expected _wxDateSpan_p.");
return NULL;
}
}
{
wxPy_BEGIN_ALLOW_THREADS;
wxDateSpan & _result_ref = wxDateSpan_Subtract(_arg0,*_arg1);
_result = (wxDateSpan *) &_result_ref;
wxPy_END_ALLOW_THREADS;
} if (_result) {
SWIG_MakePtr(_ptemp, (char *) _result,"_wxDateSpan_p");
_resultobj = Py_BuildValue("s",_ptemp);
} else {
Py_INCREF(Py_None);
_resultobj = Py_None;
}
return _resultobj;
}
#define wxDateSpan_Neg(_swigobj) (_swigobj->Neg())
static PyObject *_wrap_wxDateSpan_Neg(PyObject *self, PyObject *args, PyObject *kwargs) {
PyObject * _resultobj;
@@ -7039,6 +7127,8 @@ static PyMethodDef utilscMethods[] = {
{ "wxDateSpan___add__", (PyCFunction) _wrap_wxDateSpan___add__, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_Multiply", (PyCFunction) _wrap_wxDateSpan_Multiply, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_Neg", (PyCFunction) _wrap_wxDateSpan_Neg, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_Subtract", (PyCFunction) _wrap_wxDateSpan_Subtract, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_Add", (PyCFunction) _wrap_wxDateSpan_Add, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_GetTotalDays", (PyCFunction) _wrap_wxDateSpan_GetTotalDays, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_GetDays", (PyCFunction) _wrap_wxDateSpan_GetDays, METH_VARARGS | METH_KEYWORDS },
{ "wxDateSpan_GetWeeks", (PyCFunction) _wrap_wxDateSpan_GetWeeks, METH_VARARGS | METH_KEYWORDS },

View File

@@ -737,6 +737,14 @@ class wxDateSpanPtr :
def GetTotalDays(self, *_args, **_kwargs):
val = apply(utilsc.wxDateSpan_GetTotalDays,(self,) + _args, _kwargs)
return val
def Add(self, *_args, **_kwargs):
val = apply(utilsc.wxDateSpan_Add,(self,) + _args, _kwargs)
if val: val = wxDateSpanPtr(val)
return val
def Subtract(self, *_args, **_kwargs):
val = apply(utilsc.wxDateSpan_Subtract,(self,) + _args, _kwargs)
if val: val = wxDateSpanPtr(val)
return val
def Neg(self, *_args, **_kwargs):
val = apply(utilsc.wxDateSpan_Neg,(self,) + _args, _kwargs)
if val: val = wxDateSpanPtr(val)

View File

@@ -505,7 +505,7 @@ class wxWindow(wxWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -537,7 +537,7 @@ class wxPanel(wxPanelPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxPanel,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -588,7 +588,7 @@ class wxDialog(wxDialogPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxDialog,_args,_kwargs)
self.thisown = 1
wx._StdDialogCallbacks(self)
#wx._StdDialogCallbacks(self)
@@ -649,8 +649,8 @@ class wxScrolledWindow(wxScrolledWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windowsc.new_wxScrolledWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
wx._StdOnScrollCallbacks(self)
#wx._StdWindowCallbacks(self)
#wx._StdOnScrollCallbacks(self)

View File

@@ -104,7 +104,7 @@ class wxNotebook(wxNotebookPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows2c.new_wxNotebook,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -204,7 +204,7 @@ class wxSplitterWindow(wxSplitterWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows2c.new_wxSplitterWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)

View File

@@ -114,7 +114,7 @@ class wxSashWindow(wxSashWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows3c.new_wxSashWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
#wx._StdWindowCallbacks(self)
@@ -214,9 +214,9 @@ class wxSashLayoutWindow(wxSashLayoutWindowPtr):
def __init__(self,*_args,**_kwargs):
self.this = apply(windows3c.new_wxSashLayoutWindow,_args,_kwargs)
self.thisown = 1
wx._StdWindowCallbacks(self)
wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)
wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)
#wx._StdWindowCallbacks(self)
#wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)
#wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)

View File

@@ -858,41 +858,41 @@ _wxSetDictionary(vars())
# Helper function to link python methods to wxWindows virtual
# functions by name.
def _checkForCallback(obj, name, event, theID=-1):
try: cb = getattr(obj, name)
except: pass
else: obj.Connect(theID, -1, event, cb)
## def _checkForCallback(obj, name, event, theID=-1):
## try: cb = getattr(obj, name)
## except: pass
## else: obj.Connect(theID, -1, event, cb)
def _StdWindowCallbacks(win):
_checkForCallback(win, "OnChar", wxEVT_CHAR)
_checkForCallback(win, "OnSize", wxEVT_SIZE)
_checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
_checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
_checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
_checkForCallback(win, "OnPaint", wxEVT_PAINT)
_checkForCallback(win, "OnIdle", wxEVT_IDLE)
## def _StdWindowCallbacks(win):
## _checkForCallback(win, "OnChar", wxEVT_CHAR)
## _checkForCallback(win, "OnSize", wxEVT_SIZE)
## _checkForCallback(win, "OnEraseBackground", wxEVT_ERASE_BACKGROUND)
## _checkForCallback(win, "OnSysColourChanged", wxEVT_SYS_COLOUR_CHANGED)
## _checkForCallback(win, "OnInitDialog", wxEVT_INIT_DIALOG)
## _checkForCallback(win, "OnPaint", wxEVT_PAINT)
## _checkForCallback(win, "OnIdle", wxEVT_IDLE)
def _StdFrameCallbacks(win):
_StdWindowCallbacks(win)
_checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
_checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
_checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
## def _StdFrameCallbacks(win):
## _StdWindowCallbacks(win)
## _checkForCallback(win, "OnActivate", wxEVT_ACTIVATE)
## _checkForCallback(win, "OnMenuHighlight", wxEVT_MENU_HIGHLIGHT)
## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
def _StdDialogCallbacks(win):
_StdWindowCallbacks(win)
_checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
_checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
_checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
_checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
_checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
## def _StdDialogCallbacks(win):
## _StdWindowCallbacks(win)
## _checkForCallback(win, "OnOk", wxEVT_COMMAND_BUTTON_CLICKED, wxID_OK)
## _checkForCallback(win, "OnApply", wxEVT_COMMAND_BUTTON_CLICKED, wxID_APPLY)
## _checkForCallback(win, "OnCancel", wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL)
## _checkForCallback(win, "OnCloseWindow", wxEVT_CLOSE_WINDOW)
## _checkForCallback(win, "OnCharHook", wxEVT_CHAR_HOOK)
def _StdOnScrollCallbacks(win):
try: cb = getattr(win, "OnScroll")
except: pass
else: EVT_SCROLL(win, cb)
## def _StdOnScrollCallbacks(win):
## try: cb = getattr(win, "OnScroll")
## except: pass
## else: EVT_SCROLL(win, cb)
@@ -1363,12 +1363,6 @@ def EVT_SPIN_DOWN(win, id, func):
win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
def EVT_SPIN(win, id, func):
win.Connect(id, -1, wxEVT_SCROLL_TOP, func)
win.Connect(id, -1, wxEVT_SCROLL_BOTTOM, func)
win.Connect(id, -1, wxEVT_SCROLL_LINEUP, func)
win.Connect(id, -1, wxEVT_SCROLL_LINEDOWN, func)
win.Connect(id, -1, wxEVT_SCROLL_PAGEUP, func)
win.Connect(id, -1, wxEVT_SCROLL_PAGEDOWN, func)
win.Connect(id, -1, wxEVT_SCROLL_THUMBTRACK,func)

View File

@@ -142,7 +142,7 @@ class wxPageSetupDialog : public wxDialog {
public:
wxPageSetupDialog(wxWindow* parent, wxPageSetupDialogData* data = NULL);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxPageSetupDialogData& GetPageSetupData();
int ShowModal();
@@ -189,7 +189,7 @@ class wxPrintDialog : public wxDialog {
public:
wxPrintDialog(wxWindow* parent, wxPrintDialogData* data = NULL);
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
wxPrintDialogData& GetPrintDialogData();
%new wxDC* GetPrintDC();
@@ -339,7 +339,7 @@ public:
long style = wxDEFAULT_FRAME_STYLE,
char* name = "frame");
%pragma(python) addtomethod = "__init__:wx._StdFrameCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdFrameCallbacks(self)"
void Initialize();

View File

@@ -42,7 +42,7 @@ public:
long style = wxST_SIZEGRIP,
char* name = "statusBar");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%addmethods {
%new wxRect* GetFieldRect(long item) {
@@ -278,7 +278,7 @@ public:
long style = wxNO_BORDER | wxTB_HORIZONTAL,
const char* name = wxToolBarNameStr);
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
};
@@ -295,7 +295,7 @@ public:
long style = wxNO_BORDER | wxTB_HORIZONTAL,
const char* name = wxToolBarNameStr);
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y);
};
@@ -347,7 +347,7 @@ public:
long style = wxTB_HORIZONTAL | wxNO_BORDER,
char* name = "toolBar");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool AddControl(wxControl * control);

View File

@@ -993,13 +993,13 @@ public:
// ------------------------------------------------------------------------
#ifdef MISSING
// add another wxDateSpan to us
inline wxDateSpan& Add(const wxDateSpan& other);
// subtract another wxDateSpan from us
inline wxDateSpan& Subtract(const wxDateSpan& other);
#endif
// inverse the sign of this timespan
inline wxDateSpan& Neg();

View File

@@ -165,7 +165,7 @@ public:
long style = 0,
char* name = "panel");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void CaptureMouse();
void Center(int direction = wxBOTH);
@@ -399,7 +399,7 @@ public:
long style = wxTAB_TRAVERSAL,
const char* name = "panel");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
void InitDialog();
wxButton* GetDefaultItem();
@@ -427,7 +427,7 @@ public:
long style = wxDEFAULT_DIALOG_STYLE,
const char* name = "dialogBox");
%pragma(python) addtomethod = "__init__:wx._StdDialogCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdDialogCallbacks(self)"
void Centre(int direction = wxBOTH);
void EndModal(int retCode);
@@ -455,8 +455,8 @@ public:
long style = wxHSCROLL | wxVSCROLL,
char* name = "scrolledWindow");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._StdOnScrollCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdOnScrollCallbacks(self)"
void EnableScrolling(bool xScrolling, bool yScrolling);
int GetScrollPageSize(int orient);

View File

@@ -80,16 +80,16 @@ public:
long style=0,
char* name="grid");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnSelectCell', wxEVT_GRID_SELECT_CELL)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCreateCell', wxEVT_GRID_CREATE_CELL)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnChangeLabels', wxEVT_GRID_CHANGE_LABELS)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnChangeSelectionLabel', wxEVT_GRID_CHANGE_SEL_LABEL)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellChange', wxEVT_GRID_CELL_CHANGE)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellLeftClick', wxEVT_GRID_CELL_LCLICK)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCellRightClick', wxEVT_GRID_CELL_RCLICK)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnLabelLeftClick', wxEVT_GRID_LABEL_LCLICK)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnLabelRightClick', wxEVT_GRID_LABEL_RCLICK)"
void AdjustScrollbars();
@@ -261,7 +261,7 @@ public:
long style = 0,
char* name = "notebook");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetPageCount();
int SetSelection(int nPage);
@@ -325,7 +325,7 @@ public:
long style=wxSP_3D|wxCLIP_CHILDREN,
char* name = "splitterWindow");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
int GetBorderSize();
int GetMinimumPaneSize();

View File

@@ -76,7 +76,7 @@ public:
long style = wxCLIP_CHILDREN | wxSW_3D,
const char* name = "sashWindow");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
bool GetSashVisible(wxSashEdgePosition edge);
int GetDefaultBorderSize();
@@ -155,9 +155,9 @@ public:
long style = wxCLIP_CHILDREN | wxSW_3D,
const char* name = "layoutWindow");
%pragma(python) addtomethod = "__init__:wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)"
%pragma(python) addtomethod = "__init__:wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)"
%pragma(python) addtomethod = "__init__:#wx._StdWindowCallbacks(self)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnCalculateLayout', wxEVT_CALCULATE_LAYOUT)"
%pragma(python) addtomethod = "__init__:#wx._checkForCallback(self, 'OnQueryLayoutInfo', wxEVT_QUERY_LAYOUT_INFO)"
wxLayoutAlignment GetAlignment();

View File

@@ -84,6 +84,8 @@ class wxGenButton(wxControl):
EVT_KILL_FOCUS(self, self.OnLoseFocus)
EVT_KEY_DOWN(self, self.OnKeyDown)
EVT_KEY_UP(self, self.OnKeyUp)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_PAINT(self, self.OnPaint)
def SetBestSize(self, size=None):

View File

@@ -394,6 +394,9 @@ class wxCalendar(wxWindow):
self.size = None
self.set_day = None
EVT_PAINT(self, self.OnPaint)
# control some of the main calendar attributes
def HideTitle(self):
@@ -523,7 +526,7 @@ class wxCalendar(wxWindow):
for key in self.rg.keys():
val = self.rg[key]
ms_rect = wxRect(mx, my, 1, 1)
if wxIntersectRect(ms_rect, val) != None:
if wxIntersectRect(ms_rect, val) is not None:
result = self.TestDay(key)
return result
return None

View File

@@ -48,6 +48,7 @@ class wxMultipleChoiceDialog(wxDialog):
self.SetAutoLayout(TRUE)
self.lst = lst
self.Layout()
EVT_SIZE(self, self.OnSize)
def OnSize(self, event):
self.Layout()

View File

@@ -111,6 +111,8 @@ class wxEditor(wxScrolledWindow):
EVT_LEFT_DOWN(self, self.OnMouseClick)
EVT_RIGHT_DOWN(self, self.OnMouseClick)
EVT_SCROLLWIN(self, self.OnScroll)
EVT_CHAR(self, self.OnChar)
EVT_PAINT(self, self.OnPaint)
self.o_cx = self.cx
self.o_cy = self.cy

View File

@@ -319,6 +319,7 @@ if __name__ == "__main__":
class DemoFrame( wxFrame ):
def __init__(self, parent):
wxFrame.__init__(self, parent, 2400, "File entry with browse", size=(500,260) )
EVT_CLOSE(self, self.OnCloseWindow)
panel = wxPanel (self,-1)
innerbox = wxBoxSizer(wxVERTICAL)
control = FileBrowseButton(

View File

@@ -200,6 +200,7 @@ if __name__=='__main__':
def __init__(self, parent):
wxFrame.__init__(self, parent, -1, 'Test Layout Constraints',
wxPyDefaultPosition, wxSize(500, 300))
EVT_CLOSE(self, self.OnCloseWindow)
self.SetAutoLayout(true)
EVT_BUTTON(self, 100, self.OnButton)

View File

@@ -769,6 +769,9 @@ class wxMVCTree(wxScrolledWindow):
EVT_MOUSE_EVENTS(self, self.OnMouse)
EVT_KEY_DOWN(self, self.OnKeyDown)
self.doubleBuffered = true
EVT_SIZE(self, self.OnSize)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_PAINT(self, self.OnPaint)
def Refresh(self):

View File

@@ -155,7 +155,8 @@ class PyShellOutput(wxPanel):
# refreshes are annoying
self.in_batch =0
self.dirty =0
EVT_SIZE(self, self.OnSize)
EVT_IDLE(self, self.OnIdle)
def OnSize(self, event):
self.client.SetSize(self.GetClientSize())
@@ -248,6 +249,7 @@ class PyShell(wxPanel):
splitter.SetMinimumPaneSize(20)
self.splitter =splitter
EVT_SET_FOCUS(self, self.OnSetFocus)
EVT_SIZE(self, self.OnSize)
def OnSetFocus(self, event):
self.input.SetFocus()

View File

@@ -74,6 +74,8 @@ class SplashScreen(wxFrame):
self.timer = SplashTimer(callback)
self.timer.Start(duration, 1) # one-shot only
EVT_LEFT_DOWN(self, self.OnMouseClick)
EVT_CLOSE(self, self.OnCloseWindow)
EVT_PAINT(self, self.OnPaint)
def OnPaint(self, event):
dc = wxPaintDC(self)

View File

@@ -55,6 +55,9 @@ class wxVTKRenderWindow(wxScrolledWindow):
EVT_RIGHT_UP (self, self.Release)
EVT_MOTION (self, self.MouseMotion)
EVT_ERASE_BACKGROUND(self, self.OnEraseBackground)
EVT_PAINT(self, self.OnPaint)
def GetRenderer(self):
self.renderWindow.GetRenderers().InitTraversal()

View File

@@ -176,6 +176,7 @@ class PlotCanvas(wx.wxWindow):
self.SetBackgroundColour(wx.wxNamedColour("white"))
wx.EVT_SIZE(self,self.reconfigure)
wx.EVT_PAINT(self, self.OnPaint)
self._setsize()
self.last_draw = None
# self.font = self._testFont(font)
@@ -446,8 +447,6 @@ Are you sure you want to do this?""", "Danger!", wx.wxYES_NO)
about = wx.wxMessageDialog(self, __doc__, "About...", wx.wxOK)
about.ShowModal()
def OnCloseWindow(self, event):
self.Destroy()
class MyApp(wx.wxApp):