Fixed a bunch of leaking references in how the callbacks deal with
objects. Should be MUCH better now. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8887 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
2d5e89e1cd
commit
de20db997d
@ -31,6 +31,8 @@ object, (usually a window.)
|
|||||||
|
|
||||||
Added wxNotifyEvent.Allow()
|
Added wxNotifyEvent.Allow()
|
||||||
|
|
||||||
|
Fixed GOBS of reference leaks.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
New in 2.2.2
|
New in 2.2.2
|
||||||
|
@ -40,9 +40,14 @@ elseiff "%1" == "f" then
|
|||||||
shift
|
shift
|
||||||
set CMD=%SETUP% %FLAGS% FINAL=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
|
set CMD=%SETUP% %FLAGS% FINAL=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
|
rem "h" --> HYBRID
|
||||||
|
elseiff "%1" == "h" then
|
||||||
|
shift
|
||||||
|
set CMD=%SETUP% %FLAGS% HYBRID=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
|
|
||||||
rem (no command arg) --> normal build for development
|
rem (no command arg) --> normal build for development
|
||||||
else
|
else
|
||||||
set CMD=%SETUP% %FLAGS% HYBRID=1 build_ext --inplace %1 %2 %3 %4 %5 %6 %7 %8 %9
|
set CMD=%SETUP% %FLAGS% HYBRID=0 build_ext --inplace --debug %1 %2 %3 %4 %5 %6 %7 %8 %9
|
||||||
endiff
|
endiff
|
||||||
|
|
||||||
|
|
||||||
|
@ -855,6 +855,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -1037,6 +1038,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -473,6 +473,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
|
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
@ -661,6 +662,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -8658,6 +8658,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -8838,6 +8839,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -2305,6 +2305,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -2488,6 +2489,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -12875,6 +12875,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -13087,6 +13088,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -8215,6 +8215,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
|
{ "_class_wxPyCircleShape","_wxPyCircleShape",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
@ -8422,6 +8423,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -8823,6 +8823,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -9006,6 +9007,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxGauge","_class_wxGauge",0},
|
{ "_wxGauge","_class_wxGauge",0},
|
||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
|
{ "_class_wxCommandEvent","_class_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
|
||||||
{ "_class_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
|
{ "_class_wxCommandEvent","_wxStyledTextEvent",SwigwxStyledTextEventTowxCommandEvent},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
|
@ -19,7 +19,7 @@ class MyParentFrame(wxMDIParentFrame):
|
|||||||
menubar.Append(menu, "&File")
|
menubar.Append(menu, "&File")
|
||||||
self.SetMenuBar(menubar)
|
self.SetMenuBar(menubar)
|
||||||
|
|
||||||
#self.CreateStatusBar()
|
self.CreateStatusBar()
|
||||||
|
|
||||||
EVT_MENU(self, 5000, self.OnNewWindow)
|
EVT_MENU(self, 5000, self.OnNewWindow)
|
||||||
EVT_MENU(self, 5001, self.OnExit)
|
EVT_MENU(self, 5001, self.OnExit)
|
||||||
|
140
wxPython/demo/MDISashDemo.py
Normal file
140
wxPython/demo/MDISashDemo.py
Normal file
@ -0,0 +1,140 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
from wxPython.wx import *
|
||||||
|
from wxScrolledWindow import MyCanvas
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyParentFrame(wxMDIParentFrame):
|
||||||
|
ID_WINDOW_TOP = 5100
|
||||||
|
ID_WINDOW_LEFT1 = 5101
|
||||||
|
ID_WINDOW_LEFT2 = 5102
|
||||||
|
ID_WINDOW_BOTTOM = 5103
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
wxMDIParentFrame.__init__(self, None, -1, "MDI Parent", size=(600,400),
|
||||||
|
style = wxDEFAULT_FRAME_STYLE | wxHSCROLL | wxVSCROLL)
|
||||||
|
|
||||||
|
self.winCount = 0
|
||||||
|
menu = wxMenu()
|
||||||
|
menu.Append(5000, "&New Window")
|
||||||
|
menu.AppendSeparator()
|
||||||
|
menu.Append(5001, "E&xit")
|
||||||
|
|
||||||
|
menubar = wxMenuBar()
|
||||||
|
menubar.Append(menu, "&File")
|
||||||
|
self.SetMenuBar(menubar)
|
||||||
|
|
||||||
|
#self.CreateStatusBar()
|
||||||
|
|
||||||
|
EVT_MENU(self, 5000, self.OnNewWindow)
|
||||||
|
EVT_MENU(self, 5001, self.OnExit)
|
||||||
|
|
||||||
|
|
||||||
|
EVT_SASH_DRAGGED_RANGE(self,
|
||||||
|
self.ID_WINDOW_TOP, self.ID_WINDOW_BOTTOM,
|
||||||
|
self.OnSashDrag)
|
||||||
|
EVT_SIZE(self, self.OnSize)
|
||||||
|
|
||||||
|
|
||||||
|
# Create some layout windows
|
||||||
|
# A window like a toolbar
|
||||||
|
win = wxSashLayoutWindow(self, self.ID_WINDOW_TOP, style = wxNO_BORDER|wxSW_3D)
|
||||||
|
win.SetDefaultSize((1000, 30))
|
||||||
|
win.SetOrientation(wxLAYOUT_HORIZONTAL)
|
||||||
|
win.SetAlignment(wxLAYOUT_TOP)
|
||||||
|
win.SetBackgroundColour(wxColour(255, 0, 0))
|
||||||
|
win.SetSashVisible(wxSASH_BOTTOM, true)
|
||||||
|
|
||||||
|
self.topWindow = win
|
||||||
|
|
||||||
|
|
||||||
|
# A window like a statusbar
|
||||||
|
win = wxSashLayoutWindow(self, self.ID_WINDOW_BOTTOM, style = wxNO_BORDER|wxSW_3D)
|
||||||
|
win.SetDefaultSize((1000, 30))
|
||||||
|
win.SetOrientation(wxLAYOUT_HORIZONTAL)
|
||||||
|
win.SetAlignment(wxLAYOUT_BOTTOM)
|
||||||
|
win.SetBackgroundColour(wxColour(0, 0, 255))
|
||||||
|
win.SetSashVisible(wxSASH_TOP, true)
|
||||||
|
|
||||||
|
self.bottomWindow = win
|
||||||
|
|
||||||
|
|
||||||
|
# A window to the left of the client window
|
||||||
|
win = wxSashLayoutWindow(self, self.ID_WINDOW_LEFT1, style = wxNO_BORDER|wxSW_3D)
|
||||||
|
win.SetDefaultSize((120, 1000))
|
||||||
|
win.SetOrientation(wxLAYOUT_VERTICAL)
|
||||||
|
win.SetAlignment(wxLAYOUT_LEFT)
|
||||||
|
win.SetBackgroundColour(wxColour(0, 255, 0))
|
||||||
|
win.SetSashVisible(wxSASH_RIGHT, TRUE)
|
||||||
|
win.SetExtraBorderSize(10)
|
||||||
|
textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize,
|
||||||
|
wxTE_MULTILINE|wxSUNKEN_BORDER)
|
||||||
|
textWindow.SetValue("A sub window")
|
||||||
|
|
||||||
|
self.leftWindow1 = win
|
||||||
|
|
||||||
|
|
||||||
|
# Another window to the left of the client window
|
||||||
|
win = wxSashLayoutWindow(self, self.ID_WINDOW_LEFT2, style = wxNO_BORDER|wxSW_3D)
|
||||||
|
win.SetDefaultSize((120, 1000))
|
||||||
|
win.SetOrientation(wxLAYOUT_VERTICAL)
|
||||||
|
win.SetAlignment(wxLAYOUT_LEFT)
|
||||||
|
win.SetBackgroundColour(wxColour(0, 255, 255))
|
||||||
|
win.SetSashVisible(wxSASH_RIGHT, TRUE)
|
||||||
|
|
||||||
|
self.leftWindow2 = win
|
||||||
|
|
||||||
|
|
||||||
|
def OnSashDrag(self, event):
|
||||||
|
if event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE:
|
||||||
|
return
|
||||||
|
|
||||||
|
eID = event.GetId()
|
||||||
|
if eID == self.ID_WINDOW_TOP:
|
||||||
|
self.topWindow.SetDefaultSize(wxSize(1000, event.GetDragRect().height))
|
||||||
|
|
||||||
|
elif eID == self.ID_WINDOW_LEFT1:
|
||||||
|
self.leftWindow1.SetDefaultSize(wxSize(event.GetDragRect().width, 1000))
|
||||||
|
|
||||||
|
|
||||||
|
elif eID == self.ID_WINDOW_LEFT2:
|
||||||
|
self.leftWindow2.SetDefaultSize(wxSize(event.GetDragRect().width, 1000))
|
||||||
|
|
||||||
|
elif eID == self.ID_WINDOW_BOTTOM:
|
||||||
|
self.bottomWindow.SetDefaultSize(wxSize(1000, event.GetDragRect().height))
|
||||||
|
|
||||||
|
wxLayoutAlgorithm().LayoutMDIFrame(self)
|
||||||
|
self.GetClientWindow().Refresh()
|
||||||
|
|
||||||
|
|
||||||
|
def OnSize(self, event):
|
||||||
|
wxLayoutAlgorithm().LayoutMDIFrame(self)
|
||||||
|
|
||||||
|
|
||||||
|
def OnExit(self, evt):
|
||||||
|
self.Close(true)
|
||||||
|
|
||||||
|
|
||||||
|
def OnNewWindow(self, evt):
|
||||||
|
self.winCount = self.winCount + 1
|
||||||
|
win = wxMDIChildFrame(self, -1, "Child Window: %d" % self.winCount)
|
||||||
|
canvas = MyCanvas(win)
|
||||||
|
win.Show(true)
|
||||||
|
|
||||||
|
|
||||||
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
|
class MyApp(wxApp):
|
||||||
|
def OnInit(self):
|
||||||
|
frame = MyParentFrame()
|
||||||
|
frame.Show(true)
|
||||||
|
self.SetTopWindow(frame)
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
app = MyApp(0)
|
||||||
|
app.MainLoop()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -15,6 +15,9 @@ class TestSashWindow(wxPanel):
|
|||||||
|
|
||||||
self.log = log
|
self.log = log
|
||||||
|
|
||||||
|
# will accupy the space not uised by the Layout Algorithm
|
||||||
|
self.remainingSpace = wxPanel(self, -1, style=wxSUNKEN_BORDER)
|
||||||
|
|
||||||
EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP,
|
EVT_SASH_DRAGGED_RANGE(self, self.ID_WINDOW_TOP,
|
||||||
self.ID_WINDOW_BOTTOM, self.OnSashDrag)
|
self.ID_WINDOW_BOTTOM, self.OnSashDrag)
|
||||||
EVT_SIZE(self, self.OnSize)
|
EVT_SIZE(self, self.OnSize)
|
||||||
@ -56,10 +59,9 @@ class TestSashWindow(wxPanel):
|
|||||||
win.SetBackgroundColour(wxColour(0, 255, 0))
|
win.SetBackgroundColour(wxColour(0, 255, 0))
|
||||||
win.SetSashVisible(wxSASH_RIGHT, TRUE)
|
win.SetSashVisible(wxSASH_RIGHT, TRUE)
|
||||||
win.SetExtraBorderSize(10)
|
win.SetExtraBorderSize(10)
|
||||||
|
|
||||||
textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize,
|
textWindow = wxTextCtrl(win, -1, "", wxDefaultPosition, wxDefaultSize,
|
||||||
wxTE_MULTILINE|wxSUNKEN_BORDER)
|
wxTE_MULTILINE|wxSUNKEN_BORDER)
|
||||||
textWindow.SetValue("A help window")
|
textWindow.SetValue("A sub window")
|
||||||
|
|
||||||
self.leftWindow1 = win
|
self.leftWindow1 = win
|
||||||
|
|
||||||
@ -95,11 +97,11 @@ class TestSashWindow(wxPanel):
|
|||||||
elif eID == self.ID_WINDOW_BOTTOM:
|
elif eID == self.ID_WINDOW_BOTTOM:
|
||||||
self.bottomWindow.SetDefaultSize(wxSize(1000, event.GetDragRect().height))
|
self.bottomWindow.SetDefaultSize(wxSize(1000, event.GetDragRect().height))
|
||||||
|
|
||||||
wxLayoutAlgorithm().LayoutWindow(self)
|
wxLayoutAlgorithm().LayoutWindow(self, self.remainingSpace)
|
||||||
|
self.remainingSpace.Refresh()
|
||||||
|
|
||||||
def OnSize(self, event):
|
def OnSize(self, event):
|
||||||
wxLayoutAlgorithm().LayoutWindow(self)
|
wxLayoutAlgorithm().LayoutWindow(self, self.remainingSpace)
|
||||||
|
|
||||||
#---------------------------------------------------------------------------
|
#---------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -125,29 +127,4 @@ def runTest(frame, nb, log):
|
|||||||
|
|
||||||
|
|
||||||
overview = """\
|
overview = """\
|
||||||
wxSashLayoutWindow responds to OnCalculateLayout events generated by wxLayoutAlgorithm. It allows the application to use simple accessors to specify how the window should be laid out, rather than having to respond to events. The fact that the class derives from wxSashWindow allows sashes to be used if required, to allow the windows to be user-resizable.
|
|
||||||
|
|
||||||
wxSashLayoutWindow()
|
|
||||||
-------------------------------------------
|
|
||||||
|
|
||||||
Default constructor.
|
|
||||||
|
|
||||||
wxSashLayoutWindow(wxSashLayoutWindow* parent, wxSashLayoutWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxSW_3D, const wxString& name = "layoutWindow")
|
|
||||||
|
|
||||||
Constructs a sash layout window, which can be a child of a frame, dialog or any other non-control window.
|
|
||||||
|
|
||||||
Parameters
|
|
||||||
-------------------
|
|
||||||
|
|
||||||
parent = Pointer to a parent window.
|
|
||||||
|
|
||||||
id = Window identifier. If -1, will automatically create an identifier.
|
|
||||||
|
|
||||||
pos = Window position. wxDefaultPosition is (-1, -1) which indicates that wxSashLayoutWindows should generate a default position for the window. If using the wxSashLayoutWindow class directly, supply an actual position.
|
|
||||||
|
|
||||||
size = Window size. wxDefaultSize is (-1, -1) which indicates that wxSashLayoutWindows should generate a default size for the window.
|
|
||||||
|
|
||||||
style = Window style. For window styles, please see wxSashLayoutWindow.
|
|
||||||
|
|
||||||
name = Window name.
|
|
||||||
"""
|
"""
|
||||||
|
@ -78,7 +78,7 @@ class TestToolBar(wxFrame):
|
|||||||
event.Skip()
|
event.Skip()
|
||||||
|
|
||||||
|
|
||||||
def OnClearSB(self, event):
|
def OnClearSB(self, event): # called for the timer event handler
|
||||||
self.SetStatusText("")
|
self.SetStatusText("")
|
||||||
self.timer.Stop()
|
self.timer.Stop()
|
||||||
self.timer = None
|
self.timer = None
|
||||||
|
@ -13,7 +13,7 @@ from my_distutils import run_swig, contrib_copy_tree
|
|||||||
# flags and values that affect this script
|
# flags and values that affect this script
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
|
|
||||||
VERSION = "2.3.0b1"
|
VERSION = "2.3b1"
|
||||||
DESCRIPTION = "Cross platform GUI toolkit for Python"
|
DESCRIPTION = "Cross platform GUI toolkit for Python"
|
||||||
AUTHOR = "Robin Dunn"
|
AUTHOR = "Robin Dunn"
|
||||||
AUTHOR_EMAIL = "robin@alldunn.com"
|
AUTHOR_EMAIL = "robin@alldunn.com"
|
||||||
@ -199,7 +199,7 @@ if IN_CVS_TREE and newer('setup.py', 'src/__version__.py'):
|
|||||||
|
|
||||||
print 'Preparing CORE...'
|
print 'Preparing CORE...'
|
||||||
swig_force = force
|
swig_force = force
|
||||||
swig_args = ['-c++', '-shadow', '-python', '-keyword', '-dascii',
|
swig_args = ['-c++', '-shadow', '-python', '-keyword', '-dnone', #'-dascii',
|
||||||
'-I./src', '-D'+WXPLAT]
|
'-I./src', '-D'+WXPLAT]
|
||||||
swig_deps = ['src/my_typemaps.i']
|
swig_deps = ['src/my_typemaps.i']
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
ver = '2.3.0b1'
|
ver = '2.3b1'
|
||||||
|
@ -75,7 +75,9 @@
|
|||||||
// Py_DECREF(arg);
|
// Py_DECREF(arg);
|
||||||
|
|
||||||
// // set ThisOwn
|
// // set ThisOwn
|
||||||
// PyObject_SetAttrString($target, "thisown", PyInt_FromLong(1));
|
// PyObject* one = PyInt_FromLong(1);
|
||||||
|
// PyObject_SetAttrString($target, "thisown", one);
|
||||||
|
// Py_DECREF(one);
|
||||||
// }
|
// }
|
||||||
// } else {
|
// } else {
|
||||||
// Py_INCREF(Py_None);
|
// Py_INCREF(Py_None);
|
||||||
|
@ -339,6 +339,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
%new wxColour* wxNamedColour(const wxString& colorName);
|
%new wxColour* wxNamedColour(const wxString& colorName);
|
||||||
|
|
||||||
%{ // Alternate 'constructor'
|
%{ // Alternate 'constructor'
|
||||||
wxColour* wxNamedColour(const wxString& colorName) {
|
wxColour* wxNamedColour(const wxString& colorName) {
|
||||||
return new wxColour(colorName);
|
return new wxColour(colorName);
|
||||||
|
@ -71,11 +71,11 @@
|
|||||||
#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \
|
#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \
|
||||||
void CBNAME(wxGridCellAttr *attr, int a, int b) { \
|
void CBNAME(wxGridCellAttr *attr, int a, int b) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback( \
|
PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
|
||||||
Py_BuildValue("(Oii)", \
|
m_myInst.callCallback(Py_BuildValue("(Oii)", obj, a, b)); \
|
||||||
wxPyConstructObject((void*)attr, "wxGridCellAttr"), \
|
Py_DECREF(obj); \
|
||||||
a, b)); \
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(attr, a, b); \
|
PCLASS::CBNAME(attr, a, b); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -89,11 +89,11 @@
|
|||||||
#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \
|
#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \
|
||||||
void CBNAME(wxGridCellAttr *attr, int val) { \
|
void CBNAME(wxGridCellAttr *attr, int val) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback( \
|
PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
|
||||||
Py_BuildValue("(Oi)", \
|
m_myInst.callCallback(Py_BuildValue("(Oi)", obj, val)); \
|
||||||
wxPyConstructObject((void*)attr, "wxGridCellAttr"), \
|
Py_DECREF(obj); \
|
||||||
val)); \
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(attr, val); \
|
PCLASS::CBNAME(attr, val); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -136,8 +136,9 @@
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -163,8 +164,9 @@
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a, b); \
|
rval = PCLASS::CBNAME(a, b); \
|
||||||
@ -237,8 +239,9 @@
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyFloat_AsDouble(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyFloat_AsDouble(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a, b); \
|
rval = PCLASS::CBNAME(a, b); \
|
||||||
@ -309,8 +312,9 @@
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a); \
|
rval = PCLASS::CBNAME(a); \
|
||||||
@ -982,7 +986,6 @@ public:
|
|||||||
PYCALLBACK__GCAINT(wxGridTableBase, SetColAttr);
|
PYCALLBACK__GCAINT(wxGridTableBase, SetColAttr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxString GetValue(int row, int col) {
|
wxString GetValue(int row, int col) {
|
||||||
bool doSave = wxPyRestoreThread();
|
bool doSave = wxPyRestoreThread();
|
||||||
wxString rval;
|
wxString rval;
|
||||||
@ -990,8 +993,10 @@ public:
|
|||||||
PyObject* ro;
|
PyObject* ro;
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
|
||||||
if (ro) {
|
if (ro) {
|
||||||
rval = PyString_AsString(PyObject_Str(ro));
|
PyObject* str = PyObject_Str(ro);
|
||||||
|
rval = PyString_AsString(str);
|
||||||
Py_DECREF(ro);
|
Py_DECREF(ro);
|
||||||
|
Py_DECREF(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wxPySaveThread(doSave);
|
wxPySaveThread(doSave);
|
||||||
|
@ -105,6 +105,11 @@ int wxPyApp::MainLoop(void) {
|
|||||||
//---------------------------------------------------------------------
|
//---------------------------------------------------------------------
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
#include "wx/msw/msvcrt.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
int WXDLLEXPORT wxEntryStart( int argc, char** argv );
|
int WXDLLEXPORT wxEntryStart( int argc, char** argv );
|
||||||
int WXDLLEXPORT wxEntryInitGui();
|
int WXDLLEXPORT wxEntryInitGui();
|
||||||
void WXDLLEXPORT wxEntryCleanup();
|
void WXDLLEXPORT wxEntryCleanup();
|
||||||
@ -121,6 +126,11 @@ static char* __nullArgv[1] = { 0 };
|
|||||||
// wxcmodule is imported. (Before there is a wxApp object.)
|
// wxcmodule is imported. (Before there is a wxApp object.)
|
||||||
void __wxPreStart()
|
void __wxPreStart()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#ifdef __WXMSW__
|
||||||
|
// wxCrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef WXP_WITH_THREAD
|
#ifdef WXP_WITH_THREAD
|
||||||
PyEval_InitThreads();
|
PyEval_InitThreads();
|
||||||
wxPyEventThreadState = PyThreadState_Get();
|
wxPyEventThreadState = PyThreadState_Get();
|
||||||
@ -158,11 +168,12 @@ PyObject* __wxStart(PyObject* /* self */, PyObject* args)
|
|||||||
if (!PyArg_ParseTuple(args, "O", &onInitFunc))
|
if (!PyArg_ParseTuple(args, "O", &onInitFunc))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
#if 0 // Try it out without this check, soo how it does...
|
||||||
if (wxTopLevelWindows.Number() > 0) {
|
if (wxTopLevelWindows.Number() > 0) {
|
||||||
PyErr_SetString(PyExc_TypeError, "Only 1 wxApp per process!");
|
PyErr_SetString(PyExc_TypeError, "Only 1 wxApp per process!");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// This is the next part of the wxEntry functionality...
|
// This is the next part of the wxEntry functionality...
|
||||||
PyObject* sysargv = PySys_GetObject("argv");
|
PyObject* sysargv = PySys_GetObject("argv");
|
||||||
@ -280,7 +291,9 @@ PyObject* wxPyConstructObject(void* ptr,
|
|||||||
Py_DECREF(arg);
|
Py_DECREF(arg);
|
||||||
|
|
||||||
if (setThisOwn) {
|
if (setThisOwn) {
|
||||||
PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
|
PyObject* one = PyInt_FromLong(1);
|
||||||
|
PyObject_SetAttrString(obj, "thisown", one);
|
||||||
|
Py_DECREF(one);
|
||||||
}
|
}
|
||||||
|
|
||||||
return obj;
|
return obj;
|
||||||
@ -427,12 +440,12 @@ void wxPyCallbackHelper::setSelf(PyObject* self, PyObject* klass, int incref) {
|
|||||||
// If the object (m_self) has an attibute of the given name, and if that
|
// If the object (m_self) has an attibute of the given name, and if that
|
||||||
// attribute is a method, and if that method's class is not from a base class,
|
// attribute is a method, and if that method's class is not from a base class,
|
||||||
// then we'll save a pointer to the method so callCallback can call it.
|
// then we'll save a pointer to the method so callCallback can call it.
|
||||||
bool wxPyCallbackHelper::findCallback(const wxString& name) const {
|
bool wxPyCallbackHelper::findCallback(const char* name) const {
|
||||||
wxPyCallbackHelper* self = (wxPyCallbackHelper*)this; // cast away const
|
wxPyCallbackHelper* self = (wxPyCallbackHelper*)this; // cast away const
|
||||||
self->m_lastFound = NULL;
|
self->m_lastFound = NULL;
|
||||||
if (m_self && PyObject_HasAttrString(m_self, (char*)name.c_str())) {
|
if (m_self && PyObject_HasAttrString(m_self, (char*)name)) {
|
||||||
PyObject* method;
|
PyObject* method;
|
||||||
method = PyObject_GetAttrString(m_self, (char*)name.c_str());
|
method = PyObject_GetAttrString(m_self, (char*)name);
|
||||||
|
|
||||||
if (PyMethod_Check(method) &&
|
if (PyMethod_Check(method) &&
|
||||||
((PyMethod_GET_CLASS(method) == m_class) ||
|
((PyMethod_GET_CLASS(method) == m_class) ||
|
||||||
@ -440,6 +453,9 @@ bool wxPyCallbackHelper::findCallback(const wxString& name) const {
|
|||||||
|
|
||||||
self->m_lastFound = method;
|
self->m_lastFound = method;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
Py_DECREF(method);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return m_lastFound != NULL;
|
return m_lastFound != NULL;
|
||||||
}
|
}
|
||||||
@ -461,10 +477,17 @@ int wxPyCallbackHelper::callCallback(PyObject* argTuple) const {
|
|||||||
// Invoke the Python callable object, returning the raw PyObject return
|
// Invoke the Python callable object, returning the raw PyObject return
|
||||||
// value. Caller should DECREF the return value and also call PyEval_SaveThread.
|
// value. Caller should DECREF the return value and also call PyEval_SaveThread.
|
||||||
PyObject* wxPyCallbackHelper::callCallbackObj(PyObject* argTuple) const {
|
PyObject* wxPyCallbackHelper::callCallbackObj(PyObject* argTuple) const {
|
||||||
PyObject* result;
|
wxPyCallbackHelper* self = (wxPyCallbackHelper*)this; // cast away const
|
||||||
|
PyObject* result;
|
||||||
|
|
||||||
result = PyEval_CallObject(m_lastFound, argTuple);
|
// Save a copy of the pointer in case the callback generates another
|
||||||
|
// callback. In that case m_lastFound will have a different value when
|
||||||
|
// it gets back here...
|
||||||
|
PyObject* method = m_lastFound;
|
||||||
|
|
||||||
|
result = PyEval_CallObject(method, argTuple);
|
||||||
Py_DECREF(argTuple);
|
Py_DECREF(argTuple);
|
||||||
|
Py_DECREF(method);
|
||||||
if (!result) {
|
if (!result) {
|
||||||
PyErr_Print();
|
PyErr_Print();
|
||||||
}
|
}
|
||||||
@ -987,7 +1010,7 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
PyErr_SetString(PyExc_TypeError, "Expected a wxColour object or a string containing a colour name or #RRGGBB.");
|
PyErr_SetString(PyExc_TypeError, "Expected a wxColour object or a string containing a colour name or '#RRGGBB'.");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -998,3 +1021,4 @@ bool wxColour_helper(PyObject* source, wxColour** obj) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -15,7 +15,6 @@
|
|||||||
|
|
||||||
#include <wx/wx.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
|
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
|
|
||||||
// if we want to handle threads and Python threads are available...
|
// if we want to handle threads and Python threads are available...
|
||||||
@ -216,7 +215,7 @@ public:
|
|||||||
|
|
||||||
void setSelf(PyObject* self, PyObject* klass, int incref=TRUE);
|
void setSelf(PyObject* self, PyObject* klass, int incref=TRUE);
|
||||||
|
|
||||||
bool findCallback(const wxString& name) const;
|
bool findCallback(const char* name) const;
|
||||||
int callCallback(PyObject* argTuple) const;
|
int callCallback(PyObject* argTuple) const;
|
||||||
PyObject* callCallbackObj(PyObject* argTuple) const;
|
PyObject* callCallbackObj(PyObject* argTuple) const;
|
||||||
|
|
||||||
@ -393,9 +392,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DC(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a) { \
|
void CLASS::CBNAME(wxDC& a) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"))); \
|
m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a); \
|
PCLASS::CBNAME(a); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -416,9 +417,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a, bool b) { \
|
void CLASS::CBNAME(wxDC& a, bool b) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oi)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), (int)b)); \
|
m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b)); \
|
||||||
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b); \
|
PCLASS::CBNAME(a, b); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -437,9 +440,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a, bool b) { \
|
void CLASS::CBNAME(wxDC& a, bool b) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oi)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), (int)b)); \
|
m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b)); \
|
||||||
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b); \
|
PCLASS::CBNAME(a, b); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -499,10 +504,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DC4DBLBOOL(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
|
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oddddi)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), \
|
m_myInst.callCallback(Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f)); \
|
||||||
b, c, d, e, (int)f)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b, c, d, e, f); \
|
PCLASS::CBNAME(a, b, c, d, e, f); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -522,10 +528,11 @@ public:
|
|||||||
bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
|
bool CLASS::CBNAME(wxDC& a, double b, double c, double d, double e, bool f) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
bool rval; \
|
bool rval; \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
rval = m_myInst.callCallback(Py_BuildValue("(Oddddi)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), \
|
rval = m_myInst.callCallback(Py_BuildValue("(Oddddi)", obj, b, c, d, e, (int)f));\
|
||||||
b, c, d, e, (int)f)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
rval = PCLASS::CBNAME(a, b, c, d, e, f); \
|
rval = PCLASS::CBNAME(a, b, c, d, e, f); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -566,10 +573,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DC4DBL(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) { \
|
void CLASS::CBNAME(wxDC& a, double b, double c, double d, double e) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Odddd)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), \
|
m_myInst.callCallback(Py_BuildValue("(Odddd)", obj, b, c, d, e)); \
|
||||||
b, c, d, e)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b, c, d, e); \
|
PCLASS::CBNAME(a, b, c, d, e); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -588,10 +596,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__DCBOOL(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxDC& a, bool b) { \
|
void CLASS::CBNAME(wxDC& a, bool b) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oi)", \
|
PyObject* obj = wxPyConstructObject(&a, "wxDC"); \
|
||||||
wxPyConstructObject(&a, "wxDC"), \
|
m_myInst.callCallback(Py_BuildValue("(Oi)", obj, (int)b)); \
|
||||||
(int)b)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b); \
|
PCLASS::CBNAME(a, b); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -611,10 +620,11 @@ public:
|
|||||||
void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d, \
|
void CLASS::CBNAME(wxControlPoint* a, bool b, double c, double d, \
|
||||||
int e, int f) { \
|
int e, int f) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oiddii)", \
|
PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint"); \
|
||||||
wxPyConstructObject(a, "wxPyControlPoint"), \
|
m_myInst.callCallback(Py_BuildValue("(Oiddii)", obj, (int)b, c, d, e, f));\
|
||||||
(int)b, c, d, e, f)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b, c, d, e, f); \
|
PCLASS::CBNAME(a, b, c, d, e, f); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -634,10 +644,11 @@ public:
|
|||||||
#define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME) \
|
#define IMP_PYCALLBACK__WXCP2DBL2INT(CLASS, PCLASS, CBNAME) \
|
||||||
void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) { \
|
void CLASS::CBNAME(wxControlPoint* a, double b, double c, int d, int e) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(Oddii)", \
|
PyObject* obj = wxPyConstructObject(a, "wxPyControlPoint"); \
|
||||||
wxPyConstructObject(a, "wxPyControlPoint"), \
|
m_myInst.callCallback(Py_BuildValue("(Oddii)", obj, b, c, d, e)); \
|
||||||
b, c, d, e)); \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(a, b, c, d, e); \
|
PCLASS::CBNAME(a, b, c, d, e); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -758,8 +769,9 @@ public:
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(s)", a.c_str())); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(s)", a.c_str())); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -779,8 +791,9 @@ public:
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(si)", a.c_str(),b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(si)", a.c_str(),b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -825,8 +838,9 @@ public:
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("()")); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("()")); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
else \
|
else \
|
||||||
@ -852,8 +866,9 @@ public:
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("()")); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("()")); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -870,9 +885,11 @@ public:
|
|||||||
bool CLASS::CBNAME(const wxHtmlTag& a) { \
|
bool CLASS::CBNAME(const wxHtmlTag& a) { \
|
||||||
bool rval = FALSE; \
|
bool rval = FALSE; \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
rval = m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject((void*)&a,"wxHtmlTag"); \
|
||||||
wxPyConstructObject((void*)&a,"wxHtmlTag"))); \
|
rval = m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
return rval; \
|
return rval; \
|
||||||
}
|
}
|
||||||
@ -926,9 +943,11 @@ public:
|
|||||||
bool CLASS::CBNAME(wxWindow* a) { \
|
bool CLASS::CBNAME(wxWindow* a) { \
|
||||||
bool rval; \
|
bool rval; \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
rval = m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject((void*)a,"wxWindow"); \
|
||||||
wxPyConstructObject((void*)a,"wxWindow"))); \
|
rval = m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
else \
|
else \
|
||||||
rval = PCLASS::CBNAME(a); \
|
rval = PCLASS::CBNAME(a); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -993,13 +1012,15 @@ public:
|
|||||||
wxFSFile* rval=0; \
|
wxFSFile* rval=0; \
|
||||||
if (m_myInst.findCallback(#CBNAME)) { \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro=m_myInst.callCallbackObj(Py_BuildValue("(Os)", \
|
PyObject* obj = wxPyConstructObject(&a, "(wxFileSystem"); \
|
||||||
wxPyConstructObject(&a, "(wxFileSystemC"),b.c_str())); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(Os)", \
|
||||||
|
obj, b.c_str())); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
SWIG_GetPtrObj(ro, (void **)&rval, "_wxFSFILE_p"); \
|
SWIG_GetPtrObj(ro, (void **)&rval, "_wxFSFILE_p"); \
|
||||||
Py_DECREF(ro); \
|
Py_DECREF(ro); \
|
||||||
} \
|
} \
|
||||||
} \
|
Py_DECREF(obj); \
|
||||||
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
return rval; \
|
return rval; \
|
||||||
};
|
};
|
||||||
@ -1117,18 +1138,20 @@ public:
|
|||||||
void base_##CBNAME(const Type& a);
|
void base_##CBNAME(const Type& a);
|
||||||
|
|
||||||
|
|
||||||
#define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type) \
|
#define IMP_PYCALLBACK__constany(CLASS, PCLASS, CBNAME, Type) \
|
||||||
void CLASS::CBNAME(const Type& a) { \
|
void CLASS::CBNAME(const Type& a) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject((void*)&a, #Type); \
|
||||||
wxPyConstructObject((void*)&a, #Type))); \
|
m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
else \
|
Py_DECREF(obj); \
|
||||||
PCLASS::CBNAME(a); \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
else \
|
||||||
} \
|
PCLASS::CBNAME(a); \
|
||||||
void CLASS::base_##CBNAME(const Type& a) { \
|
wxPySaveThread(doSave); \
|
||||||
PCLASS::CBNAME(a); \
|
} \
|
||||||
|
void CLASS::base_##CBNAME(const Type& a) { \
|
||||||
|
PCLASS::CBNAME(a); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1139,18 +1162,20 @@ public:
|
|||||||
void base_##CBNAME(Type& a);
|
void base_##CBNAME(Type& a);
|
||||||
|
|
||||||
|
|
||||||
#define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type) \
|
#define IMP_PYCALLBACK__any(CLASS, PCLASS, CBNAME, Type) \
|
||||||
void CLASS::CBNAME(Type& a) { \
|
void CLASS::CBNAME(Type& a) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject((void*)&a, #Type); \
|
||||||
wxPyConstructObject(&a, #Type))); \
|
m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
else \
|
Py_DECREF(obj); \
|
||||||
PCLASS::CBNAME(a); \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
else \
|
||||||
} \
|
PCLASS::CBNAME(a); \
|
||||||
void CLASS::base_##CBNAME(Type& a) { \
|
wxPySaveThread(doSave); \
|
||||||
PCLASS::CBNAME(a); \
|
} \
|
||||||
|
void CLASS::base_##CBNAME(Type& a) { \
|
||||||
|
PCLASS::CBNAME(a); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
@ -1160,20 +1185,22 @@ public:
|
|||||||
bool base_##CBNAME(Type& a);
|
bool base_##CBNAME(Type& a);
|
||||||
|
|
||||||
|
|
||||||
#define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type) \
|
#define IMP_PYCALLBACK_bool_any(CLASS, PCLASS, CBNAME, Type) \
|
||||||
bool CLASS::CBNAME(Type& a) { \
|
bool CLASS::CBNAME(Type& a) { \
|
||||||
bool rv; \
|
bool rv; \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
rv = m_myInst.callCallback(Py_BuildValue("(O)", \
|
PyObject* obj = wxPyConstructObject((void*)&a, #Type); \
|
||||||
wxPyConstructObject(&a, #Type))); \
|
rv = m_myInst.callCallback(Py_BuildValue("(O)", obj)); \
|
||||||
else \
|
Py_DECREF(obj); \
|
||||||
rv = PCLASS::CBNAME(a); \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
else \
|
||||||
return rv; \
|
rv = PCLASS::CBNAME(a); \
|
||||||
} \
|
wxPySaveThread(doSave); \
|
||||||
bool CLASS::base_##CBNAME(Type& a) { \
|
return rv; \
|
||||||
return PCLASS::CBNAME(a); \
|
} \
|
||||||
|
bool CLASS::base_##CBNAME(Type& a) { \
|
||||||
|
return PCLASS::CBNAME(a); \
|
||||||
}
|
}
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -275,12 +275,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnExit() {
|
void OnExit() {
|
||||||
|
bool doSave = wxPyRestoreThread();
|
||||||
Py_DECREF(m_tagHandlerClass);
|
Py_DECREF(m_tagHandlerClass);
|
||||||
m_tagHandlerClass = NULL;
|
m_tagHandlerClass = NULL;
|
||||||
for (size_t x=0; x < m_objArray.GetCount(); x++) {
|
for (size_t x=0; x < m_objArray.GetCount(); x++) {
|
||||||
PyObject* obj = (PyObject*)m_objArray.Item(x);
|
PyObject* obj = (PyObject*)m_objArray.Item(x);
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
|
wxPySaveThread(doSave);
|
||||||
};
|
};
|
||||||
|
|
||||||
void FillHandlersTable(wxHtmlWinParser *parser) {
|
void FillHandlersTable(wxHtmlWinParser *parser) {
|
||||||
@ -434,6 +436,7 @@ IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
|
|||||||
if (m_myInst.findCallback("OnLinkClicked")) {
|
if (m_myInst.findCallback("OnLinkClicked")) {
|
||||||
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
|
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
|
||||||
m_myInst.callCallback(Py_BuildValue("(O)", obj));
|
m_myInst.callCallback(Py_BuildValue("(O)", obj));
|
||||||
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxHtmlWindow::OnLinkClicked(link);
|
wxHtmlWindow::OnLinkClicked(link);
|
||||||
|
@ -255,7 +255,9 @@ public:
|
|||||||
bool doSave = wxPyRestoreThread();
|
bool doSave = wxPyRestoreThread();
|
||||||
wxRect* newRect = new wxRect(dest);
|
wxRect* newRect = new wxRect(dest);
|
||||||
obj = wxPyConstructObject((void*)newRect, "wxRect");
|
obj = wxPyConstructObject((void*)newRect, "wxRect");
|
||||||
PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
|
PyObject* one = PyInt_FromLong(1);
|
||||||
|
PyObject_SetAttrString(obj, "thisown", one);
|
||||||
|
Py_DECREF(one);
|
||||||
wxPySaveThread(doSave);
|
wxPySaveThread(doSave);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -1 +1 @@
|
|||||||
*.doc
|
|
||||||
|
@ -488,7 +488,9 @@ static PyObject *_wrap_wxFSFile_GetStream(PyObject *self, PyObject *args, PyObje
|
|||||||
Py_DECREF(arg);
|
Py_DECREF(arg);
|
||||||
|
|
||||||
// set ThisOwn
|
// set ThisOwn
|
||||||
PyObject_SetAttrString(_resultobj, "thisown", PyInt_FromLong(1));
|
PyObject* one = PyInt_FromLong(1);
|
||||||
|
PyObject_SetAttrString(_resultobj, "thisown", one);
|
||||||
|
Py_DECREF(one);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
|
@ -134,11 +134,11 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \
|
#define PYCALLBACK__GCAINTINT(PCLASS, CBNAME) \
|
||||||
void CBNAME(wxGridCellAttr *attr, int a, int b) { \
|
void CBNAME(wxGridCellAttr *attr, int a, int b) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback( \
|
PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
|
||||||
Py_BuildValue("(Oii)", \
|
m_myInst.callCallback(Py_BuildValue("(Oii)", obj, a, b)); \
|
||||||
wxPyConstructObject((void*)attr, "wxGridCellAttr"), \
|
Py_DECREF(obj); \
|
||||||
a, b)); \
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(attr, a, b); \
|
PCLASS::CBNAME(attr, a, b); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -152,11 +152,11 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \
|
#define PYCALLBACK__GCAINT(PCLASS, CBNAME) \
|
||||||
void CBNAME(wxGridCellAttr *attr, int val) { \
|
void CBNAME(wxGridCellAttr *attr, int val) { \
|
||||||
bool doSave = wxPyRestoreThread(); \
|
bool doSave = wxPyRestoreThread(); \
|
||||||
if (m_myInst.findCallback(#CBNAME)) \
|
if (m_myInst.findCallback(#CBNAME)) { \
|
||||||
m_myInst.callCallback( \
|
PyObject* obj = wxPyConstructObject((void*)attr, "wxGridCellAttr");\
|
||||||
Py_BuildValue("(Oi)", \
|
m_myInst.callCallback(Py_BuildValue("(Oi)", obj, val)); \
|
||||||
wxPyConstructObject((void*)attr, "wxGridCellAttr"), \
|
Py_DECREF(obj); \
|
||||||
val)); \
|
} \
|
||||||
else \
|
else \
|
||||||
PCLASS::CBNAME(attr, val); \
|
PCLASS::CBNAME(attr, val); \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -199,8 +199,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
wxPySaveThread(doSave); \
|
wxPySaveThread(doSave); \
|
||||||
@ -226,8 +227,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a, b); \
|
rval = PCLASS::CBNAME(a, b); \
|
||||||
@ -300,8 +302,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",a,b)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyFloat_AsDouble(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyFloat_AsDouble(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a, b); \
|
rval = PCLASS::CBNAME(a, b); \
|
||||||
@ -372,8 +375,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
PyObject* ro; \
|
PyObject* ro; \
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a)); \
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(i)",a)); \
|
||||||
if (ro) { \
|
if (ro) { \
|
||||||
rval = PyString_AsString(PyObject_Str(ro)); \
|
PyObject* str = PyObject_Str(ro); \
|
||||||
Py_DECREF(ro); \
|
rval = PyString_AsString(str); \
|
||||||
|
Py_DECREF(ro); Py_DECREF(str); \
|
||||||
} \
|
} \
|
||||||
} else \
|
} else \
|
||||||
rval = PCLASS::CBNAME(a); \
|
rval = PCLASS::CBNAME(a); \
|
||||||
@ -710,7 +714,6 @@ public:
|
|||||||
PYCALLBACK__GCAINT(wxGridTableBase, SetColAttr);
|
PYCALLBACK__GCAINT(wxGridTableBase, SetColAttr);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
wxString GetValue(int row, int col) {
|
wxString GetValue(int row, int col) {
|
||||||
bool doSave = wxPyRestoreThread();
|
bool doSave = wxPyRestoreThread();
|
||||||
wxString rval;
|
wxString rval;
|
||||||
@ -718,8 +721,10 @@ public:
|
|||||||
PyObject* ro;
|
PyObject* ro;
|
||||||
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
|
ro = m_myInst.callCallbackObj(Py_BuildValue("(ii)",row,col));
|
||||||
if (ro) {
|
if (ro) {
|
||||||
rval = PyString_AsString(PyObject_Str(ro));
|
PyObject* str = PyObject_Str(ro);
|
||||||
|
rval = PyString_AsString(str);
|
||||||
Py_DECREF(ro);
|
Py_DECREF(ro);
|
||||||
|
Py_DECREF(str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
wxPySaveThread(doSave);
|
wxPySaveThread(doSave);
|
||||||
|
@ -163,12 +163,14 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void OnExit() {
|
void OnExit() {
|
||||||
|
bool doSave = wxPyRestoreThread();
|
||||||
Py_DECREF(m_tagHandlerClass);
|
Py_DECREF(m_tagHandlerClass);
|
||||||
m_tagHandlerClass = NULL;
|
m_tagHandlerClass = NULL;
|
||||||
for (size_t x=0; x < m_objArray.GetCount(); x++) {
|
for (size_t x=0; x < m_objArray.GetCount(); x++) {
|
||||||
PyObject* obj = (PyObject*)m_objArray.Item(x);
|
PyObject* obj = (PyObject*)m_objArray.Item(x);
|
||||||
Py_DECREF(obj);
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
|
wxPySaveThread(doSave);
|
||||||
};
|
};
|
||||||
|
|
||||||
void FillHandlersTable(wxHtmlWinParser *parser) {
|
void FillHandlersTable(wxHtmlWinParser *parser) {
|
||||||
@ -229,6 +231,7 @@ IMP_PYCALLBACK__STRING(wxPyHtmlWindow, wxHtmlWindow, OnSetTitle);
|
|||||||
if (m_myInst.findCallback("OnLinkClicked")) {
|
if (m_myInst.findCallback("OnLinkClicked")) {
|
||||||
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
|
PyObject* obj = wxPyConstructObject((void*)&link, "wxHtmlLinkInfo");
|
||||||
m_myInst.callCallback(Py_BuildValue("(O)", obj));
|
m_myInst.callCallback(Py_BuildValue("(O)", obj));
|
||||||
|
Py_DECREF(obj);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
wxHtmlWindow::OnLinkClicked(link);
|
wxHtmlWindow::OnLinkClicked(link);
|
||||||
@ -6273,6 +6276,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -6469,6 +6473,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxHtmlParser","_wxHtmlWinParser",SwigwxHtmlWinParserTowxHtmlParser},
|
{ "_wxHtmlParser","_wxHtmlWinParser",SwigwxHtmlWinParserTowxHtmlParser},
|
||||||
{ "_wxHtmlParser","_class_wxHtmlParser",0},
|
{ "_wxHtmlParser","_class_wxHtmlParser",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -3188,6 +3188,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
{ "_wxBusyInfo","_class_wxBusyInfo",0},
|
||||||
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
{ "_class_wxMenuEvent","_wxMenuEvent",0},
|
||||||
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
{ "_wxPaletteChangedEvent","_class_wxPaletteChangedEvent",0},
|
||||||
|
{ "_wxJoystick","_class_wxJoystick",0},
|
||||||
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
{ "_class_wxPyBitmapDataObject","_wxPyBitmapDataObject",0},
|
||||||
{ "_wxClientDC","_class_wxClientDC",0},
|
{ "_wxClientDC","_class_wxClientDC",0},
|
||||||
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
{ "_wxMouseEvent","_class_wxMouseEvent",0},
|
||||||
@ -3382,6 +3383,7 @@ static struct { char *n1; char *n2; void *(*pcnv)(void *); } _swig_mapping[] = {
|
|||||||
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
{ "_class_wxCheckListBox","_wxCheckListBox",0},
|
||||||
{ "_wxHtmlParser","_class_wxHtmlParser",0},
|
{ "_wxHtmlParser","_class_wxHtmlParser",0},
|
||||||
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
{ "_class_wxBusyInfo","_wxBusyInfo",0},
|
||||||
|
{ "_class_wxJoystick","_wxJoystick",0},
|
||||||
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
{ "_class_wxCommandEvent","_wxCommandEvent",0},
|
||||||
{ "_class_wxClientDC","_wxClientDC",0},
|
{ "_class_wxClientDC","_wxClientDC",0},
|
||||||
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
{ "_class_wxSizeEvent","_wxSizeEvent",0},
|
||||||
|
@ -121,7 +121,9 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
bool doSave = wxPyRestoreThread();
|
bool doSave = wxPyRestoreThread();
|
||||||
wxRect* newRect = new wxRect(dest);
|
wxRect* newRect = new wxRect(dest);
|
||||||
obj = wxPyConstructObject((void*)newRect, "wxRect");
|
obj = wxPyConstructObject((void*)newRect, "wxRect");
|
||||||
PyObject_SetAttrString(obj, "thisown", PyInt_FromLong(1));
|
PyObject* one = PyInt_FromLong(1);
|
||||||
|
PyObject_SetAttrString(obj, "thisown", one);
|
||||||
|
Py_DECREF(one);
|
||||||
wxPySaveThread(doSave);
|
wxPySaveThread(doSave);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
@ -400,8 +400,10 @@ public:
|
|||||||
if (!PyObject_HasAttrString(py, name))
|
if (!PyObject_HasAttrString(py, name))
|
||||||
return NULL;
|
return NULL;
|
||||||
PyObject* o = PyObject_GetAttrString(py, name);
|
PyObject* o = PyObject_GetAttrString(py, name);
|
||||||
if (!PyMethod_Check(o) && !PyCFunction_Check(o))
|
if (!PyMethod_Check(o) && !PyCFunction_Check(o)) {
|
||||||
|
Py_DECREF(o);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ static char* wxStringErrorMsg = "string type is required for parameter";
|
|||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
// Typemap to convert strings to wxColour. Two string formats are accepted,
|
// Typemap to convert strings to wxColour. Two string formats are accepted,
|
||||||
// either a colour name, for a hex colour spec like "#RRGGBB"
|
// either a colour name, or a hex colour spec like "#RRGGBB"
|
||||||
|
|
||||||
%typemap(python,in) wxColour& (wxColour temp) {
|
%typemap(python,in) wxColour& (wxColour temp) {
|
||||||
$target = &temp;
|
$target = &temp;
|
||||||
|
@ -67,7 +67,9 @@
|
|||||||
Py_DECREF(arg);
|
Py_DECREF(arg);
|
||||||
|
|
||||||
// set ThisOwn
|
// set ThisOwn
|
||||||
PyObject_SetAttrString($target, "thisown", PyInt_FromLong(1));
|
PyObject* one = PyInt_FromLong(1);
|
||||||
|
PyObject_SetAttrString($target, "thisown", one);
|
||||||
|
Py_DECREF(one);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Py_INCREF(Py_None);
|
Py_INCREF(Py_None);
|
||||||
@ -371,8 +373,10 @@ public:
|
|||||||
if (!PyObject_HasAttrString(py, name))
|
if (!PyObject_HasAttrString(py, name))
|
||||||
return NULL;
|
return NULL;
|
||||||
PyObject* o = PyObject_GetAttrString(py, name);
|
PyObject* o = PyObject_GetAttrString(py, name);
|
||||||
if (!PyMethod_Check(o) && !PyCFunction_Check(o))
|
if (!PyMethod_Check(o) && !PyCFunction_Check(o)) {
|
||||||
|
Py_DECREF(o);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
#define __version__ "0.0.0" // The real value is now in build.py...
|
#define __version__ "0.0.0" // The real value is now in setup.py...
|
||||||
|
|
||||||
wxPoint wxPyDefaultPosition;
|
wxPoint wxPyDefaultPosition;
|
||||||
wxSize wxPyDefaultSize;
|
wxSize wxPyDefaultSize;
|
||||||
|
Loading…
Reference in New Issue
Block a user