Modified form of Patch #1611222, adds wxSearchCtrl (generic & native carbon HISearchField)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2006-12-11 06:19:27 +00:00
parent 16ba9ea815
commit 3f7f284d55
62 changed files with 23198 additions and 11630 deletions
+2
View File
@@ -75,6 +75,7 @@ _treeList = [
'BitmapComboBox',
'I18N',
'Img2PyArtProvider',
'SearchCtrl',
]),
# managed windows == things with a (optional) caption you can close
@@ -132,6 +133,7 @@ _treeList = [
'RadioButton',
'SashWindow',
'ScrolledWindow',
'SearchCtrl',
'Slider',
'SpinButton',
'SpinCtrl',
+105
View File
@@ -0,0 +1,105 @@
import wx
#----------------------------------------------------------------------
class TestPanel(wx.Panel):
def __init__(self, parent, log):
self.log = log
wx.Panel.__init__(self, parent, -1, style=0)
# Create controls
sb = wx.StaticBox(self, -1, "Options")
searchBtnOpt = wx.CheckBox(self, -1, "Search button")
searchBtnOpt.SetValue(True)
cancelBtnOpt = wx.CheckBox(self, -1, "Cancel button")
menuBtnOpt = wx.CheckBox(self, -1, "Search menu")
self.search = wx.SearchCtrl(self, size=(200,-1), style=wx.TE_PROCESS_ENTER)
# Setup the layout
box = wx.StaticBoxSizer(sb, wx.VERTICAL)
box.Add(searchBtnOpt, 0, wx.ALL, 5)
box.Add(cancelBtnOpt, 0, wx.ALL, 5)
box.Add(menuBtnOpt, 0, wx.ALL, 5)
sizer = wx.BoxSizer(wx.HORIZONTAL)
sizer.Add(box, 0, wx.ALL, 15)
sizer.Add((15,15))
sizer.Add(self.search, 0, wx.ALL, 15)
self.tc = wx.TextCtrl(self) # just for testing that heights match...
sizer.Add(self.tc, 0, wx.TOP, 15)
self.SetSizer(sizer)
# Set event bindings
self.Bind(wx.EVT_CHECKBOX, self.OnToggleSearchButton, searchBtnOpt)
self.Bind(wx.EVT_CHECKBOX, self.OnToggleCancelButton, cancelBtnOpt)
self.Bind(wx.EVT_CHECKBOX, self.OnToggleSearchMenu, menuBtnOpt)
self.Bind(wx.EVT_SEARCHCTRL_SEARCH, self.OnSearch, self.search)
self.Bind(wx.EVT_SEARCHCTRL_CANCEL, self.OnCancel, self.search)
self.search.Bind(wx.EVT_TEXT_ENTER, self.OnDoSearch) #, self.search)
def OnToggleSearchButton(self, evt):
self.search.SetSearchButtonVisible( evt.GetInt() )
def OnToggleCancelButton(self, evt):
self.search.SetCancelButtonVisible( evt.GetInt() )
def OnToggleSearchMenu(self, evt):
if evt.GetInt():
self.search.SetMenu( self.MakeMenu() )
else:
self.search.SetMenu(None)
def OnSearch(self, evt):
self.log.write("OnSearch")
def OnCancel(self, evt):
self.log.write("OnCancel")
def OnDoSearch(self, evt):
self.log.write("OnDoSearch: " + self.search.GetValue())
def MakeMenu(self):
menu = wx.Menu()
item = menu.Append(-1, "Recent Searches")
item.Enable(False)
for txt in [ "You can maintain",
"a list of old",
"search strings here",
"and bind EVT_MENU to",
"catch their selections" ]:
menu.Append(-1, txt)
return menu
#----------------------------------------------------------------------
def runTest(frame, nb, log):
win = TestPanel(nb, log)
return win
#----------------------------------------------------------------------
overview = """<html><body>
<h2><center>wx.SearchCtrl</center></h2>
</body></html>
"""
if __name__ == '__main__':
import sys,os
import run
run.main(['', os.path.basename(sys.argv[0])] + sys.argv[1:])
+47 -6
View File
@@ -12,9 +12,45 @@ TBFLAGS = ( wx.TB_HORIZONTAL
#---------------------------------------------------------------------------
class TestSearchCtrl(wx.SearchCtrl):
maxSearches = 5
def __init__(self, parent, id=-1, value="",
pos=wx.DefaultPosition, size=wx.DefaultSize, style=0,
doSearch=None):
style |= wx.TE_PROCESS_ENTER
wx.SearchCtrl.__init__(self, parent, id, value, pos, size, style)
self.Bind(wx.EVT_TEXT_ENTER, self.OnTextEntered)
self.Bind(wx.EVT_MENU_RANGE, self.OnMenuItem, id=1, id2=self.maxSearches)
self.doSearch = doSearch
self.searches = []
def OnTextEntered(self, evt):
text = self.GetValue()
if self.doSearch(text):
self.searches.append(text)
if len(self.searches) > self.maxSearches:
del self.searches[0]
self.SetMenu(self.MakeMenu())
self.SetValue("")
def OnMenuItem(self, evt):
text = self.searches[evt.GetId()-1]
self.doSearch(text)
def MakeMenu(self):
menu = wx.Menu()
item = menu.Append(-1, "Recent Searches")
item.Enable(False)
for idx, txt in enumerate(self.searches):
menu.Append(1+idx, txt)
return menu
class TestToolBar(wx.Frame):
def __init__(self, parent, log):
wx.Frame.__init__(self, parent, -1, 'Test ToolBar', size=(500, 300))
wx.Frame.__init__(self, parent, -1, 'Test ToolBar', size=(600, 400))
self.log = log
self.timer = None
self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
@@ -83,10 +119,6 @@ class TestToolBar(wx.Frame):
shortHelp="Toggle this")
self.Bind(wx.EVT_TOOL, self.OnToolClick, id=50)
## tb.AddCheckTool(60, images.getTog1Bitmap(), images.getTog2Bitmap(),
## shortHelp="Toggle with 2 bitmaps")
## self.Bind(EVT_TOOL, self.OnToolClick, id=60)
self.Bind(wx.EVT_TOOL_ENTER, self.OnToolEnter)
self.Bind(wx.EVT_TOOL_RCLICKED, self.OnToolRClick) # Match all
self.Bind(wx.EVT_TIMER, self.OnClearSB)
@@ -101,13 +133,22 @@ class TestToolBar(wx.Frame):
))
self.Bind(wx.EVT_COMBOBOX, self.OnCombo, id=cbID)
tb.AddControl(wx.TextCtrl(tb, -1, "Toolbar controls!!", size=(150, -1)))
search = TestSearchCtrl(tb, size=(150,-1), doSearch=self.DoSearch)
tb.AddControl(search)
# Final thing to do for a toolbar is call the Realize() method. This
# causes it to render (more or less, that is).
tb.Realize()
def DoSearch(self, text):
# called by TestSearchCtrl
self.log.WriteText("DoSearch: %s\n" % text)
# return true to tell the search ctrl to remember the text
return True
def OnToolClick(self, event):
self.log.WriteText("tool %s clicked\n" % event.GetId())
#tb = self.GetToolBar()
+1
View File
@@ -289,6 +289,7 @@ swig_sources = run_swig(['controls.i'], 'src', GENDIR, PKGDIR,
'src/_hyperlink.i',
'src/_picker.i',
'src/_collpane.i',
'src/_srchctrl.i',
],
True)
ext = Extension('_controls_', swig_sources,
+99
View File
@@ -0,0 +1,99 @@
/////////////////////////////////////////////////////////////////////////////
// Name: _srchctrl.i
// Purpose: SWIG interface for wxSearchCtrl
//
// Author: Robin Dunn
//
// Created: 9-Dec-2006
// RCS-ID: $Id$
// Copyright: (c) 2006 by Total Control Software
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
// Not a %module
%{
#include <wx/srchctrl.h>
%}
//---------------------------------------------------------------------------
%newgroup
MAKE_CONST_WXSTRING(SearchCtrlNameStr);
MustHaveApp(wxSearchCtrl);
class wxSearchCtrl : public wxTextCtrl
{
public:
%pythonAppend wxSearchCtrl "self._setOORInfo(self)";
%pythonAppend wxSearchCtrl() "";
wxSearchCtrl(wxWindow *parent, wxWindowID id=-1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPySearchCtrlNameStr);
DocCtorStrName(
wxSearchCtrl(),
"Precreate a wx.SearchCtrl for 2-phase creation.", "",
PreSearchCtrl);
bool Create(wxWindow *parent, wxWindowID id=-1,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPySearchCtrlNameStr);
// get/set search button menu
// --------------------------
virtual void SetMenu( wxMenu* menu );
virtual wxMenu* GetMenu();
// get/set search options
// ----------------------
virtual void SetSearchButtonVisible( bool show );
virtual bool GetSearchButtonVisible() const;
virtual void SetCancelButtonVisible( bool show );
virtual bool GetCancelButtonVisible() const;
#ifdef __WXMAC__
%extend {
void SetSearchBitmap( const wxBitmap& ) {}
void SetSearchMenuBitmap( const wxBitmap& ) {}
void SetCancelBitmap( const wxBitmap& ) {}
}
#else
void SetSearchBitmap( const wxBitmap& bitmap );
void SetSearchMenuBitmap( const wxBitmap& bitmap );
void SetCancelBitmap( const wxBitmap& bitmap );
#endif
%property(Menu, GetMenu, SetMenu);
%property(SearchButtonVisible, GetSearchButtonVisible, SetSearchButtonVisible);
%property(CancelButtonVisible, GetCancelButtonVisible, SetCancelButtonVisible);
};
%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_CANCEL;
%constant wxEventType wxEVT_COMMAND_SEARCHCTRL_SEARCH;
%pythoncode {
EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1)
EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1)
}
//---------------------------------------------------------------------------
+1 -1
View File
@@ -62,7 +62,7 @@ MAKE_CONST_WXSTRING_NOSWIG(ControlNameStr);
%include _hyperlink.i
%include _picker.i
%include _collpane.i
%include _srchctrl.i
//---------------------------------------------------------------------------
//---------------------------------------------------------------------------
+84 -2
View File
@@ -1018,6 +1018,7 @@ _controls_.StaticBox_swigregister(StaticBox)
StaticBitmapNameStr = cvar.StaticBitmapNameStr
StaticBoxNameStr = cvar.StaticBoxNameStr
StaticTextNameStr = cvar.StaticTextNameStr
StaticLineNameStr = cvar.StaticLineNameStr
def PreStaticBox(*args, **kwargs):
"""PreStaticBox() -> StaticBox"""
@@ -1051,7 +1052,7 @@ class StaticLine(_core.Control):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> StaticLine
String name=StaticLineNameStr) -> StaticLine
"""
_controls_.StaticLine_swiginit(self,_controls_.new_StaticLine(*args, **kwargs))
self._setOORInfo(self)
@@ -1060,7 +1061,7 @@ class StaticLine(_core.Control):
"""
Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> bool
String name=StaticLineNameStr) -> bool
"""
return _controls_.StaticLine_Create(*args, **kwargs)
@@ -7128,5 +7129,86 @@ class CollapsiblePaneEvent(_core.CommandEvent):
Collapsed = property(GetCollapsed,SetCollapsed)
_controls_.CollapsiblePaneEvent_swigregister(CollapsiblePaneEvent)
#---------------------------------------------------------------------------
class SearchCtrl(TextCtrl):
"""Proxy of C++ SearchCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> SearchCtrl
"""
_controls_.SearchCtrl_swiginit(self,_controls_.new_SearchCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> bool
"""
return _controls_.SearchCtrl_Create(*args, **kwargs)
def SetMenu(*args, **kwargs):
"""SetMenu(self, Menu menu)"""
return _controls_.SearchCtrl_SetMenu(*args, **kwargs)
def GetMenu(*args, **kwargs):
"""GetMenu(self) -> Menu"""
return _controls_.SearchCtrl_GetMenu(*args, **kwargs)
def SetSearchButtonVisible(*args, **kwargs):
"""SetSearchButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetSearchButtonVisible(*args, **kwargs)
def GetSearchButtonVisible(*args, **kwargs):
"""GetSearchButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetSearchButtonVisible(*args, **kwargs)
def SetCancelButtonVisible(*args, **kwargs):
"""SetCancelButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetCancelButtonVisible(*args, **kwargs)
def GetCancelButtonVisible(*args, **kwargs):
"""GetCancelButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetCancelButtonVisible(*args, **kwargs)
def SetSearchBitmap(*args, **kwargs):
"""SetSearchBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetSearchBitmap(*args, **kwargs)
def SetSearchMenuBitmap(*args, **kwargs):
"""SetSearchMenuBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetSearchMenuBitmap(*args, **kwargs)
def SetCancelBitmap(*args, **kwargs):
"""SetCancelBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetCancelBitmap(*args, **kwargs)
Menu = property(GetMenu,SetMenu)
SearchButtonVisible = property(GetSearchButtonVisible,SetSearchButtonVisible)
CancelButtonVisible = property(GetCancelButtonVisible,SetCancelButtonVisible)
_controls_.SearchCtrl_swigregister(SearchCtrl)
SearchCtrlNameStr = cvar.SearchCtrlNameStr
def PreSearchCtrl(*args, **kwargs):
"""
PreSearchCtrl() -> SearchCtrl
Precreate a wx.SearchCtrl for 2-phase creation.
"""
val = _controls_.new_PreSearchCtrl(*args, **kwargs)
return val
wxEVT_COMMAND_SEARCHCTRL_CANCEL = _controls_.wxEVT_COMMAND_SEARCHCTRL_CANCEL
wxEVT_COMMAND_SEARCHCTRL_SEARCH = _controls_.wxEVT_COMMAND_SEARCHCTRL_SEARCH
EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1)
EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1)
File diff suppressed because one or more lines are too long
+1
View File
@@ -41272,6 +41272,7 @@ SWIGINTERN PyObject *_wrap_Window_FromHWND(PyObject *SWIGUNUSEDPARM(self), PyObj
}
arg2 = static_cast< unsigned long >(val2);
{
if (!wxPyCheckForApp()) SWIG_fail;
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxWindow *)wxWindow_FromHWND(arg1,arg2);
wxPyEndAllowThreads(__tstate);
+7 -7
View File
@@ -80,15 +80,15 @@ class AnimationBase(_core.Object):
return _animate.AnimationBase_IsOk(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, size_t i) -> int"""
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs)
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> size_t"""
"""GetFrameCount(self) -> int"""
return _animate.AnimationBase_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, size_t i) -> Image"""
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationBase_GetFrame(*args, **kwargs)
def GetSize(*args, **kwargs):
@@ -120,19 +120,19 @@ class Animation(AnimationBase):
__swig_destroy__ = _animate.delete_Animation
__del__ = lambda self : None;
def GetFramePosition(*args, **kwargs):
"""GetFramePosition(self, size_t frame) -> Point"""
"""GetFramePosition(self, int frame) -> Point"""
return _animate.Animation_GetFramePosition(*args, **kwargs)
def GetFrameSize(*args, **kwargs):
"""GetFrameSize(self, size_t frame) -> Size"""
"""GetFrameSize(self, int frame) -> Size"""
return _animate.Animation_GetFrameSize(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, size_t frame) -> int"""
"""GetDisposalMethod(self, int frame) -> int"""
return _animate.Animation_GetDisposalMethod(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, size_t frame) -> Colour"""
"""GetTransparentColour(self, int frame) -> Colour"""
return _animate.Animation_GetTransparentColour(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
+48 -86
View File
@@ -2678,55 +2678,6 @@ SWIG_From_int (int value)
}
SWIGINTERN int
SWIG_AsVal_long (PyObject* obj, long* val)
{
if (PyNumber_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
}
return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (PyObject* obj, unsigned long* val)
{
long v = 0;
if (SWIG_AsVal_long(obj, &v) && v < 0) {
return SWIG_TypeError;
}
else if (val)
*val = (unsigned long)v;
return SWIG_OK;
}
SWIGINTERNINLINE int
SWIG_AsVal_size_t (PyObject * obj, size_t *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
return res;
}
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long (unsigned long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
}
SWIGINTERNINLINE PyObject *
SWIG_From_size_t (size_t value)
{
return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
}
#include <limits.h>
#ifndef LLONG_MIN
# define LLONG_MIN LONG_LONG_MIN
@@ -2739,6 +2690,17 @@ SWIG_From_size_t (size_t value)
#endif
SWIGINTERN int
SWIG_AsVal_long (PyObject* obj, long* val)
{
if (PyNumber_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
}
return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
@@ -2759,10 +2721,10 @@ SWIGINTERN wxAnimation *new_wxAnimation__SWIG_1(wxString const &name,wxAnimation
ani->LoadFile(name, type);
return ani;
}
SWIGINTERN wxPoint wxAnimation_GetFramePosition(wxAnimation const *self,size_t frame){ return wxDefaultPosition; }
SWIGINTERN wxSize wxAnimation_GetFrameSize(wxAnimation const *self,size_t frame){ return wxDefaultSize; }
SWIGINTERN wxAnimationDisposal wxAnimation_GetDisposalMethod(wxAnimation const *self,size_t frame){ return wxANIM_UNSPECIFIED; }
SWIGINTERN wxColour wxAnimation_GetTransparentColour(wxAnimation const *self,size_t frame){ return wxNullColour; }
SWIGINTERN wxPoint wxAnimation_GetFramePosition(wxAnimation const *self,int frame){ return wxDefaultPosition; }
SWIGINTERN wxSize wxAnimation_GetFrameSize(wxAnimation const *self,int frame){ return wxDefaultSize; }
SWIGINTERN wxAnimationDisposal wxAnimation_GetDisposalMethod(wxAnimation const *self,int frame){ return wxANIM_UNSPECIFIED; }
SWIGINTERN wxColour wxAnimation_GetTransparentColour(wxAnimation const *self,int frame){ return wxNullColour; }
SWIGINTERN wxColour wxAnimation_GetBackgroundColour(wxAnimation const *self){ return wxNullColour; }
// for backwards compatibility
#ifndef wxAN_FIT_ANIMATION
@@ -2875,11 +2837,11 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetDelay(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t arg2 ;
int arg2 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -2893,11 +2855,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetDelay(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AnimationBase_GetDelay" "', expected argument " "1"" of type '" "wxAnimationBase const *""'");
}
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetDelay" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetDelay" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (int)((wxAnimationBase const *)arg1)->GetDelay(arg2);
@@ -2914,7 +2876,7 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetFrameCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t result;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
@@ -2928,11 +2890,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetFrameCount(PyObject *SWIGUNUSEDPARM(
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (size_t)((wxAnimationBase const *)arg1)->GetFrameCount();
result = (int)((wxAnimationBase const *)arg1)->GetFrameCount();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_From_size_t(static_cast< size_t >(result));
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
@@ -2942,11 +2904,11 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t arg2 ;
int arg2 ;
SwigValueWrapper<wxImage > result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -2960,11 +2922,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetFrame(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AnimationBase_GetFrame" "', expected argument " "1"" of type '" "wxAnimationBase const *""'");
}
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetFrame" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetFrame" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = ((wxAnimationBase const *)arg1)->GetFrame(arg2);
@@ -3250,11 +3212,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetFramePosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxPoint result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3268,11 +3230,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetFramePosition(PyObject *SWIGUNUSEDPARM(s
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetFramePosition" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFramePosition" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFramePosition" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = wxAnimation_GetFramePosition((wxAnimation const *)arg1,arg2);
@@ -3289,11 +3251,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetFrameSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxSize result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3307,11 +3269,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetFrameSize(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetFrameSize" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFrameSize" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFrameSize" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = wxAnimation_GetFrameSize((wxAnimation const *)arg1,arg2);
@@ -3328,11 +3290,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetDisposalMethod(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxAnimationDisposal result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3346,11 +3308,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetDisposalMethod(PyObject *SWIGUNUSEDPARM(
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetDisposalMethod" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetDisposalMethod" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetDisposalMethod" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxAnimationDisposal)wxAnimation_GetDisposalMethod((wxAnimation const *)arg1,arg2);
@@ -3367,11 +3329,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetTransparentColour(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxColour result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3385,11 +3347,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetTransparentColour(PyObject *SWIGUNUSEDPA
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetTransparentColour" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetTransparentColour" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetTransparentColour" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = wxAnimation_GetTransparentColour((wxAnimation const *)arg1,arg2);
+1
View File
@@ -3320,6 +3320,7 @@ public:
rval = *ptr;
}
else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
PyErr_Clear(); // Clear the exception left over from wxPyConvertSwigPtr
PyObject* o1 = PySequence_GetItem(ro, 0);
PyObject* o2 = PySequence_GetItem(ro, 1);
if (PyNumber_Check(o1) && PyNumber_Check(o2))
+84 -2
View File
@@ -1012,6 +1012,7 @@ _controls_.StaticBox_swigregister(StaticBox)
StaticBitmapNameStr = cvar.StaticBitmapNameStr
StaticBoxNameStr = cvar.StaticBoxNameStr
StaticTextNameStr = cvar.StaticTextNameStr
StaticLineNameStr = cvar.StaticLineNameStr
def PreStaticBox(*args, **kwargs):
"""PreStaticBox() -> StaticBox"""
@@ -1045,7 +1046,7 @@ class StaticLine(_core.Control):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> StaticLine
String name=StaticLineNameStr) -> StaticLine
"""
_controls_.StaticLine_swiginit(self,_controls_.new_StaticLine(*args, **kwargs))
self._setOORInfo(self)
@@ -1054,7 +1055,7 @@ class StaticLine(_core.Control):
"""
Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> bool
String name=StaticLineNameStr) -> bool
"""
return _controls_.StaticLine_Create(*args, **kwargs)
@@ -7121,5 +7122,86 @@ class CollapsiblePaneEvent(_core.CommandEvent):
Collapsed = property(GetCollapsed,SetCollapsed)
_controls_.CollapsiblePaneEvent_swigregister(CollapsiblePaneEvent)
#---------------------------------------------------------------------------
class SearchCtrl(TextCtrl):
"""Proxy of C++ SearchCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> SearchCtrl
"""
_controls_.SearchCtrl_swiginit(self,_controls_.new_SearchCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> bool
"""
return _controls_.SearchCtrl_Create(*args, **kwargs)
def SetMenu(*args, **kwargs):
"""SetMenu(self, Menu menu)"""
return _controls_.SearchCtrl_SetMenu(*args, **kwargs)
def GetMenu(*args, **kwargs):
"""GetMenu(self) -> Menu"""
return _controls_.SearchCtrl_GetMenu(*args, **kwargs)
def SetSearchButtonVisible(*args, **kwargs):
"""SetSearchButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetSearchButtonVisible(*args, **kwargs)
def GetSearchButtonVisible(*args, **kwargs):
"""GetSearchButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetSearchButtonVisible(*args, **kwargs)
def SetCancelButtonVisible(*args, **kwargs):
"""SetCancelButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetCancelButtonVisible(*args, **kwargs)
def GetCancelButtonVisible(*args, **kwargs):
"""GetCancelButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetCancelButtonVisible(*args, **kwargs)
def SetSearchBitmap(*args, **kwargs):
"""SetSearchBitmap(self, Bitmap ?)"""
return _controls_.SearchCtrl_SetSearchBitmap(*args, **kwargs)
def SetSearchMenuBitmap(*args, **kwargs):
"""SetSearchMenuBitmap(self, Bitmap ?)"""
return _controls_.SearchCtrl_SetSearchMenuBitmap(*args, **kwargs)
def SetCancelBitmap(*args, **kwargs):
"""SetCancelBitmap(self, Bitmap ?)"""
return _controls_.SearchCtrl_SetCancelBitmap(*args, **kwargs)
Menu = property(GetMenu,SetMenu)
SearchButtonVisible = property(GetSearchButtonVisible,SetSearchButtonVisible)
CancelButtonVisible = property(GetCancelButtonVisible,SetCancelButtonVisible)
_controls_.SearchCtrl_swigregister(SearchCtrl)
SearchCtrlNameStr = cvar.SearchCtrlNameStr
def PreSearchCtrl(*args, **kwargs):
"""
PreSearchCtrl() -> SearchCtrl
Precreate a wx.SearchCtrl for 2-phase creation.
"""
val = _controls_.new_PreSearchCtrl(*args, **kwargs)
return val
wxEVT_COMMAND_SEARCHCTRL_CANCEL = _controls_.wxEVT_COMMAND_SEARCHCTRL_CANCEL
wxEVT_COMMAND_SEARCHCTRL_SEARCH = _controls_.wxEVT_COMMAND_SEARCHCTRL_SEARCH
EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1)
EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1)
File diff suppressed because one or more lines are too long
+1
View File
@@ -41271,6 +41271,7 @@ SWIGINTERN PyObject *_wrap_Window_FromHWND(PyObject *SWIGUNUSEDPARM(self), PyObj
}
arg2 = static_cast< unsigned long >(val2);
{
if (!wxPyCheckForApp()) SWIG_fail;
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxWindow *)wxWindow_FromHWND(arg1,arg2);
wxPyEndAllowThreads(__tstate);
+1
View File
@@ -3320,6 +3320,7 @@ public:
rval = *ptr;
}
else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
PyErr_Clear(); // Clear the exception left over from wxPyConvertSwigPtr
PyObject* o1 = PySequence_GetItem(ro, 0);
PyObject* o2 = PySequence_GetItem(ro, 1);
if (PyNumber_Check(o1) && PyNumber_Check(o2))
+84 -2
View File
@@ -1018,6 +1018,7 @@ _controls_.StaticBox_swigregister(StaticBox)
StaticBitmapNameStr = cvar.StaticBitmapNameStr
StaticBoxNameStr = cvar.StaticBoxNameStr
StaticTextNameStr = cvar.StaticTextNameStr
StaticLineNameStr = cvar.StaticLineNameStr
def PreStaticBox(*args, **kwargs):
"""PreStaticBox() -> StaticBox"""
@@ -1051,7 +1052,7 @@ class StaticLine(_core.Control):
"""
__init__(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> StaticLine
String name=StaticLineNameStr) -> StaticLine
"""
_controls_.StaticLine_swiginit(self,_controls_.new_StaticLine(*args, **kwargs))
self._setOORInfo(self)
@@ -1060,7 +1061,7 @@ class StaticLine(_core.Control):
"""
Create(self, Window parent, int id=-1, Point pos=DefaultPosition,
Size size=DefaultSize, long style=LI_HORIZONTAL,
String name=StaticTextNameStr) -> bool
String name=StaticLineNameStr) -> bool
"""
return _controls_.StaticLine_Create(*args, **kwargs)
@@ -7147,5 +7148,86 @@ class CollapsiblePaneEvent(_core.CommandEvent):
Collapsed = property(GetCollapsed,SetCollapsed)
_controls_.CollapsiblePaneEvent_swigregister(CollapsiblePaneEvent)
#---------------------------------------------------------------------------
class SearchCtrl(TextCtrl):
"""Proxy of C++ SearchCtrl class"""
thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
__repr__ = _swig_repr
def __init__(self, *args, **kwargs):
"""
__init__(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> SearchCtrl
"""
_controls_.SearchCtrl_swiginit(self,_controls_.new_SearchCtrl(*args, **kwargs))
self._setOORInfo(self)
def Create(*args, **kwargs):
"""
Create(self, Window parent, int id=-1, String value=wxEmptyString,
Point pos=DefaultPosition, Size size=DefaultSize,
long style=0, Validator validator=DefaultValidator,
String name=SearchCtrlNameStr) -> bool
"""
return _controls_.SearchCtrl_Create(*args, **kwargs)
def SetMenu(*args, **kwargs):
"""SetMenu(self, Menu menu)"""
return _controls_.SearchCtrl_SetMenu(*args, **kwargs)
def GetMenu(*args, **kwargs):
"""GetMenu(self) -> Menu"""
return _controls_.SearchCtrl_GetMenu(*args, **kwargs)
def SetSearchButtonVisible(*args, **kwargs):
"""SetSearchButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetSearchButtonVisible(*args, **kwargs)
def GetSearchButtonVisible(*args, **kwargs):
"""GetSearchButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetSearchButtonVisible(*args, **kwargs)
def SetCancelButtonVisible(*args, **kwargs):
"""SetCancelButtonVisible(self, bool show)"""
return _controls_.SearchCtrl_SetCancelButtonVisible(*args, **kwargs)
def GetCancelButtonVisible(*args, **kwargs):
"""GetCancelButtonVisible(self) -> bool"""
return _controls_.SearchCtrl_GetCancelButtonVisible(*args, **kwargs)
def SetSearchBitmap(*args, **kwargs):
"""SetSearchBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetSearchBitmap(*args, **kwargs)
def SetSearchMenuBitmap(*args, **kwargs):
"""SetSearchMenuBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetSearchMenuBitmap(*args, **kwargs)
def SetCancelBitmap(*args, **kwargs):
"""SetCancelBitmap(self, Bitmap bitmap)"""
return _controls_.SearchCtrl_SetCancelBitmap(*args, **kwargs)
Menu = property(GetMenu,SetMenu)
SearchButtonVisible = property(GetSearchButtonVisible,SetSearchButtonVisible)
CancelButtonVisible = property(GetCancelButtonVisible,SetCancelButtonVisible)
_controls_.SearchCtrl_swigregister(SearchCtrl)
SearchCtrlNameStr = cvar.SearchCtrlNameStr
def PreSearchCtrl(*args, **kwargs):
"""
PreSearchCtrl() -> SearchCtrl
Precreate a wx.SearchCtrl for 2-phase creation.
"""
val = _controls_.new_PreSearchCtrl(*args, **kwargs)
return val
wxEVT_COMMAND_SEARCHCTRL_CANCEL = _controls_.wxEVT_COMMAND_SEARCHCTRL_CANCEL
wxEVT_COMMAND_SEARCHCTRL_SEARCH = _controls_.wxEVT_COMMAND_SEARCHCTRL_SEARCH
EVT_SEARCHCTRL_CANCEL = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_CANCEL, 1)
EVT_SEARCHCTRL_SEARCH = wx.PyEventBinder( wxEVT_COMMAND_SEARCHCTRL_SEARCH, 1)
File diff suppressed because one or more lines are too long
+1
View File
@@ -41297,6 +41297,7 @@ SWIGINTERN PyObject *_wrap_Window_FromHWND(PyObject *SWIGUNUSEDPARM(self), PyObj
}
arg2 = static_cast< unsigned long >(val2);
{
if (!wxPyCheckForApp()) SWIG_fail;
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxWindow *)wxWindow_FromHWND(arg1,arg2);
wxPyEndAllowThreads(__tstate);
+7 -7
View File
@@ -80,15 +80,15 @@ class AnimationBase(_core.Object):
return _animate.AnimationBase_IsOk(*args, **kwargs)
def GetDelay(*args, **kwargs):
"""GetDelay(self, size_t i) -> int"""
"""GetDelay(self, int i) -> int"""
return _animate.AnimationBase_GetDelay(*args, **kwargs)
def GetFrameCount(*args, **kwargs):
"""GetFrameCount(self) -> size_t"""
"""GetFrameCount(self) -> int"""
return _animate.AnimationBase_GetFrameCount(*args, **kwargs)
def GetFrame(*args, **kwargs):
"""GetFrame(self, size_t i) -> Image"""
"""GetFrame(self, int i) -> Image"""
return _animate.AnimationBase_GetFrame(*args, **kwargs)
def GetSize(*args, **kwargs):
@@ -120,19 +120,19 @@ class Animation(AnimationBase):
__swig_destroy__ = _animate.delete_Animation
__del__ = lambda self : None;
def GetFramePosition(*args, **kwargs):
"""GetFramePosition(self, size_t frame) -> Point"""
"""GetFramePosition(self, int frame) -> Point"""
return _animate.Animation_GetFramePosition(*args, **kwargs)
def GetFrameSize(*args, **kwargs):
"""GetFrameSize(self, size_t frame) -> Size"""
"""GetFrameSize(self, int frame) -> Size"""
return _animate.Animation_GetFrameSize(*args, **kwargs)
def GetDisposalMethod(*args, **kwargs):
"""GetDisposalMethod(self, size_t frame) -> int"""
"""GetDisposalMethod(self, int frame) -> int"""
return _animate.Animation_GetDisposalMethod(*args, **kwargs)
def GetTransparentColour(*args, **kwargs):
"""GetTransparentColour(self, size_t frame) -> Colour"""
"""GetTransparentColour(self, int frame) -> Colour"""
return _animate.Animation_GetTransparentColour(*args, **kwargs)
def GetBackgroundColour(*args, **kwargs):
+44 -82
View File
@@ -2678,55 +2678,6 @@ SWIG_From_int (int value)
}
SWIGINTERN int
SWIG_AsVal_long (PyObject* obj, long* val)
{
if (PyNumber_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
}
return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_unsigned_SS_long (PyObject* obj, unsigned long* val)
{
long v = 0;
if (SWIG_AsVal_long(obj, &v) && v < 0) {
return SWIG_TypeError;
}
else if (val)
*val = (unsigned long)v;
return SWIG_OK;
}
SWIGINTERNINLINE int
SWIG_AsVal_size_t (PyObject * obj, size_t *val)
{
unsigned long v;
int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
return res;
}
SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long (unsigned long value)
{
return (value > LONG_MAX) ?
PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value));
}
SWIGINTERNINLINE PyObject *
SWIG_From_size_t (size_t value)
{
return SWIG_From_unsigned_SS_long (static_cast< unsigned long >(value));
}
#include <limits.h>
#ifndef LLONG_MIN
# define LLONG_MIN LONG_LONG_MIN
@@ -2739,6 +2690,17 @@ SWIG_From_size_t (size_t value)
#endif
SWIGINTERN int
SWIG_AsVal_long (PyObject* obj, long* val)
{
if (PyNumber_Check(obj)) {
if (val) *val = PyInt_AsLong(obj);
return SWIG_OK;
}
return SWIG_TypeError;
}
SWIGINTERN int
SWIG_AsVal_int (PyObject * obj, int *val)
{
@@ -2866,11 +2828,11 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetDelay(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t arg2 ;
int arg2 ;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -2884,11 +2846,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetDelay(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AnimationBase_GetDelay" "', expected argument " "1"" of type '" "wxAnimationBase const *""'");
}
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetDelay" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetDelay" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (int)((wxAnimationBase const *)arg1)->GetDelay(arg2);
@@ -2905,7 +2867,7 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetFrameCount(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t result;
int result;
void *argp1 = 0 ;
int res1 = 0 ;
PyObject *swig_obj[1] ;
@@ -2919,11 +2881,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetFrameCount(PyObject *SWIGUNUSEDPARM(
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (size_t)((wxAnimationBase const *)arg1)->GetFrameCount();
result = (int)((wxAnimationBase const *)arg1)->GetFrameCount();
wxPyEndAllowThreads(__tstate);
if (PyErr_Occurred()) SWIG_fail;
}
resultobj = SWIG_From_size_t(static_cast< size_t >(result));
resultobj = SWIG_From_int(static_cast< int >(result));
return resultobj;
fail:
return NULL;
@@ -2933,11 +2895,11 @@ fail:
SWIGINTERN PyObject *_wrap_AnimationBase_GetFrame(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimationBase *arg1 = (wxAnimationBase *) 0 ;
size_t arg2 ;
int arg2 ;
SwigValueWrapper<wxImage > result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -2951,11 +2913,11 @@ SWIGINTERN PyObject *_wrap_AnimationBase_GetFrame(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AnimationBase_GetFrame" "', expected argument " "1"" of type '" "wxAnimationBase const *""'");
}
arg1 = reinterpret_cast< wxAnimationBase * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetFrame" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "AnimationBase_GetFrame" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = ((wxAnimationBase const *)arg1)->GetFrame(arg2);
@@ -3241,11 +3203,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetFramePosition(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxPoint result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3259,11 +3221,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetFramePosition(PyObject *SWIGUNUSEDPARM(s
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetFramePosition" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFramePosition" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFramePosition" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = ((wxAnimation const *)arg1)->GetFramePosition(arg2);
@@ -3280,11 +3242,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetFrameSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxSize result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3298,11 +3260,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetFrameSize(PyObject *SWIGUNUSEDPARM(self)
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetFrameSize" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFrameSize" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetFrameSize" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = ((wxAnimation const *)arg1)->GetFrameSize(arg2);
@@ -3319,11 +3281,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetDisposalMethod(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxAnimationDisposal result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3337,11 +3299,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetDisposalMethod(PyObject *SWIGUNUSEDPARM(
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetDisposalMethod" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetDisposalMethod" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetDisposalMethod" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = (wxAnimationDisposal)((wxAnimation const *)arg1)->GetDisposalMethod(arg2);
@@ -3358,11 +3320,11 @@ fail:
SWIGINTERN PyObject *_wrap_Animation_GetTransparentColour(PyObject *SWIGUNUSEDPARM(self), PyObject *args, PyObject *kwargs) {
PyObject *resultobj = 0;
wxAnimation *arg1 = (wxAnimation *) 0 ;
size_t arg2 ;
int arg2 ;
wxColour result;
void *argp1 = 0 ;
int res1 = 0 ;
size_t val2 ;
int val2 ;
int ecode2 = 0 ;
PyObject * obj0 = 0 ;
PyObject * obj1 = 0 ;
@@ -3376,11 +3338,11 @@ SWIGINTERN PyObject *_wrap_Animation_GetTransparentColour(PyObject *SWIGUNUSEDPA
SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Animation_GetTransparentColour" "', expected argument " "1"" of type '" "wxAnimation const *""'");
}
arg1 = reinterpret_cast< wxAnimation * >(argp1);
ecode2 = SWIG_AsVal_size_t(obj1, &val2);
ecode2 = SWIG_AsVal_int(obj1, &val2);
if (!SWIG_IsOK(ecode2)) {
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetTransparentColour" "', expected argument " "2"" of type '" "size_t""'");
SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Animation_GetTransparentColour" "', expected argument " "2"" of type '" "int""'");
}
arg2 = static_cast< size_t >(val2);
arg2 = static_cast< int >(val2);
{
PyThreadState* __tstate = wxPyBeginAllowThreads();
result = ((wxAnimation const *)arg1)->GetTransparentColour(arg2);
+1
View File
@@ -3320,6 +3320,7 @@ public:
rval = *ptr;
}
else if (PySequence_Check(ro) && PyObject_Length(ro) == 2) {
PyErr_Clear(); // Clear the exception left over from wxPyConvertSwigPtr
PyObject* o1 = PySequence_GetItem(ro, 0);
PyObject* o2 = PySequence_GetItem(ro, 1);
if (PyNumber_Check(o1) && PyNumber_Check(o2))