You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(191) |
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(238) |
Dec
(68) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(104) |
Feb
(518) |
Mar
(302) |
Apr
(211) |
May
(311) |
Jun
(55) |
Jul
(6) |
Aug
(35) |
Sep
(76) |
Oct
(50) |
Nov
(37) |
Dec
(340) |
2007 |
Jan
(23) |
Feb
(107) |
Mar
(98) |
Apr
(60) |
May
(136) |
Jun
(371) |
Jul
(175) |
Aug
(74) |
Sep
(3) |
Oct
(2) |
Nov
(53) |
Dec
(129) |
2008 |
Jan
(337) |
Feb
(23) |
Mar
(18) |
Apr
(4) |
May
(3) |
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
(33) |
Nov
|
Dec
(26) |
2009 |
Jan
(4) |
Feb
(1) |
Mar
(15) |
Apr
|
May
(35) |
Jun
(11) |
Jul
|
Aug
|
Sep
(19) |
Oct
(26) |
Nov
(11) |
Dec
(11) |
2010 |
Jan
(4) |
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(8) |
Sep
|
Oct
|
Nov
(8) |
Dec
(7) |
2011 |
Jan
|
Feb
|
Mar
(4) |
Apr
(8) |
May
(5) |
Jun
(8) |
Jul
(1) |
Aug
|
Sep
|
Oct
(5) |
Nov
(13) |
Dec
|
From: John L. <jr...@us...> - 2007-06-12 05:03:20
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/modules/wxbindstc/src Modified Files: Makefile wxstc_bind.cpp Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wxstc_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/wxstc_bind.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** wxstc_bind.cpp 8 Jun 2007 01:36:31 -0000 1.24 --- wxstc_bind.cpp 12 Jun 2007 05:03:17 -0000 1.25 *************** *** 1533,1536 **** --- 1533,1537 ---- m_objectArray = wxLuaGetObjectList_wxstc(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxstc(m_functionCount); + InitBinding(); } Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/Makefile,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** Makefile 23 May 2007 20:17:24 -0000 1.9 --- Makefile 12 Jun 2007 05:03:17 -0000 1.10 *************** *** 36,40 **** CXX = $(WXCXX) ! APPEXTRADEFS = -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXLUA_WXLUASETUP_DIR) -I$(WXPREFIX)/contrib/include -DLUACALL= WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluastc-$(WXRELEASE) --- 36,42 ---- CXX = $(WXCXX) ! GCC_PROFILE = #-pg ! APPEXTRADEFS = $(GCC_PROFILE) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXLUA_WXLUASETUP_DIR) -I$(WXPREFIX)/contrib/include -DLUACALL= ! APPEXTRALIBS = $(GCC_PROFILE) WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluastc-$(WXRELEASE) *************** *** 72,76 **** $(WXBIND_TARGET_LIB_SHARED): $(OBJECTS) ! $(CXX) -shared -o $@ $(OBJECTS) cd $(WXBIND_TARGET_LIBDIR) \ && $(RM) $(WXBIND_TARGET_LIB_LINK1) $(WXBIND_TARGET_LIB_LINK2) \ --- 74,78 ---- $(WXBIND_TARGET_LIB_SHARED): $(OBJECTS) ! $(CXX) -shared -o $@ $(OBJECTS) $(APPEXTRALIBS) cd $(WXBIND_TARGET_LIBDIR) \ && $(RM) $(WXBIND_TARGET_LIB_LINK1) $(WXBIND_TARGET_LIB_LINK2) \ |
From: John L. <jr...@us...> - 2007-06-12 05:03:20
|
Update of /cvsroot/wxlua/wxLua/apps/wxluafreeze/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/apps/wxluafreeze/src Modified Files: Makefile Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluafreeze/src/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Makefile 23 May 2007 20:17:24 -0000 1.5 --- Makefile 12 Jun 2007 05:03:16 -0000 1.6 *************** *** 48,52 **** WXFL_LIB = $(WXBASENAME)_fl-$(WXRELEASE) ! APPEXTRADEFS = -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -DLUACALL= # This will build a static wxLua app, staticly linked to .a libs --- 48,53 ---- WXFL_LIB = $(WXBASENAME)_fl-$(WXRELEASE) ! GCC_PROFILE = #-pg ! APPEXTRADEFS = $(GCC_PROFILE) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -DLUACALL= # This will build a static wxLua app, staticly linked to .a libs *************** *** 55,59 **** # This will build a shared wxLua app, dynamicly linked to .so libs # -l$(WXFL_LIB) ! APPEXTRALIBS=-L$(WXLIB_DIR) -L$(WXLUA_LIBDIR) -l$(WXSTC_LIB) -l$(WXXRC_LIB) -l$(WXLUABIND_LIB) -l$(WXLUASTC_LIB) -l$(WXLUA_LIB) -l$(WXLUADEBUG_LIB) -l$(WXLUASOCKET_LIB) $(LUA_LIBS) OBJECTS=wxluafreeze.o --- 56,60 ---- # This will build a shared wxLua app, dynamicly linked to .so libs # -l$(WXFL_LIB) ! APPEXTRALIBS=$(GCC_PROFILE) -L$(WXLIB_DIR) -L$(WXLUA_LIBDIR) -l$(WXSTC_LIB) -l$(WXXRC_LIB) -l$(WXLUABIND_LIB) -l$(WXLUASTC_LIB) -l$(WXLUA_LIB) -l$(WXLUADEBUG_LIB) -l$(WXLUASOCKET_LIB) $(LUA_LIBS) OBJECTS=wxluafreeze.o |
From: John L. <jr...@us...> - 2007-06-12 05:03:20
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/modules/wxbindstc/include Modified Files: wxbind.h Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/include/wxbind.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxbind.h 8 Jun 2007 01:36:30 -0000 1.25 --- wxbind.h 12 Jun 2007 05:03:17 -0000 1.26 *************** *** 26,32 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 10 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 10 // --------------------------------------------------------------------------- --- 26,32 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 11 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 11 // --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-06-12 05:03:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/modules/wxbind/src Modified Files: Makefile wx_bind.cpp Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -C2 -d -r1.101 -r1.102 *** wx_bind.cpp 12 Jun 2007 00:08:40 -0000 1.101 --- wx_bind.cpp 12 Jun 2007 05:03:16 -0000 1.102 *************** *** 7756,7759 **** --- 7756,7760 ---- m_objectArray = wxLuaGetObjectList_wx(m_objectCount); m_functionArray = wxLuaGetFunctionList_wx(m_functionCount); + InitBinding(); } Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/Makefile,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Makefile 23 May 2007 20:17:24 -0000 1.13 --- Makefile 12 Jun 2007 05:03:16 -0000 1.14 *************** *** 39,43 **** CXX = $(WXCXX) ! APPEXTRADEFS = -I$(WXLUA_WXLUASETUP_DIR) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -DLUACALL= WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluabind-$(WXRELEASE) --- 39,45 ---- CXX = $(WXCXX) ! GCC_PROFILE = #-pg ! APPEXTRADEFS = $(GCC_PROFILE) -I$(WXLUA_WXLUASETUP_DIR) -I$(WXLUA_DIR) -I$(WXLUA_DIR)/modules -I$(WXLUA_DIR)/modules/lua/include -I$(WXPREFIX)/contrib/include -DLUACALL= ! APPEXTRALIBS = $(GCC_PROFILE) WXBIND_TARGET_LIBNAME = lib$(WXBASENAME)_wxluabind-$(WXRELEASE) *************** *** 103,107 **** $(WXBIND_TARGET_LIB_SHARED): $(OBJECTS) ! $(CXX) -shared -o $@ $(OBJECTS) cd $(WXBIND_TARGET_LIBDIR) \ && $(RM) $(WXBIND_TARGET_LIB_LINK1) $(WXBIND_TARGET_LIB_LINK2) \ --- 105,109 ---- $(WXBIND_TARGET_LIB_SHARED): $(OBJECTS) ! $(CXX) -shared -o $@ $(OBJECTS) $(APPEXTRALIBS) cd $(WXBIND_TARGET_LIBDIR) \ && $(RM) $(WXBIND_TARGET_LIB_LINK1) $(WXBIND_TARGET_LIB_LINK2) \ |
From: John L. <jr...@us...> - 2007-06-12 05:03:19
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/bindings Modified Files: genwxbind.lua Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.118 retrieving revision 1.119 diff -C2 -d -r1.118 -r1.119 *** genwxbind.lua 12 Jun 2007 00:08:35 -0000 1.118 --- genwxbind.lua 12 Jun 2007 05:03:16 -0000 1.119 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 10 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. --- 18,22 ---- -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 11 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 4114,4117 **** --- 4114,4118 ---- table.insert(fileData, " m_objectArray = "..hook_cpp_object_funcname.."(m_objectCount);\n") table.insert(fileData, " m_functionArray = "..hook_cpp_function_funcname.."(m_functionCount);\n") + table.insert(fileData, " InitBinding();\n") table.insert(fileData, "}\n") table.insert(fileData, "\n") |
From: John L. <jr...@us...> - 2007-06-12 05:03:19
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/apps/wxluacan/src Modified Files: wxluacan.h wxluacan_bind.cpp Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wxluacan_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan_bind.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxluacan_bind.cpp 8 Jun 2007 01:36:21 -0000 1.22 --- wxluacan_bind.cpp 12 Jun 2007 05:03:16 -0000 1.23 *************** *** 181,184 **** --- 181,185 ---- m_objectArray = wxLuaGetObjectList_wxluacan(m_objectCount); m_functionArray = wxLuaGetFunctionList_wxluacan(m_functionCount); + InitBinding(); } Index: wxluacan.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/wxluacan.h,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** wxluacan.h 8 Jun 2007 01:36:21 -0000 1.27 --- wxluacan.h 12 Jun 2007 05:03:16 -0000 1.28 *************** *** 18,24 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 10 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 10 // --------------------------------------------------------------------------- --- 18,24 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 11 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 11 // --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-06-12 05:03:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22549/wxLua/modules/wxbind/include Modified Files: wxbind.h Log Message: Add ability to do profiling in GCC using Makefiles Add InitBinding function to wxLuaBinding to presort items Test code for sorted wxLuaMethods, doesn't seem to be any faster though. Index: wxbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxbind.h,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** wxbind.h 8 Jun 2007 01:36:22 -0000 1.69 --- wxbind.h 12 Jun 2007 05:03:16 -0000 1.70 *************** *** 43,49 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 10 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 10 // --------------------------------------------------------------------------- --- 43,49 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 11 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 11 // --------------------------------------------------------------------------- |
From: John L. <jr...@us...> - 2007-06-12 00:09:10
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/docs Modified Files: binding.html changelog.txt wxlua.html Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxlua.html 11 Jun 2007 03:57:59 -0000 1.22 --- wxlua.html 12 Jun 2007 00:08:36 -0000 1.23 *************** *** 1,20 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! <title>wxLua Documentation</title> ! ! ! <meta content="John Labenski" name="author"> ! [...3672 lines suppressed...] the script as a string with the given name. The name is only used if lua errors out and then the debug message will contain ! that name. </li> <li>Returns lua's error code LUA_ERRXXX ! or 0 on success</li> </ul> <li>int ! LuaDoBuffer(const char *buffer, size_t len, const char ! *name)</li> <ul> <li>Run a buffer, perhaps from bin2lua.lua, that you've ! compiled with your program.</li> <li>Returns lua's error ! code LUA_ERRXXX or 0 on success</li> </ul> <li>int ! LuaDoFile(const wxString &filename)</li> <ul> <li>Run ! a lua file from disk.</li> <li>Returns lua's error code ! LUA_ERRXXX or 0 on success</li> </ul> <li>int ! LuaPCall(int narg, int nresults)</li> <ul> <li>Uses lua_call to run a chunk on the stack, but sets ! things up for wxLua first.</li> <li>Returns lua's error ! code LUA_ERRXXX or 0 on success</li> </ul> <li>The other functions are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> ! </ul></body></html> \ No newline at end of file Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** changelog.txt 11 Jun 2007 03:57:59 -0000 1.34 --- changelog.txt 12 Jun 2007 00:08:36 -0000 1.35 *************** *** 80,83 **** --- 80,92 ---- - Added validator.wx.lua to test wxGenericValidators and wxTextValidators, both of which work again. + - Rename all functions dealing with "enumeration" to "integer" since it's + more generic and that's what it's often used for. + + - Event handling is faster now that we store the wxLuaBindEvent struct + instead of the wxEventType and then have to look up the struct each time. + + - Changed calling base class function from base_[FunctionName] to just + _[Function Name]. This is faster and more reliable since if a function + was called "base_XXX" before there would have been a problem. version 2.8.0.0 (released 24/12/2006) Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** binding.html 11 Jun 2007 03:57:59 -0000 1.19 --- binding.html 12 Jun 2007 00:08:36 -0000 1.20 *************** *** 1,30 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> ! ! <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! <title>wxLua Binding HowTo</title> ! ! ! <meta content="John Labenski" name="author"> ! [...2118 lines suppressed...] %__WXMOTIF20__<br> %__WXMAC__<br> %__WXMAC_CLASSIC__<br> %__WXMAC_CARBON__<br> %__WXMAC_OSX__<br> %__WXMGL__<br> %__WXMSW__<br> %__WXOS2__<br> %__WXOSX__<br> %__WXPALMOS__<br> %__WXPM__<br> %__WXSTUBS__<br> %__WXXT__<br> %__WXX11__<br> %__WXWINE__<br> %__WXUNIVERSAL__<br> %__X__<br> %__WXWINCE__<br> ! <br></body></html> \ No newline at end of file |
From: John L. <jr...@us...> - 2007-06-12 00:09:10
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/bindings/wxwidgets Modified Files: data.i override.hpp wx_datatypes.lua wxlua.i Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -d -r1.64 -r1.65 *** wx_datatypes.lua 8 Jun 2007 22:50:08 -0000 1.64 --- wx_datatypes.lua 12 Jun 2007 00:08:36 -0000 1.65 *************** *** 247,255 **** Name = "wxArrayInt", }, - wxArrayInt_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayInt_FromLuaTable", - }, wxArrayString = { Condition = "wxLUA_USE_wxArrayString", --- 247,250 ---- *************** *** 259,267 **** Name = "wxArrayString", }, - wxArrayString_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayString_FromLuaTable", - }, wxArrayTreeItemIds = { Condition = "wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL", --- 254,257 ---- Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxlua.i,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** wxlua.i 11 Jun 2007 03:57:59 -0000 1.23 --- wxlua.i 12 Jun 2007 00:08:36 -0000 1.24 *************** *** 42,46 **** %define WXLUAARG_UserData %define WXLUAARG_LuaThread ! %define WXLUAARG_Enum // Is this lua_type() (or in lua type()) considered --- 42,46 ---- %define WXLUAARG_UserData %define WXLUAARG_LuaThread ! %define WXLUAARG_Integer // Is this lua_type() (or in lua type()) considered *************** *** 189,196 **** // %override [any value type] wxLuaObject::GetObject() // C++ Func: bool GetObject() ! // get the object, note C++ returns bool, this "returns" the referenced object void GetObject() const ! // these are used to verify that things are working //bool *GetBoolPtr(); //int *GetIntPtr(); --- 189,196 ---- // %override [any value type] wxLuaObject::GetObject() // C++ Func: bool GetObject() ! // get the object, note C++ returns bool, in lua it "returns" the referenced object void GetObject() const ! // These are not useful in lua //bool *GetBoolPtr(); //int *GetIntPtr(); *************** *** 200,204 **** int GetAllocationFlags() const bool HasAllocationFlag(wxLuaObject_Type flag) ! int SetAllocationFlag(wxLuaObject_Type flag, bool set) %endclass --- 200,204 ---- int GetAllocationFlags() const bool HasAllocationFlag(wxLuaObject_Type flag) ! //int SetAllocationFlag(wxLuaObject_Type flag, bool set) // NOT for use in lua %endclass *************** *** 229,232 **** --- 229,236 ---- //bool OnPrintPage(int pageNum) + // Dummy test function to directly verify that the binding virtual functions really work. + // This base class function appends "-Base" to the val string and returns it. + virtual wxString TestVirtualFunctionBinding(const wxString& val) // { return val + wxT("-Base"); } + %endclass Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/override.hpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** override.hpp 11 Jun 2007 03:57:59 -0000 1.73 --- override.hpp 12 Jun 2007 00:08:36 -0000 1.74 *************** *** 1608,1612 **** evttype_idx = 4; ! if (wxlState.IsEnumerationType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else --- 1608,1612 ---- evttype_idx = 4; ! if (wxlState.IsIntegerType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else *************** *** 1617,1621 **** } ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1617,1621 ---- } ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1633,1637 **** evttype_idx = 3; ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1633,1637 ---- evttype_idx = 3; ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1680,1684 **** } ! if (wxlState.IsEnumerationType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else --- 1680,1684 ---- } ! if (wxlState.IsIntegerType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else *************** *** 1722,1726 **** evttype_idx = 4; ! if (wxlState.IsEnumerationType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else --- 1722,1726 ---- evttype_idx = 4; ! if (wxlState.IsIntegerType(3)) lastId = (wxWindowID)lua_tonumber(L, 3); else *************** *** 1731,1735 **** } ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1731,1735 ---- } ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1746,1750 **** evttype_idx = 3; ! if (wxlState.IsEnumerationType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else --- 1746,1750 ---- evttype_idx = 3; ! if (wxlState.IsIntegerType(2)) winId = (wxWindowID)lua_tonumber(L, 2); else *************** *** 1770,1774 **** } ! if (wxlState.IsEnumerationType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else --- 1770,1774 ---- } ! if (wxlState.IsIntegerType(evttype_idx)) eventType = (wxEventType)lua_tonumber(L, evttype_idx); else *************** *** 1924,1928 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); wxString ext; wxString name; --- 1924,1928 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); wxString ext; wxString name; *************** *** 1949,1953 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); wxString ext; wxString name; --- 1949,1953 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 2 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); wxString ext; wxString name; *************** *** 1976,1980 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetEnumerationType(3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); --- 1976,1980 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlState.GetIntegerType(3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); *************** *** 2271,2275 **** wxFontEncoding altEncoding; // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlState.GetEnumerationType(2); // get this wxFontMapper *self = (wxFontMapper *)wxlState.GetUserDataType(1, s_wxluatag_wxFontMapper); --- 2271,2275 ---- wxFontEncoding altEncoding; // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlState.GetIntegerType(2); // get this wxFontMapper *self = (wxFontMapper *)wxlState.GetUserDataType(1, s_wxluatag_wxFontMapper); *************** *** 3456,3460 **** lua_gettable(L, -2); if (lua_isnumber(L, -1)) ! kind = (wxItemKind)wxlState.GetEnumerationType(-1); lua_pop(L, 1); --- 3456,3460 ---- lua_gettable(L, -2); if (lua_isnumber(L, -1)) ! kind = (wxItemKind)wxlState.GetIntegerType(-1); lua_pop(L, 1); *************** *** 3537,3541 **** // bool isCheckable = false // This used to be a bool instead of a wxItemKind ! wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetEnumerationType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString wxString help = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); --- 3537,3541 ---- // bool isCheckable = false // This used to be a bool instead of a wxItemKind ! wxItemKind itemkind = (wxItemKind)(argCount >= 5 ? wxlState.GetIntegerType(5) : wxITEM_NORMAL); // const wxString& help = wxEmptyString wxString help = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); Index: data.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/data.i,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** data.i 11 Jun 2007 03:57:58 -0000 1.29 --- data.i 12 Jun 2007 00:08:36 -0000 1.30 *************** *** 326,329 **** --- 326,330 ---- %class %delete %noclassinfo %encapsulate wxSortedArrayString, wxArrayString wxSortedArrayString() + wxSortedArrayString(const wxArrayString& src) // have to have this constructor since they're not derived wxSortedArrayString(const wxSortedArrayString& src) |
From: John L. <jr...@us...> - 2007-06-12 00:09:09
|
Update of /cvsroot/wxlua/wxLua/bindings/wxstc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/bindings/wxstc Modified Files: wxstc_datatypes.lua Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxstc_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxstc/wxstc_datatypes.lua,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** wxstc_datatypes.lua 8 Jun 2007 22:50:06 -0000 1.54 --- wxstc_datatypes.lua 12 Jun 2007 00:08:36 -0000 1.55 *************** *** 247,255 **** Name = "wxArrayInt", }, - wxArrayInt_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayInt_FromLuaTable", - }, wxArrayString = { Condition = "wxLUA_USE_wxArrayString", --- 247,250 ---- *************** *** 259,267 **** Name = "wxArrayString", }, - wxArrayString_FromLuaTable = { - DefType = "special", - IsNumber = true, - Name = "wxArrayString_FromLuaTable", - }, wxArrayTreeItemIds = { Condition = "wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL", --- 254,257 ---- |
From: John L. <jr...@us...> - 2007-06-12 00:09:09
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxbind/include Modified Files: wxlprint.h Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxlprint.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxlprint.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** wxlprint.h 13 Dec 2006 06:57:49 -0000 1.8 --- wxlprint.h 12 Jun 2007 00:08:36 -0000 1.9 *************** *** 46,49 **** --- 46,52 ---- wxLuaObject *GetID() const { return m_pObject; } + // Dummy test function to directly verify that the binding virtual functions really work. + virtual wxString TestVirtualFunctionBinding(const wxString& val); + private: wxLuaState m_wxlState; |
From: John L. <jr...@us...> - 2007-06-12 00:09:09
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/bindings Modified Files: genwxbind.lua Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** genwxbind.lua 11 Jun 2007 03:57:57 -0000 1.117 --- genwxbind.lua 12 Jun 2007 00:08:35 -0000 1.118 *************** *** 264,273 **** -- "fake" data types that we handle in some more complicated way ! AllocDataType("LuaFunction", "special", true) ! AllocDataType("LuaTable", "special", true) ! AllocDataType("wxString", "special", true) ! AllocDataType("wxArrayString_FromLuaTable", "special", true) ! AllocDataType("wxArrayInt_FromLuaTable", "special", true) ! AllocDataType("IntArray_FromLuaTable", "special", true) -- attributes that can precede a data type (must set equal to true) --- 264,274 ---- -- "fake" data types that we handle in some more complicated way ! AllocDataType("LuaFunction", "special", true) ! AllocDataType("LuaTable", "special", true) ! AllocDataType("wxString", "special", true) ! --AllocDataType("wxArrayString", "special", true) -- special, but we only convert input, not output ! --AllocDataType("wxSortedArrayString", "special", true) -- special, but we only convert input, not output ! --AllocDataType("wxArrayInt", "special", true) -- special, but we only convert input, not output ! AllocDataType("IntArray_FromLuaTable", "special", true) -- attributes that can precede a data type (must set equal to true) *************** *** 2826,2832 **** table.insert(codeList, " bool val = wxlua_getbooleantype(L, 2);\n") elseif IsDataTypeEnum(memberType) then ! overload_argList = overload_argList.."&s_wxluaarg_Enum, " CommentBindingTable(codeList, " // get the number value\n") ! table.insert(codeList, " "..memberType.." val = ("..memberType..")wxlua_getenumerationtype(L, 2);\n") else overload_argList = overload_argList.."&s_wxluaarg_Number, " --- 2827,2833 ---- table.insert(codeList, " bool val = wxlua_getbooleantype(L, 2);\n") elseif IsDataTypeEnum(memberType) then ! overload_argList = overload_argList.."&s_wxluaarg_Integer, " CommentBindingTable(codeList, " // get the number value\n") ! table.insert(codeList, " "..memberType.." val = ("..memberType..")wxlua_getintegertype(L, 2);\n") else overload_argList = overload_argList.."&s_wxluaarg_Number, " *************** *** 3086,3089 **** --- 3087,3096 ---- argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" declare = "wxArrayString " + elseif ((argType == "wxSortedArrayString") and + ((indirectionCount == 0) or + ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then + overload_argList = overload_argList.."&s_wxluatag_wxSortedArrayString, " + argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" + declare = "wxSortedArrayString " elseif ((argType == "wxArrayInt") and ((indirectionCount == 0) or *************** *** 3231,3236 **** argItem = "wxlua_getbooleantype(L, "..argNum..")" elseif IsDataTypeEnum(argType) then ! overload_argList = overload_argList.."&s_wxluaarg_Enum, " ! argItem = "("..argType..")wxlua_getenumerationtype(L, "..argNum..")" else overload_argList = overload_argList.."&s_wxluaarg_Number, " --- 3238,3243 ---- argItem = "wxlua_getbooleantype(L, "..argNum..")" elseif IsDataTypeEnum(argType) then ! overload_argList = overload_argList.."&s_wxluaarg_Integer, " ! argItem = "("..argType..")wxlua_getintegertype(L, "..argNum..")" else overload_argList = overload_argList.."&s_wxluaarg_Number, " *************** *** 3459,3468 **** table.insert(codeList, " wxlState.AddTrackedObject((long)returns, new wxObject_"..MakeVar(parseObject.Name).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxlState.AddTrackedObject(("..returnCast..")returns);\n") end elseif parseObject.HasClassInfo then ! CommentBindingTable(codeList, " // add to tracked window list\n") ! table.insert(codeList, " if (returns && returns->IsKindOf(CLASSINFO(wxWindow)))\n") ! table.insert(codeList, " wxlState.AddTrackedWindow((wxWindow*)returns);\n") end --- 3466,3474 ---- table.insert(codeList, " wxlState.AddTrackedObject((long)returns, new wxObject_"..MakeVar(parseObject.Name).."(("..returnCast..")returns));\n") else ! table.insert(codeList, " wxlState.AddTrackedObject(returns);\n") end elseif parseObject.HasClassInfo then ! CommentBindingTable(codeList, " // add to tracked window list, it will check validity\n") ! table.insert(codeList, " wxlState.AddTrackedWindow(returns);\n") end |
From: John L. <jr...@us...> - 2007-06-12 00:08:48
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxlua/include Modified Files: wxlbind.h wxlcallb.h wxldefs.h wxlstate.h Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxlcallb.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlcallb.h,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxlcallb.h 14 Dec 2006 01:01:26 -0000 1.15 --- wxlcallb.h 12 Jun 2007 00:08:42 -0000 1.16 *************** *** 33,39 **** // winID and lastID follow the same notation as wxEvtHandler::Connect // if only one event Id is needed set lastId = wxID_ANY ! wxLuaCallback( const wxLuaState& state, int lua_func_stack_idx, wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *pHandler ); virtual ~wxLuaCallback(); --- 33,39 ---- // winID and lastID follow the same notation as wxEvtHandler::Connect // if only one event Id is needed set lastId = wxID_ANY ! wxLuaCallback( const wxLuaState& wxlState, int lua_func_stack_idx, wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *evtHandler ); virtual ~wxLuaCallback(); *************** *** 41,66 **** void ClearwxLuaState() { m_wxlState.UnRef(); } ! wxLuaState GetwxLuaState() const { return m_wxlState; } ! wxWindowID GetId() const { return m_id; } ! wxWindowID GetLastId() const { return m_lastId; } ! wxEventType GetEventType() const { return m_eventType; } ! wxEvtHandler *GetEvtHandler() const { return m_pHandler; } // Central event handler that calls CallFunction() for the actual ! // wxLuaCallback callback user data void EventHandler(wxEvent& event); // Handle the event by calling the lua function to handle the event. // The lua function will receive a single parameter, the type of event. ! virtual void CallFunction(wxEvent *pEvent); protected: ! int m_routine; // reference to the lua routine to call ! ! // store the wxLuaState since we're added to a list of it's callbacks. ! wxLuaState m_wxlState; ! wxEvtHandler* m_pHandler; ! wxWindowID m_id; ! wxWindowID m_lastId; ! wxEventType m_eventType; private: --- 41,68 ---- void ClearwxLuaState() { m_wxlState.UnRef(); } ! wxLuaState GetwxLuaState() const { return m_wxlState; } ! wxWindowID GetId() const { return m_id; } ! wxWindowID GetLastId() const { return m_lastId; } ! wxEventType GetEventType() const { return m_wxlBindEvent ? *m_wxlBindEvent->eventType : wxEVT_NULL; } ! wxEvtHandler* GetEvtHandler() const { return m_evtHandler; } ! ! const wxLuaBindEvent* GetwxLuaBindEvent() const { return m_wxlBindEvent; } // Central event handler that calls CallFunction() for the actual ! // wxLuaCallback callback user data. This function is treated like a ! // static function that all handlers of this class will call. void EventHandler(wxEvent& event); + // Handle the event by calling the lua function to handle the event. // The lua function will receive a single parameter, the type of event. ! virtual void CallFunction(wxEvent *event); protected: ! int m_routine; // ref to the lua routine to call in the wxLuaReferences registry table ! wxLuaState m_wxlState; // store it since we're added to a list of it's callbacks. ! wxEvtHandler* m_evtHandler; ! wxWindowID m_id; ! wxWindowID m_lastId; ! const wxLuaBindEvent* m_wxlBindEvent; // data for this wxEventType private: *************** *** 80,84 **** public: wxLuaWinDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, int iTag); --- 82,86 ---- public: wxLuaWinDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *evtHandler, int iTag); *************** *** 87,104 **** void ClearwxLuaState() { m_wxlState.UnRef(); } ! wxLuaState GetwxLuaState() const { return m_wxlState; } ! int GetId() const { return m_id; } ! wxEvtHandler* GetEvtHandler() const { return m_pHandler; } // Central event handler that calls OnDestroy() for the actual // wxLuaWinDestroyCallback callback user data void EventHandler(wxWindowDestroyEvent& event); // Handle the event by clearing the metatable for the window virtual void OnDestroy(wxWindowDestroyEvent& event); ! protected: ! // store the wxLuaState since we're added to a list of it's callbacks. ! wxLuaState m_wxlState; ! wxEvtHandler* m_pHandler; int m_id; --- 89,106 ---- void ClearwxLuaState() { m_wxlState.UnRef(); } ! wxLuaState GetwxLuaState() const { return m_wxlState; } ! int GetId() const { return m_id; } ! wxEvtHandler* GetEvtHandler() const { return m_evtHandler; } // Central event handler that calls OnDestroy() for the actual // wxLuaWinDestroyCallback callback user data void EventHandler(wxWindowDestroyEvent& event); + // Handle the event by clearing the metatable for the window virtual void OnDestroy(wxWindowDestroyEvent& event); ! protected: ! wxLuaState m_wxlState; // store it since we're added to a list of it's callbacks. ! wxEvtHandler* m_evtHandler; int m_id; Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxldefs.h 8 Jun 2007 03:40:51 -0000 1.21 --- wxldefs.h 12 Jun 2007 00:08:42 -0000 1.22 *************** *** 99,105 **** #if wxUSE_UNICODE ! #define wxLUA_UNUSED_NOTUNICODE(x) x #else /* !Unicode */ ! #define wxLUA_UNUSED_NOTUNICODE(x) #endif // wxUSE_UNICODE --- 99,105 ---- #if wxUSE_UNICODE ! #define wxLUA_UNICODE_ONLY(x) x #else /* !Unicode */ ! #define wxLUA_UNICODE_ONLY(x) #endif // wxUSE_UNICODE Index: wxlbind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlbind.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** wxlbind.h 11 Jun 2007 03:58:10 -0000 1.47 --- wxlbind.h 12 Jun 2007 00:08:42 -0000 1.48 *************** *** 20,24 **** // ---------------------------------------------------------------------------- ! // C functions for lua installed by the wxLuaBinding // ---------------------------------------------------------------------------- --- 20,24 ---- // ---------------------------------------------------------------------------- ! // C functions for the metatable for wxLua userdata installed by the wxLuaBinding // ---------------------------------------------------------------------------- *************** *** 38,41 **** --- 38,76 ---- // ---------------------------------------------------------------------------- + // Binding tags are generated as positive tag id automatically when bound + // so we set the inbuilt lua arg tags to negative values + // + // note that -1 is use as initialiser for class tags + // and 0 is used as an end marker for the wxLuaArgTag array that + // represents function prototype argument types. + + // wxlua arg tags for common lua types + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_None; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Nil; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Boolean; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LightUserData; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Number; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_String; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaTable; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaFunction; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_UserData; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaThread; + extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Integer; + + #define WXLUAARG_None 0 + #define WXLUAARG_Nil -2 + #define WXLUAARG_Boolean -3 + #define WXLUAARG_LightUserData -4 + #define WXLUAARG_Number -5 + #define WXLUAARG_String -6 + #define WXLUAARG_LuaTable -7 + #define WXLUAARG_LuaFunction -8 + #define WXLUAARG_UserData -9 + #define WXLUAARG_LuaThread -10 + #define WXLUAARG_Integer -11 + + typedef int* wxLuaArgTag; // address of class tag (a pointer to it) + extern WXDLLIMPEXP_DATA_WXLUA(wxLuaArgTag) s_wxluaargArray_None[1]; // = {0} + enum wxLuaMethod_Type // The type of a Lua method { *************** *** 58,67 **** }; - typedef int* wxLuaArgTag; // address of class tag (a pointer to it) - extern WXDLLIMPEXP_DATA_WXLUA(wxLuaArgTag) s_wxluaargArray_None[1]; // = {0} - struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc // defines a single C func for a LUA method { ! lua_CFunction func; // function that implements the method or property int type; // wxLuaMethod_Type flags for this function int minargs; // min number of required args --- 93,99 ---- }; struct WXDLLIMPEXP_WXLUA wxLuaBindCFunc // defines a single C func for a LUA method { ! lua_CFunction func; // C function that implements the method or property int type; // wxLuaMethod_Type flags for this function int minargs; // min number of required args *************** *** 78,113 **** int type; // wxLuaMethod_Type flags for this method // note each func has own type, this is ored values of them ! wxLuaBindCFunc *funcs; // array of functions for this method ! int funcs_n; // number of functions (overloaded > 1) for this method wxLuaBindMethod *basemethod; // overloaded methods from base class, else NULL // see comments for WXLUAMETHOD_OVERLOAD_BASE }; - // wxlua arg tags for common lua types - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_None; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Nil; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Boolean; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LightUserData; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Number; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_String; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaTable; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaFunction; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_UserData; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_LuaThread; - extern WXDLLIMPEXP_DATA_WXLUA(int) s_wxluaarg_Enum; - - #define WXLUAARG_None 0 - #define WXLUAARG_Nil -2 - #define WXLUAARG_Boolean -3 - #define WXLUAARG_LightUserData -4 - #define WXLUAARG_Number -5 - #define WXLUAARG_String -6 - #define WXLUAARG_LuaTable -7 - #define WXLUAARG_LuaFunction -8 - #define WXLUAARG_UserData -9 - #define WXLUAARG_LuaThread -10 - #define WXLUAARG_Enum -11 - - struct WXDLLIMPEXP_WXLUA wxLuaBindDefine // defines a numeric define for wxLua { --- 110,119 ---- int type; // wxLuaMethod_Type flags for this method // note each func has own type, this is ored values of them ! wxLuaBindCFunc *funcs; // array of C functions for this method ! int funcs_n; // number of C functions (overloaded > 1) for this method wxLuaBindMethod *basemethod; // overloaded methods from base class, else NULL // see comments for WXLUAMETHOD_OVERLOAD_BASE }; struct WXDLLIMPEXP_WXLUA wxLuaBindDefine // defines a numeric define for wxLua { *************** *** 126,132 **** struct WXDLLIMPEXP_WXLUA wxLuaBindEvent // defines a wxWidgets Event for wxLua { ! const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" ! const int *eventType; // wxWidgets event type, e.g. &wxEVT_COMMAND_MENU_SELECTED ! int *class_tag; // lua class tag, e.g. &s_wxluatag_wxCommandEvent }; --- 132,138 ---- struct WXDLLIMPEXP_WXLUA wxLuaBindEvent // defines a wxWidgets Event for wxLua { ! const char *name; // name of the event, e.g. "wxEVT_COMMAND_MENU_SELECTED" ! const wxEventType *eventType; // wxWidgets event type, e.g. &wxEVT_COMMAND_MENU_SELECTED ! int *class_tag; // lua class tag, e.g. &s_wxluatag_wxCommandEvent }; *************** *** 153,157 **** // See wxLuaBinding::SetBaseClass ! wxLuaBindDefine* enums; // Class member enums int enums_n; // number of enums }; --- 159,163 ---- // See wxLuaBinding::SetBaseClass ! wxLuaBindDefine* enums; // Class member enums (if any) int enums_n; // number of enums }; *************** *** 202,206 **** { public: ! // Wrap the item at the lua state's stack index and create a reference to it. wxLuaObject(const wxLuaState& wxlState, int stack_idx = 1); --- 208,213 ---- { public: ! // Wrap the item at the lua_State's stack index and create a reference to it. ! // in the wxLuaReferences registy table wxLuaObject(const wxLuaState& wxlState, int stack_idx = 1); *************** *** 218,222 **** // Call GetObject() so that it's on the stack then try to get the value of // the object as the specified type and set the member variable equal to it ! // and return a pointer to member variable. bool *GetBoolPtr(); int *GetIntPtr(); --- 225,230 ---- // Call GetObject() so that it's on the stack then try to get the value of // the object as the specified type and set the member variable equal to it ! // and return a pointer to member variable to a function that wants ! // a pointer to read/write from/to. bool *GetBoolPtr(); int *GetIntPtr(); *************** *** 235,239 **** private: wxLuaState* m_wxlState; // a pointer due to include recursion. ! int m_iReference; bool m_bool; int m_int; --- 243,247 ---- private: wxLuaState* m_wxlState; // a pointer due to include recursion. ! int m_reference; bool m_bool; int m_int; *************** *** 388,400 **** // ----------------------------------------------------------------------- ! // Lookup a lua method or get property called cpIndex in the wxLuaBindClass array pClass ! // Ensure that the lookup is of the required type. If the lua method ! // can not be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the method name, // else return NULL; static wxLuaBindMethod* GetClassMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses = true); ! // Lookup a lua property function named cpIndex in the wxLuaBindClass pClass ! // Ensure that the lookup is of the required type. If the lua property ! // can not be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the property name, // else return NULL; --- 396,408 ---- // ----------------------------------------------------------------------- ! // Lookup a lua method or get property called methodName in the wxLuaBindClass array wxlClass. ! // Ensure that the lookup is of WXLUAMETHOD_METHOD|WXLUAMETHOD_GETPROP type. ! // If the lua method cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the method name, // else return NULL; static wxLuaBindMethod* GetClassMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses = true); ! // Lookup a lua property function named propName in the wxLuaBindClass wxlClass ! // Ensure that the lookup is of WXLUAMETHOD_GETPROP|WXLUAMETHOD_SETPROP type. ! // If the lua property cannot be found on the current class recurse through base classes // Return a pointer to the wxLuaBindMethod that corresponds to the property name, // else return NULL; Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** wxlstate.h 11 Jun 2007 03:58:10 -0000 1.75 --- wxlstate.h 12 Jun 2007 00:08:42 -0000 1.76 *************** *** 96,106 **** #define wxlua_pushstring_wxLuaReferences(L) lua_pushlstring(L, "wxLuaReferences", 15) // Push the "wxLuaClasses" string onto the stack. This is the name of an ! // index in the LUA_REGISTRYINDEX table that is // t[wxLuaBindClass.name] = wxLuaBindClass, where the wxLuaBindClass is a lightuserdata. #define wxlua_pushstring_wxLuaClasses(L) lua_pushlstring(L, "wxLuaClasses", 12) ! // Push the "wxLuaDerivedFunctions" string onto the stack. This is the name of an // index in the LUA_REGISTRYINDEX table that is a table // t[lightuserdata object] = {["derived func/value name"] = wxLuaObject(lua function/value), ...} ! #define wxlua_pushstring_wxLuaDerivedFunctions(L) lua_pushlstring(L, "wxLuaDerivedFunctions", 21) // Push the "wxLuaStateRefData" string onto the stack. This is the name of an // index of the LUA_REGISTRYINDEX table that is a lightuserdata of the --- 96,106 ---- #define wxlua_pushstring_wxLuaReferences(L) lua_pushlstring(L, "wxLuaReferences", 15) // Push the "wxLuaClasses" string onto the stack. This is the name of an ! // index in the LUA_REGISTRYINDEX table that is a table // t[wxLuaBindClass.name] = wxLuaBindClass, where the wxLuaBindClass is a lightuserdata. #define wxlua_pushstring_wxLuaClasses(L) lua_pushlstring(L, "wxLuaClasses", 12) ! // Push the "wxLuaDerivedMethods" string onto the stack. This is the name of an // index in the LUA_REGISTRYINDEX table that is a table // t[lightuserdata object] = {["derived func/value name"] = wxLuaObject(lua function/value), ...} ! #define wxlua_pushstring_wxLuaDerivedMethods(L) lua_pushlstring(L, "wxLuaDerivedMethods", 19) // Push the "wxLuaStateRefData" string onto the stack. This is the name of an // index of the LUA_REGISTRYINDEX table that is a lightuserdata of the *************** *** 132,135 **** --- 132,136 ---- // Push the errorMsg on the stack and call lua_error WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const char* errorMsg); + wxLUA_UNICODE_ONLY(WXDLLIMPEXP_WXLUA void LUACALL wxlua_terror(lua_State* L, const wxString& errorMsg) { wxlua_terror(L, wx2lua(errorMsg)); }) // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the *************** *** 164,170 **** // ---------------------------------------------------------------------------- ! // Get the wxLuaBindClass* for this class_tag or NULL if the tag is invalid WXDLLIMPEXP_WXLUA const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, int class_tag); ! // Get the wxLuaBindClass* for this class_name or NULL if the name is invalid WXDLLIMPEXP_WXLUA const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, const char* class_name); // Is a class with the class_tag equal to or derived from a class with the base_class_tag. --- 165,174 ---- // ---------------------------------------------------------------------------- ! // Get the wxLuaBindClass* for this class_tag or NULL if the tag is invalid. ! // Gets the wxLuaBindClass from the metatable stored in the wxLuaReferences registry table ! // for the classes that have been installed into lua. WXDLLIMPEXP_WXLUA const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, int class_tag); ! // Get the wxLuaBindClass* for this class_name or NULL if the name is invalid. ! // Gets the wxLuaBindClass from the "wxLuaClasses" table in the lua registry. WXDLLIMPEXP_WXLUA const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, const char* class_name); // Is a class with the class_tag equal to or derived from a class with the base_class_tag. *************** *** 172,175 **** --- 176,180 ---- // returns -1 if the class_tag is not derived from the base class WXDLLIMPEXP_WXLUA int LUACALL wxlua_isderivedclass(lua_State* L, int class_tag, int base_class_tag); + // Same as above, but works directly with the wxLuaBindClasses. WXDLLIMPEXP_WXLUA int LUACALL wxlua_isderivedclass(const wxLuaBindClass* wxlClass, const wxLuaBindClass* wxlBaseClass); // Verify if the luatype = lua_type(L, stack_idx) is valid for the *************** *** 179,210 **** // and wxlua_getluatype() since it allows a small amount of coersion between types. // It also doesn't account for the automatic conversion of certain lua types ! // to wxluatypes, see wxLuaState::IswxLuaType which is more complete. WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag); // Get a human readable name for the predefined WXLUAARG_XXX or s_wxluaarg_XXX tags. // returns empty string if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA wxString wxlua_getwxluatypename(int wxluaarg_tag); ! // Get the wxluaarg_tag for the lua_type(). // returns -1 if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA int wxlua_getwxluatype(int luatype); ! // Get the lua_type() for the predefined WXLUAARG_XXX or s_wxluaarg_XXX tags. // returns -1 (LUA_TNONE) if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA int wxlua_getluatype(int wxluatype); // Helper functions to get numbers, booleans and strings safer. // These validate that the object at the stack index specified is a string, bool, ! // enum, or double number object or that the object can be converted to it. // Note: wxLua has a stricter sense of type than lua and we don't want to // always allow coersion between types since oftentimes there's an error. ! #define wxlua_isstringtype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_String) == 1) ! #define wxlua_isbooleantype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Boolean) == 1) ! #define wxlua_isenumerationtype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Enum) == 1) ! #define wxlua_isnumbertype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Number) == 1) // After verifying using wxlua_isXXXtype return the value, else call // wxlua_terror with a message that's appropriate for stack_idx to be a // parameter to a function call. (These are used in the bindings) WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getbooleantype(lua_State* L, int stack_idx); ! WXDLLIMPEXP_WXLUA long LUACALL wxlua_getenumerationtype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA double LUACALL wxlua_getnumbertype(lua_State* L, int stack_idx); --- 184,225 ---- // and wxlua_getluatype() since it allows a small amount of coersion between types. // It also doesn't account for the automatic conversion of certain lua types ! // to wxluatypes, (wxString, wxArrayString, wxArrayInt) ! // see wxLuaState::IswxLuaType which is more complete. WXDLLIMPEXP_WXLUA int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag); // Get a human readable name for the predefined WXLUAARG_XXX or s_wxluaarg_XXX tags. // returns empty string if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA wxString wxlua_getwxluatypename(int wxluaarg_tag); ! // Get the wxluaarg_tag for the lua_type() = LUA_TXXX. // returns -1 if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA int wxlua_getwxluatype(int luatype); ! // Get the lua_type() = LUA_TXXX for the predefined WXLUAARG_XXX or s_wxluaarg_XXX tags. // returns -1 (LUA_TNONE) if the tag was not one of the predefined types. WXDLLIMPEXP_WXLUA int wxlua_getluatype(int wxluatype); + // Is this data a userdata object that wxLua has pushed into lua? + // This should be the same as + // (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) + #define wxlua_iswxuserdata(L, stack_idx) (lua_type((L), (stack_idx)) == LUA_TUSERDATA) + // Helper functions to get numbers, booleans and strings safer. // These validate that the object at the stack index specified is a string, bool, ! // int, or double number object or that the object can be converted to it. // Note: wxLua has a stricter sense of type than lua and we don't want to // always allow coersion between types since oftentimes there's an error. ! // Note: The wxLuaState::IsStringType function takes both a lua string and a wxString ! // userdata as valid strings. ! #define wxlua_isstringtype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_String) == 1) ! #define wxlua_isbooleantype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Boolean) == 1) ! #define wxlua_isintegertype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Integer) == 1) ! #define wxlua_isnumbertype(L, stack_idx) (wxlua_iswxluatype(lua_type(L, stack_idx), WXLUAARG_Number) == 1) // After verifying using wxlua_isXXXtype return the value, else call // wxlua_terror with a message that's appropriate for stack_idx to be a // parameter to a function call. (These are used in the bindings) + // Note: The function wxLuaState::GetwxStringType does automatic conversion + // of both a lua string and a userdata wxString to a wxString. WXDLLIMPEXP_WXLUA const char* LUACALL wxlua_getstringtype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA bool LUACALL wxlua_getbooleantype(lua_State* L, int stack_idx); ! WXDLLIMPEXP_WXLUA long LUACALL wxlua_getintegertype(lua_State* L, int stack_idx); WXDLLIMPEXP_WXLUA double LUACALL wxlua_getnumbertype(lua_State* L, int stack_idx); *************** *** 216,221 **** // Convert the table at stack index to a "new" array of const char* strings. ! // Return a pointer to the array of strings (you need to delete them) // returns the number of character strings in the array in count. WXDLLIMPEXP_WXLUA const char** LUACALL wxlua_getchararray(lua_State* L, int stack_idx, int& count); --- 231,239 ---- // Convert the table at stack index to a "new" array of const char* strings. ! // Return a pointer to the array of strings. You need to delete the array, but not ! // the individual strings since lua should still have them during the life of the ! // returned array, if not you will need to copy them. // returns the number of character strings in the array in count. + // See usage in the wxBitmap constructor for XPMs. WXDLLIMPEXP_WXLUA const char** LUACALL wxlua_getchararray(lua_State* L, int stack_idx, int& count); *************** *** 253,257 **** wxEventType m_inEventType; // wxEventType set when in event, else wxEVT_NULL ! wxLongToLongHashMap m_trackedObjects; // tracked objects. wxList m_callbackList; // event objects for wxLuaCallback wxList m_winDestroyCallbackList; // wxLuaWinDestroyCallback installed --- 271,280 ---- wxEventType m_inEventType; // wxEventType set when in event, else wxEVT_NULL ! wxLongToLongHashMap m_trackedObjects; // tracked wxObjects that we will delete when the ! // wxLuaState is closed or lua gc them. ! // key is (long)object* and value is the wxObject ! // Note that non wxObject classes use ! // wxLUA_DECLARE_ENCAPSULATION so the key is the object pointer ! // and the value is the wxObject encapsulation. wxList m_callbackList; // event objects for wxLuaCallback wxList m_winDestroyCallbackList; // wxLuaWinDestroyCallback installed *************** *** 302,318 **** // ------------------------------------------------------------------------ ! lua_State* m_lua_State; // the lua_State that "is" lua ! bool m_lua_State_static; // lua_close the lua_State if !static bool m_lua_State_coroutine; // this is a coroutine, don't close it wxLuaStateData* m_wxlStateData; // the data shared for this state ! bool m_own_stateData; // not a coroutine when true // Get the wxLuaStateRefData from the corresponding lua_State ! // returns NULL if none found static wxLuaStateRefData* GetLuaStateRefData(lua_State* L); // A mapping between hashmap[lua_State* L] = *wxLuaStateRefData ! // Note: The coroutines are not hashed since we cannot know when they ! // are deleted. We create wxLuaStates for them on the fly. static wxHashMapLuaStateRefData s_wxHashMapLuaStateRefData; }; --- 325,341 ---- // ------------------------------------------------------------------------ ! lua_State* m_lua_State; // the lua_State that "is" lua ! bool m_lua_State_static; // lua_close() the lua_State if !static bool m_lua_State_coroutine; // this is a coroutine, don't close it wxLuaStateData* m_wxlStateData; // the data shared for this state ! bool m_own_stateData; // not a coroutine when true, so delete it when done // Get the wxLuaStateRefData from the corresponding lua_State ! // returns NULL if none found. static wxLuaStateRefData* GetLuaStateRefData(lua_State* L); // A mapping between hashmap[lua_State* L] = *wxLuaStateRefData ! // Note: The coroutine lua_States are not hashed since we cannot know when ! // they are deleted. We create wxLuaStates for them on the fly. static wxHashMapLuaStateRefData s_wxHashMapLuaStateRefData; }; *************** *** 399,403 **** // Set the event handler that the wxLuaEvents from this will be sent to, can be NULL ! // see wxEVT_LUA_XXX for a list of possible events that may be sent void SetEventHandler(wxEvtHandler *evtHandler); wxEvtHandler *GetEventHandler() const; --- 422,426 ---- // Set the event handler that the wxLuaEvents from this will be sent to, can be NULL ! // see wxEVT_LUA_XXX for a list of possible events that may be sent. void SetEventHandler(wxEvtHandler *evtHandler); wxEvtHandler *GetEventHandler() const; *************** *** 454,465 **** // Break a currently running lua program by setting the lua debug hook to // be called for anything and breaking as soon as possible by calling ! // terror with the message void DebugHookBreak(const wxString &message = wxT("Lua interpreter stopped")); ! // Clear a previously set DebugHookBreak, resetting the debug hook // to the previous values void ClearDebugHookBreak(); // has DebugHookBreak() been called and we're waiting for the next hook call bool GetDebugHookBreak() const; ! // Get the message that will be sent when from a DebugHookBreak call wxString GetDebugHookBreakMessage() const; --- 477,488 ---- // Break a currently running lua program by setting the lua debug hook to // be called for anything and breaking as soon as possible by calling ! // terror() with the message void DebugHookBreak(const wxString &message = wxT("Lua interpreter stopped")); ! // Clear a previously set DebugHookBreak(), resetting the debug hook // to the previous values void ClearDebugHookBreak(); // has DebugHookBreak() been called and we're waiting for the next hook call bool GetDebugHookBreak() const; ! // Get the message that will be sent when from a DebugHookBreak() call wxString GetDebugHookBreakMessage() const; *************** *** 491,495 **** // Registers a new C function for Lua, see usage in wxlstate.cpp void RegisterFunction(lua_CFunction func, const char* funcName); ! wxLUA_UNUSED_NOTUNICODE(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) // Register all the bindings in the wxLuaStateData, this is done // automatically by default on creation. (internal use) --- 514,518 ---- // Registers a new C function for Lua, see usage in wxlstate.cpp void RegisterFunction(lua_CFunction func, const char* funcName); ! wxLUA_UNICODE_ONLY(void RegisterFunction(lua_CFunction func, const wxString &funcName) { RegisterFunction(func, wx2lua(funcName)); }) // Register all the bindings in the wxLuaStateData, this is done // automatically by default on creation. (internal use) *************** *** 497,501 **** // Get the installed wxLuaBinding with the given ! // wxLuaBinding::GetBindingName or NULL for no match. wxLuaBinding* GetLuaBinding(const wxString& bindingName) const; --- 520,524 ---- // Get the installed wxLuaBinding with the given ! // wxLuaBinding::GetBindingName() or NULL for no match. wxLuaBinding* GetLuaBinding(const wxString& bindingName) const; *************** *** 551,556 **** // Add a wxWindow to track and delete when we're closed, only track ! // the parent window, not it's children. ! void AddTrackedWindow(wxWindow *win); // Don't track this window anymore and don't delete it. bool RemoveTrackedWindow(wxWindow *win); --- 574,582 ---- // Add a wxWindow to track and delete when we're closed, only track ! // the parent window, not it's children. returns true if it was added. ! // Note: wxObject is used as the base class since we blindly call this ! // function for all objects with classinfo in the bindings and we ! // want to minimize the code in the bindings. ! bool AddTrackedWindow(wxObject *win); // Don't track this window anymore and don't delete it. bool RemoveTrackedWindow(wxWindow *win); *************** *** 559,563 **** // delete all stray wxWindow derived classes that have been destroyed ! // by wxWidgets (eg. a child window) (not needed, for debugging perhaps?) void GarbageCollectWindows(bool closeWindows); --- 585,590 ---- // delete all stray wxWindow derived classes that have been destroyed ! // by wxWidgets (eg. a child window) ! // This function does not need to be called ever, for debugging perhaps? void GarbageCollectWindows(bool closeWindows); *************** *** 587,591 **** // Push the errorMsg on the stack and call lua_error void terror(const char *errorMsg) const; ! wxLUA_UNUSED_NOTUNICODE(void terror(const wxString& errorMsg) const { terror(wx2lua(errorMsg)); }) // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the --- 614,618 ---- // Push the errorMsg on the stack and call lua_error void terror(const char *errorMsg) const; ! wxLUA_UNICODE_ONLY(void terror(const wxString& errorMsg) const { terror(wx2lua(errorMsg)); }) // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the *************** *** 646,653 **** // calls terror if the value is not of the right type. bool GetBooleanType(int stack_idx); ! // Validate that the object at the stack index specified is a enumeration object ! // or that the object can be converted to a enumeration and return the enumeration value. // calls terror if the value is not of the right type. ! long GetEnumerationType(int stack_idx); // Validate that the object at the stack index specified is a number object // or that the object can be converted to a number and return the number value. --- 673,680 ---- // calls terror if the value is not of the right type. bool GetBooleanType(int stack_idx); ! // Validate that the object at the stack index specified is an integer object ! // or that the object can be converted to an integer and return the integer value. // calls terror if the value is not of the right type. ! long GetIntegerType(int stack_idx); // Validate that the object at the stack index specified is a number object // or that the object can be converted to a number and return the number value. *************** *** 659,663 **** bool IsStringType(int stack_idx) const; bool IsBooleanType(int stack_idx) const; ! bool IsEnumerationType(int stack_idx) const; bool IsNumberType(int stack_idx) const; --- 686,690 ---- bool IsStringType(int stack_idx) const; bool IsBooleanType(int stack_idx) const; ! bool IsIntegerType(int stack_idx) const; bool IsNumberType(int stack_idx) const; *************** *** 707,710 **** --- 734,739 ---- // userdata and the new wxLuaObject wraps the lua function or value // which will be deleted by this. + // The derived methods are stored in the "wxLuaDerivedMethods" table in the + // lua registry table. bool SetDerivedMethod(void *pObject, const char *method_name, wxLuaObject* wxlObj); // Is there a derived method given an object and and a method name. *************** *** 713,720 **** bool HasDerivedMethod(void *pObject, const char *method_name, bool push_method) const; // When an object is being garbage collected and we call RemoveTrackedObject ! // object on it, we should also remove any derived functions or values it may have bool RemoveDerivedMethod(void *pObject) const; // Find a derived method given an object and and a method name. ! // If the method can be found, return the wxLuaState it belongs to. static wxLuaState GetDerivedMethodState(void *pObject, const char *method); --- 742,753 ---- bool HasDerivedMethod(void *pObject, const char *method_name, bool push_method) const; // When an object is being garbage collected and we call RemoveTrackedObject ! // object on it, we should also remove any derived functions or values it may have. bool RemoveDerivedMethod(void *pObject) const; // Find a derived method given an object and and a method name. ! // If the method can be found, return the valid wxLuaState it belongs to. ! // This function can be used for classes that implement virtual functions to ! // try to find a wxLuaState that may have overridden the function to call it. ! // It is probably easier to merely make a wxLuaState a class member for ! // faster lookup though. static wxLuaState GetDerivedMethodState(void *pObject, const char *method); *************** *** 742,746 **** bool lua_IsString(int index) const; bool lua_IsCFunction(int index) const; ! bool lua_IsUserData(int index) const; int lua_Type(int index) const; wxString lua_TypeName(int type) const; --- 775,779 ---- bool lua_IsString(int index) const; bool lua_IsCFunction(int index) const; ! bool lua_IsUserdata(int index) const; int lua_Type(int index) const; wxString lua_TypeName(int type) const; *************** *** 758,762 **** size_t luaL_ObjLen(int index) const; lua_CFunction lua_ToCFunction(int index) const; ! void* lua_ToUserData(int index) const; wxLuaState lua_ToThread(int index) const; const void* lua_ToPointer(int index) const; --- 791,795 ---- size_t luaL_ObjLen(int index) const; lua_CFunction lua_ToCFunction(int index) const; ! void* lua_ToUserdata(int index) const; wxLuaState lua_ToThread(int index) const; const void* lua_ToPointer(int index) const; *************** *** 770,779 **** void lua_PushLString(const char* s, size_t len); void lua_PushString(const char* s); ! wxLUA_UNUSED_NOTUNICODE(void lua_PushString(const wxString& s) { lua_PushString(wx2lua(s)); }) //wxString lua_PushVfString(); //wxString lua_PushFString(); void lua_PushCClosure(lua_CFunction fn, int n); void lua_PushBoolean(bool b); ! void lua_PushLightUserData(void* p); //void lua_PushThread(lua_State* L); --- 803,812 ---- void lua_PushLString(const char* s, size_t len); void lua_PushString(const char* s); ! wxLUA_UNICODE_ONLY(void lua_PushString(const wxString& s) { lua_PushString(wx2lua(s)); }) //wxString lua_PushVfString(); //wxString lua_PushFString(); void lua_PushCClosure(lua_CFunction fn, int n); void lua_PushBoolean(bool b); ! void lua_PushLightUserdata(void* p); //void lua_PushThread(lua_State* L); *************** *** 783,793 **** void lua_GetTable(int idx); void lua_GetField(int idx, const char* k); ! wxLUA_UNUSED_NOTUNICODE(void lua_GetField(int idx, const wxString& k) { lua_GetField(idx, wx2lua(k)); }) void lua_RawGet(int idx); void lua_RawGeti(int idx, int n); void lua_CreateTable(int narr, int nrec); void lua_NewTable(); ! void* lua_NewUserData(size_t sz); ! int lua_GetMetaTable(int objindex); void lua_GetFenv(int idx); --- 816,826 ---- void lua_GetTable(int idx); void lua_GetField(int idx, const char* k); ! wxLUA_UNICODE_ONLY(void lua_GetField(int idx, const wxString& k) { lua_GetField(idx, wx2lua(k)); }) void lua_RawGet(int idx); void lua_RawGeti(int idx, int n); void lua_CreateTable(int narr, int nrec); void lua_NewTable(); ! void* lua_NewUserdata(size_t sz); ! int lua_GetMetatable(int objindex); void lua_GetFenv(int idx); *************** *** 797,804 **** void lua_SetTable(int idx); void lua_SetField(int idx, const char* k); ! wxLUA_UNUSED_NOTUNICODE(void lua_SetField(int idx, const wxString& k) { lua_SetField(idx, wx2lua(k)); }) void lua_RawSet(int idx); void lua_RawSeti(int idx, int n); ! int lua_SetMetaTable(int objindex); int lua_SetFenv(int idx); --- 830,837 ---- void lua_SetTable(int idx); void lua_SetField(int idx, const char* k); ! wxLUA_UNICODE_ONLY(void lua_SetField(int idx, const wxString& k) { lua_SetField(idx, wx2lua(k)); }) void lua_RawSet(int idx); void lua_RawSeti(int idx, int n); ! int lua_SetMetatable(int objindex); int lua_SetFenv(int idx); *************** *** 810,814 **** int lua_CPCall(lua_CFunction func, void *ud); int lua_Load(lua_Reader reader, void *dt, const char* chunkname); ! wxLUA_UNUSED_NOTUNICODE(int lua_Load(lua_Reader reader, void *dt, const wxString& chunkname) { return lua_Load(reader, dt, wx2lua(chunkname)); }) int lua_Dump(lua_Writer writer, void *data); --- 843,847 ---- int lua_CPCall(lua_CFunction func, void *ud); int lua_Load(lua_Reader reader, void *dt, const char* chunkname); ! wxLUA_UNICODE_ONLY(int lua_Load(lua_Reader reader, void *dt, const wxString& chunkname) { return lua_Load(reader, dt, wx2lua(chunkname)); }) int lua_Dump(lua_Writer writer, void *data); *************** *** 845,854 **** void lua_Register(const char* funcName, lua_CFunction f); ! wxLUA_UNUSED_NOTUNICODE(void lua_Register(const wxString& funcName, lua_CFunction f) { lua_Register(wx2lua(funcName), f); }) void lua_PushCFunction(lua_CFunction f); bool lua_IsFunction(int idx) const; bool lua_IsTable(int idx) const; ! bool lua_IsLightUserData(int idx) const; bool lua_IsNil(int idx) const; bool lua_IsBoolean(int idx) const; --- 878,887 ---- void lua_Register(const char* funcName, lua_CFunction f); ! wxLUA_UNICODE_ONLY(void lua_Register(const wxString& funcName, lua_CFunction f) { lua_Register(wx2lua(funcName), f); }) void lua_PushCFunction(lua_CFunction f); bool lua_IsFunction(int idx) const; bool lua_IsTable(int idx) const; ! bool lua_IsLightUserdata(int idx) const; bool lua_IsNil(int idx) const; bool lua_IsBoolean(int idx) const; *************** *** 867,875 **** int lua_GetStack(int level, lua_Debug* ar); int lua_GetInfo(const char* what, lua_Debug* ar); ! wxLUA_UNUSED_NOTUNICODE(int lua_GetInfo(const wxString& what, lua_Debug* ar) { return lua_GetInfo(wx2lua(what), ar); }) const char* lua_GetLocal(const lua_Debug* ar, int n); const char* lua_SetLocal(const lua_Debug* ar, int n); ! const char* lua_GetUpValue(int funcindex, int n); ! const char* lua_SetUpValue(int funcindex, int n); int lua_SetHook(lua_Hook func, int mask, int count); --- 900,908 ---- int lua_GetStack(int level, lua_Debug* ar); int lua_GetInfo(const char* what, lua_Debug* ar); ! wxLUA_UNICODE_ONLY(int lua_GetInfo(const wxString& what, lua_Debug* ar) { return lua_GetInfo(wx2lua(what), ar); }) const char* lua_GetLocal(const lua_Debug* ar, int n); const char* lua_SetLocal(const lua_Debug* ar, int n); ! const char* lua_GetUpvalue(int funcindex, int n); ! const char* lua_SetUpvalue(int funcindex, int n); int lua_SetHook(lua_Hook func, int mask, int count); *************** *** 883,887 **** void luaI_OpenLib(const char *libname, const luaL_reg *l, int nup); void luaL_Register(const char *libname, const luaL_reg *l); ! int luaL_GetMetaField(int obj, const char *e); int luaL_CallMeta(int obj, const char *e); int luaL_TypeError(int narg, const char *tname); --- 916,920 ---- void luaI_OpenLib(const char *libname, const luaL_reg *l, int nup); void luaL_Register(const char *libname, const luaL_reg *l); ! int luaL_GetMetafield(int obj, const char *e); int luaL_CallMeta(int obj, const char *e); int luaL_TypeError(int narg, const char *tname); *************** *** 900,904 **** int luaL_NewMetatable(const char *tname); void luaL_GetMetatable(const char *tname); ! void *luaL_CheckUData(int ud, const char *tname); void luaL_Where(int lvl); --- 933,937 ---- int luaL_NewMetatable(const char *tname); void luaL_GetMetatable(const char *tname); ! void *luaL_CheckUdata(int ud, const char *tname); void luaL_Where(int lvl); |
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxbind/src Modified Files: appframe.cpp clipdrag.cpp controls.cpp data.cpp datetime.cpp defsutil.cpp dialogs.cpp event.cpp file.cpp gdi.cpp grid.cpp help.cpp html.cpp image.cpp mdi.cpp menutool.cpp print.cpp sizer.cpp socket.cpp wave.cpp windows.cpp wx_bind.cpp wxlprint.cpp wxlua.cpp xml.cpp Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: xml.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/xml.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** xml.cpp 8 Jun 2007 01:36:30 -0000 1.35 --- xml.cpp 12 Jun 2007 00:08:41 -0000 1.36 *************** *** 460,464 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_SetType[] = { &s_wxluatag_wxXmlNode, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxXmlNode_SetType(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetType[1] = {{ wxLua_wxXmlNode_SetType, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetType }}; --- 460,464 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_SetType[] = { &s_wxluatag_wxXmlNode, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxXmlNode_SetType(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_SetType[1] = {{ wxLua_wxXmlNode_SetType, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxXmlNode_SetType }}; *************** *** 468,472 **** wxLuaState wxlState(L); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getenumerationtype(L, 2); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); --- 468,472 ---- wxLuaState wxlState(L); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // get this wxXmlNode * self = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 477,481 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor2[] = { &s_wxluatag_wxXmlNode, &s_wxluaarg_Enum, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluatag_wxXmlProperty, &s_wxluatag_wxXmlNode, NULL }; static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor2[1] = {{ wxLua_wxXmlNode_constructor2, WXLUAMETHOD_CONSTRUCTOR, 6, 6, s_wxluatagArray_wxLua_wxXmlNode_constructor2 }}; --- 477,481 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor2[] = { &s_wxluatag_wxXmlNode, &s_wxluaarg_Integer, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluatag_wxXmlProperty, &s_wxluatag_wxXmlNode, NULL }; static int LUACALL wxLua_wxXmlNode_constructor2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor2[1] = {{ wxLua_wxXmlNode_constructor2, WXLUAMETHOD_CONSTRUCTOR, 6, 6, s_wxluatagArray_wxLua_wxXmlNode_constructor2 }}; *************** *** 495,499 **** const wxString name = wxlState.GetwxStringType(3); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getenumerationtype(L, 2); // wxXmlNode parent wxXmlNode * parent = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); --- 495,499 ---- const wxString name = wxlState.GetwxStringType(3); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 2); // wxXmlNode parent wxXmlNode * parent = (wxXmlNode *)wxlState.GetUserDataType(1, s_wxluatag_wxXmlNode); *************** *** 508,512 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor1[] = { &s_wxluaarg_Enum, &s_wxluaarg_String, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor1[1] = {{ wxLua_wxXmlNode_constructor1, WXLUAMETHOD_CONSTRUCTOR, 2, 3, s_wxluatagArray_wxLua_wxXmlNode_constructor1 }}; --- 508,512 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlNode_constructor1[] = { &s_wxluaarg_Integer, &s_wxluaarg_String, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxXmlNode_constructor1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlNode_constructor1[1] = {{ wxLua_wxXmlNode_constructor1, WXLUAMETHOD_CONSTRUCTOR, 2, 3, s_wxluatagArray_wxLua_wxXmlNode_constructor1 }}; *************** *** 524,528 **** const wxString name = wxlState.GetwxStringType(2); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getenumerationtype(L, 1); // call constructor returns = new wxXmlNode(type, name, content); --- 524,528 ---- const wxString name = wxlState.GetwxStringType(2); // wxXmlNodeType type ! wxXmlNodeType type = (wxXmlNodeType)wxlua_getintegertype(L, 1); // call constructor returns = new wxXmlNode(type, name, content); *************** *** 1082,1086 **** returns = new wxXmlDocument(filename, encoding); // add to tracked memory list ! wxlState.AddTrackedObject((wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); --- 1082,1086 ---- returns = new wxXmlDocument(filename, encoding); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); *************** *** 1100,1104 **** returns = new wxXmlDocument(); // add to tracked memory list ! wxlState.AddTrackedObject((wxXmlDocument *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); --- 1100,1104 ---- returns = new wxXmlDocument(); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlDocument, returns); *************** *** 1761,1765 **** returns = new wxXmlResource(filemask, flags); // add to tracked memory list ! wxlState.AddTrackedObject((wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); --- 1761,1765 ---- returns = new wxXmlResource(filemask, flags); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); *************** *** 1784,1788 **** returns = new wxXmlResource(flags); // add to tracked memory list ! wxlState.AddTrackedObject((wxXmlResource *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); --- 1784,1788 ---- returns = new wxXmlResource(flags); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXmlResource, returns); Index: defsutil.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/defsutil.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** defsutil.cpp 8 Jun 2007 01:36:25 -0000 1.37 --- defsutil.cpp 12 Jun 2007 00:08:38 -0000 1.38 *************** *** 234,238 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Kill[] = { &s_wxluaarg_Number, &s_wxluaarg_Enum, &s_wxluaarg_Number, NULL }; static int LUACALL wxLua_wxProcess_Kill(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxProcess_Kill[1] = {{ wxLua_wxProcess_Kill, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 3, s_wxluatagArray_wxLua_wxProcess_Kill }}; --- 234,238 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxProcess_Kill[] = { &s_wxluaarg_Number, &s_wxluaarg_Integer, &s_wxluaarg_Number, NULL }; static int LUACALL wxLua_wxProcess_Kill(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxProcess_Kill[1] = {{ wxLua_wxProcess_Kill, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 3, s_wxluatagArray_wxLua_wxProcess_Kill }}; *************** *** 246,250 **** int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxKILL_NOCHILDREN); // wxSignal sig = wxSIGTERM ! wxSignal sig = (argCount >= 2 ? (wxSignal)wxlua_getenumerationtype(L, 2) : wxSIGTERM); // int pid int pid = (int)wxlua_getnumbertype(L, 1); --- 246,250 ---- int flags = (argCount >= 3 ? (int)wxlua_getnumbertype(L, 3) : wxKILL_NOCHILDREN); // wxSignal sig = wxSIGTERM ! wxSignal sig = (argCount >= 2 ? (wxSignal)wxlua_getintegertype(L, 2) : wxSIGTERM); // int pid int pid = (int)wxlua_getnumbertype(L, 1); *************** *** 913,917 **** returns = new wxBusyInfo(message, parent); // add to tracked memory list ! wxlState.AddTrackedObject((wxBusyInfo *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyInfo, returns); --- 913,917 ---- returns = new wxBusyInfo(message, parent); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBusyInfo, returns); Index: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlua.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wxlua.cpp 11 Jun 2007 03:58:07 -0000 1.40 --- wxlua.cpp 12 Jun 2007 00:08:41 -0000 1.41 *************** *** 119,123 **** ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag[] = { &s_wxluatag_wxLuaObject, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxLuaObject_HasAllocationFlag(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_HasAllocationFlag[1] = {{ wxLua_wxLuaObject_HasAllocationFlag, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag }}; --- 119,123 ---- ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag[] = { &s_wxluatag_wxLuaObject, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxLuaObject_HasAllocationFlag(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_HasAllocationFlag[1] = {{ wxLua_wxLuaObject_HasAllocationFlag, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxLuaObject_HasAllocationFlag }}; *************** *** 128,132 **** bool returns; // wxLuaObject_Type flag ! wxLuaObject_Type flag = (wxLuaObject_Type)wxlua_getenumerationtype(L, 2); // get this wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); --- 128,132 ---- bool returns; // wxLuaObject_Type flag ! wxLuaObject_Type flag = (wxLuaObject_Type)wxlua_getintegertype(L, 2); // get this wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); *************** *** 139,164 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_SetAllocationFlag[] = { &s_wxluatag_wxLuaObject, &s_wxluaarg_Enum, &s_wxluaarg_Boolean, NULL }; - static int LUACALL wxLua_wxLuaObject_SetAllocationFlag(lua_State *L); - static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_SetAllocationFlag[1] = {{ wxLua_wxLuaObject_SetAllocationFlag, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxLuaObject_SetAllocationFlag }}; - // int SetAllocationFlag(wxLuaObject_Type flag, bool set) - static int LUACALL wxLua_wxLuaObject_SetAllocationFlag(lua_State *L) - { - wxLuaState wxlState(L); - int returns; - // bool set - bool set = wxlua_getbooleantype(L, 3); - // wxLuaObject_Type flag - wxLuaObject_Type flag = (wxLuaObject_Type)wxlua_getenumerationtype(L, 2); - // get this - wxLuaObject * self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); - // call SetAllocationFlag - returns = self->SetAllocationFlag(flag, set); - // push the result number - lua_pushnumber(L, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_SetObject[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L); --- 139,142 ---- *************** *** 206,210 **** { "GetObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_GetObject, 1, NULL }, { "HasAllocationFlag", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_HasAllocationFlag, 1, NULL }, - { "SetAllocationFlag", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_SetAllocationFlag, 1, NULL }, { "SetObject", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaObject_SetObject, 1, NULL }, { "wxLuaObject", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxLuaObject_constructor, 1, NULL }, --- 184,187 ---- *************** *** 283,286 **** --- 260,283 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaPrintout_TestVirtualFunctionBinding[] = { &s_wxluatag_wxLuaPrintout, &s_wxluaarg_String, NULL }; + static int LUACALL wxLua_wxLuaPrintout_TestVirtualFunctionBinding(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaPrintout_TestVirtualFunctionBinding[1] = {{ wxLua_wxLuaPrintout_TestVirtualFunctionBinding, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxLuaPrintout_TestVirtualFunctionBinding }}; + // virtual wxString TestVirtualFunctionBinding(const wxString& val) // { return val + wxT("-Base"); } + static int LUACALL wxLua_wxLuaPrintout_TestVirtualFunctionBinding(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // const wxString val + const wxString val = wxlState.GetwxStringType(2); + // get this + wxLuaPrintout * self = (wxLuaPrintout *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaPrintout); + // call TestVirtualFunctionBinding + returns = self->TestVirtualFunctionBinding(val); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaPrintout_constructor[] = { &s_wxluaarg_String, &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaPrintout_constructor(lua_State *L); *************** *** 318,321 **** --- 315,319 ---- { "GetID", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_GetID, 1, NULL }, { "SetPageInfo", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_SetPageInfo, 1, NULL }, + { "TestVirtualFunctionBinding", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_TestVirtualFunctionBinding, 1, NULL }, { "wxLuaPrintout", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxLuaPrintout_constructor, 1, NULL }, Index: image.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/image.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** image.cpp 8 Jun 2007 03:40:51 -0000 1.41 --- image.cpp 12 Jun 2007 00:08:39 -0000 1.42 *************** *** 1831,1835 **** returns = new wxImage(name, type); // add to tracked memory list ! wxlState.AddTrackedObject((wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1831,1835 ---- returns = new wxImage(name, type); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1858,1862 **** returns = new wxImage(width, height, clear); // add to tracked memory list ! wxlState.AddTrackedObject((wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1858,1862 ---- returns = new wxImage(width, height, clear); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1879,1883 **** returns = new wxImage(*image); // add to tracked memory list ! wxlState.AddTrackedObject((wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1879,1883 ---- returns = new wxImage(*image); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 1897,1901 **** returns = new wxImage(); // add to tracked memory list ! wxlState.AddTrackedObject((wxImage *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); --- 1897,1901 ---- returns = new wxImage(); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxImage, returns); *************** *** 3050,3056 **** // call constructor returns = new wxBMPHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBMPHandler, returns); --- 3050,3055 ---- // call constructor returns = new wxBMPHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxBMPHandler, returns); *************** *** 3092,3098 **** // call constructor returns = new wxICOHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxICOHandler, returns); --- 3091,3096 ---- // call constructor returns = new wxICOHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxICOHandler, returns); *************** *** 3134,3140 **** // call constructor returns = new wxCURHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCURHandler, returns); --- 3132,3137 ---- // call constructor returns = new wxCURHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCURHandler, returns); *************** *** 3176,3182 **** // call constructor returns = new wxANIHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxANIHandler, returns); --- 3173,3178 ---- // call constructor returns = new wxANIHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxANIHandler, returns); *************** *** 3218,3224 **** // call constructor returns = new wxIFFHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxIFFHandler, returns); --- 3214,3219 ---- // call constructor returns = new wxIFFHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxIFFHandler, returns); *************** *** 3260,3266 **** // call constructor returns = new wxGIFHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGIFHandler, returns); --- 3255,3260 ---- // call constructor returns = new wxGIFHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGIFHandler, returns); *************** *** 3302,3308 **** // call constructor returns = new wxJPEGHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxJPEGHandler, returns); --- 3296,3301 ---- // call constructor returns = new wxJPEGHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxJPEGHandler, returns); *************** *** 3344,3350 **** // call constructor returns = new wxPCXHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPCXHandler, returns); --- 3337,3342 ---- // call constructor returns = new wxPCXHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPCXHandler, returns); *************** *** 3386,3392 **** // call constructor returns = new wxPNGHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNGHandler, returns); --- 3378,3383 ---- // call constructor returns = new wxPNGHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNGHandler, returns); *************** *** 3428,3434 **** // call constructor returns = new wxPNMHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNMHandler, returns); --- 3419,3424 ---- // call constructor returns = new wxPNMHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxPNMHandler, returns); *************** *** 3470,3476 **** // call constructor returns = new wxTIFFHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTIFFHandler, returns); --- 3460,3465 ---- // call constructor returns = new wxTIFFHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTIFFHandler, returns); *************** *** 3512,3518 **** // call constructor returns = new wxTGAHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTGAHandler, returns); --- 3501,3506 ---- // call constructor returns = new wxTGAHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxTGAHandler, returns); *************** *** 3554,3560 **** // call constructor returns = new wxXPMHandler(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXPMHandler, returns); --- 3542,3547 ---- // call constructor returns = new wxXPMHandler(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxXPMHandler, returns); Index: mdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/mdi.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** mdi.cpp 8 Jun 2007 01:36:27 -0000 1.37 --- mdi.cpp 12 Jun 2007 00:08:39 -0000 1.38 *************** *** 269,273 **** #endif // ((defined(__WXMSW__)) && (wxLUA_USE_MDI && wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE)) && (wxLUA_USE_wxMenu && wxUSE_MENUS) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxMDIParentFrame_Tile[] = { &s_wxluatag_wxMDIParentFrame, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxMDIParentFrame_Tile(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxMDIParentFrame_Tile[1] = {{ wxLua_wxMDIParentFrame_Tile, WXLUAMETHOD_METHOD, 1, 2, s_wxluatagArray_wxLua_wxMDIParentFrame_Tile }}; --- 269,273 ---- #endif // ((defined(__WXMSW__)) && (wxLUA_USE_MDI && wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE)) && (wxLUA_USE_wxMenu && wxUSE_MENUS) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxMDIParentFrame_Tile[] = { &s_wxluatag_wxMDIParentFrame, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxMDIParentFrame_Tile(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxMDIParentFrame_Tile[1] = {{ wxLua_wxMDIParentFrame_Tile, WXLUAMETHOD_METHOD, 1, 2, s_wxluatagArray_wxLua_wxMDIParentFrame_Tile }}; *************** *** 279,283 **** int argCount = lua_gettop(L); // wxOrientation orient = wxHORIZONTAL ! wxOrientation orient = (argCount >= 2 ? (wxOrientation)wxlua_getenumerationtype(L, 2) : wxHORIZONTAL); // get this wxMDIParentFrame * self = (wxMDIParentFrame *)wxlState.GetUserDataType(1, s_wxluatag_wxMDIParentFrame); --- 279,283 ---- int argCount = lua_gettop(L); // wxOrientation orient = wxHORIZONTAL ! wxOrientation orient = (argCount >= 2 ? (wxOrientation)wxlua_getintegertype(L, 2) : wxHORIZONTAL); // get this wxMDIParentFrame * self = (wxMDIParentFrame *)wxlState.GetUserDataType(1, s_wxluatag_wxMDIParentFrame); *************** *** 317,323 **** // call constructor returns = new wxMDIParentFrame(parent, id, title, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); --- 317,322 ---- // call constructor returns = new wxMDIParentFrame(parent, id, title, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); *************** *** 338,344 **** // call constructor returns = new wxMDIParentFrame(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); --- 337,342 ---- // call constructor returns = new wxMDIParentFrame(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIParentFrame, returns); *************** *** 537,543 **** // call constructor returns = new wxMDIChildFrame(parent, id, title, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); --- 535,540 ---- // call constructor returns = new wxMDIChildFrame(parent, id, title, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); *************** *** 558,564 **** // call constructor returns = new wxMDIChildFrame(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); --- 555,560 ---- // call constructor returns = new wxMDIChildFrame(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxMDIChildFrame, returns); *************** *** 730,736 **** // call constructor returns = new wxDocChildFrame(doc, view, parent, id, title, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocChildFrame, returns); --- 726,731 ---- // call constructor returns = new wxDocChildFrame(doc, view, parent, id, title, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocChildFrame, returns); *************** *** 1522,1528 **** // call constructor returns = new wxDocManager(flags, initialize); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocManager, returns); --- 1517,1522 ---- // call constructor returns = new wxDocManager(flags, initialize); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocManager, returns); *************** *** 1709,1715 **** // call constructor returns = new wxDocParentFrame(manager, parent, id, title, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocParentFrame, returns); --- 1703,1708 ---- // call constructor returns = new wxDocParentFrame(manager, parent, id, title, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocParentFrame, returns); *************** *** 2117,2123 **** // call constructor returns = new wxDocTemplate(manager, descr, filter, dir, ext, docTypeName, viewTypeName, docClassInfo, viewClassInfo, flags); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocTemplate, returns); --- 2110,2115 ---- // call constructor returns = new wxDocTemplate(manager, descr, filter, dir, ext, docTypeName, viewTypeName, docClassInfo, viewClassInfo, flags); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocTemplate, returns); *************** *** 2792,2798 **** // call constructor returns = new wxDocument(); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocument, returns); --- 2784,2789 ---- // call constructor returns = new wxDocument(); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxDocument, returns); *************** *** 3628,3634 **** // call constructor returns = new wxCommandProcessor(maxCommands); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCommandProcessor, returns); --- 3619,3624 ---- // call constructor returns = new wxCommandProcessor(maxCommands); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxCommandProcessor, returns); *************** *** 4017,4023 **** // call constructor returns = new wxFileHistory(maxFiles, idBase); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxFileHistory, returns); --- 4007,4012 ---- // call constructor returns = new wxFileHistory(maxFiles, idBase); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxFileHistory, returns); Index: wxlprint.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlprint.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wxlprint.cpp 11 Jun 2007 03:58:07 -0000 1.17 --- wxlprint.cpp 12 Jun 2007 00:08:41 -0000 1.18 *************** *** 244,246 **** --- 244,268 ---- } + wxString wxLuaPrintout::TestVirtualFunctionBinding(const wxString& val) + { + wxString result(val + wxT("-Base")); + + if (m_wxlState.Ok() && !m_wxlState.GetCallBaseClassFunction() && + m_wxlState.HasDerivedMethod(this, "TestVirtualFunctionBinding", true)) + { + int nOldTop = m_wxlState.lua_GetTop(); + m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); + m_wxlState.lua_PushString(val); + + m_wxlState.LuaPCall(2, 1); + result = m_wxlState.GetwxStringType(-1); + m_wxlState.lua_SetTop(nOldTop); + } + // no else since wxPrintout doesn't have this function + + m_wxlState.SetCallBaseClassFunction(false); // clear flag always + + return result; + } + #endif // wxLUA_USE_wxLuaPrintout Index: grid.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/grid.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** grid.cpp 11 Jun 2007 03:58:04 -0000 1.39 --- grid.cpp 12 Jun 2007 00:08:39 -0000 1.40 *************** *** 1726,1730 **** #endif // (wxLUA_USE_wxFont) && (wxLUA_USE_wxGrid && wxUSE_GRID) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellAttr_SetKind[] = { &s_wxluatag_wxGridCellAttr, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGridCellAttr_SetKind(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellAttr_SetKind[1] = {{ wxLua_wxGridCellAttr_SetKind, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGridCellAttr_SetKind }}; --- 1726,1730 ---- #endif // (wxLUA_USE_wxFont) && (wxLUA_USE_wxGrid && wxUSE_GRID) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellAttr_SetKind[] = { &s_wxluatag_wxGridCellAttr, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGridCellAttr_SetKind(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellAttr_SetKind[1] = {{ wxLua_wxGridCellAttr_SetKind, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGridCellAttr_SetKind }}; *************** *** 1734,1738 **** wxLuaState wxlState(L); // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getenumerationtype(L, 2); // get this wxGridCellAttr * self = (wxGridCellAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellAttr); --- 1734,1738 ---- wxLuaState wxlState(L); // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getintegertype(L, 2); // get this wxGridCellAttr * self = (wxGridCellAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxGridCellAttr); *************** *** 2002,2006 **** int s_wxluatag_wxGridCellAttrProvider = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellAttrProvider_GetAttr[] = { &s_wxluatag_wxGridCellAttrProvider, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGridCellAttrProvider_GetAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellAttrProvider_GetAttr[1] = {{ wxLua_wxGridCellAttrProvider_GetAttr, WXLUAMETHOD_METHOD, 4, 4, s_wxluatagArray_wxLua_wxGridCellAttrProvider_GetAttr }}; --- 2002,2006 ---- int s_wxluatag_wxGridCellAttrProvider = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellAttrProvider_GetAttr[] = { &s_wxluatag_wxGridCellAttrProvider, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGridCellAttrProvider_GetAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellAttrProvider_GetAttr[1] = {{ wxLua_wxGridCellAttrProvider_GetAttr, WXLUAMETHOD_METHOD, 4, 4, s_wxluatagArray_wxLua_wxGridCellAttrProvider_GetAttr }}; *************** *** 2011,2015 **** wxGridCellAttr *returns; // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getenumerationtype(L, 4); // int col int col = (int)wxlua_getnumbertype(L, 3); --- 2011,2015 ---- wxGridCellAttr *returns; // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getintegertype(L, 4); // int col int col = (int)wxlua_getnumbertype(L, 3); *************** *** 2341,2345 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridTableBase_GetAttr[] = { &s_wxluatag_wxGridTableBase, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGridTableBase_GetAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridTableBase_GetAttr[1] = {{ wxLua_wxGridTableBase_GetAttr, WXLUAMETHOD_METHOD, 4, 4, s_wxluatagArray_wxLua_wxGridTableBase_GetAttr }}; --- 2341,2345 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridTableBase_GetAttr[] = { &s_wxluatag_wxGridTableBase, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGridTableBase_GetAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridTableBase_GetAttr[1] = {{ wxLua_wxGridTableBase_GetAttr, WXLUAMETHOD_METHOD, 4, 4, s_wxluatagArray_wxLua_wxGridTableBase_GetAttr }}; *************** *** 2350,2354 **** wxGridCellAttr *returns; // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getenumerationtype(L, 4); // int col int col = (int)wxlua_getnumbertype(L, 3); --- 2350,2354 ---- wxGridCellAttr *returns; // wxGridCellAttr::wxAttrKind kind ! wxGridCellAttr::wxAttrKind kind = (wxGridCellAttr::wxAttrKind)wxlua_getintegertype(L, 4); // int col int col = (int)wxlua_getnumbertype(L, 3); *************** *** 2945,2951 **** // call constructor returns = new wxGridStringTable(numRows, numCols); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridStringTable, returns); --- 2945,2950 ---- // call constructor returns = new wxGridStringTable(numRows, numCols); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridStringTable, returns); *************** *** 3728,3732 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_CreateGrid[] = { &s_wxluatag_wxGrid, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGrid_CreateGrid(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_CreateGrid[1] = {{ wxLua_wxGrid_CreateGrid, WXLUAMETHOD_METHOD, 3, 4, s_wxluatagArray_wxLua_wxGrid_CreateGrid }}; --- 3727,3731 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_CreateGrid[] = { &s_wxluatag_wxGrid, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGrid_CreateGrid(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_CreateGrid[1] = {{ wxLua_wxGrid_CreateGrid, WXLUAMETHOD_METHOD, 3, 4, s_wxluatagArray_wxLua_wxGrid_CreateGrid }}; *************** *** 3739,3743 **** int argCount = lua_gettop(L); // wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells ! wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getenumerationtype(L, 4) : wxGrid::wxGridSelectCells); // int numCols int numCols = (int)wxlua_getnumbertype(L, 3); --- 3738,3742 ---- int argCount = lua_gettop(L); // wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells ! wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getintegertype(L, 4) : wxGrid::wxGridSelectCells); // int numCols int numCols = (int)wxlua_getnumbertype(L, 3); *************** *** 6893,6897 **** #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxGrid && wxUSE_GRID) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_SetSelectionMode[] = { &s_wxluatag_wxGrid, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGrid_SetSelectionMode(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_SetSelectionMode[1] = {{ wxLua_wxGrid_SetSelectionMode, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGrid_SetSelectionMode }}; --- 6892,6896 ---- #endif // (wxLUA_USE_wxColourPenBrush) && (wxLUA_USE_wxGrid && wxUSE_GRID) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_SetSelectionMode[] = { &s_wxluatag_wxGrid, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGrid_SetSelectionMode(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_SetSelectionMode[1] = {{ wxLua_wxGrid_SetSelectionMode, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxGrid_SetSelectionMode }}; *************** *** 6901,6905 **** wxLuaState wxlState(L); // wxGrid::wxGridSelectionModes selmode ! wxGrid::wxGridSelectionModes selmode = (wxGrid::wxGridSelectionModes)wxlua_getenumerationtype(L, 2); // get this wxGrid * self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); --- 6900,6904 ---- wxLuaState wxlState(L); // wxGrid::wxGridSelectionModes selmode ! wxGrid::wxGridSelectionModes selmode = (wxGrid::wxGridSelectionModes)wxlua_getintegertype(L, 2); // get this wxGrid * self = (wxGrid *)wxlState.GetUserDataType(1, s_wxluatag_wxGrid); *************** *** 6910,6914 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_SetTable[] = { &s_wxluatag_wxGrid, &s_wxluatag_wxGridTableBase, &s_wxluaarg_Boolean, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxGrid_SetTable(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_SetTable[1] = {{ wxLua_wxGrid_SetTable, WXLUAMETHOD_METHOD, 2, 4, s_wxluatagArray_wxLua_wxGrid_SetTable }}; --- 6909,6913 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGrid_SetTable[] = { &s_wxluatag_wxGrid, &s_wxluatag_wxGridTableBase, &s_wxluaarg_Boolean, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxGrid_SetTable(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGrid_SetTable[1] = {{ wxLua_wxGrid_SetTable, WXLUAMETHOD_METHOD, 2, 4, s_wxluatagArray_wxLua_wxGrid_SetTable }}; *************** *** 6921,6925 **** int argCount = lua_gettop(L); // wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells ! wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getenumerationtype(L, 4) : wxGrid::wxGridSelectCells); // bool takeOwnership = false bool takeOwnership = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : false); --- 6920,6924 ---- int argCount = lua_gettop(L); // wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells ! wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getintegertype(L, 4) : wxGrid::wxGridSelectCells); // bool takeOwnership = false bool takeOwnership = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : false); *************** *** 7102,7108 **** // call constructor returns = new wxGrid(parent, id, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGrid, returns); --- 7101,7106 ---- // call constructor returns = new wxGrid(parent, id, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGrid, returns); *************** *** 7644,7648 **** returns = new wxGridEvent(id, type, obj, row, col, x, y, sel, control, shift, alt, meta); // add to tracked memory list ! wxlState.AddTrackedObject((wxGridEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridEvent, returns); --- 7642,7646 ---- returns = new wxGridEvent(id, type, obj, row, col, x, y, sel, control, shift, alt, meta); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridEvent, returns); *************** *** 7841,7847 **** // call constructor returns = new wxGridSizeEvent(id, type, obj, rowOrCol, x, y, control, shift, alt, meta); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridSizeEvent, returns); --- 7839,7844 ---- // call constructor returns = new wxGridSizeEvent(id, type, obj, rowOrCol, x, y, control, shift, alt, meta); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridSizeEvent, returns); *************** *** 8143,8147 **** returns = new wxGridRangeSelectEvent(id, type, obj, *topLeft, *bottomRight, sel, control, shift, alt, meta); // add to tracked memory list ! wxlState.AddTrackedObject((wxGridRangeSelectEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridRangeSelectEvent, returns); --- 8140,8144 ---- returns = new wxGridRangeSelectEvent(id, type, obj, *topLeft, *bottomRight, sel, control, shift, alt, meta); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridRangeSelectEvent, returns); *************** *** 8336,8340 **** returns = new wxGridEditorCreatedEvent(id, type, obj, row, col, ctrl); // add to tracked memory list ! wxlState.AddTrackedObject((wxGridEditorCreatedEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridEditorCreatedEvent, returns); --- 8333,8337 ---- returns = new wxGridEditorCreatedEvent(id, type, obj, row, col, ctrl); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxGridEditorCreatedEvent, returns); Index: file.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/file.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** file.cpp 11 Jun 2007 03:58:03 -0000 1.48 --- file.cpp 12 Jun 2007 00:08:38 -0000 1.49 *************** *** 312,316 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign4[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_Assign4(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign4[1] = {{ wxLua_wxFileName_Assign4, WXLUAMETHOD_METHOD, 4, 5, s_wxluatagArray_wxLua_wxFileName_Assign4 }}; --- 312,316 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign4[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_Assign4(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign4[1] = {{ wxLua_wxFileName_Assign4, WXLUAMETHOD_METHOD, 4, 5, s_wxluatagArray_wxLua_wxFileName_Assign4 }}; *************** *** 322,326 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 5 ? (wxPathFormat)wxlua_getenumerationtype(L, 5) : wxPATH_NATIVE); // const wxString ext const wxString ext = wxlState.GetwxStringType(4); --- 322,326 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 5 ? (wxPathFormat)wxlua_getintegertype(L, 5) : wxPATH_NATIVE); // const wxString ext const wxString ext = wxlState.GetwxStringType(4); *************** *** 337,341 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign3[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_Assign3(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign3[1] = {{ wxLua_wxFileName_Assign3, WXLUAMETHOD_METHOD, 3, 4, s_wxluatagArray_wxLua_wxFileName_Assign3 }}; --- 337,341 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign3[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_Assign3(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign3[1] = {{ wxLua_wxFileName_Assign3, WXLUAMETHOD_METHOD, 3, 4, s_wxluatagArray_wxLua_wxFileName_Assign3 }}; *************** *** 347,351 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 4 ? (wxPathFormat)wxlua_getenumerationtype(L, 4) : wxPATH_NATIVE); // const wxString name const wxString name = wxlState.GetwxStringType(3); --- 347,351 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 4 ? (wxPathFormat)wxlua_getintegertype(L, 4) : wxPATH_NATIVE); // const wxString name const wxString name = wxlState.GetwxStringType(3); *************** *** 360,364 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign2[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_Assign2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign2[1] = {{ wxLua_wxFileName_Assign2, WXLUAMETHOD_METHOD, 5, 6, s_wxluatagArray_wxLua_wxFileName_Assign2 }}; --- 360,364 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign2[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_Assign2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign2[1] = {{ wxLua_wxFileName_Assign2, WXLUAMETHOD_METHOD, 5, 6, s_wxluatagArray_wxLua_wxFileName_Assign2 }}; *************** *** 370,374 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 6 ? (wxPathFormat)wxlua_getenumerationtype(L, 6) : wxPATH_NATIVE); // const wxString ext const wxString ext = wxlState.GetwxStringType(5); --- 370,374 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 6 ? (wxPathFormat)wxlua_getintegertype(L, 6) : wxPATH_NATIVE); // const wxString ext const wxString ext = wxlState.GetwxStringType(5); *************** *** 387,391 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign1[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_Assign1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign1[1] = {{ wxLua_wxFileName_Assign1, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxFileName_Assign1 }}; --- 387,391 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_Assign1[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_Assign1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_Assign1[1] = {{ wxLua_wxFileName_Assign1, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxFileName_Assign1 }}; *************** *** 397,401 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getenumerationtype(L, 3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); --- 397,401 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getintegertype(L, 3) : wxPATH_NATIVE); // const wxString fullpath const wxString fullpath = wxlState.GetwxStringType(2); *************** *** 444,448 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignDir[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_AssignDir(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_AssignDir[1] = {{ wxLua_wxFileName_AssignDir, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxFileName_AssignDir }}; --- 444,448 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignDir[] = { &s_wxluatag_wxFileName, &s_wxluaarg_String, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_AssignDir(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_AssignDir[1] = {{ wxLua_wxFileName_AssignDir, WXLUAMETHOD_METHOD, 2, 3, s_wxluatagArray_wxLua_wxFileName_AssignDir }}; *************** *** 454,458 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getenumerationtype(L, 3) : wxPATH_NATIVE); // const wxString dir const wxString dir = wxlState.GetwxStringType(2); --- 454,458 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 3 ? (wxPathFormat)wxlua_getintegertype(L, 3) : wxPATH_NATIVE); // const wxString dir const wxString dir = wxlState.GetwxStringType(2); *************** *** 787,791 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_GetForbiddenChars[] = { &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_GetForbiddenChars(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_GetForbiddenChars[1] = {{ wxLua_wxFileName_GetForbiddenChars, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 1, s_wxluatagArray_wxLua_wxFileName_GetForbiddenChars }}; --- 787,791 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_GetForbiddenChars[] = { &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_GetForbiddenChars(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_GetForbiddenChars[1] = {{ wxLua_wxFileName_GetForbiddenChars, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 1, s_wxluatagArray_wxLua_wxFileName_GetForbiddenChars }}; *************** *** 798,802 **** int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 1 ? (wxPathFormat)wxlua_getenumerationtype(L, 1) : wxPATH_NATIVE); // call GetForbiddenChars returns = wxFileName::GetForbiddenChars(format); --- 798,802 ---- int argCount = lua_gettop(L); // wxPathFormat format = wxPATH_NATIVE ! wxPathFormat format = (argCount >= 1 ? (wxPathFormat)wxlua_getintegertype(L, 1) : wxPATH_NATIVE); // call GetForbiddenChars returns = wxFileName::GetForbiddenChars(format); *************** *** 807,811 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_GetFormat[] = { &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxFileName_GetFormat(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_GetFormat[1] = {{ wxLua_wxFileName_GetFormat, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 1, s_wxluatagArray_wxLua_wxFileName_GetFormat }}; --- 807,811 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_GetFormat[] = { &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxFileName_GetFormat(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileName_GetFormat[1] = {{ wxLua_wxFi... [truncated message content] |
From: John L. <jr...@us...> - 2007-06-12 00:08:47
|
Update of /cvsroot/wxlua/wxLua/samples In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/samples Modified Files: bindings.wx.lua debug.wx.lua printing.wx.lua unittest.wx.lua validator.wx.lua wxluasudoku.wx.lua Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: debug.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/debug.wx.lua,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** debug.wx.lua 31 May 2007 21:38:49 -0000 1.11 --- debug.wx.lua 12 Jun 2007 00:08:42 -0000 1.12 *************** *** 41,50 **** userdata.GetClassInfo = function(self) ! results.refData3 = self:base_GetClassInfo() return 1 end results.refData1 = userdata:GetClassInfo() ! results.refData2 = userdata:base_GetClassInfo() wxLuaStackDialog() --- 41,50 ---- userdata.GetClassInfo = function(self) ! results.refData3 = self:_GetClassInfo() return 1 end results.refData1 = userdata:GetClassInfo() ! results.refData2 = userdata:_GetClassInfo() wxLuaStackDialog() Index: bindings.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/bindings.wx.lua,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** bindings.wx.lua 11 Jun 2007 03:58:11 -0000 1.3 --- bindings.wx.lua 12 Jun 2007 00:08:42 -0000 1.4 *************** *** 592,596 **** "WXLUAARG_UserData", "WXLUAARG_LuaThread", ! "WXLUAARG_Enum" } --- 592,596 ---- "WXLUAARG_UserData", "WXLUAARG_LuaThread", ! "WXLUAARG_Integer" } Index: wxluasudoku.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/wxluasudoku.wx.lua,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** wxluasudoku.wx.lua 5 Jun 2007 21:07:26 -0000 1.69 --- wxluasudoku.wx.lua 12 Jun 2007 00:08:42 -0000 1.70 *************** *** 2711,2716 **** local pageSetupDialog = wx.wxPageSetupDialog(sudokuGUI.frame, sudokuGUI.pageSetupData) pageSetupDialog:ShowModal() ! sudokuGUI.printData = pageSetupDialog:GetPageSetupData():GetPrintData():Copy() ! sudokuGUI.pageSetupData = pageSetupDialog:GetPageSetupData():Copy() --pageSetupDialog:Destroy() end --- 2711,2716 ---- local pageSetupDialog = wx.wxPageSetupDialog(sudokuGUI.frame, sudokuGUI.pageSetupData) pageSetupDialog:ShowModal() ! sudokuGUI.printData = pageSetupDialog:GetPageSetupDialogData():GetPrintData():Copy() ! sudokuGUI.pageSetupData = pageSetupDialog:GetPageSetupDialogData():Copy() --pageSetupDialog:Destroy() end *************** *** 3801,3821 **** local fcListBox = wx.wxListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) fcListBox:SetSelection(0) ! fcFlexSizer:AddWindow( fcListBox, 0, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) local fcBoxSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local sampleWin = wx.wxWindow(panel, ID_SAMPLE_TEXT, wx.wxDefaultPosition, wx.wxSize(140,140)) ! fcBoxSizer:AddWindow( sampleWin, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ); local fontButton = wx.wxButton( panel, ID_FONT_BUTTON, "Choose Font", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:AddWindow( fontButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) local colourButton = wx.wxButton( panel, ID_COLOUR_BUTTON, "Choose Color", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:AddWindow( colourButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) local resetButton = wx.wxButton( panel, ID_RESET_BUTTON, "Reset Value...", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:AddWindow( resetButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) ! fcFlexSizer:AddSizer( fcBoxSizer, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) ! mainSizer:AddSizer( fcFlexSizer, 1, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL, 5 ) panel:SetSizer( mainSizer ) --- 3801,3821 ---- local fcListBox = wx.wxListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) fcListBox:SetSelection(0) ! fcFlexSizer:Add( fcListBox, 0, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) local fcBoxSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local sampleWin = wx.wxWindow(panel, ID_SAMPLE_TEXT, wx.wxDefaultPosition, wx.wxSize(140,140)) ! fcBoxSizer:Add( sampleWin, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ); local fontButton = wx.wxButton( panel, ID_FONT_BUTTON, "Choose Font", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:Add( fontButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) local colourButton = wx.wxButton( panel, ID_COLOUR_BUTTON, "Choose Color", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:Add( colourButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) local resetButton = wx.wxButton( panel, ID_RESET_BUTTON, "Reset Value...", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! fcBoxSizer:Add( resetButton, 0, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL+wx.wxALL, 5 ) ! fcFlexSizer:Add( fcBoxSizer, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) ! mainSizer:Add( fcFlexSizer, 1, wx.wxGROW+wx.wxALIGN_CENTER_VERTICAL, 5 ) panel:SetSizer( mainSizer ) *************** *** 4073,4077 **** local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local showListBox = wx.wxCheckListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) ! mainSizer:AddWindow( showListBox, 1, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) --- 4073,4077 ---- local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local showListBox = wx.wxCheckListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) ! mainSizer:Add( showListBox, 1, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) *************** *** 4143,4147 **** local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local showListBox = wx.wxCheckListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) ! mainSizer:AddWindow( showListBox, 1, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) --- 4143,4147 ---- local mainSizer = wx.wxBoxSizer( wx.wxVERTICAL ) local showListBox = wx.wxCheckListBox( panel, ID_LISTBOX, wx.wxDefaultPosition, wx.wxSize(80,100), listStrings, wx.wxLB_SINGLE ) ! mainSizer:Add( showListBox, 1, wx.wxGROW+wx.wxALIGN_CENTER_HORIZONTAL+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) *************** *** 4205,4216 **** local buttonSizer = wx.wxBoxSizer( wx.wxHORIZONTAL ) local okButton = wx.wxButton( panel, wx.wxID_OK, "&OK", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:AddWindow( okButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) local cancelButton = wx.wxButton( panel, wx.wxID_CANCEL, "&Cancel", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:AddWindow( cancelButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) local applyButton = wx.wxButton( panel, wx.wxID_APPLY, "&Apply", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:AddWindow( applyButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) ! mainSizer:AddWindow( notebook, 1, wx.wxGROW+wx.wxALIGN_CENTER, 0 ) ! mainSizer:AddSizer( buttonSizer, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) mainSizer:SetSizeHints( dialog ) --- 4205,4216 ---- local buttonSizer = wx.wxBoxSizer( wx.wxHORIZONTAL ) local okButton = wx.wxButton( panel, wx.wxID_OK, "&OK", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:Add( okButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) local cancelButton = wx.wxButton( panel, wx.wxID_CANCEL, "&Cancel", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:Add( cancelButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) local applyButton = wx.wxButton( panel, wx.wxID_APPLY, "&Apply", wx.wxDefaultPosition, wx.wxDefaultSize, 0 ) ! buttonSizer:Add( applyButton, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) ! mainSizer:Add( notebook, 1, wx.wxGROW+wx.wxALIGN_CENTER, 0 ) ! mainSizer:Add( buttonSizer, 0, wx.wxALIGN_CENTER+wx.wxALL, 5 ) panel:SetSizer( mainSizer ) mainSizer:SetSizeHints( dialog ) *************** *** 4536,4542 **** function (event) local str = sudoku.ToString(sudokuGUI.GetCurrentTable()) ! if wx.wxClipboard_Get():Open() then ! wx.wxClipboard_Get():SetData(wx.wxTextDataObject(str)) ! wx.wxClipboard_Get():Close() end end --- 4536,4542 ---- function (event) local str = sudoku.ToString(sudokuGUI.GetCurrentTable()) ! if wx.wxClipboard.Get():Open() then ! wx.wxClipboard.Get():SetData(wx.wxTextDataObject(str)) ! wx.wxClipboard.Get():Close() end end *************** *** 4932,4946 **** local toolBar = sudokuGUI.frame:CreateToolBar(wx.wxNO_BORDER) -- + wx.wxTB_FLAT + wx.wxTB_DOCKABLE) ! toolBar:AddTool(sudokuGUI.ID_NEW, "New", wx.wxArtProvider.GetBitmap(wx.wxART_NEW, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Clear the current puzzle", "Clear the current puzzle") ! toolBar:AddCheckTool(sudokuGUI.ID_CREATE, "Create", wx.wxArtProvider.GetBitmap(wx.wxART_ADD_BOOKMARK, wx.wxART_TOOLBAR), wx.wxNullBitmap, "Enter initial values for the puzzle", "Enter initial values for the puzzle") ! toolBar:AddTool(sudokuGUI.ID_GENERATE, "Generate", wx.wxArtProvider.GetBitmap(wx.wxART_EXECUTABLE_FILE, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Generate a new puzzle", "Generate a new puzzle") ! toolBar:AddTool(sudokuGUI.ID_OPEN, "Open", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_OPEN, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Open a puzzle file", "Open a puzzle file") ! toolBar:AddTool(sudokuGUI.ID_SAVEAS, "Save", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_SAVE_AS, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Save the current puzzle", "Save the current puzzle") ! toolBar:AddTool(sudokuGUI.ID_PRINT, "Print", wx.wxArtProvider.GetBitmap(wx.wxART_PRINT, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Print the puzzle", "Print the puzzle") toolBar:AddSeparator() ! toolBar:AddTool(sudokuGUI.ID_UNDO, "Undo", wx.wxArtProvider.GetBitmap(wx.wxART_UNDO, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Undo the last entry", "Undo the last entry") ! toolBar:AddTool(sudokuGUI.ID_REDO, "Redo", wx.wxArtProvider.GetBitmap(wx.wxART_REDO, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Redo the last entry", "Redo the last entry") toolBar:AddSeparator() ! toolBar:AddTool(sudokuGUI.ID_HELP, "Help", wx.wxArtProvider.GetBitmap(wx.wxART_QUESTION, wx.wxART_TOOLBAR), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Help on wxLuaSudoku", "Help on wxLuaSudoku") toolBar:Realize() --- 4932,4947 ---- local toolBar = sudokuGUI.frame:CreateToolBar(wx.wxNO_BORDER) -- + wx.wxTB_FLAT + wx.wxTB_DOCKABLE) ! local tbSize = toolBar:GetToolBitmapSize() -- required to force help icon to right size in MSW ! toolBar:AddTool(sudokuGUI.ID_NEW, "New", wx.wxArtProvider.GetBitmap(wx.wxART_NEW, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Clear the current puzzle", "Clear the current puzzle") ! toolBar:AddCheckTool(sudokuGUI.ID_CREATE, "Create", wx.wxArtProvider.GetBitmap(wx.wxART_ADD_BOOKMARK, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, "Enter initial values for the puzzle", "Enter initial values for the puzzle") ! toolBar:AddTool(sudokuGUI.ID_GENERATE, "Generate", wx.wxArtProvider.GetBitmap(wx.wxART_EXECUTABLE_FILE, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Generate a new puzzle", "Generate a new puzzle") ! toolBar:AddTool(sudokuGUI.ID_OPEN, "Open", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_OPEN, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Open a puzzle file", "Open a puzzle file") ! toolBar:AddTool(sudokuGUI.ID_SAVEAS, "Save", wx.wxArtProvider.GetBitmap(wx.wxART_FILE_SAVE_AS, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Save the current puzzle", "Save the current puzzle") ! toolBar:AddTool(sudokuGUI.ID_PRINT, "Print", wx.wxArtProvider.GetBitmap(wx.wxART_PRINT, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Print the puzzle", "Print the puzzle") toolBar:AddSeparator() ! toolBar:AddTool(sudokuGUI.ID_UNDO, "Undo", wx.wxArtProvider.GetBitmap(wx.wxART_UNDO, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Undo the last entry", "Undo the last entry") ! toolBar:AddTool(sudokuGUI.ID_REDO, "Redo", wx.wxArtProvider.GetBitmap(wx.wxART_REDO, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Redo the last entry", "Redo the last entry") toolBar:AddSeparator() ! toolBar:AddTool(sudokuGUI.ID_HELP, "Help", wx.wxArtProvider.GetBitmap(wx.wxART_QUESTION, wx.wxART_TOOLBAR, tbSize), wx.wxNullBitmap, wx.wxITEM_NORMAL, "Help on wxLuaSudoku", "Help on wxLuaSudoku") toolBar:Realize() *************** *** 5033,5037 **** --sudokuGUI.UpdateTable() ! sudokuGUI.frame:SetClientSize(wx.wxSize(300,300)) sudokuGUI.block_refresh = false sudokuGUI.ConfigLoad() --- 5034,5038 ---- --sudokuGUI.UpdateTable() ! sudokuGUI.frame:SetClientSize(300,300) sudokuGUI.block_refresh = false sudokuGUI.ConfigLoad() Index: validator.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/validator.wx.lua,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** validator.wx.lua 11 Jun 2007 03:58:11 -0000 1.1 --- validator.wx.lua 12 Jun 2007 00:08:42 -0000 1.2 *************** *** 46,50 **** scroll_val = 10 checkl_val = { 0, 2 } ! text_alpha_val = "OnlyAlphabetCharsAllowed" checkObj = wx.wxLuaObject(check_val) --- 46,50 ---- scroll_val = 10 checkl_val = { 0, 2 } ! text_alpha_val = "DeleteSpace OnlyAlphabetCharsAllowed" checkObj = wx.wxLuaObject(check_val) *************** *** 83,87 **** textAlphaCtrl = wx.wxTextCtrl(dialog, ID_TEXTCTRL, "THIS WILL BE OVERWRITTEN", ! wx.wxDefaultPosition, wx.wxDefaultSize, 0, wx.wxTextValidator(wx.wxFILTER_ALPHA, textAlphaObj)) --- 83,87 ---- textAlphaCtrl = wx.wxTextCtrl(dialog, ID_TEXTCTRL, "THIS WILL BE OVERWRITTEN", ! wx.wxDefaultPosition, wx.wxSize(400, -1), 0, wx.wxTextValidator(wx.wxFILTER_ALPHA, textAlphaObj)) *************** *** 113,117 **** "wxLua Validator Demo", -- caption on the frame wx.wxDefaultPosition, -- let system place the frame ! wx.wxSize(450, 450), -- set the size of the frame wx.wxDEFAULT_FRAME_STYLE ) -- use default frame styles --- 113,117 ---- "wxLua Validator Demo", -- caption on the frame wx.wxDefaultPosition, -- let system place the frame ! wx.wxSize(450, 420), -- set the size of the frame wx.wxDEFAULT_FRAME_STYLE ) -- use default frame styles Index: unittest.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/unittest.wx.lua,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** unittest.wx.lua 11 Jun 2007 03:58:11 -0000 1.9 --- unittest.wx.lua 12 Jun 2007 00:08:42 -0000 1.10 *************** *** 88,91 **** --- 88,102 ---- b = wx.wxArrayString(a) PrintOk((b:Item(1) == "b") and (b:GetCount() == 3), "Test automatic overload of wxArrayString(wxArrayString)") + b = a:ToLuaTable() + PrintOk((b[2] == "b") and (#b == 3), "Test wxArrayString::ToLuaTable()") + + a = wx.wxSortedArrayString(wx.wxArrayString({"c", "b", "a"})) + PrintOk((a:Item(0) == "a") and (a:GetCount() == 3), "Test automatic overload of wxSortedArrayString(wxArrayString(lua table))") + a = wx.wxSortedArrayString({"c", "b", "a"}) + PrintOk((a:Item(0) == "a") and (a:GetCount() == 3), "Test automatic overload of wxSortedArrayString(lua table)") + b = wx.wxSortedArrayString(a) + PrintOk((b:Item(1) == "b") and (b:GetCount() == 3), "Test automatic overload of wxSortedArrayString(wxSortedArrayString)") + b = a:ToLuaTable() + PrintOk((b[2] == "b") and (#b == 3), "Test wxSortedArrayString::ToLuaTable()") a = wx.wxArrayInt({1, 2, 3}) *************** *** 93,96 **** --- 104,109 ---- b = wx.wxArrayInt(a) PrintOk((b:Item(1) == 2) and (b:GetCount() == 3), "Test automatic overload of wxArrayInt(wxArrayInt)") + b = a:ToLuaTable() + PrintOk((b[2] == 2) and (#b == 3), "Test wxArrayInt::ToLuaTable()") -- --------------------------------------------------------------------------- *************** *** 149,154 **** -- --------------------------------------------------------------------------- ! ! print("\nTest adding a functions to a class object userdata.\n") -- --------------------------------------------------------------------------- --- 162,166 ---- -- --------------------------------------------------------------------------- ! print("\nTest adding a methods to a class object userdata.\n") -- --------------------------------------------------------------------------- *************** *** 157,166 **** PrintOk(a:Print() == "1,2,3,4", "Add a new lua function to an already created wx.wxRect") a = wx.wxRect(1,2,3,4); function a.GetX(self) return "x" end PrintOk(a:GetX() == "x", "Replace wxRect:GetX with a lua function") ! PrintOk(a:base_GetX() == 1, "Replace wxRect:GetX with a lua function, call wxRect:base_GetX for original function") PrintOk(a:GetX() == "x", "Replace wxRect:GetX with a lua function (test recursion)") ! PrintOk(a:base_GetX() == 1, "Replace wxRect:GetX with a lua function, call wxRect:base_GetX for original function (rest recursion)") print("\n") --- 169,200 ---- PrintOk(a:Print() == "1,2,3,4", "Add a new lua function to an already created wx.wxRect") + a.value = 5 + PrintOk(a.value == 5, "Add a number value to an already created wx.wxRect") + a = wx.wxRect(1,2,3,4); function a.GetX(self) return "x" end PrintOk(a:GetX() == "x", "Replace wxRect:GetX with a lua function") ! PrintOk(a:_GetX() == 1, "Replace wxRect:GetX with a lua function, call wxRect:_GetX for original function") PrintOk(a:GetX() == "x", "Replace wxRect:GetX with a lua function (test recursion)") ! PrintOk(a:_GetX() == 1, "Replace wxRect:GetX with a lua function, call wxRect:_GetX for original function (test recursion)") ! ! -- --------------------------------------------------------------------------- ! print("\nTest virtual class functions and calling base class functions.\n") ! -- --------------------------------------------------------------------------- ! ! a = wx.wxLuaPrintout() ! PrintOk(a:TestVirtualFunctionBinding("Hello") == "Hello-Base", "Test wxLuaPrintout::TestVirtualFunctionBinding without overriding it.") ! PrintOk(a:_TestVirtualFunctionBinding("Hello") == "Hello-Base", "Test wxLuaPrintout::_TestVirtualFunctionBinding without overriding it.") ! ! a.TestVirtualFunctionBinding = function(self, val) return val.."-Lua" end ! PrintOk(a:TestVirtualFunctionBinding("Hello") == "Hello-Lua", "Test wxLuaPrintout::TestVirtualFunctionBinding overriding it, but not calling base.") ! PrintOk(a:_TestVirtualFunctionBinding("Hello") == "Hello-Base", "Test wxLuaPrintout::_TestVirtualFunctionBinding overriding it, but directly calling the base.") ! ! a.TestVirtualFunctionBinding = function(self, val) ! return self:_TestVirtualFunctionBinding(val).."-Lua" ! end ! PrintOk(a:TestVirtualFunctionBinding("Hello") == "Hello-Base-Lua", "Test wxLuaPrintout::TestVirtualFunctionBinding overriding it and calling base.") ! ! print("\n") Index: printing.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/printing.wx.lua,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** printing.wx.lua 11 Jun 2007 03:58:11 -0000 1.14 --- printing.wx.lua 12 Jun 2007 00:08:42 -0000 1.15 *************** *** 64,72 **** printOut.OnBeginDocument = function(self, startPage, endPage) ! return self:base_OnBeginDocument(startPage, endPage) end printOut.OnEndDocument = function(self) ! return self:base_OnEndDocument() end --- 64,72 ---- printOut.OnBeginDocument = function(self, startPage, endPage) ! return self:_OnBeginDocument(startPage, endPage) end printOut.OnEndDocument = function(self) ! return self:_OnEndDocument() end |
From: John L. <jr...@us...> - 2007-06-12 00:08:47
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -d -r1.106 -r1.107 *** wxlstate.cpp 11 Jun 2007 03:58:10 -0000 1.106 --- wxlstate.cpp 12 Jun 2007 00:08:42 -0000 1.107 *************** *** 338,342 **** // pop the table and set it as the metatable for the newuserdata if (lua_setmetatable(L, -2) == 0) ! wxlua_terror(L, "wxLua: Unable to set metatable"); else return true; --- 338,342 ---- // pop the table and set it as the metatable for the newuserdata if (lua_setmetatable(L, -2) == 0) ! wxlua_terror(L, "wxLua: Unable to set metatable in tpushusertag."); else [...1320 lines suppressed...] int invalidArg = 0; --- 3529,3532 ---- *************** *** 3505,3508 **** --- 3536,3542 ---- int lua_argStart = 0; + // don't remove the table, but do skip past it when counting args + bool remove_table = wxluabind_removetableforcall(GetLuaState(), true); + if (remove_table) { *************** *** 3634,3637 **** --- 3668,3672 ---- { // we have to count the methods that are displayed to find the one that failed + // since we're failing anyway, we don't need this to be fast method = wxlMethod; int i_func = 0; Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -d -r1.69 -r1.70 *** wxlbind.cpp 11 Jun 2007 03:58:10 -0000 1.69 --- wxlbind.cpp 12 Jun 2007 00:08:42 -0000 1.70 *************** *** 27,36 **** int LUACALL wxluabind_wxLuaBinding_index(lua_State* L); - // Binding tags are generated as positive tag id automatically when bound - // so we set the inbuilt lua arg tags to negative values - // - // note that -1 is use as initialiser for class tags - // and 0 is used as an end marker for tag array that - // represents prototypes argument types wxLuaArgTag s_wxluaargArray_None[1] = {0}; --- 27,30 ---- *************** *** 47,51 **** int s_wxluaarg_UserData = WXLUAARG_UserData; // raw data int s_wxluaarg_LuaThread = WXLUAARG_LuaThread; ! int s_wxluaarg_Enum = WXLUAARG_Enum; //----------------------------------------------------------------------------- --- 41,45 ---- int s_wxluaarg_UserData = WXLUAARG_UserData; // raw data int s_wxluaarg_LuaThread = WXLUAARG_LuaThread; ! int s_wxluaarg_Integer = WXLUAARG_Integer; //----------------------------------------------------------------------------- *************** *** 68,72 **** } - // A wxLuaFunction object is being garbage collected. int LUACALL wxlua_gc_wxLuaFunction(lua_State *L) { --- 62,65 ---- *************** *** 74,79 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! if (lua_isuserdata(L, 1) && (lua_islightuserdata(L, 1) == 0) && ! (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, true); --- 67,71 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! if (wxlua_iswxuserdata(L, 1) && (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, true); *************** *** 84,88 **** } - // Handler for the 'function' tag method. int LUACALL wxlua_call_wxLuaFunction(lua_State *L) { --- 76,79 ---- *************** *** 90,100 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! if (lua_isuserdata(L, 1) && (lua_islightuserdata(L, 1) == 0) && ! (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, false); // remove the userdata *this from the stack ! // can't do this for static and nonstatic overloaded functions //if (wxlFunction->m_wxlMethod && WXLUA_HASBIT(wxlFunction->m_wxlMethod->type, WXLUAMETHOD_STATIC)) // lua_remove(L, 1); --- 81,90 ---- wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); ! if (wxlua_iswxuserdata(L, 1) && (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, false); // remove the userdata *this from the stack ! // can't do this when there's both static and nonstatic overloaded functions //if (wxlFunction->m_wxlMethod && WXLUA_HASBIT(wxlFunction->m_wxlMethod->type, WXLUAMETHOD_STATIC)) // lua_remove(L, 1); *************** *** 115,126 **** { // set up the reference to the item on the stack ! m_iReference = m_wxlState->tinsert(stack_idx); } wxLuaObject::~wxLuaObject() { ! // If a refererence exists, remove it, don't bother if lua is being closed ! if ((m_iReference != LUA_NOREF) && m_wxlState->Ok() && !m_wxlState->IsClosing()) ! m_wxlState->tremove(m_iReference); delete m_wxlState; --- 105,116 ---- { // set up the reference to the item on the stack ! m_reference = m_wxlState->tinsert(stack_idx); } wxLuaObject::~wxLuaObject() { ! // If a refererence exists, remove it, but don't bother if lua is being closed ! if ((m_reference != LUA_NOREF) && m_wxlState->Ok() && !m_wxlState->IsClosing()) ! m_wxlState->tremove(m_reference); delete m_wxlState; *************** *** 167,171 **** return true; } ! else if (m_wxlState->tget(m_iReference)) return true; --- 157,161 ---- return true; } ! else if (m_wxlState->tget(m_reference)) return true; *************** *** 176,186 **** { wxCHECK_RET(m_wxlState->Ok(), wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_iReference != LUA_NOREF)) // FIXME should this error out? ! m_wxlState->tremove(m_iReference); ! m_iReference = LUA_NOREF; if (m_wxlState->Ok()) ! m_iReference = m_wxlState->tinsert(stack_idx); } --- 166,176 ---- { wxCHECK_RET(m_wxlState->Ok(), wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_reference != LUA_NOREF)) // FIXME should this error out? ! m_wxlState->tremove(m_reference); ! m_reference = LUA_NOREF; if (m_wxlState->Ok()) ! m_reference = m_wxlState->tinsert(stack_idx); } *************** *** 188,192 **** { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { m_bool = (lua_toboolean(m_wxlState->GetLuaState(), -1) != 0); --- 178,182 ---- { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_reference != LUA_NOREF) && GetObject()) { m_bool = (lua_toboolean(m_wxlState->GetLuaState(), -1) != 0); *************** *** 200,204 **** { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { m_int = (int) lua_tonumber(m_wxlState->GetLuaState(), -1); --- 190,194 ---- { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_reference != LUA_NOREF) && GetObject()) { m_int = (int) lua_tonumber(m_wxlState->GetLuaState(), -1); *************** *** 212,216 **** { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { m_string = lua2wx(lua_tostring(m_wxlState->GetLuaState(), -1)); --- 202,206 ---- { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_reference != LUA_NOREF) && GetObject()) { m_string = lua2wx(lua_tostring(m_wxlState->GetLuaState(), -1)); *************** *** 225,229 **** { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { m_wxlState->GetwxArrayInt(-1, m_arrayInt); --- 215,219 ---- { wxCHECK_MSG(m_wxlState->Ok(), false, wxT("Invalid wxLuaState")); ! if (m_wxlState->Ok() && (m_reference != LUA_NOREF) && GetObject()) { m_wxlState->GetwxArrayInt(-1, m_arrayInt); *************** *** 253,257 **** wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState")); - int retVal = 0; wxLuaBindClass *wxlClass = (wxLuaBindClass *)lua_touserdata(L, lua_upvalueindex(1)); --- 243,246 ---- *************** *** 259,264 **** long key = -1; ! if ((wxlClass != NULL) && lua_isuserdata(L, 1) && ! (lua_islightuserdata(L, 1) == 0) && (wxlState.ttag(1) == *wxlClass->class_tag)) { key = (long)wxlState.ttouserdata(1, true); --- 248,252 ---- long key = -1; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlState.ttag(1) == *wxlClass->class_tag)) { key = (long)wxlState.ttouserdata(1, true); *************** *** 267,271 **** //tracked = ! wxlState.RemoveTrackedObject((void*)key, true); // delete from m_pTrackedList wxlState.RemoveDerivedMethod((void*)key); } --- 255,259 ---- //tracked = ! wxlState.RemoveTrackedObject((void*)key, true); wxlState.RemoveDerivedMethod((void*)key); } *************** *** 274,278 **** // lua2wx(wxlClass ? wxlClass->name : "").c_str(), wxlClass ? *wxlClass->class_tag : 0, (int)L, key, (int)tracked, retVal); ! return retVal; } --- 262,266 ---- // lua2wx(wxlClass ? wxlClass->name : "").c_str(), wxlClass ? *wxlClass->class_tag : 0, (int)L, key, (int)tracked, retVal); ! return 0; } *************** *** 287,293 **** // ---------------------------------------------------------------------------- - #define CALL_BASECLASS_FUNC "base_" - #define CALL_BASECLASS_FUNC_LEN 5 - int LUACALL wxluabind_getTableFunc(lua_State *L) { --- 275,278 ---- *************** *** 300,304 **** // called as a function() or a .member? ! // See below, if base_XXX is called then we set this flag so that // the called function knows to call the base class instead of recalling // the lua function and recursing. --- 285,289 ---- // called as a function() or a .member? ! // See below, if _XXX is called then we set this flag so that // the called function knows to call the base class instead of recalling // the lua function and recursing. *************** *** 309,315 **** bool found = false; int result = 0; ! wxLuaBindClass *wxlClass = (wxLuaBindClass *)lua_touserdata(L, lua_upvalueindex(1)); ! const char *name = "{unknown}"; ! wxCharBuffer funcName; // debugging code for the table function, see print statement below --- 294,299 ---- bool found = false; int result = 0; ! wxLuaBindClass *wxlClass = (wxLuaBindClass *)lua_touserdata(L, lua_upvalueindex(1)); ! const char *name = NULL; // debugging code for the table function, see print statement below *************** *** 319,333 **** //int init_class_tag = wxlClass ? *wxlClass->class_tag : -1; ! if ((wxlClass != NULL) && lua_isuserdata(L, 1) && ! (lua_islightuserdata(L, 1) == 0) && (wxlState.ttag(1) == *wxlClass->class_tag)) { void *pObject = wxlState.ttouserdata(1); ! funcName = lua_tostring(L, 2); // make a copy of the string ! name = funcName.data(); ! callbase = (memcmp(name, CALL_BASECLASS_FUNC, CALL_BASECLASS_FUNC_LEN) == 0); if (callbase) ! name += CALL_BASECLASS_FUNC_LEN; // skip past "base_" else { --- 303,315 ---- //int init_class_tag = wxlClass ? *wxlClass->class_tag : -1; ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlState.ttag(1) == *wxlClass->class_tag)) { void *pObject = wxlState.ttouserdata(1); ! name = lua_tostring(L, 2); // make a copy of the string ! callbase = name[0] == '_'; if (callbase) ! name++; // skip past "_"FunctionName else { *************** *** 386,392 **** } ! //if (lua2wx(funcName).Find(wxT("OnBeginDocument")) != -1) // wxPrintf(wxT("wxluabind_getTableFunc func '%s' wxlClass %d '%s', userdata %d, lightuserdata %d, ttag %d, class_tag %d lua_State %d wxLuaStateRefData %d call base %d\n"), ! // lua2wx(funcName).c_str(), (long)wxlClass, wxlClass ? lua2wx(wxlClass->name).c_str() : wxT(""), init_isuserdata, init_islightuserdata, init_ttag, init_class_tag, (long)L, (long)wxlState.GetRefData(), (int)wxlState.GetCallBaseClassFunction()); if (!found) --- 368,374 ---- } ! //if (lua2wx(name).Find(wxT("OnBeginDocument")) != -1) // wxPrintf(wxT("wxluabind_getTableFunc func '%s' wxlClass %d '%s', userdata %d, lightuserdata %d, ttag %d, class_tag %d lua_State %d wxLuaStateRefData %d call base %d\n"), ! // lua2wx(name).c_str(), (long)wxlClass, wxlClass ? lua2wx(wxlClass->name).c_str() : wxT(""), init_isuserdata, init_islightuserdata, init_ttag, init_class_tag, (long)L, (long)wxlState.GetRefData(), (int)wxlState.GetCallBaseClassFunction()); if (!found) *************** *** 415,421 **** //wxPrintf(wxT("wxluabind_setTableFunc '%s'\n"), lua2wx(name).c_str()); ! if ((wxlClass != NULL) && lua_isuserdata(L, 1) && ! (lua_islightuserdata(L, 1) == 0) && ! (wxlState.ttag(1) == *wxlClass->class_tag)) { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods --- 397,401 ---- //wxPrintf(wxT("wxluabind_setTableFunc '%s'\n"), lua2wx(name).c_str()); ! if ((wxlClass != NULL) && wxlua_iswxuserdata(L, 1) && (wxlState.ttag(1) == *wxlClass->class_tag)) { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** wxlcallb.cpp 11 Jun 2007 03:58:10 -0000 1.30 --- wxlcallb.cpp 12 Jun 2007 00:08:42 -0000 1.31 *************** *** 26,42 **** IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxObject) ! wxLuaCallback::wxLuaCallback(const wxLuaState& state, int lua_func_stack_idx, wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *pEvtHandler) ! : wxObject(), m_wxlState(state), ! m_pHandler(pEvtHandler), m_id(winId), m_lastId(lastId), ! m_eventType(eventType) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); ! // create a reference to the lua function m_routine = m_wxlState.tinsert(lua_func_stack_idx); ! pEvtHandler->Connect( winId, lastId, eventType, (wxObjectEventFunction)&wxLuaCallback::EventHandler, this); --- 26,55 ---- IMPLEMENT_ABSTRACT_CLASS(wxLuaCallback, wxObject) ! wxLuaCallback::wxLuaCallback(const wxLuaState& wxlState, int lua_func_stack_idx, wxWindowID winId, wxWindowID lastId, ! wxEventType eventType, wxEvtHandler *evtHandler) ! : wxObject(), m_wxlState(wxlState), ! m_evtHandler(evtHandler), m_id(winId), m_lastId(lastId), ! m_wxlBindEvent(NULL) ! //m_eventType(eventType) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); ! m_wxlBindEvent = wxlState.GetLuaEvent(eventType); ! ! if (m_wxlBindEvent == NULL) ! { ! // Do not install this invalid or unknown event type since we won't know ! // what wxEvent type class to use and someone probably made a mistake. ! wxString msg = wxString::Format(wxT("Invalid or unknown wxEventType : %d, winIds %d %d."), ! (int)eventType, winId, lastId); ! m_wxlState.terror(msg); ! return; ! } ! ! // create a reference to the lua event handler function m_routine = m_wxlState.tinsert(lua_func_stack_idx); ! m_evtHandler->Connect(winId, lastId, eventType, (wxObjectEventFunction)&wxLuaCallback::EventHandler, this); *************** *** 58,62 **** void wxLuaCallback::EventHandler(wxEvent& event) { ! // This is the wxLuaCallback to use, NOT "this" wxLuaCallback *theCallback = (wxLuaCallback *) event.m_callbackUserData; --- 71,75 ---- void wxLuaCallback::EventHandler(wxEvent& event) { ! // This is the wxLuaCallback to use, NOT "this" since "this" is a central event handler function wxLuaCallback *theCallback = (wxLuaCallback *) event.m_callbackUserData; *************** *** 68,71 **** --- 81,85 ---- wxlState.SetInEventType(event.GetEventType()); + // If this is a wxWindow being destroyed, clear out all callbacks to it for safety if (event.GetEventType() == wxEVT_DESTROY) { *************** *** 83,89 **** while (node) { ! wxLuaCallback *pCallback = (wxLuaCallback *)node->GetData(); ! if ((pCallback != NULL) && (pCallback->GetEvtHandler() == evtHandler)) { // delete the reference to all other handlers that are cleared --- 97,103 ---- while (node) { ! wxLuaCallback *wxlCallback = (wxLuaCallback *)node->GetData(); ! if ((wxlCallback != NULL) && (wxlCallback->GetEvtHandler() == evtHandler)) { // delete the reference to all other handlers that are cleared *************** *** 92,96 **** wxlState.GetTrackedCallbackList()->Erase(pc_node); ! pCallback->ClearwxLuaState(); } else --- 106,110 ---- wxlState.GetTrackedCallbackList()->Erase(pc_node); ! wxlCallback->ClearwxLuaState(); } else *************** *** 104,108 **** } ! void wxLuaCallback::CallFunction(wxEvent *pEvent) { // Cannot call it if Lua is gone or the interpreter has been destroyed --- 118,122 ---- } ! void wxLuaCallback::CallFunction(wxEvent *event) { // Cannot call it if Lua is gone or the interpreter has been destroyed *************** *** 116,133 **** wxLuaState wxlState(m_wxlState); ! int eventClassTag = wxlState.GetwxEventTag(); // get the s_wxluatag_wxEvent ! const wxLuaBindEvent *pLuaEvent = wxlState.GetLuaEvent(pEvent->GetEventType()); ! if (pLuaEvent) ! eventClassTag = *pLuaEvent->class_tag; ! lua_checkstack(wxlState.GetLuaState(), LUA_MINSTACK); ! int oldTop = lua_gettop(wxlState.GetLuaState()); if (wxlState.tget(m_routine)) { ! lua_pushvalue(wxlState.GetLuaState(), LUA_GLOBALSINDEX); ! if (lua_setfenv(wxlState.GetLuaState(), -2) != 0) { ! wxlState.tpushusertag(pEvent, eventClassTag); wxlState.LuaPCall(1, 0); } --- 130,149 ---- wxLuaState wxlState(m_wxlState); ! int event_tag = 0; ! // If !m_wxlBindEvent, we would have errored in the constructor, but... ! if (m_wxlBindEvent != NULL) ! event_tag = *m_wxlBindEvent->class_tag; ! else ! event_tag = wxlState.GetwxEventTag(); // get the s_wxluatag_wxEvent ! wxlState.lua_CheckStack(LUA_MINSTACK); ! int oldTop = wxlState.lua_GetTop(); if (wxlState.tget(m_routine)) { ! wxlState.lua_PushValue(LUA_GLOBALSINDEX); ! if (wxlState.lua_SetFenv(-2) != 0) { ! wxlState.tpushusertag(event, event_tag); wxlState.LuaPCall(1, 0); } *************** *** 138,142 **** wxlState.terror("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function has been garbage collected."); ! lua_settop(wxlState.GetLuaState(), oldTop); } --- 154,158 ---- wxlState.terror("wxLua: wxEvtHandler::Connect in wxLuaCallback::CallFunction: function has been garbage collected."); ! wxlState.lua_SetTop(oldTop); // pop function from the stack (if it's there) } *************** *** 146,170 **** IMPLEMENT_ABSTRACT_CLASS(wxLuaWinDestroyCallback, wxObject) ! wxLuaWinDestroyCallback::wxLuaWinDestroyCallback(const wxLuaState& state, ! wxWindowID id, wxEvtHandler *pHandler, int iTag) ! :wxObject(), m_wxlState(state), ! m_pHandler(pHandler), m_id(id) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); - lua_State *L = m_wxlState.GetLuaState(); // allocate a LUA proxy for the object ! const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); if (ptr != NULL) { // save the address of the object in the proxy ! *ptr = pHandler; ! // and set the metatable of the proxy if (m_wxlState.tget(iTag)) { ! if (lua_setmetatable(L, -2) == 0) m_wxlState.terror("wxLua: Unable to set metatable of proxy in wxLuaWinDestroyCallback."); } --- 162,185 ---- IMPLEMENT_ABSTRACT_CLASS(wxLuaWinDestroyCallback, wxObject) ! wxLuaWinDestroyCallback::wxLuaWinDestroyCallback(const wxLuaState& wxlState, ! wxWindowID id, wxEvtHandler *evtHandler, int iTag) ! :wxObject(), m_wxlState(wxlState), ! m_evtHandler(evtHandler), m_id(id) { wxCHECK_RET(m_wxlState.Ok(), wxT("Invalid wxLuaState")); // allocate a LUA proxy for the object ! const void **ptr = (const void **)m_wxlState.lua_NewUserdata(sizeof(void *)); if (ptr != NULL) { // save the address of the object in the proxy ! *ptr = evtHandler; ! // and set the metatable of the proxy to the wxLuaReferences registry table if (m_wxlState.tget(iTag)) { ! if (m_wxlState.lua_SetMetatable(-2) == 0) m_wxlState.terror("wxLua: Unable to set metatable of proxy in wxLuaWinDestroyCallback."); } *************** *** 174,182 **** { // create a reference to object ! lua_pushlightuserdata(L, pHandler); // key ! lua_pushvalue(L, -3); // value // save it in the destroy handler table ! lua_rawset(L, -3); ! lua_pop(L, 1); } --- 189,197 ---- { // create a reference to object ! m_wxlState.lua_PushLightUserdata(evtHandler); // key ! m_wxlState.lua_PushValue(-3); // value // save it in the destroy handler table ! m_wxlState.lua_RawSet(-3); ! m_wxlState.lua_Pop(1); // pop the table from GetLuaWinDestroyTableTag() } *************** *** 184,190 **** // connect the event handler ! pHandler->Connect(id, wxEVT_DESTROY, ! (wxObjectEventFunction)&wxLuaWinDestroyCallback::EventHandler, ! this); } else --- 199,205 ---- // connect the event handler ! m_evtHandler->Connect(id, wxEVT_DESTROY, ! (wxObjectEventFunction)&wxLuaWinDestroyCallback::EventHandler, ! this); } else *************** *** 203,207 **** { wxLuaWinDestroyCallback *theCallback = (wxLuaWinDestroyCallback *)event.m_callbackUserData; ! if (theCallback && (((wxEvtHandler*)event.GetEventObject()) == theCallback->m_pHandler)) { theCallback->OnDestroy(event); --- 218,222 ---- { wxLuaWinDestroyCallback *theCallback = (wxLuaWinDestroyCallback *)event.m_callbackUserData; ! if (theCallback && (((wxEvtHandler*)event.GetEventObject()) == theCallback->m_evtHandler)) { theCallback->OnDestroy(event); *************** *** 224,234 **** if (m_wxlState.tget(m_wxlState.GetLuaWinDestroyTableTag())) { - lua_State* L = m_wxlState.GetLuaState(); // clear the metatable reference in the lua proxy. ! lua_pushlightuserdata(L, m_pHandler); ! lua_rawget(L, -2); ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! lua_pop(L, 2); } } --- 239,248 ---- if (m_wxlState.tget(m_wxlState.GetLuaWinDestroyTableTag())) { // clear the metatable reference in the lua proxy. ! m_wxlState.lua_PushLightUserdata(m_evtHandler); ! m_wxlState.lua_RawGet(-2); ! m_wxlState.lua_PushNil(); ! m_wxlState.lua_SetMetatable(-2); ! m_wxlState.lua_Pop(2); } } |
From: John L. <jr...@us...> - 2007-06-12 00:08:46
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxluasocket/src Modified Files: wxluasocket.cpp Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: wxluasocket.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxluasocket.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** wxluasocket.cpp 8 Jun 2007 01:36:32 -0000 1.25 --- wxluasocket.cpp 12 Jun 2007 00:08:42 -0000 1.26 *************** *** 412,416 **** returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list ! wxlState.AddTrackedObject((wxLuaDebuggerServer *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaDebuggerServer, returns); --- 412,416 ---- returns = new wxLuaDebuggerServer(portNumber); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxLuaDebuggerServer, returns); |
From: John L. <jr...@us...> - 2007-06-12 00:08:45
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv4216/wxLua/modules/wxbindstc/src Modified Files: stc.cpp Log Message: Change wxLuaState::AddTrackedWindow to take a wxObject and figure out inside if it's a window Change the nomenclature "enum" to "integer" as the integer data type Change "base_"XXX to "_"XXX for base class function calls Add a test function to wxLuaPrintout to really check if virtual functions work More fixes to samples for binding changes Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** stc.cpp 8 Jun 2007 01:36:30 -0000 1.37 --- stc.cpp 12 Jun 2007 00:08:41 -0000 1.38 *************** *** 7224,7228 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontAttr[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontAttr, WXLUAMETHOD_METHOD, 7, 8, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr }}; --- 7224,7228 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontAttr(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontAttr[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontAttr, WXLUAMETHOD_METHOD, 7, 8, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontAttr }}; *************** *** 7234,7238 **** int argCount = lua_gettop(L); // wxFontEncoding encoding = wxFONTENCODING_DEFAULT ! wxFontEncoding encoding = (argCount >= 8 ? (wxFontEncoding)wxlua_getenumerationtype(L, 8) : wxFONTENCODING_DEFAULT); // bool underline bool underline = wxlua_getbooleantype(L, 7); --- 7234,7238 ---- int argCount = lua_gettop(L); // wxFontEncoding encoding = wxFONTENCODING_DEFAULT ! wxFontEncoding encoding = (argCount >= 8 ? (wxFontEncoding)wxlua_getintegertype(L, 8) : wxFONTENCODING_DEFAULT); // bool underline bool underline = wxlua_getbooleantype(L, 7); *************** *** 7255,7259 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontEncoding(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontEncoding, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding }}; --- 7255,7259 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[] = { &s_wxluatag_wxStyledTextCtrl, &s_wxluaarg_Number, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextCtrl_StyleSetFontEncoding(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextCtrl_StyleSetFontEncoding[1] = {{ wxLua_wxStyledTextCtrl_StyleSetFontEncoding, WXLUAMETHOD_METHOD, 3, 3, s_wxluatagArray_wxLua_wxStyledTextCtrl_StyleSetFontEncoding }}; *************** *** 7263,7267 **** wxLuaState wxlState(L); // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlua_getenumerationtype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); --- 7263,7267 ---- wxLuaState wxlState(L); // wxFontEncoding encoding ! wxFontEncoding encoding = (wxFontEncoding)wxlua_getintegertype(L, 3); // int style int style = (int)wxlua_getnumbertype(L, 2); *************** *** 7978,7984 **** // call constructor returns = new wxStyledTextCtrl(parent, id, *pos, *size, style, name); ! // add to tracked window list ! if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) ! wxlState.AddTrackedWindow((wxWindow*)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); --- 7978,7983 ---- // call constructor returns = new wxStyledTextCtrl(parent, id, *pos, *size, style, name); ! // add to tracked window list, it will check validity ! wxlState.AddTrackedWindow(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextCtrl, returns); *************** *** 9013,9017 **** #if wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult[] = { &s_wxluatag_wxStyledTextEvent, &s_wxluaarg_Enum, NULL }; static int LUACALL wxLua_wxStyledTextEvent_SetDragResult(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_SetDragResult[1] = {{ wxLua_wxStyledTextEvent_SetDragResult, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult }}; --- 9012,9016 ---- #if wxLUA_USE_wxDragDrop && wxUSE_DRAG_AND_DROP ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult[] = { &s_wxluatag_wxStyledTextEvent, &s_wxluaarg_Integer, NULL }; static int LUACALL wxLua_wxStyledTextEvent_SetDragResult(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_SetDragResult[1] = {{ wxLua_wxStyledTextEvent_SetDragResult, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStyledTextEvent_SetDragResult }}; *************** *** 9021,9025 **** wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)wxlua_getenumerationtype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); --- 9020,9024 ---- wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)wxlua_getintegertype(L, 2); // get this wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxStyledTextEvent); *************** *** 9356,9360 **** returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject((wxStyledTextEvent *)returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); --- 9355,9359 ---- returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxlState.AddTrackedObject(returns); // push the constructed class pointer wxlState.PushUserDataType(s_wxluatag_wxStyledTextEvent, returns); |
From: John L. <jr...@us...> - 2007-06-11 03:58:42
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/modules/wxbind/src Modified Files: appframe.cpp controls.cpp data.cpp dialogs.cpp file.cpp gdi.cpp grid.cpp html.cpp windows.cpp wx_bind.cpp wxlhtmlwin.cpp wxlprint.cpp wxlua.cpp Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: wxlprint.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlprint.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxlprint.cpp 21 May 2007 01:07:59 -0000 1.16 --- wxlprint.cpp 11 Jun 2007 03:58:07 -0000 1.17 *************** *** 58,62 **** m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaCall(1, false); *minPage = (int)m_wxlState.GetNumberType(-4); --- 58,62 ---- m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaPCall(1, 4); *minPage = (int)m_wxlState.GetNumberType(-4); *************** *** 89,94 **** m_wxlState.lua_PushNumber(pageNum); ! m_wxlState.LuaCall(2, false); ! fResult = m_wxlState.GetBooleanType(-1); m_wxlState.lua_SetTop(nOldTop); --- 89,93 ---- m_wxlState.lua_PushNumber(pageNum); ! m_wxlState.LuaPCall(2, 1); fResult = m_wxlState.GetBooleanType(-1); m_wxlState.lua_SetTop(nOldTop); *************** *** 140,146 **** m_wxlState.lua_PushNumber(endPage); ! m_wxlState.LuaCall(3, false); fResult = m_wxlState.GetBooleanType(-1); - m_wxlState.lua_Pop(1); m_wxlState.lua_SetTop(nOldTop); //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 2 call base %d\n"), m_wxlState.GetCallBaseClassFunction()); --- 139,144 ---- m_wxlState.lua_PushNumber(endPage); ! m_wxlState.LuaPCall(3, 1); fResult = m_wxlState.GetBooleanType(-1); m_wxlState.lua_SetTop(nOldTop); //wxPrintf(wxT("wxLuaPrintout::OnBeginDocument 2 call base %d\n"), m_wxlState.GetCallBaseClassFunction()); *************** *** 167,171 **** int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaCall(1, true); m_wxlState.lua_SetTop(nOldTop); } --- 165,169 ---- int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); } *************** *** 183,187 **** int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaCall(1, true); m_wxlState.lua_SetTop(nOldTop); } --- 181,185 ---- int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); } *************** *** 199,203 **** int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaCall(1, true); m_wxlState.lua_SetTop(nOldTop); } --- 197,201 ---- int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); } *************** *** 215,219 **** int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaCall(1, true); m_wxlState.lua_SetTop(nOldTop); } --- 213,217 ---- int nOldTop = m_wxlState.lua_GetTop(); m_wxlState.tpushusertag(this, s_wxluatag_wxLuaPrintout); ! m_wxlState.LuaPCall(1, 0); m_wxlState.lua_SetTop(nOldTop); } *************** *** 235,240 **** m_wxlState.lua_PushNumber(pageNum); ! m_wxlState.LuaCall(2, false); ! fResult = m_wxlState.GetBooleanType(-1); m_wxlState.lua_SetTop(nOldTop); --- 233,237 ---- m_wxlState.lua_PushNumber(pageNum); ! m_wxlState.LuaPCall(2, 1); fResult = m_wxlState.GetBooleanType(-1); m_wxlState.lua_SetTop(nOldTop); Index: windows.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/windows.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** windows.cpp 8 Jun 2007 01:36:28 -0000 1.54 --- windows.cpp 11 Jun 2007 03:58:05 -0000 1.55 *************** *** 1558,1561 **** --- 1558,1629 ---- } + static wxLuaArgTag s_wxluatagArray_wxLua_wxWindow_GetScreenPosition[] = { &s_wxluatag_wxWindow, NULL }; + static int LUACALL wxLua_wxWindow_GetScreenPosition(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxWindow_GetScreenPosition[1] = {{ wxLua_wxWindow_GetScreenPosition, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxWindow_GetScreenPosition }}; + // virtual wxPoint GetScreenPosition() + static int LUACALL wxLua_wxWindow_GetScreenPosition(lua_State *L) + { + wxLuaState wxlState(L); + wxPoint *returns; + // get this + wxWindow * self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call GetScreenPosition + // allocate a new object using the copy constructor + returns = new wxPoint(self->GetScreenPosition()); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxObject_wxPoint((wxPoint *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxPoint, returns); + + return 1; + } + + #endif // wxLUA_USE_wxPointSizeRect + + #define wxLua_wxWindow_GetScreenPositionXY wxLua_wxWindow_GetScreenPositionXY + static wxLuaArgTag s_wxluatagArray_wxLua_wxWindow_GetScreenPositionXY[] = { &s_wxluatag_wxWindow, NULL }; + static int LUACALL wxLua_wxWindow_GetScreenPositionXY(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxWindow_GetScreenPositionXY[1] = {{ wxLua_wxWindow_GetScreenPositionXY, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxWindow_GetScreenPositionXY }}; + // %override wxLua_wxWindow_GetScreenPositionXY + // virtual void GetScreenPositionXY(int* x, int* y) const + static int LUACALL wxLua_wxWindow_GetScreenPositionXY(lua_State *L) + { + wxLuaState wxlState(L); + int y = 0; + int x = 0; + // get this + wxWindow *self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call GetPosition + self->GetScreenPosition(&x, &y); + lua_pushnumber(L, x); + lua_pushnumber(L, y); + // return the number of parameters + return 2; + } + + + + #if wxLUA_USE_wxPointSizeRect + static wxLuaArgTag s_wxluatagArray_wxLua_wxWindow_GetScreenRect[] = { &s_wxluatag_wxWindow, NULL }; + static int LUACALL wxLua_wxWindow_GetScreenRect(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxWindow_GetScreenRect[1] = {{ wxLua_wxWindow_GetScreenRect, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxWindow_GetScreenRect }}; + // virtual wxRect GetScreenRect() const + static int LUACALL wxLua_wxWindow_GetScreenRect(lua_State *L) + { + wxLuaState wxlState(L); + wxRect *returns; + // get this + wxWindow * self = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call GetScreenRect + // allocate a new object using the copy constructor + returns = new wxRect(self->GetScreenRect()); + // add the new object to the tracked memory list + wxlState.AddTrackedObject((long)returns, new wxObject_wxRect((wxRect *)returns)); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxRect, returns); + + return 1; + } + #endif // wxLUA_USE_wxPointSizeRect *************** *** 4343,4346 **** --- 4411,4421 ---- #if wxLUA_USE_wxPointSizeRect { "GetRect", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxWindow_GetRect, 1, NULL }, + { "GetScreenPosition", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxWindow_GetScreenPosition, 1, NULL }, + #endif // wxLUA_USE_wxPointSizeRect + + { "GetScreenPositionXY", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxWindow_GetScreenPositionXY, 1, NULL }, + + #if wxLUA_USE_wxPointSizeRect + { "GetScreenRect", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxWindow_GetScreenRect, 1, NULL }, #endif // wxLUA_USE_wxPointSizeRect Index: wxlhtmlwin.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlhtmlwin.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** wxlhtmlwin.cpp 21 May 2007 01:07:59 -0000 1.15 --- wxlhtmlwin.cpp 11 Jun 2007 03:58:07 -0000 1.16 *************** *** 70,75 **** m_wxlState.tpushusertag((void *) &event, s_wxluatag_wxMouseEvent); ! m_wxlState.LuaCall(5, false); ! fResult = (lua_tonumber(L, -1) != 0); lua_settop(L, nOldTop); --- 70,74 ---- m_wxlState.tpushusertag((void *) &event, s_wxluatag_wxMouseEvent); ! m_wxlState.LuaPCall(5, 1); fResult = (lua_tonumber(L, -1) != 0); lua_settop(L, nOldTop); *************** *** 109,113 **** lua_pushnumber(L, y); ! m_wxlState.LuaCall(4, true); lua_settop(L, nOldTop); } --- 108,112 ---- lua_pushnumber(L, y); ! m_wxlState.LuaPCall(4, 0); lua_settop(L, nOldTop); } *************** *** 128,132 **** m_wxlState.tpushusertag((void *) &link, s_wxluatag_wxHtmlLinkInfo); ! m_wxlState.LuaCall(2, true); lua_settop(L, nOldTop); } --- 127,131 ---- m_wxlState.tpushusertag((void *) &link, s_wxluatag_wxHtmlLinkInfo); ! m_wxlState.LuaPCall(2, 0); lua_settop(L, nOldTop); } *************** *** 147,151 **** m_wxlState.lua_PushString(title); ! m_wxlState.LuaCall(2, true); lua_settop(L, nOldTop); } --- 146,150 ---- m_wxlState.lua_PushString(title); ! m_wxlState.LuaPCall(2, 0); lua_settop(L, nOldTop); } Index: file.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/file.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** file.cpp 8 Jun 2007 01:36:25 -0000 1.47 --- file.cpp 11 Jun 2007 03:58:03 -0000 1.48 *************** *** 33,45 **** int s_wxluatag_wxPathList = -1; ! #if wxCHECK_VERSION(2,8,0) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_Add2[] = { &s_wxluatag_wxPathList, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxPathList_Add2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxPathList_Add2[1] = {{ wxLua_wxPathList_Add2, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPathList_Add2 }}; ! // %wxchkver_2_8 void Add(const wxArrayString_FromLuaTable& paths) static int LUACALL wxLua_wxPathList_Add2(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString_FromLuaTable paths wxArrayString paths = wxArrayString(); wxlState.GetwxArrayString(2, paths); // get this --- 33,45 ---- int s_wxluatag_wxPathList = -1; ! #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_Add2[] = { &s_wxluatag_wxPathList, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxPathList_Add2(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxPathList_Add2[1] = {{ wxLua_wxPathList_Add2, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPathList_Add2 }}; ! // %wxchkver_2_8 void Add(const wxArrayString& paths) static int LUACALL wxLua_wxPathList_Add2(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString paths wxArrayString paths = wxArrayString(); wxlState.GetwxArrayString(2, paths); // get this *************** *** 51,54 **** --- 51,57 ---- } + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)) + + #if wxCHECK_VERSION(2,8,0) static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_Add1[] = { &s_wxluatag_wxPathList, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxPathList_Add1(lua_State *L); *************** *** 230,234 **** ! #if (wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) static int LUACALL wxLua_wxPathList_Add_overload(lua_State *L); // function overload table --- 233,237 ---- ! #if ((wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)))||(wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) static int LUACALL wxLua_wxPathList_Add_overload(lua_State *L); // function overload table *************** *** 237,243 **** { wxLua_wxPathList_Add_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 2, 2, s_wxluaargArray_None }, ! #if wxCHECK_VERSION(2,8,0) { wxLua_wxPathList_Add2, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPathList_Add2 }, ! #endif // wxCHECK_VERSION(2,8,0) #if wxCHECK_VERSION(2,8,0) --- 240,246 ---- { wxLua_wxPathList_Add_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 2, 2, s_wxluaargArray_None }, ! #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)) { wxLua_wxPathList_Add2, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxPathList_Add2 }, ! #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)) #if wxCHECK_VERSION(2,8,0) *************** *** 258,268 **** return wxlState.CallOverloadedFunction(&overload_method); } ! #endif // (wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxPathList_methods[] = { ! #if (wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) { "Add", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPathList_Add_overload, s_wxluafunc_wxLua_wxPathList_Add_overload_count, 0 }, ! #endif // (wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) { "AddEnvList", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPathList_AddEnvList, 1, NULL }, --- 261,271 ---- return wxlState.CallOverloadedFunction(&overload_method); } ! #endif // ((wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)))||(wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxPathList_methods[] = { ! #if ((wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)))||(wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) { "Add", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPathList_Add_overload, s_wxluafunc_wxLua_wxPathList_Add_overload_count, 0 }, ! #endif // ((wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0)))||(wxCHECK_VERSION(2,8,0))||(!wxCHECK_VERSION(2,8,0)) { "AddEnvList", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxPathList_AddEnvList, 1, NULL }, Index: dialogs.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/dialogs.cpp,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** dialogs.cpp 8 Jun 2007 01:36:25 -0000 1.41 --- dialogs.cpp 11 Jun 2007 03:58:03 -0000 1.42 *************** *** 954,965 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetArtists[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetArtists(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetArtists[1] = {{ wxLua_wxAboutDialogInfo_SetArtists, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetArtists }}; ! // void SetArtists(const wxArrayString_FromLuaTable& artists) static int LUACALL wxLua_wxAboutDialogInfo_SetArtists(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString_FromLuaTable artists wxArrayString artists = wxArrayString(); wxlState.GetwxArrayString(2, artists); // get this --- 954,967 ---- } ! ! #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetArtists[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetArtists(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetArtists[1] = {{ wxLua_wxAboutDialogInfo_SetArtists, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetArtists }}; ! // void SetArtists(const wxArrayString& artists) static int LUACALL wxLua_wxAboutDialogInfo_SetArtists(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString artists wxArrayString artists = wxArrayString(); wxlState.GetwxArrayString(2, artists); // get this *************** *** 971,974 **** --- 973,978 ---- } + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) + static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetCopyright[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetCopyright(lua_State *L); *************** *** 1005,1016 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDevelopers[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetDevelopers(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetDevelopers[1] = {{ wxLua_wxAboutDialogInfo_SetDevelopers, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDevelopers }}; ! // void SetDevelopers(const wxArrayString_FromLuaTable& developers) static int LUACALL wxLua_wxAboutDialogInfo_SetDevelopers(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString_FromLuaTable developers wxArrayString developers = wxArrayString(); wxlState.GetwxArrayString(2, developers); // get this --- 1009,1022 ---- } ! ! #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDevelopers[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetDevelopers(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetDevelopers[1] = {{ wxLua_wxAboutDialogInfo_SetDevelopers, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDevelopers }}; ! // void SetDevelopers(const wxArrayString& developers) static int LUACALL wxLua_wxAboutDialogInfo_SetDevelopers(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString developers wxArrayString developers = wxArrayString(); wxlState.GetwxArrayString(2, developers); // get this *************** *** 1022,1033 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDocWriters[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetDocWriters(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetDocWriters[1] = {{ wxLua_wxAboutDialogInfo_SetDocWriters, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDocWriters }}; ! // void SetDocWriters(const wxArrayString_FromLuaTable& docwriters) static int LUACALL wxLua_wxAboutDialogInfo_SetDocWriters(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString_FromLuaTable docwriters wxArrayString docwriters = wxArrayString(); wxlState.GetwxArrayString(2, docwriters); // get this --- 1028,1039 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDocWriters[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetDocWriters(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetDocWriters[1] = {{ wxLua_wxAboutDialogInfo_SetDocWriters, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetDocWriters }}; ! // void SetDocWriters(const wxArrayString& docwriters) static int LUACALL wxLua_wxAboutDialogInfo_SetDocWriters(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString docwriters wxArrayString docwriters = wxArrayString(); wxlState.GetwxArrayString(2, docwriters); // get this *************** *** 1039,1042 **** --- 1045,1049 ---- } + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) #if (wxLUA_USE_wxIcon) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) *************** *** 1111,1122 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetTranslators[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetTranslators(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetTranslators[1] = {{ wxLua_wxAboutDialogInfo_SetTranslators, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetTranslators }}; ! // void SetTranslators(const wxArrayString_FromLuaTable& translators) static int LUACALL wxLua_wxAboutDialogInfo_SetTranslators(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString_FromLuaTable translators wxArrayString translators = wxArrayString(); wxlState.GetwxArrayString(2, translators); // get this --- 1118,1131 ---- } ! ! #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetTranslators[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetTranslators(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxAboutDialogInfo_SetTranslators[1] = {{ wxLua_wxAboutDialogInfo_SetTranslators, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxAboutDialogInfo_SetTranslators }}; ! // void SetTranslators(const wxArrayString& translators) static int LUACALL wxLua_wxAboutDialogInfo_SetTranslators(lua_State *L) { wxLuaState wxlState(L); ! // const wxArrayString translators wxArrayString translators = wxArrayString(); wxlState.GetwxArrayString(2, translators); // get this *************** *** 1128,1131 **** --- 1137,1142 ---- } + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) + static wxLuaArgTag s_wxluatagArray_wxLua_wxAboutDialogInfo_SetVersion[] = { &s_wxluatag_wxAboutDialogInfo, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxAboutDialogInfo_SetVersion(lua_State *L); *************** *** 1231,1239 **** --- 1242,1257 ---- { "HasVersion", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_HasVersion, 1, NULL }, { "HasWebSite", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_HasWebSite, 1, NULL }, + + #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) { "SetArtists", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetArtists, 1, NULL }, + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) + { "SetCopyright", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetCopyright, 1, NULL }, { "SetDescription", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetDescription, 1, NULL }, + + #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) { "SetDevelopers", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetDevelopers, 1, NULL }, { "SetDocWriters", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetDocWriters, 1, NULL }, + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) #if (wxLUA_USE_wxIcon) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) *************** *** 1244,1248 **** --- 1262,1270 ---- { "SetLicense", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetLicense, 1, NULL }, { "SetName", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetName, 1, NULL }, + + #if (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) { "SetTranslators", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetTranslators, 1, NULL }, + #endif // (wxLUA_USE_wxArrayString) && (wxCHECK_VERSION(2,8,0) && wxUSE_ABOUTDLG && wxLUA_USE_wxAboutDialog) + { "SetVersion", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetVersion, 1, NULL }, { "SetWebSite", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxAboutDialogInfo_SetWebSite, 1, NULL }, *************** *** 2267,2275 **** wxLuaState wxlState(L); // const wxArrayInt selections ! const wxArrayInt * selections = (const wxArrayInt *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayInt); // get this wxMultiChoiceDialog * self = (wxMultiChoiceDialog *)wxlState.GetUserDataType(1, s_wxluatag_wxMultiChoiceDialog); // call SetSelections ! self->SetSelections(*selections); return 0; --- 2289,2297 ---- wxLuaState wxlState(L); // const wxArrayInt selections ! wxArrayInt selections = wxArrayInt(); wxlState.GetwxArrayInt(2, selections); // get this wxMultiChoiceDialog * self = (wxMultiChoiceDialog *)wxlState.GetUserDataType(1, s_wxluatag_wxMultiChoiceDialog); // call SetSelections ! self->SetSelections(selections); return 0; *************** *** 2278,2286 **** #endif // (wxLUA_USE_wxArrayInt) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! #if (wxLUA_USE_wxPointSizeRect) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxMultiChoiceDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_LuaTable, &s_wxluaarg_Number, &s_wxluatag_wxPoint, NULL }; static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxMultiChoiceDialog_constructor[1] = {{ wxLua_wxMultiChoiceDialog_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 6, s_wxluatagArray_wxLua_wxMultiChoiceDialog_constructor }}; ! // wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L) { --- 2300,2308 ---- #endif // (wxLUA_USE_wxArrayInt) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! #if ((wxLUA_USE_wxArrayString) && (wxLUA_USE_wxPointSizeRect)) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxMultiChoiceDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluatag_wxArrayString, &s_wxluaarg_Number, &s_wxluatag_wxPoint, NULL }; static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxMultiChoiceDialog_constructor[1] = {{ wxLua_wxMultiChoiceDialog_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 6, s_wxluatagArray_wxLua_wxMultiChoiceDialog_constructor }}; ! // wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L) { *************** *** 2294,2298 **** // long style = wxCHOICEDLG_STYLE long style = (argCount >= 5 ? (long)wxlua_getnumbertype(L, 5) : wxCHOICEDLG_STYLE); ! // const wxArrayString_FromLuaTable choices wxArrayString choices = wxArrayString(); wxlState.GetwxArrayString(4, choices); // const wxString caption --- 2316,2320 ---- // long style = wxCHOICEDLG_STYLE long style = (argCount >= 5 ? (long)wxlua_getnumbertype(L, 5) : wxCHOICEDLG_STYLE); ! // const wxArrayString choices wxArrayString choices = wxArrayString(); wxlState.GetwxArrayString(4, choices); // const wxString caption *************** *** 2313,2317 **** } ! #endif // (wxLUA_USE_wxPointSizeRect) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) --- 2335,2339 ---- } ! #endif // ((wxLUA_USE_wxArrayString) && (wxLUA_USE_wxPointSizeRect)) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) *************** *** 2324,2330 **** #endif // (wxLUA_USE_wxArrayInt) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! #if (wxLUA_USE_wxPointSizeRect) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) { "wxMultiChoiceDialog", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxMultiChoiceDialog_constructor, 1, NULL }, ! #endif // (wxLUA_USE_wxPointSizeRect) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) { 0, 0, 0, 0 }, --- 2346,2352 ---- #endif // (wxLUA_USE_wxArrayInt) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) ! #if ((wxLUA_USE_wxArrayString) && (wxLUA_USE_wxPointSizeRect)) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) { "wxMultiChoiceDialog", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxMultiChoiceDialog_constructor, 1, NULL }, ! #endif // ((wxLUA_USE_wxArrayString) && (wxLUA_USE_wxPointSizeRect)) && (wxUSE_CHOICEDLG && wxLUA_USE_wxMultiChoiceDialog) { 0, 0, 0, 0 }, *************** *** 2398,2407 **** ! #if (wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxPointSizeRect) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxSingleChoiceDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_LuaTable, &s_wxluaarg_LightUserData, &s_wxluaarg_Number, &s_wxluatag_wxPoint, NULL }; static int LUACALL wxLua_wxSingleChoiceDialog_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxSingleChoiceDialog_constructor[1] = {{ wxLua_wxSingleChoiceDialog_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 7, s_wxluatagArray_wxLua_wxSingleChoiceDialog_constructor }}; // %override wxLua_wxSingleChoiceDialog_constructor ! // wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxSingleChoiceDialog_constructor(lua_State *L) { --- 2420,2429 ---- ! #if ((wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxArrayString)) && (wxLUA_USE_wxPointSizeRect) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxSingleChoiceDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluatag_wxArrayString, &s_wxluaarg_LightUserData, &s_wxluaarg_Number, &s_wxluatag_wxPoint, NULL }; static int LUACALL wxLua_wxSingleChoiceDialog_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxSingleChoiceDialog_constructor[1] = {{ wxLua_wxSingleChoiceDialog_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 7, s_wxluatagArray_wxLua_wxSingleChoiceDialog_constructor }}; // %override wxLua_wxSingleChoiceDialog_constructor ! // wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxSingleChoiceDialog_constructor(lua_State *L) { *************** *** 2415,2419 **** // long style = wxCHOICEDLG_STYLE long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxCHOICEDLG_STYLE); ! // const wxArrayString_FromLuaTable choices int dummy_count; wxArrayString choices = wxArrayString(); dummy_count = wxlState.GetwxArrayString(4, choices); // const wxString caption --- 2437,2441 ---- // long style = wxCHOICEDLG_STYLE long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxCHOICEDLG_STYLE); ! // const wxArrayString choices int dummy_count; wxArrayString choices = wxArrayString(); dummy_count = wxlState.GetwxArrayString(4, choices); // const wxString caption *************** *** 2435,2439 **** ! #endif // (wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxPointSizeRect) --- 2457,2461 ---- ! #endif // ((wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxArrayString)) && (wxLUA_USE_wxPointSizeRect) *************** *** 2445,2451 **** { "SetSelection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxSingleChoiceDialog_SetSelection, 1, NULL }, ! #if (wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxPointSizeRect) { "wxSingleChoiceDialog", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxSingleChoiceDialog_constructor, 1, NULL }, ! #endif // (wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxPointSizeRect) { 0, 0, 0, 0 }, --- 2467,2473 ---- { "SetSelection", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxSingleChoiceDialog_SetSelection, 1, NULL }, ! #if ((wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxArrayString)) && (wxLUA_USE_wxPointSizeRect) { "wxSingleChoiceDialog", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxSingleChoiceDialog_constructor, 1, NULL }, ! #endif // ((wxUSE_CHOICEDLG && wxLUA_USE_wxSingleChoiceDialog) && (wxLUA_USE_wxArrayString)) && (wxLUA_USE_wxPointSizeRect) { 0, 0, 0, 0 }, Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** appframe.cpp 8 Jun 2007 01:36:23 -0000 1.47 --- appframe.cpp 11 Jun 2007 03:58:00 -0000 1.48 *************** *** 1945,1949 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFrame_SetStatusWidths[] = { &s_wxluatag_wxFrame, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxFrame_SetStatusWidths(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFrame_SetStatusWidths[1] = {{ wxLua_wxFrame_SetStatusWidths, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxFrame_SetStatusWidths }}; --- 1945,1949 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFrame_SetStatusWidths[] = { &s_wxluatag_wxFrame, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxFrame_SetStatusWidths(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxFrame_SetStatusWidths[1] = {{ wxLua_wxFrame_SetStatusWidths, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxFrame_SetStatusWidths }}; *************** *** 2465,2469 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStatusBar_SetStatusStyles[] = { &s_wxluatag_wxStatusBar, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxStatusBar_SetStatusStyles(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStatusBar_SetStatusStyles[1] = {{ wxLua_wxStatusBar_SetStatusStyles, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStatusBar_SetStatusStyles }}; --- 2465,2469 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStatusBar_SetStatusStyles[] = { &s_wxluatag_wxStatusBar, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxStatusBar_SetStatusStyles(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStatusBar_SetStatusStyles[1] = {{ wxLua_wxStatusBar_SetStatusStyles, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStatusBar_SetStatusStyles }}; *************** *** 2503,2507 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStatusBar_SetStatusWidths[] = { &s_wxluatag_wxStatusBar, &s_wxluaarg_LuaTable, NULL }; static int LUACALL wxLua_wxStatusBar_SetStatusWidths(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStatusBar_SetStatusWidths[1] = {{ wxLua_wxStatusBar_SetStatusWidths, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStatusBar_SetStatusWidths }}; --- 2503,2507 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxStatusBar_SetStatusWidths[] = { &s_wxluatag_wxStatusBar, &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxStatusBar_SetStatusWidths(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxStatusBar_SetStatusWidths[1] = {{ wxLua_wxStatusBar_SetStatusWidths, WXLUAMETHOD_METHOD, 2, 2, s_wxluatagArray_wxLua_wxStatusBar_SetStatusWidths }}; Index: data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/data.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** data.cpp 8 Jun 2007 01:36:24 -0000 1.46 --- data.cpp 11 Jun 2007 03:58:02 -0000 1.47 *************** *** 664,667 **** --- 664,681 ---- } + static int LUACALL wxLua_wxValidator_IsSilent(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxValidator_IsSilent[1] = {{ wxLua_wxValidator_IsSilent, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 0, 0, s_wxluaargArray_None }}; + // static bool IsSilent() + static int LUACALL wxLua_wxValidator_IsSilent(lua_State *L) + { + bool returns; + // call IsSilent + returns = wxValidator::IsSilent(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + static wxLuaArgTag s_wxluatagArray_wxLua_wxValidator_SetBellOnError[] = { &s_wxluaarg_Boolean, NULL }; static int LUACALL wxLua_wxValidator_SetBellOnError(lua_State *L); *************** *** 759,762 **** --- 773,777 ---- wxLuaBindMethod wxValidator_methods[] = { { "GetWindow", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxValidator_GetWindow, 1, NULL }, + { "IsSilent", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxValidator_IsSilent, 1, NULL }, { "SetBellOnError", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxValidator_SetBellOnError, 1, NULL }, { "SetWindow", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxValidator_SetWindow, 1, NULL }, *************** *** 865,873 **** wxLuaState wxlState(L); // const wxArrayString excludes ! const wxArrayString * excludes = (const wxArrayString *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayString); // get this wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetExcludes ! self->SetExcludes(*excludes); return 0; --- 880,888 ---- wxLuaState wxlState(L); // const wxArrayString excludes ! wxArrayString excludes = wxArrayString(); wxlState.GetwxArrayString(2, excludes); // get this wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetExcludes ! self->SetExcludes(excludes); return 0; *************** *** 882,890 **** wxLuaState wxlState(L); // const wxArrayString includes ! const wxArrayString * includes = (const wxArrayString *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayString); // get this wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetIncludes ! self->SetIncludes(*includes); return 0; --- 897,905 ---- wxLuaState wxlState(L); // const wxArrayString includes ! wxArrayString includes = wxArrayString(); wxlState.GetwxArrayString(2, includes); // get this wxTextValidator * self = (wxTextValidator *)wxlState.GetUserDataType(1, s_wxluatag_wxTextValidator); // call SetIncludes ! self->SetIncludes(includes); return 0; *************** *** 910,933 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextValidator_constructor[1] = {{ wxLua_wxTextValidator_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 2, s_wxluatagArray_wxLua_wxTextValidator_constructor }}; // %override wxLua_wxTextValidator_constructor - - class wxLuaTextValidator : public wxTextValidator - { - public: - wxLuaTextValidator(long style, const wxString& valPtr) - : wxTextValidator(style, &valString), valString(valPtr) - { - } - - wxLuaTextValidator(long style) : wxTextValidator(style) - { - } - - wxString valString; - }; - // wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL) static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L) --- 925,932 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_constructor[] = { &s_wxluaarg_Number, &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextValidator_constructor[1] = {{ wxLua_wxTextValidator_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 2, s_wxluatagArray_wxLua_wxTextValidator_constructor }}; // %override wxLua_wxTextValidator_constructor // wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL) static int LUACALL wxLua_wxTextValidator_constructor(lua_State *L) *************** *** 940,948 **** // long style = wxFILTER_NONE long style = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : wxFILTER_NONE); // call constructor if (argCount >= 2) ! returns = new wxLuaTextValidator(style, wxlState.GetwxStringType(2)); else ! returns = new wxLuaTextValidator(style); // push the constructed class pointer --- 939,951 ---- // long style = wxFILTER_NONE long style = (argCount >= 1 ? (long)wxlState.GetNumberType(1) : wxFILTER_NONE); + // call constructor if (argCount >= 2) ! { ! wxLuaObject *valPtr = (wxLuaObject *)wxlState.GetUserDataType(2, s_wxluatag_wxLuaObject); ! returns = new wxTextValidator(style, valPtr->GetStringPtr()); ! } else ! returns = new wxTextValidator(style); // push the constructed class pointer *************** *** 1007,1018 **** } ! ! #if (wxLUA_USE_wxArrayInt) && ((wxLUA_USE_wxGenericValidator) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorArray_constructor[] = { &s_wxluatag_wxArrayInt, NULL }; ! static int LUACALL wxLua_wxGenericValidatorArray_constructor(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorArray_constructor[1] = {{ wxLua_wxGenericValidatorArray_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorArray_constructor }}; ! // %override wxLua_wxGenericValidatorArray_constructor ! // %constructor wxGenericValidatorArray(wxLuaObject *valPtr) ! static int LUACALL wxLua_wxGenericValidatorArray_constructor(lua_State *L) { wxluabind_removetableforcall(L); --- 1010,1019 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorArrayInt_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; ! static int LUACALL wxLua_wxGenericValidatorArrayInt_constructor(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorArrayInt_constructor[1] = {{ wxLua_wxGenericValidatorArrayInt_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorArrayInt_constructor }}; ! // %override wxLua_wxGenericValidatorArrayInt_constructor ! // %constructor wxGenericValidatorArrayInt(wxLuaObject *valPtr) ! static int LUACALL wxLua_wxGenericValidatorArrayInt_constructor(lua_State *L) { wxluabind_removetableforcall(L); *************** *** 1032,1038 **** ! #endif // (wxLUA_USE_wxArrayInt) && ((wxLUA_USE_wxGenericValidator) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) ! ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorBool_constructor[] = { &s_wxluaarg_LightUserData, NULL }; static int LUACALL wxLua_wxGenericValidatorBool_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorBool_constructor[1] = {{ wxLua_wxGenericValidatorBool_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorBool_constructor }}; --- 1033,1037 ---- ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorBool_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxGenericValidatorBool_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorBool_constructor[1] = {{ wxLua_wxGenericValidatorBool_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorBool_constructor }}; *************** *** 1057,1061 **** ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorInt_constructor[] = { &s_wxluaarg_LightUserData, NULL }; static int LUACALL wxLua_wxGenericValidatorInt_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorInt_constructor[1] = {{ wxLua_wxGenericValidatorInt_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorInt_constructor }}; --- 1056,1060 ---- ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorInt_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxGenericValidatorInt_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorInt_constructor[1] = {{ wxLua_wxGenericValidatorInt_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorInt_constructor }}; *************** *** 1080,1084 **** ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorString_constructor[] = { &s_wxluaarg_String, NULL }; static int LUACALL wxLua_wxGenericValidatorString_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorString_constructor[1] = {{ wxLua_wxGenericValidatorString_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorString_constructor }}; --- 1079,1083 ---- ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorString_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxGenericValidatorString_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidatorString_constructor[1] = {{ wxLua_wxGenericValidatorString_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxGenericValidatorString_constructor }}; *************** *** 1109,1117 **** wxLuaBindMethod wxGenericValidator_methods[] = { { "Delete", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGenericValidator_Delete, 1, NULL }, ! ! #if (wxLUA_USE_wxArrayInt) && ((wxLUA_USE_wxGenericValidator) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) ! { "wxGenericValidatorArray", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorArray_constructor, 1, NULL }, ! #endif // (wxLUA_USE_wxArrayInt) && ((wxLUA_USE_wxGenericValidator) && (wxLUA_USE_wxValidator && wxUSE_VALIDATORS)) ! { "wxGenericValidatorBool", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorBool_constructor, 1, NULL }, { "wxGenericValidatorInt", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorInt_constructor, 1, NULL }, --- 1108,1112 ---- wxLuaBindMethod wxGenericValidator_methods[] = { { "Delete", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxGenericValidator_Delete, 1, NULL }, ! { "wxGenericValidatorArrayInt", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorArrayInt_constructor, 1, NULL }, { "wxGenericValidatorBool", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorBool_constructor, 1, NULL }, { "wxGenericValidatorInt", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxGenericValidatorInt_constructor, 1, NULL }, *************** *** 2058,2082 **** - static wxLuaArgTag s_wxluatagArray_wxLua_wxArrayInt_constructor2[] = { &s_wxluaarg_LuaTable, NULL }; - static int LUACALL wxLua_wxArrayInt_constructor2(lua_State *L); - // static wxLuaBindCFunc s_wxluafunc_wxLua_wxArrayInt_constructor2[1] = {{ wxLua_wxArrayInt_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayInt_constructor2 }}; - // wxArrayInt(const wxArrayInt_FromLuaTable& array) - static int LUACALL wxLua_wxArrayInt_constructor2(lua_State *L) - { - wxluabind_removetableforcall(L); - wxLuaState wxlState(L); - wxArrayInt *returns; - // const wxArrayInt_FromLuaTable array - wxArrayInt array = wxArrayInt(); wxlState.GetwxArrayInt(1, array); - // call constructor - returns = new wxArrayInt(array); - // add to tracked memory list - wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayInt((wxArrayInt *)returns)); - // push the constructed class pointer - wxlState.PushUserDataType(s_wxluatag_wxArrayInt, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxArrayInt_constructor1[] = { &s_wxluatag_wxArrayInt, NULL }; static int LUACALL wxLua_wxArrayInt_constructor1(lua_State *L); --- 2053,2056 ---- *************** *** 2089,2095 **** wxArrayInt *returns; // const wxArrayInt array ! const wxArrayInt * array = (const wxArrayInt *)wxlState.GetUserDataType(1, s_wxluatag_wxArrayInt); // call constructor ! returns = new wxArrayInt(*array); // add to tracked memory list wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayInt((wxArrayInt *)returns)); --- 2063,2069 ---- wxArrayInt *returns; // const wxArrayInt array ! wxArrayInt array = wxArrayInt(); wxlState.GetwxArrayInt(1, array); // call constructor ! returns = new wxArrayInt(array); // add to tracked memory list wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayInt((wxArrayInt *)returns)); *************** *** 2127,2131 **** { { wxLua_wxArrayInt_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 1, s_wxluaargArray_None }, - { wxLua_wxArrayInt_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayInt_constructor2 }, { wxLua_wxArrayInt_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayInt_constructor1 }, { wxLua_wxArrayInt_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, --- 2101,2104 ---- *************** *** 2475,2499 **** - static wxLuaArgTag s_wxluatagArray_wxLua_wxArrayString_constructor2[] = { &s_wxluaarg_LuaTable, NULL }; - static int LUACALL wxLua_wxArrayString_constructor2(lua_State *L); - // static wxLuaBindCFunc s_wxluafunc_wxLua_wxArrayString_constructor2[1] = {{ wxLua_wxArrayString_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayString_constructor2 }}; - // wxArrayString(const wxArrayString_FromLuaTable& array) - static int LUACALL wxLua_wxArrayString_constructor2(lua_State *L) - { - wxluabind_removetableforcall(L); - wxLuaState wxlState(L); - wxArrayString *returns; - // const wxArrayString_FromLuaTable array - wxArrayString array = wxArrayString(); wxlState.GetwxArrayString(1, array); - // call constructor - returns = new wxArrayString(array); - // add to tracked memory list - wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayString((wxArrayString *)returns)); - // push the constructed class pointer - wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxArrayString_constructor1[] = { &s_wxluatag_wxArrayString, NULL }; static int LUACALL wxLua_wxArrayString_constructor1(lua_State *L); --- 2448,2451 ---- *************** *** 2506,2512 **** wxArrayString *returns; // const wxArrayString array ! const wxArrayString * array = (const wxArrayString *)wxlState.GetUserDataType(1, s_wxluatag_wxArrayString); // call constructor ! returns = new wxArrayString(*array); // add to tracked memory list wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayString((wxArrayString *)returns)); --- 2458,2464 ---- wxArrayString *returns; // const wxArrayString array ! wxArrayString array = wxArrayString(); wxlState.GetwxArrayString(1, array); // call constructor ! returns = new wxArrayString(array); // add to tracked memory list wxlState.AddTrackedObject((long)returns, new wxObject_wxArrayString((wxArrayString *)returns)); *************** *** 2544,2548 **** { { wxLua_wxArrayString_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 1, s_wxluaargArray_None }, - { wxLua_wxArrayString_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayString_constructor2 }, { wxLua_wxArrayString_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxArrayString_constructor1 }, { wxLua_wxArrayString_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, --- 2496,2499 ---- *************** *** 2614,2638 **** } - static wxLuaArgTag s_wxluatagArray_wxLua_wxSortedArrayString_constructor2[] = { &s_wxluaarg_LuaTable, NULL }; - static int LUACALL wxLua_wxSortedArrayString_constructor2(lua_State *L); - // static wxLuaBindCFunc s_wxluafunc_wxLua_wxSortedArrayString_constructor2[1] = {{ wxLua_wxSortedArrayString_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxSortedArrayString_constructor2 }}; - // wxSortedArrayString(const wxArrayString_FromLuaTable& array) - static int LUACALL wxLua_wxSortedArrayString_constructor2(lua_State *L) - { - wxluabind_removetableforcall(L); - wxLuaState wxlState(L); - wxSortedArrayString *returns; - // const wxArrayString_FromLuaTable array - wxArrayString array = wxArrayString(); wxlState.GetwxArrayString(1, array); - // call constructor - returns = new wxSortedArrayString(array); - // add to tracked memory list - wxlState.AddTrackedObject((long)returns, new wxObject_wxSortedArrayString((wxSortedArrayString *)returns)); - // push the constructed class pointer - wxlState.PushUserDataType(s_wxluatag_wxSortedArrayString, returns); - - return 1; - } - static wxLuaArgTag s_wxluatagArray_wxLua_wxSortedArrayString_constructor1[] = { &s_wxluatag_wxSortedArrayString, NULL }; static int LUACALL wxLua_wxSortedArrayString_constructor1(lua_State *L); --- 2565,2568 ---- *************** *** 2683,2687 **** { { wxLua_wxSortedArrayString_constructor_overload, WXLUAMETHOD_METHOD|WXLUAMETHOD_OVERLOAD, 0, 1, s_wxluaargArray_None }, - { wxLua_wxSortedArrayString_constructor2, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxSortedArrayString_constructor2 }, { wxLua_wxSortedArrayString_constructor1, WXLUAMETHOD_CONSTRUCTOR, 1, 1, s_wxluatagArray_wxLua_wxSortedArrayString_constructor1 }, { wxLua_wxSortedArrayString_constructor, WXLUAMETHOD_CONSTRUCTOR, 0, 0, s_wxluaargArray_None }, --- 2613,2616 ---- Index: wxlua.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxlua.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** wxlua.cpp 8 Jun 2007 01:36:30 -0000 1.39 --- wxlua.cpp 11 Jun 2007 03:58:07 -0000 1.40 *************** *** 111,117 **** // get this wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); ! // call GetObject that if successful will push an item onto the stack if (self->GetObject()) return 1; return 0; } --- 111,118 ---- // get this wxLuaObject *self = (wxLuaObject *)wxlState.GetUserDataType(1, s_wxluatag_wxLuaObject); ! // call GetObject that push the item onto the stack, or nil if (self->GetObject()) return 1; + return 0; } *************** *** 160,166 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_SetObject[] = { &s_wxluatag_wxLuaObject, &s_wxluaarg_Number, NULL }; static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_SetObject[1] = {{ wxLua_wxLuaObject_SetObject, WXLUAMETHOD_METHOD, 1, 2, s_wxluatagArray_wxLua_wxLuaObject_SetObject }}; // %override wxLua_wxLuaObject_SetObject // void SetObject(void *object) --- 161,167 ---- } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxLuaObject_SetObject[] = { &s_wxluatag_wxLuaObject, NULL }; static int LUACALL wxLua_wxLuaObject_SetObject(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaObject_SetObject[1] = {{ wxLua_wxLuaObject_SetObject, WXLUAMETHOD_METHOD, 1, 1, s_wxluatagArray_wxLua_wxLuaObject_SetObject }}; // %override wxLua_wxLuaObject_SetObject // void SetObject(void *object) Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** controls.cpp 8 Jun 2007 01:36:23 -0000 1.59 --- controls.cpp 11 Jun 2007 03:58:01 -0000 1.60 *************** *** 1093,1101 **** wxLuaState wxlState(L); // const wxArrayString strings ! const wxArrayString * strings = (const wxArrayString *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayString); // get this wxControlWithItems * self = (wxControlWithItems *)wxlState.GetUserDataType(1, s_wxluatag_wxControlWithItems); // call Append ! self->Append(*strings); return 0; --- 1093,1101 ---- [...1066 lines suppressed...] *** 10077,10085 **** wxLuaState wxlState(L); // const wxArrayInt tabs ! const wxArrayInt * tabs = (const wxArrayInt *)wxlState.GetUserDataType(2, s_wxluatag_wxArrayInt); // get this wxTextAttr * self = (wxTextAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxTextAttr); // call SetTabs ! self->SetTabs(*tabs); return 0; --- 10128,10136 ---- wxLuaState wxlState(L); // const wxArrayInt tabs ! wxArrayInt tabs = wxArrayInt(); wxlState.GetwxArrayInt(2, tabs); // get this wxTextAttr * self = (wxTextAttr *)wxlState.GetUserDataType(1, s_wxluatag_wxTextAttr); // call SetTabs ! self->SetTabs(tabs); return 0; Index: grid.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/grid.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** grid.cpp 8 Jun 2007 01:36:26 -0000 1.38 --- grid.cpp 11 Jun 2007 03:58:04 -0000 1.39 *************** *** 1066,1073 **** int s_wxluatag_wxGridCellChoiceEditor = -1; ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellChoiceEditor_constructor[] = { &s_wxluaarg_LuaTable, &s_wxluaarg_Boolean, NULL }; static int LUACALL wxLua_wxGridCellChoiceEditor_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellChoiceEditor_constructor[1] = {{ wxLua_wxGridCellChoiceEditor_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxGridCellChoiceEditor_constructor }}; ! // wxGridCellChoiceEditor(const wxArrayString_FromLuaTable& choices, bool allowOthers = false) static int LUACALL wxLua_wxGridCellChoiceEditor_constructor(lua_State *L) { --- 1066,1074 ---- int s_wxluatag_wxGridCellChoiceEditor = -1; ! #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxGrid && wxUSE_GRID) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxGridCellChoiceEditor_constructor[] = { &s_wxluatag_wxArrayString, &s_wxluaarg_Boolean, NULL }; static int LUACALL wxLua_wxGridCellChoiceEditor_constructor(lua_State *L); static wxLuaBindCFunc s_wxluafunc_wxLua_wxGridCellChoiceEditor_constructor[1] = {{ wxLua_wxGridCellChoiceEditor_constructor, WXLUAMETHOD_CONSTRUCTOR, 1, 2, s_wxluatagArray_wxLua_wxGridCellChoiceEditor_constructor }}; ! // wxGridCellChoiceEditor(const wxArrayString& choices, bool allowOthers = false) static int LUACALL wxLua_wxGridCellChoiceEditor_constructor(lua_State *L) { *************** *** 1079,1083 **** // bool allowOthers = false bool allowOthers = (argCount >= 2 ? wxlua_getbooleantype(L, 2) : false); ! // const wxArrayString_FromLuaTable choices wxArrayString choices = wxArrayString(); wxlState.GetwxArrayString(1, choices); // call constructor --- 1080,1... [truncated message content] |
From: John L. <jr...@us...> - 2007-06-11 03:58:35
|
Update of /cvsroot/wxlua/wxLua/docs In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/docs Modified Files: binding.html changelog.txt wxlua.html wxluaref.html Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: wxluaref.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxluaref.html,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wxluaref.html 1 Jun 2007 18:19:46 -0000 1.20 --- wxluaref.html 11 Jun 2007 03:57:59 -0000 1.21 *************** *** 615,618 **** --- 615,619 ---- <a href="#wxLocaleInfo">wxLocaleInfo</a><br> <a href="#wxLocaleInitFlags">wxLocaleInitFlags</a><br> + <a href="#wxLuaMethod_Type">wxLuaMethod_Type</a><br> <a href="#wxLuaObject_Type">wxLuaObject_Type</a><br> <a href="#wxMediaCtrlPlayerControls">wxMediaCtrlPlayerControls</a><br> *************** *** 640,643 **** --- 641,645 ---- <a href="#wxSocketNotify">wxSocketNotify</a><br> [...1904 lines suppressed...] ! <font color=#007755> <i>%define_event</i> wxEVT_STC_MODIFIED // EVT_STC_MODIFIED(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_MACRORECORD // EVT_STC_MACRORECORD(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_MARGINCLICK // EVT_STC_MARGINCLICK(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_NEEDSHOWN // EVT_STC_NEEDSHOWN(id, fn)</font><br> ! <font color=#007755> !<i>%wxchkver_2_5</i> <i>%define_event</i> wxEVT_STC_POSCHANGED // ??</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_PAINTED // EVT_STC_PAINTED(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_USERLISTSELECTION // EVT_STC_USERLISTSELECTION(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_URIDROPPED // EVT_STC_URIDROPPED(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_DWELLSTART // EVT_STC_DWELLSTART(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_DWELLEND // EVT_STC_DWELLEND(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_START_DRAG // EVT_STC_START_DRAG(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_DRAG_OVER // EVT_STC_DRAG_OVER(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_DO_DROP // EVT_STC_DO_DROP(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_ZOOM // EVT_STC_ZOOM(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_HOTSPOT_CLICK // EVT_STC_HOTSPOT_CLICK(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_HOTSPOT_DCLICK // EVT_STC_HOTSPOT_DCLICK(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_CALLTIP_CLICK // EVT_STC_CALLTIP_CLICK(id, fn)</font><br> ! <font color=#007755> <i>%define_event</i> wxEVT_STC_AUTOCOMP_SELECTION // EVT_STC_AUTOCOMP_SELECTION(id, fn)</font><br> <br> wxStyledTextEvent(wxEventType commandType = 0, int id = 0)<br> Index: wxlua.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/wxlua.html,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxlua.html 7 Jun 2007 03:31:50 -0000 1.21 --- wxlua.html 11 Jun 2007 03:57:59 -0000 1.22 *************** *** 3,25 **** <head> - - <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! ! - [...4496 lines suppressed...] ! LuaPCall(int narg, int nresults)</li> <ul> <li>Uses lua_call to run a chunk on the stack, but sets things up for wxLua first.</li> <li>Returns lua's error ! code LUA_ERRXXX or 0 on success</li> </ul> <li>The other functions are documented in <span style="font-style: italic;">wxLua/modules/wxlua/include/wxlstate.h</span>.</li> </ul> </body> </html> Index: binding.html =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/binding.html,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** binding.html 6 Jun 2007 23:42:56 -0000 1.18 --- binding.html 11 Jun 2007 03:57:59 -0000 1.19 *************** *** 1,10 **** <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html><head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! ! <title>wxLua Binding HowTo</title><meta content="John Labenski" name="author"></head> <body> --- 1,14 ---- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> ! <html> ! <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> ! <title>wxLua Binding HowTo</title> ! <meta content="John Labenski" name="author"> ! ! </head> ! <body> *************** *** 330,334 **** <li>int s_wxluatag_CLASS_NAME for each class that is mapped ! through the wxLuaBindClass struct and when the binding is initialized will contain the tag index that lua assigns to the class for the userdata.</li> --- 334,339 ---- <li>int s_wxluatag_CLASS_NAME for each class that is mapped ! through the wxLuaBindClass struct and when the binding is ! initialized will contain the tag index that lua assigns to the class for the userdata.</li> *************** *** 368,373 **** functions to push into the lua binding table.</li> ! <li>A wxLuaBindClass struct that contains the class names, all ! the wxLuaBindMethod structs from each *.i generated cpp files, and their tags.</li> --- 373,380 ---- functions to push into the lua binding table.</li> ! <li>A wxLuaBindClass struct that contains the class names, ! all ! the wxLuaBindMethod structs from each *.i generated cpp files, ! and their tags.</li> *************** *** 541,552 **** <li><i><b>const ! wxArrayString_FromLuaTable& ! choices </b>or just<b> </b></i><i><b>wxArrayString_FromLuaTable ! choices</b></i></li> <ul> <li>The ! binding generator will read from lua a numerically indexed table of strings for that parameter and convert them into a --- 548,558 ---- <li><i><b>const ! wxArrayString& ! choices or wxArrayString choices</b></i></li> <ul> <li>The ! binding generator will read from lua either a wxArrayString or a a numerically indexed table of strings for that parameter and convert them into a *************** *** 554,563 **** function.</li> </ul> <li><i><b>const ! wxArrayInt_FromLuaTable& ! choices </b>or just </i><i><b>wxArrayInt_FromLuaTable ! choices</b></i></li> <ul> --- 560,574 ---- function.</li> + <li>If either <i><b>wxArrayString& + choices</b></i> or <i><b>wxArrayString* choices</b></i> + is used, the generator will not do the table conversion, but look for a + wxArrayString userdata since it's assumed that the C++ function will + modify the wxArrayString that's passed to it.</li> + </ul> <li><i><b>const ! wxArrayInt& ! choices or wxArrayInt choices</b></i></li> <ul> *************** *** 565,577 **** <li>The binding generator will read from lua a ! numerically indexed table of integers for that parameter and convert them into a wxArrayInt for the C++ function.</li> ! </ul><li style="font-weight: bold; font-style: italic;">IntArray_FromLuaTable</li><ul><li>The binding generator will read from lua a numerically indexed table of ! integers and create two parameters (int count, int* array) to pass ! to a function.</li><li>The int* array will be automatically deleted and the function should not take ownership of it and delete it itself.</li></ul> <li><i><b>LuaTable --- 576,607 ---- <li>The binding generator will read from lua a ! wxArrayInt or a numerically indexed table of integers for that ! parameter and convert them into a wxArrayInt for the C++ function.</li> ! <li>If either <i><b>wxArrayInt& choices</b></i> ! or <i><b>wxArrayInt* choices</b></i> is used, ! the generator will not do the table conversion, but look for a ! wxArrayInt userdata since it's assumed that the C++ function will ! modify the wxArrayInt that's passed to it.</li> ! ! </ul> ! ! <li style="font-weight: bold; font-style: italic;">IntArray_FromLuaTable</li> ! ! <ul> ! ! <li>The binding generator will read from lua a numerically indexed table of ! integers and create two parameters (int count, int* array) to ! pass ! to a function.</li> ! ! <li>The int* array will be automatically deleted and the ! function should not take ownership of it and delete it itself.</li> ! ! </ul> <li><i><b>LuaTable *************** *** 724,728 **** do not have ! DECLARE_XXX_CLASS in their declaration, eg. wxPoint and any non wxObject derived classes.</li> --- 754,758 ---- do not have ! DECLARE_XXX_CLASS in their declaration, e.g. wxPoint and any non wxObject derived classes.</li> *************** *** 750,755 **** accessed in wxLua using <i>wx.NUMBER</i>. </li> ! <li>The ! <i>NUMBER</i> can be a #define or an int. </li> --- 780,784 ---- accessed in wxLua using <i>wx.NUMBER</i>. </li> ! <li>The <i>NUMBER</i> can be a #define or an int. </li> *************** *** 847,852 **** accessed in wxLua using <i>wx.STRING</i>. </li> ! <li>The ! <i>STRING</i> must be defined as <i>"const wxChar* STRING = _("str") or --- 876,880 ---- accessed in wxLua using <i>wx.STRING</i>. </li> ! <li>The <i>STRING</i> must be defined as <i>"const wxChar* STRING = _("str") or *************** *** 1414,1416 **** <br> ! </body></html> \ No newline at end of file --- 1442,1445 ---- <br> ! </body> ! </html> Index: changelog.txt =================================================================== RCS file: /cvsroot/wxlua/wxLua/docs/changelog.txt,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** changelog.txt 6 Jun 2007 23:42:56 -0000 1.33 --- changelog.txt 11 Jun 2007 03:57:59 -0000 1.34 *************** *** 1,3 **** -  wxLua ChangeLog =============== --- 1,2 ---- *************** *** 30,36 **** - *** Removed MOST %renamed functions so that they are not overloaded. For example wxSizer::AddWindow/AddSizer is now just wxSizer::Add! ! Removed most renamed constructors so like wxEmptyBitmap, wxBitmapFromFile ! and you now need only call wxBitmap(...) and wxLua will determine which ! appropriate function to call. - Changed class member enums to be accessed by wx.ClassName.enumName instead of previously wx.ClassName_enumName. --- 29,35 ---- - *** Removed MOST %renamed functions so that they are not overloaded. For example wxSizer::AddWindow/AddSizer is now just wxSizer::Add! ! Removed most renamed constructors like wxEmptyBitmap, wxBitmapFromFile ! and you now need only call wxBitmap(...). wxLua will determine which ! appropriate function to call at runtime. - Changed class member enums to be accessed by wx.ClassName.enumName instead of previously wx.ClassName_enumName. *************** *** 72,75 **** --- 71,83 ---- - Renamed the GetLua[Class]List functions in wxLuaBindings to Get[Class]Array, since they're C arrays not wxLists. + - Renamed wxLuaState::LuaCall to LuaPCall since that's what it calls + and changed the parameters to match lua_pcall. + + - Removed binding helpers wxArrayString_FromLuaTable and + wxArrayInt_FromLuaTable since the conversion is now automatic and the + function can take either a table or a wxArrayXXX. See notes in binding.html. + - Fixed sorting function for the listctrl. + - Added validator.wx.lua to test wxGenericValidators and wxTextValidators, + both of which work again. version 2.8.0.0 (released 24/12/2006) |
From: John L. <jr...@us...> - 2007-06-11 03:58:34
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/bindings/wxwidgets Modified Files: appframe.i clipdrag.i controls.i data.i datetime.i dialogs.i event.i file.i gdi.i grid.i html.i menutool.i override.hpp socket.i wave.i windows.i wxlua.i Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: wave.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wave.i,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wave.i 31 May 2007 17:18:47 -0000 1.17 --- wave.i 11 Jun 2007 03:57:59 -0000 1.18 *************** *** 123,132 **** %class %delete wxMediaEvent, wxNotifyEvent ! %define_event wxEVT_MEDIA_FINISHED ! %define_event wxEVT_MEDIA_STOP ! %define_event wxEVT_MEDIA_LOADED ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_STATECHANGED ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_PLAY ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_PAUSE wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) --- 123,132 ---- %class %delete wxMediaEvent, wxNotifyEvent ! %define_event wxEVT_MEDIA_FINISHED // EVT_MEDIA_FINISHED(winid, fn) ! %define_event wxEVT_MEDIA_STOP // EVT_MEDIA_STOP(winid, fn) ! %define_event wxEVT_MEDIA_LOADED // EVT_MEDIA_LOADED(winid, fn) ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_STATECHANGED // EVT_MEDIA_STATECHANGED(winid, fn) ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_PLAY // EVT_MEDIA_PLAY(winid, fn) ! %wxchkver_2_6_4 %define_event wxEVT_MEDIA_PAUSE // EVT_MEDIA_PAUSE(winid, fn) wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) *************** *** 208,215 **** %class %delete wxJoystickEvent, wxEvent ! %define_event wxEVT_JOY_BUTTON_DOWN ! %define_event wxEVT_JOY_BUTTON_UP ! %define_event wxEVT_JOY_MOVE ! %define_event wxEVT_JOY_ZMOVE wxJoystickEvent(wxEventType eventType = wxEVT_NULL, int state = 0, int joystick = wxJOYSTICK1, int change = 0) --- 208,215 ---- %class %delete wxJoystickEvent, wxEvent ! %define_event wxEVT_JOY_BUTTON_DOWN // EVT_JOY_BUTTON_DOWN(func) ! %define_event wxEVT_JOY_BUTTON_UP // EVT_JOY_BUTTON_UP(func) ! %define_event wxEVT_JOY_MOVE // EVT_JOY_MOVE(func) ! %define_event wxEVT_JOY_ZMOVE // EVT_JOY_ZMOVE(func) wxJoystickEvent(wxEventType eventType = wxEVT_NULL, int state = 0, int joystick = wxJOYSTICK1, int change = 0) Index: html.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/html.i,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** html.i 1 Jun 2007 18:19:46 -0000 1.19 --- html.i 11 Jun 2007 03:57:59 -0000 1.20 *************** *** 306,312 **** %class wxSimpleHtmlListBox, wxHtmlWindowInterface //: public wxHtmlListBox, public wxItemContainer wxSimpleHtmlListBox() ! wxSimpleHtmlListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString_FromLuaTable& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") ! bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString_FromLuaTable& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") void SetSelection(int n) int GetSelection() const --- 306,312 ---- %class wxSimpleHtmlListBox, wxHtmlWindowInterface //: public wxHtmlListBox, public wxItemContainer wxSimpleHtmlListBox() ! wxSimpleHtmlListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") ! bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") void SetSelection(int n) int GetSelection() const *************** *** 317,321 **** virtual void Clear() virtual void Delete(unsigned int n) ! void Append(const wxArrayString_FromLuaTable& strings) int Append(const wxString& item) //int Append(const wxString& item, void *clientData) --- 317,321 ---- virtual void Clear() virtual void Delete(unsigned int n) ! void Append(const wxArrayString& strings) int Append(const wxString& item) //int Append(const wxString& item, void *clientData) Index: dialogs.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/dialogs.i,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dialogs.i 1 Jun 2007 18:19:46 -0000 1.30 --- dialogs.i 11 Jun 2007 03:57:58 -0000 1.31 *************** *** 70,75 **** wxUSE_TEXTDLG %function wxString wxGetTextFromUser(const wxString& message, const wxString& caption = "Input text", const wxString& default_value = "", wxWindow *parent = NULL, int x = -1, int y = -1, bool centre = true) // int wxGetMultipleChoice(const wxString& message, const wxString& caption, int n, const wxString& choices[], int nsel, int *selection, wxWindow *parent = NULL, int x = -1, int y = -1, bool centre = true, int width=150, int height=200) ! wxUSE_CHOICEDLG %function wxString wxGetSingleChoice(const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT) ! wxUSE_CHOICEDLG %function int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT) %function bool wxIsBusy() %function int wxMessageBox(const wxString& message, const wxString& caption = "Message", int style = wxOK | wxCENTRE, wxWindow *parent = NULL, int x = -1, int y = -1) --- 70,75 ---- wxUSE_TEXTDLG %function wxString wxGetTextFromUser(const wxString& message, const wxString& caption = "Input text", const wxString& default_value = "", wxWindow *parent = NULL, int x = -1, int y = -1, bool centre = true) // int wxGetMultipleChoice(const wxString& message, const wxString& caption, int n, const wxString& choices[], int nsel, int *selection, wxWindow *parent = NULL, int x = -1, int y = -1, bool centre = true, int width=150, int height=200) ! wxUSE_CHOICEDLG %function wxString wxGetSingleChoice(const wxString& message, const wxString& caption, const wxArrayString& choices, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT) ! wxUSE_CHOICEDLG %function int wxGetSingleChoiceIndex(const wxString& message, const wxString& caption, const wxArrayString& choices, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord, bool centre = true, int width = wxCHOICE_WIDTH, int height = wxCHOICE_HEIGHT) %function bool wxIsBusy() %function int wxMessageBox(const wxString& message, const wxString& caption = "Message", int style = wxOK | wxCENTRE, wxWindow *parent = NULL, int x = -1, int y = -1) *************** *** 160,179 **** wxString GetWebSiteDescription() const ! void SetDevelopers(const wxArrayString_FromLuaTable& developers) void AddDeveloper(const wxString& developer) bool HasDevelopers() const const wxArrayString& GetDevelopers() const ! void SetDocWriters(const wxArrayString_FromLuaTable& docwriters) void AddDocWriter(const wxString& docwriter) bool HasDocWriters() const wxArrayString GetDocWriters() const ! void SetArtists(const wxArrayString_FromLuaTable& artists) void AddArtist(const wxString& artist) bool HasArtists() const wxArrayString GetArtists() const ! void SetTranslators(const wxArrayString_FromLuaTable& translators) void AddTranslator(const wxString& translator) bool HasTranslators() const --- 160,179 ---- wxString GetWebSiteDescription() const ! void SetDevelopers(const wxArrayString& developers) void AddDeveloper(const wxString& developer) bool HasDevelopers() const const wxArrayString& GetDevelopers() const ! void SetDocWriters(const wxArrayString& docwriters) void AddDocWriter(const wxString& docwriter) bool HasDocWriters() const wxArrayString GetDocWriters() const ! void SetArtists(const wxArrayString& artists) void AddArtist(const wxString& artist) bool HasArtists() const wxArrayString GetArtists() const ! void SetTranslators(const wxArrayString& translators) void AddTranslator(const wxString& translator) bool HasTranslators() const *************** *** 315,319 **** %class wxMultiChoiceDialog, wxDialog ! wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) wxArrayInt GetSelections() const // FIXME --- 315,319 ---- %class wxMultiChoiceDialog, wxDialog ! wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) wxArrayInt GetSelections() const // FIXME *************** *** 330,336 **** %class wxSingleChoiceDialog, wxDialog ! // %override wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, void** clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) ! // C++ Func: wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) ! wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, void** clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) int GetSelection() const --- 330,336 ---- %class wxSingleChoiceDialog, wxDialog ! // %override wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, void** clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) ! // C++ Func: wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) ! wxSingleChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString& choices, void** clientData = NULL, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) int GetSelection() const *************** *** 454,462 **** %class %delete wxFindDialogEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_FIND ! %define_event wxEVT_COMMAND_FIND_NEXT ! %define_event wxEVT_COMMAND_FIND_REPLACE ! %define_event wxEVT_COMMAND_FIND_REPLACE_ALL ! %define_event wxEVT_COMMAND_FIND_CLOSE wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0) --- 454,462 ---- %class %delete wxFindDialogEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_FIND // EVT_FIND(id, fn) ! %define_event wxEVT_COMMAND_FIND_NEXT // EVT_FIND_NEXT(id, fn) ! %define_event wxEVT_COMMAND_FIND_REPLACE // EVT_FIND_REPLACE(id, fn) ! %define_event wxEVT_COMMAND_FIND_REPLACE_ALL // EVT_FIND_REPLACE_ALL(id, fn) ! %define_event wxEVT_COMMAND_FIND_CLOSE // EVT_FIND_CLOSE(id, fn) wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0) *************** *** 596,604 **** %class %delete wxWizardEvent, wxNotifyEvent ! %define_event wxEVT_WIZARD_CANCEL ! %define_event wxEVT_WIZARD_PAGE_CHANGED ! %define_event wxEVT_WIZARD_PAGE_CHANGING ! %define_event wxEVT_WIZARD_HELP ! %define_event wxEVT_WIZARD_FINISHED wxWizardEvent(wxEventType type = wxEVT_NULL, int id = -1, bool direction = true) --- 596,604 ---- %class %delete wxWizardEvent, wxNotifyEvent ! %define_event wxEVT_WIZARD_CANCEL // EVT_WIZARD_CANCEL(id, fn) ! %define_event wxEVT_WIZARD_PAGE_CHANGED // EVT_WIZARD_PAGE_CHANGED(id, fn) ! %define_event wxEVT_WIZARD_PAGE_CHANGING // EVT_WIZARD_PAGE_CHANGING(id, fn) ! %define_event wxEVT_WIZARD_HELP // EVT_WIZARD_HELP(id, fn) ! %define_event wxEVT_WIZARD_FINISHED // EVT_WIZARD_FINISHED(id, fn) wxWizardEvent(wxEventType type = wxEVT_NULL, int id = -1, bool direction = true) Index: file.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/file.i,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** file.i 1 Jun 2007 18:19:46 -0000 1.23 --- file.i 11 Jun 2007 03:57:59 -0000 1.24 *************** *** 90,94 **** !%wxchkver_2_8 void Add(const wxString& path) %wxchkver_2_8 bool Add(const wxString& path) ! %wxchkver_2_8 void Add(const wxArrayString_FromLuaTable& paths) // Find the first full path for which the file exists wxString FindValidPath(const wxString& filename) const --- 90,94 ---- !%wxchkver_2_8 void Add(const wxString& path) %wxchkver_2_8 bool Add(const wxString& path) ! %wxchkver_2_8 void Add(const wxArrayString& paths) // Find the first full path for which the file exists wxString FindValidPath(const wxString& filename) const Index: windows.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/windows.i,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** windows.i 6 Jun 2007 15:20:15 -0000 1.37 --- windows.i 11 Jun 2007 03:57:59 -0000 1.38 *************** *** 153,157 **** virtual wxWindow* GetParent() const ! // %override [int x, int y] GetPosition(int x, int y) const // C++ Func: virtual void GetPosition(int* x, int* y) const %override_name wxLua_wxWindow_GetPositionXY %rename GetPositionXY virtual void GetPosition() const --- 153,157 ---- virtual wxWindow* GetParent() const ! // %override [int x, int y] GetPosition() const // C++ Func: virtual void GetPosition(int* x, int* y) const %override_name wxLua_wxWindow_GetPositionXY %rename GetPositionXY virtual void GetPosition() const *************** *** 159,162 **** --- 159,169 ---- wxPoint GetPosition() const virtual wxRect GetRect() const + + // %override [int x, int y] GetScreenPosition() const + // C++ Func: virtual void GetScreenPosition(int* x, int* y) const + %override_name wxLua_wxWindow_GetScreenPositionXY %rename GetScreenPositionXY virtual void GetScreenPosition() const + + virtual wxPoint GetScreenPosition() + virtual wxRect GetScreenRect() const virtual int GetScrollPos(int orientation) virtual int GetScrollRange(int orientation) *************** *** 496,501 **** %class %delete wxNotebookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED ! %define_event wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxNotebookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) --- 503,508 ---- %class %delete wxNotebookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED // EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) ! %define_event wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING // EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) wxNotebookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) *************** *** 540,545 **** %class %delete wxListbookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED ! %define_event wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING wxListbookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) --- 547,552 ---- %class %delete wxListbookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED // EVT_LISTBOOK_PAGE_CHANGED(winid, fn) ! %define_event wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING // EVT_LISTBOOK_PAGE_CHANGING(winid, fn) wxListbookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) *************** *** 584,589 **** %class %delete wxChoicebookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED ! %define_event wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING wxChoicebookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) --- 591,596 ---- %class %delete wxChoicebookEvent, wxBookCtrlBaseEvent ! %define_event wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED // EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) ! %define_event wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING // EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) wxChoicebookEvent(wxEventType eventType = wxEVT_NULL, int id = 0, int sel = -1, int oldSel = -1) *************** *** 644,649 **** %class %delete wxTabEvent, wxCommandEvent ! %win %define_event wxEVT_COMMAND_TAB_SEL_CHANGED ! %win %define_event wxEVT_COMMAND_TAB_SEL_CHANGING wxTabEvent(wxEventType commandType = 0, int id = 0) --- 651,656 ---- %class %delete wxTabEvent, wxCommandEvent ! %win %define_event wxEVT_COMMAND_TAB_SEL_CHANGED // EVT_TAB_SEL_CHANGED(id, fn) ! %win %define_event wxEVT_COMMAND_TAB_SEL_CHANGING // EVT_TAB_SEL_CHANGING(id, fn) wxTabEvent(wxEventType commandType = 0, int id = 0) *************** *** 747,752 **** %class %delete wxQueryLayoutInfoEvent, wxEvent ! %define_event wxEVT_QUERY_LAYOUT_INFO ! %define_event wxEVT_CALCULATE_LAYOUT wxQueryLayoutInfoEvent(wxWindowID id = 0) --- 754,758 ---- %class %delete wxQueryLayoutInfoEvent, wxEvent ! %define_event wxEVT_QUERY_LAYOUT_INFO // EVT_QUERY_LAYOUT_INFO(func) wxQueryLayoutInfoEvent(wxWindowID id = 0) *************** *** 770,774 **** %class %delete wxCalculateLayoutEvent, wxEvent ! %define_event wxEVT_CALCULATE_LAYOUT wxCalculateLayoutEvent(wxWindowID id = 0) --- 776,780 ---- %class %delete wxCalculateLayoutEvent, wxEvent ! %define_event wxEVT_CALCULATE_LAYOUT // EVT_CALCULATE_LAYOUT(func) wxCalculateLayoutEvent(wxWindowID id = 0) *************** *** 784,788 **** %class %delete wxSashEvent, wxCommandEvent ! %define_event wxEVT_SASH_DRAGGED wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE) --- 790,794 ---- %class %delete wxSashEvent, wxCommandEvent ! %define_event wxEVT_SASH_DRAGGED // EVT_SASH_DRAGGED(id, fn) EVT_SASH_DRAGGED_RANGE(id1, id2, fn) wxSashEvent(int id = 0, wxSashEdgePosition edge = wxSASH_NONE) *************** *** 890,897 **** %class %delete wxSplitterEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING ! %define_event wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED ! %define_event wxEVT_COMMAND_SPLITTER_DOUBLECLICKED ! %define_event wxEVT_COMMAND_SPLITTER_UNSPLIT wxSplitterEvent(wxEventType type = wxEVT_NULL, wxSplitterWindow *splitter = NULL) --- 896,903 ---- %class %delete wxSplitterEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGING // EVT_SPLITTER_SASH_POS_CHANGING(id, fn) ! %define_event wxEVT_COMMAND_SPLITTER_SASH_POS_CHANGED // EVT_SPLITTER_SASH_POS_CHANGED(id, fn) ! %define_event wxEVT_COMMAND_SPLITTER_DOUBLECLICKED // EVT_SPLITTER_DCLICK(id, fn) ! %define_event wxEVT_COMMAND_SPLITTER_UNSPLIT // EVT_SPLITTER_UNSPLIT(id, fn) wxSplitterEvent(wxEventType type = wxEVT_NULL, wxSplitterWindow *splitter = NULL) Index: gdi.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/gdi.i,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** gdi.i 8 Jun 2007 01:36:22 -0000 1.49 --- gdi.i 11 Jun 2007 03:57:59 -0000 1.50 *************** *** 478,482 **** // first valid facename returned by wxFontEnumerator::GetFacenames(). // Does not return a bool since it cannot fail. ! %wxchkver_2_8 void SetFaceName(const wxArrayString_FromLuaTable& facenames) // it is important to be able to serialize wxNativeFontInfo objects to be --- 478,482 ---- // first valid facename returned by wxFontEnumerator::GetFacenames(). // Does not return a bool since it cannot fail. ! %wxchkver_2_8 void SetFaceName(const wxArrayString& facenames) // it is important to be able to serialize wxNativeFontInfo objects to be Index: menutool.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/menutool.i,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** menutool.i 1 Jun 2007 18:19:46 -0000 1.17 --- menutool.i 11 Jun 2007 03:57:59 -0000 1.18 *************** *** 168,174 **** %class %delete wxMenuEvent, wxEvent ! %define_event wxEVT_MENU_HIGHLIGHT ! %define_event wxEVT_MENU_OPEN ! %define_event wxEVT_MENU_CLOSE wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0, wxMenu* menu = NULL) --- 168,174 ---- %class %delete wxMenuEvent, wxEvent ! %define_event wxEVT_MENU_HIGHLIGHT // EVT_MENU_HIGHLIGHT(winid, func) EVT_MENU_HIGHLIGHT_ALL(func) ! %define_event wxEVT_MENU_OPEN // EVT_MENU_OPEN(func) ! %define_event wxEVT_MENU_CLOSE // EVT_MENU_CLOSE(func) wxMenuEvent(wxEventType type = wxEVT_NULL, int id = 0, wxMenu* menu = NULL) Index: data.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/data.i,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** data.i 31 May 2007 21:38:38 -0000 1.28 --- data.i 11 Jun 2007 03:57:58 -0000 1.29 *************** *** 106,109 **** --- 106,112 ---- %define_object wxDefaultValidator + // No constructor as this is a base class + + static bool IsSilent() wxWindow* GetWindow() const static void SetBellOnError(bool doIt = true) *************** *** 132,137 **** %class %delete wxTextValidator, wxValidator ! // %override wxTextValidator constructor use as is ! wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL) %wxchkver_2_5 wxArrayString& GetExcludes() --- 135,141 ---- %class %delete wxTextValidator, wxValidator ! // %override wxTextValidator(long style = wxFILTER_NONE, wxLuaObject* obj) ! // C++ Func: wxTextValidator(long style = wxFILTER_NONE, wxString *valPtr = NULL) ! wxTextValidator(long style = wxFILTER_NONE, wxLuaObject* stringObj = NULL) %wxchkver_2_5 wxArrayString& GetExcludes() *************** *** 157,172 **** %include "wx/valgen.h" ! %class %delete %noclassinfo wxGenericValidator, wxValidator // FIXME test this ! // %override wxGenericValidatorBool for wxCheckBox and wxRadioButton, input is wxLuaObject ? ! %rename wxGenericValidatorBool wxGenericValidator(bool *boolPtr) // for wxButton and wxComboBox, wxStaticText and wxTextCtrl ! %rename wxGenericValidatorString wxGenericValidator(wxString *valPtr) // for wxGauge, wxScrollBar, wxRadioBox, wxSpinButton, wxChoice ! %rename wxGenericValidatorInt wxGenericValidator(int *valPtr) // for wxListBox and wxCheckListBox ! %rename wxGenericValidatorArray wxGenericValidator(wxArrayInt *valPtr) %endclass --- 161,186 ---- %include "wx/valgen.h" ! %class %delete %noclassinfo wxGenericValidator, wxValidator ! // See the validator.wx.lua sample for usage of this class + // %override wxGenericValidatorBool(wxLuaObject* boolObj) + // C++ Func: wxGenericValidator(bool *boolPtr) + // for wxCheckBox and wxRadioButton + %rename wxGenericValidatorBool wxGenericValidator(wxLuaObject* boolObj) + + // %override wxGenericValidatorString(wxLuaObject* stringObj) + // C++ Func: wxGenericValidator(wxString *valPtr) // for wxButton and wxComboBox, wxStaticText and wxTextCtrl ! %rename wxGenericValidatorString wxGenericValidator(wxLuaObject* stringObj) + // %override wxGenericValidatorInt(wxLuaObject* intObj) + // C++ Func: wxGenericValidator(int *valPtr) // for wxGauge, wxScrollBar, wxRadioBox, wxSpinButton, wxChoice ! %rename wxGenericValidatorInt wxGenericValidator(wxLuaObject* intObj) + // %override wxGenericValidatorArrayInt(wxLuaObject* intTableObj) + // C++ Func: wxGenericValidator(wxArrayInt *valPtr) // for wxListBox and wxCheckListBox ! %rename wxGenericValidatorArrayInt wxGenericValidator(wxLuaObject* intTableObj) %endclass *************** *** 254,258 **** wxArrayInt() wxArrayInt(const wxArrayInt& array) - wxArrayInt(const wxArrayInt_FromLuaTable& array) // %override [lua table] wxArrayInt::ToLuaTable() const --- 268,271 ---- *************** *** 285,289 **** wxArrayString() wxArrayString(const wxArrayString& array) - wxArrayString(const wxArrayString_FromLuaTable& array) // %override [lua table] wxArrayString::ToLuaTable() const --- 298,301 ---- *************** *** 315,319 **** wxSortedArrayString() wxSortedArrayString(const wxSortedArrayString& src) - wxSortedArrayString(const wxArrayString_FromLuaTable& array) %endclass --- 327,330 ---- Index: datetime.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/datetime.i,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** datetime.i 1 Jun 2007 18:19:46 -0000 1.27 --- datetime.i 11 Jun 2007 03:57:58 -0000 1.28 *************** *** 365,369 **** %class %delete wxTimerEvent, wxEvent ! %define_event wxEVT_TIMER int GetInterval() const --- 365,369 ---- %class %delete wxTimerEvent, wxEvent ! %define_event wxEVT_TIMER // EVT_TIMER(id, fn) int GetInterval() const *************** *** 466,470 **** %class %delete wxDateEvent, wxCommandEvent ! %define_event wxEVT_DATE_CHANGED wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) --- 466,470 ---- %class %delete wxDateEvent, wxCommandEvent ! %define_event wxEVT_DATE_CHANGED // EVT_DATE_CHANGED(id, fn) wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) *************** *** 480,489 **** %class %delete wxCalendarEvent, wxDateEvent ! %define_event wxEVT_CALENDAR_SEL_CHANGED ! %define_event wxEVT_CALENDAR_DAY_CHANGED ! %define_event wxEVT_CALENDAR_MONTH_CHANGED ! %define_event wxEVT_CALENDAR_YEAR_CHANGED ! %define_event wxEVT_CALENDAR_DOUBLECLICKED ! %define_event wxEVT_CALENDAR_WEEKDAY_CLICKED wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type) --- 480,489 ---- %class %delete wxCalendarEvent, wxDateEvent ! %define_event wxEVT_CALENDAR_SEL_CHANGED // EVT_CALENDAR_SEL_CHANGED(id, fn) ! %define_event wxEVT_CALENDAR_DAY_CHANGED // EVT_CALENDAR_DAY(id, fn) ! %define_event wxEVT_CALENDAR_MONTH_CHANGED // EVT_CALENDAR_MONTH(id, fn) ! %define_event wxEVT_CALENDAR_YEAR_CHANGED // EVT_CALENDAR_YEAR(id, fn) ! %define_event wxEVT_CALENDAR_DOUBLECLICKED // EVT_CALENDAR(id, fn) ! %define_event wxEVT_CALENDAR_WEEKDAY_CLICKED // EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wxCalendarEvent(wxCalendarCtrl *cal, wxEventType type) Index: socket.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/socket.i,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** socket.i 1 Jun 2007 18:19:46 -0000 1.13 --- socket.i 11 Jun 2007 03:57:59 -0000 1.14 *************** *** 141,145 **** %class %delete wxSocketEvent, wxEvent ! %define_event wxEVT_SOCKET wxSocketEvent(int id = 0) --- 141,145 ---- %class %delete wxSocketEvent, wxEvent ! %define_event wxEVT_SOCKET // EVT_SOCKET(id, func) wxSocketEvent(int id = 0) Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxlua.i,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxlua.i 8 Jun 2007 22:50:09 -0000 1.22 --- wxlua.i 11 Jun 2007 03:57:59 -0000 1.23 *************** *** 32,35 **** --- 32,48 ---- %endenum + %define WXLUAARG_None + %define WXLUAARG_Nil + %define WXLUAARG_Boolean + %define WXLUAARG_LightUserData + %define WXLUAARG_Number + %define WXLUAARG_String + %define WXLUAARG_LuaTable + %define WXLUAARG_LuaFunction + %define WXLUAARG_UserData + %define WXLUAARG_LuaThread + %define WXLUAARG_Enum + + // Is this lua_type() (or in lua type()) considered %function int wxlua_iswxluatype(int luatype, int wxluaarg_tag) *************** *** 164,170 **** %class %delete wxLuaObject, wxObject ! wxLuaObject() // the wxLuaState is the calling lua_State ! void SetObject(int iParam = 1) // the stack index to make the object for ! void GetObject() const // get the object, note C++ returns bool, this "returns" the object on the stack int GetAllocationFlags() const --- 177,200 ---- %class %delete wxLuaObject, wxObject ! // %override wxLuaObject(any value type) ! // C++ Func: wxLuaObject(const wxLuaState& wxlState, int stack_idx = 1) ! // Wrap the single value passed in with a wxLuaObject ! wxLuaObject() ! ! // %override void wxLuaObject::SetObject(any value type) ! // C++ Func: void SetObject(int stack_idx = 1) ! // Discard the old reference and create a new one for the item passed in ! void SetObject() ! ! // %override [any value type] wxLuaObject::GetObject() ! // C++ Func: bool GetObject() ! // get the object, note C++ returns bool, this "returns" the referenced object ! void GetObject() const ! ! // these are used to verify that things are working ! //bool *GetBoolPtr(); ! //int *GetIntPtr(); ! //wxString *GetStringPtr(); ! //wxArrayInt *GetArrayPtr(); int GetAllocationFlags() const *************** *** 226,230 **** %class %delete wxLuaHtmlWinTagEvent, wxEvent ! %define_event wxEVT_HTML_TAG_HANDLER const wxHtmlTag *GetHtmlTag() const --- 256,260 ---- %class %delete wxLuaHtmlWinTagEvent, wxEvent ! %define_event wxEVT_HTML_TAG_HANDLER // EVT_HTML_TAG_HANDLER(id, fn) const wxHtmlTag *GetHtmlTag() const Index: controls.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/controls.i,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** controls.i 1 Jun 2007 18:19:46 -0000 1.36 --- controls.i 11 Jun 2007 03:57:58 -0000 1.37 *************** *** 165,171 **** %class wxChoice, wxControlWithItems wxChoice() ! wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxChoice") ! bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxChoice") int GetCurrentSelection() const //int GetColumns() const // Motif only but returns 1 otherwise --- 165,171 ---- %class wxChoice, wxControlWithItems wxChoice() ! wxChoice(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxChoice") ! bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxChoice") int GetCurrentSelection() const //int GetColumns() const // Motif only but returns 1 otherwise *************** *** 189,195 **** %class wxComboBox, wxControlWithItems wxComboBox() ! wxComboBox(wxWindow* parent, wxWindowID id, const wxString& value = "", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxComboBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxString& value = "", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxComboBox") bool CanCopy() const bool CanCut() const --- 189,195 ---- %class wxComboBox, wxControlWithItems wxComboBox() ! wxComboBox(wxWindow* parent, wxWindowID id, const wxString& value = "", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxComboBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxString& value = "", const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxComboBox") bool CanCopy() const bool CanCut() const *************** *** 265,271 **** %class wxListBox, wxControlWithItems wxListBox() ! wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListBox") void Deselect(int n) --- 265,271 ---- %class wxListBox, wxControlWithItems wxListBox() ! wxListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxListBox") void Deselect(int n) *************** *** 276,283 **** %wxchkver_2_8 int HitTest(const wxPoint& point) const //void InsertItems(int nItems, const wxString items[], int pos) ! void InsertItems(const wxArrayString_FromLuaTable& items, int pos) bool IsSelected(int n) const //void Set(int n, const wxString* choices) ! void Set(const wxArrayString_FromLuaTable& choices) void SetFirstItem(int n) void SetSelection(int n, bool select = true) --- 276,283 ---- %wxchkver_2_8 int HitTest(const wxPoint& point) const //void InsertItems(int nItems, const wxString items[], int pos) ! void InsertItems(const wxArrayString& items, int pos) bool IsSelected(int n) const //void Set(int n, const wxString* choices) ! void Set(const wxArrayString& choices) void SetFirstItem(int n) void SetSelection(int n, bool select = true) *************** *** 294,300 **** %class wxCheckListBox, wxListBox wxCheckListBox() ! wxCheckListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxCheckListBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxCheckListBox") void Check(int item, bool check = true) bool IsChecked(int item) const --- 294,300 ---- %class wxCheckListBox, wxListBox wxCheckListBox() ! wxCheckListBox(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxCheckListBox") ! bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxCheckListBox") void Check(int item, bool check = true) bool IsChecked(int item) const *************** *** 437,440 **** --- 437,441 ---- long SetItem(long index, int col, const wxString& label, int imageId = -1) void SetItemBackgroundColour(long item, const wxColour& col) + bool SetItemColumnImage(long item, long column, int image) //void SetItemCount(long count) bool SetItemData(long item, long data) *************** *** 447,452 **** void SetTextColour(const wxColour& col) void SetWindowStyleFlag(long style) ! // bool SortItems(lua function(long item1, long item2, long sortData) returning int, long data) ! //bool SortItems(wxListCtrlCompare fnSortCallBack, long data) bool SortItems(LuaFunction fnSortCallBack, long data) %endclass --- 448,462 ---- void SetTextColour(const wxColour& col) void SetWindowStyleFlag(long style) ! ! ! // %override bool SortItems(lua function(long item1, long item2, long data) returning int, long data) ! // C++ Func: bool SortItems(wxListCtrlCompare fnSortCallBack, long data) ! // Note: the data can only be a number, but you can create a table where the data is ! // an index of it if you need more information. ! // Also, the item1 and item2 are NOT the indexes in the wxListCtrl, but are the ! // client data associated with the item. see SetItemData(item, data) and again ! // you may want to make this "data" equal to an index in a table where you ! // store more information needed for sorting. ! // Your lua function should return 1, 0, -1 for item1 > item2, item1 == item2, item1 < item2 bool SortItems(LuaFunction fnSortCallBack, long data) %endclass *************** *** 519,544 **** %class %delete wxListEvent, wxNotifyEvent ! %define_event wxEVT_COMMAND_LIST_BEGIN_DRAG ! %define_event wxEVT_COMMAND_LIST_BEGIN_RDRAG ! %define_event wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT ! %define_event wxEVT_COMMAND_LIST_COL_CLICK ! %define_event wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS ! %define_event wxEVT_COMMAND_LIST_DELETE_ITEM ! %define_event wxEVT_COMMAND_LIST_END_LABEL_EDIT ! !%wxchkver_2_5 %define_event wxEVT_COMMAND_LIST_GET_INFO ! !%wxchkver_2_5 %define_event wxEVT_COMMAND_LIST_SET_INFO ! %define_event wxEVT_COMMAND_LIST_INSERT_ITEM ! %define_event wxEVT_COMMAND_LIST_ITEM_ACTIVATED ! %define_event wxEVT_COMMAND_LIST_ITEM_DESELECTED ! %define_event wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK ! %define_event wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK ! %define_event wxEVT_COMMAND_LIST_ITEM_SELECTED ! %define_event wxEVT_COMMAND_LIST_KEY_DOWN ! %define_event wxEVT_COMMAND_LIST_CACHE_HINT ! %define_event wxEVT_COMMAND_LIST_COL_RIGHT_CLICK ! %define_event wxEVT_COMMAND_LIST_COL_BEGIN_DRAG ! %define_event wxEVT_COMMAND_LIST_COL_DRAGGING ! %define_event wxEVT_COMMAND_LIST_COL_END_DRAG ! %define_event wxEVT_COMMAND_LIST_ITEM_FOCUSED wxListEvent(wxEventType commandType = 0, int id = 0) --- 529,554 ---- %class %delete wxListEvent, wxNotifyEvent ! %define_event wxEVT_COMMAND_LIST_BEGIN_DRAG // EVT_LIST_BEGIN_DRAG(id, fn) ! %define_event wxEVT_COMMAND_LIST_BEGIN_RDRAG // EVT_LIST_BEGIN_RDRAG(id, fn) ! %define_event wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT // EVT_LIST_BEGIN_LABEL_EDIT(id, fn) ! %define_event wxEVT_COMMAND_LIST_COL_CLICK // EVT_LIST_COL_CLICK(id, fn) ! %define_event wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS // EVT_LIST_DELETE_ALL_ITEMS(id, fn) ! %define_event wxEVT_COMMAND_LIST_DELETE_ITEM // EVT_LIST_DELETE_ITEM(id, fn) ! %define_event wxEVT_COMMAND_LIST_END_LABEL_EDIT // EVT_LIST_END_LABEL_EDIT(id, fn) ! !%wxchkver_2_5 %define_event wxEVT_COMMAND_LIST_GET_INFO // EVT_LIST_GET_INFO(id, fn) ! !%wxchkver_2_5 %define_event wxEVT_COMMAND_LIST_SET_INFO // EVT_LIST_SET_INFO(id, fn) ! %define_event wxEVT_COMMAND_LIST_INSERT_ITEM // EVT_LIST_INSERT_ITEM(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_ACTIVATED // EVT_LIST_ITEM_ACTIVATED(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_DESELECTED // EVT_LIST_ITEM_DESELECTED(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK // EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK // EVT_LIST_ITEM_RIGHT_CLICK(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_SELECTED // EVT_LIST_ITEM_SELECTED(id, fn) ! %define_event wxEVT_COMMAND_LIST_KEY_DOWN // EVT_LIST_KEY_DOWN(id, fn) ! %define_event wxEVT_COMMAND_LIST_CACHE_HINT // EVT_LIST_CACHE_HINT(id, fn) ! %define_event wxEVT_COMMAND_LIST_COL_RIGHT_CLICK // EVT_LIST_COL_RIGHT_CLICK(id, fn) ! %define_event wxEVT_COMMAND_LIST_COL_BEGIN_DRAG // EVT_LIST_COL_BEGIN_DRAG(id, fn) ! %define_event wxEVT_COMMAND_LIST_COL_DRAGGING // EVT_LIST_COL_DRAGGING(id, fn) ! %define_event wxEVT_COMMAND_LIST_COL_END_DRAG // EVT_LIST_COL_END_DRAG(id, fn) ! %define_event wxEVT_COMMAND_LIST_ITEM_FOCUSED // EVT_LIST_ITEM_FOCUSED(id, fn) wxListEvent(wxEventType commandType = 0, int id = 0) *************** *** 594,598 **** %class wxRadioBox, wxControl wxRadioBox() ! wxRadioBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxRadioBox") // these are marked deprecated in 2.6, use wxControl::Get/SetLabel/String --- 604,608 ---- %class wxRadioBox, wxControl wxRadioBox() ! wxRadioBox(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxRadioBox") // these are marked deprecated in 2.6, use wxControl::Get/SetLabel/String *************** *** 602,606 **** //void SetLabel(int n, const wxString& label) ! bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString_FromLuaTable& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxRadioBox") void Enable(bool enable) void Enable(int n, bool enable) --- 612,616 ---- //void SetLabel(int n, const wxString& label) ! bool Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& point = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxArrayString& choices, int majorDimension = 0, long style = wxRA_SPECIFY_COLS, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxRadioBox") void Enable(bool enable) void Enable(int n, bool enable) *************** *** 744,750 **** %class %delete wxSpinEvent, wxNotifyEvent ! %define_event wxEVT_SCROLL_LINEUP // EVT_SPIN_UP ! %define_event wxEVT_SCROLL_LINEDOWN // EVT_SPIN_DOWN ! %define_event wxEVT_SCROLL_THUMBTRACK // EVT_SPIN //%define_event wxEVT_COMMAND_SPINCTRL_UPDATED - actually a wxCommandEvent is sent --- 754,760 ---- %class %delete wxSpinEvent, wxNotifyEvent ! %define_event wxEVT_SCROLL_LINEUP // EVT_SPIN_UP(winid, func) ! %define_event wxEVT_SCROLL_LINEDOWN // EVT_SPIN_DOWN(winid, func) ! %define_event wxEVT_SCROLL_THUMBTRACK // EVT_SPIN(winid, func) //%define_event wxEVT_COMMAND_SPINCTRL_UPDATED - actually a wxCommandEvent is sent *************** *** 1149,1155 **** wxArrayTreeItemIds(const wxArrayTreeItemIds& array) - // %override [lua table] wxArrayString::ToLuaTable() const - //int ToLuaTable() const - void Add(const wxTreeItemId& id) void Alloc(size_t nCount) --- 1159,1162 ---- *************** *** 1181,1202 **** %class %delete wxTreeEvent, wxNotifyEvent ! %define_event wxEVT_COMMAND_TREE_BEGIN_DRAG ! %define_event wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT ! %define_event wxEVT_COMMAND_TREE_BEGIN_RDRAG ! %define_event wxEVT_COMMAND_TREE_DELETE_ITEM ! %define_event wxEVT_COMMAND_TREE_END_DRAG ! %define_event wxEVT_COMMAND_TREE_END_LABEL_EDIT ! %define_event wxEVT_COMMAND_TREE_GET_INFO ! %define_event wxEVT_COMMAND_TREE_ITEM_ACTIVATED ! %define_event wxEVT_COMMAND_TREE_ITEM_COLLAPSED ! %define_event wxEVT_COMMAND_TREE_ITEM_COLLAPSING ! %define_event wxEVT_COMMAND_TREE_ITEM_EXPANDED ! %define_event wxEVT_COMMAND_TREE_ITEM_EXPANDING ! %define_event wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK ! %define_event wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK ! %define_event wxEVT_COMMAND_TREE_KEY_DOWN ! %define_event wxEVT_COMMAND_TREE_SEL_CHANGED ! %define_event wxEVT_COMMAND_TREE_SEL_CHANGING ! %define_event wxEVT_COMMAND_TREE_SET_INFO wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0) --- 1188,1212 ---- %class %delete wxTreeEvent, wxNotifyEvent ! %define_event wxEVT_COMMAND_TREE_BEGIN_DRAG // EVT_TREE_BEGIN_DRAG(id, fn) ! %define_event wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT // EVT_TREE_BEGIN_LABEL_EDIT(id, fn) ! %define_event wxEVT_COMMAND_TREE_BEGIN_RDRAG // EVT_TREE_BEGIN_RDRAG(id, fn) ! %define_event wxEVT_COMMAND_TREE_DELETE_ITEM // EVT_TREE_DELETE_ITEM(id, fn) ! %define_event wxEVT_COMMAND_TREE_END_DRAG // EVT_TREE_END_DRAG(id, fn) ! %define_event wxEVT_COMMAND_TREE_END_LABEL_EDIT // EVT_TREE_END_LABEL_EDIT(id, fn) ! %define_event wxEVT_COMMAND_TREE_GET_INFO // EVT_TREE_GET_INFO(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_ACTIVATED // EVT_TREE_ITEM_ACTIVATED(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_COLLAPSED // EVT_TREE_ITEM_COLLAPSED(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_COLLAPSING // EVT_TREE_ITEM_COLLAPSING(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_EXPANDED // EVT_TREE_ITEM_EXPANDED(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_EXPANDING // EVT_TREE_ITEM_EXPANDING(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK // EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK // EVT_TREE_ITEM_RIGHT_CLICK(id, fn) ! %define_event wxEVT_COMMAND_TREE_KEY_DOWN // EVT_TREE_KEY_DOWN(id, fn) ! %define_event wxEVT_COMMAND_TREE_SEL_CHANGED // EVT_TREE_SEL_CHANGED(id, fn) ! %define_event wxEVT_COMMAND_TREE_SEL_CHANGING // EVT_TREE_SEL_CHANGING(id, fn) ! %define_event wxEVT_COMMAND_TREE_SET_INFO // EVT_TREE_SET_INFO(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_MENU // EVT_TREE_ITEM_MENU(id, fn) ! %define_event wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK // EVT_TREE_STATE_IMAGE_CLICK(id, fn) ! %define_event wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP // EVT_TREE_ITEM_GETTOOLTIP(id, fn) wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0) Index: clipdrag.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/clipdrag.i,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** clipdrag.i 1 Jun 2007 18:19:46 -0000 1.26 --- clipdrag.i 11 Jun 2007 03:57:58 -0000 1.27 *************** *** 48,54 **** %class %delete wxClipboardTextEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_TEXT_COPY ! %define_event wxEVT_COMMAND_TEXT_CUT ! %define_event wxEVT_COMMAND_TEXT_PASTE wxClipboardTextEvent(wxEventType type = wxEVT_NULL, wxWindowID winid = 0) --- 48,54 ---- %class %delete wxClipboardTextEvent, wxCommandEvent ! %define_event wxEVT_COMMAND_TEXT_COPY // EVT_TEXT_CUT(winid, func) ! %define_event wxEVT_COMMAND_TEXT_CUT // EVT_TEXT_COPY(winid, func) ! %define_event wxEVT_COMMAND_TEXT_PASTE // EVT_TEXT_PASTE(winid, func) wxClipboardTextEvent(wxEventType type = wxEVT_NULL, wxWindowID winid = 0) *************** *** 303,307 **** %class %delete wxDropFilesEvent, wxEvent ! %define_event wxEVT_DROP_FILES // wxDropFilesEvent(WXTYPE id = 0, int noFiles = 0, wxString* files = NULL) only handle this event --- 303,307 ---- %class %delete wxDropFilesEvent, wxEvent ! %define_event wxEVT_DROP_FILES // EVT_DROP_FILES(func) // wxDropFilesEvent(WXTYPE id = 0, int noFiles = 0, wxString* files = NULL) only handle this event Index: event.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/event.i,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** event.i 1 Jun 2007 18:19:46 -0000 1.23 --- event.i 11 Jun 2007 03:57:59 -0000 1.24 *************** *** 106,144 **** %class %delete wxCommandEvent, wxEvent ! %define_event wxEVT_NULL // dummy placeholder ! %define_event wxEVT_COMMAND_ENTER ! %define_event wxEVT_COMMAND_KILL_FOCUS ! %define_event wxEVT_COMMAND_LEFT_CLICK ! %define_event wxEVT_COMMAND_LEFT_DCLICK ! %define_event wxEVT_COMMAND_RIGHT_CLICK ! %define_event wxEVT_COMMAND_RIGHT_DCLICK ! //%define_event wxEVT_COMMAND_SCROLLBAR_UPDATED // obsolete use wxEVT_SCROLL... ! %define_event wxEVT_COMMAND_SET_FOCUS ! //%define_event wxEVT_COMMAND_VLBOX_SELECTED // unused? ! %define_event wxEVT_COMMAND_MENU_SELECTED ! %define_event wxEVT_COMMAND_TOOL_CLICKED ! %define_event wxEVT_COMMAND_TOOL_ENTER ! %define_event wxEVT_COMMAND_TOOL_RCLICKED ! %define_event wxEVT_COMMAND_TEXT_ENTER ! %define_event wxEVT_COMMAND_TEXT_UPDATED ! %define_event wxEVT_COMMAND_TEXT_URL ! %define_event wxEVT_COMMAND_TEXT_MAXLEN ! %define_event wxEVT_COMMAND_SPINCTRL_UPDATED ! %define_event wxEVT_COMMAND_SLIDER_UPDATED ! %define_event wxEVT_COMMAND_RADIOBUTTON_SELECTED ! %define_event wxEVT_COMMAND_RADIOBOX_SELECTED ! %define_event wxEVT_COMMAND_CHECKLISTBOX_TOGGLED ! %define_event wxEVT_COMMAND_LISTBOX_DOUBLECLICKED ! %define_event wxEVT_COMMAND_LISTBOX_SELECTED ! %define_event wxEVT_COMMAND_COMBOBOX_SELECTED ! %define_event wxEVT_COMMAND_CHOICE_SELECTED ! %define_event wxEVT_COMMAND_CHECKBOX_CLICKED ! %define_event wxEVT_COMMAND_BUTTON_CLICKED ! %wxchkver_2_4 %define_event wxEVT_COMMAND_TOGGLEBUTTON_CLICKED wxCommandEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) --- 106,144 ---- %class %delete wxCommandEvent, wxEvent ! %define_event wxEVT_NULL // dummy placeholder nobody sends this event ! %define_event wxEVT_COMMAND_ENTER // EVT_COMMAND_ENTER(winid, func) ! %define_event wxEVT_COMMAND_KILL_FOCUS // EVT_COMMAND_KILL_FOCUS(winid, func) ! %define_event wxEVT_COMMAND_LEFT_CLICK // EVT_COMMAND_LEFT_CLICK(winid, func) ! %define_event wxEVT_COMMAND_LEFT_DCLICK // EVT_COMMAND_LEFT_DCLICK(winid, func) ! %define_event wxEVT_COMMAND_RIGHT_CLICK // EVT_COMMAND_RIGHT_CLICK(winid, func) ! %define_event wxEVT_COMMAND_RIGHT_DCLICK // EVT_COMMAND_RIGHT_DCLICK(winid, func) ! //%define_event wxEVT_COMMAND_SCROLLBAR_UPDATED // EVT_SCROLLBAR(winid, func) obsolete use wxEVT_SCROLL... ! %define_event wxEVT_COMMAND_SET_FOCUS // EVT_COMMAND_SET_FOCUS(winid, func) ! //%define_event wxEVT_COMMAND_VLBOX_SELECTED // EVT_VLBOX(winid, func) unused? ! %define_event wxEVT_COMMAND_MENU_SELECTED // EVT_MENU(winid, func) EVT_MENU_RANGE(id1, id2, func) ! %define_event wxEVT_COMMAND_TOOL_CLICKED // EVT_TOOL(winid, func) EVT_TOOL_RANGE(id1, id2, func) ! %define_event wxEVT_COMMAND_TOOL_ENTER // EVT_TOOL_ENTER(winid, func) ! %define_event wxEVT_COMMAND_TOOL_RCLICKED // EVT_TOOL_RCLICKED(winid, func) EVT_TOOL_RCLICKED_RANGE(id1, id2, func) ! %define_event wxEVT_COMMAND_TEXT_ENTER // EVT_TEXT_ENTER(id, fn) ! %define_event wxEVT_COMMAND_TEXT_UPDATED // EVT_TEXT(id, fn) ! %define_event wxEVT_COMMAND_TEXT_URL // EVT_TEXT_URL(id, fn) ! %define_event wxEVT_COMMAND_TEXT_MAXLEN // EVT_TEXT_MAXLEN(id, fn) ! %define_event wxEVT_COMMAND_SPINCTRL_UPDATED // EVT_SPINCTRL(id, fn) ! %define_event wxEVT_COMMAND_SLIDER_UPDATED // EVT_SLIDER(winid, func) ! %define_event wxEVT_COMMAND_RADIOBUTTON_SELECTED // EVT_RADIOBUTTON(winid, func) ! %define_event wxEVT_COMMAND_RADIOBOX_SELECTED // EVT_RADIOBOX(winid, func) ! %define_event wxEVT_COMMAND_CHECKLISTBOX_TOGGLED // EVT_CHECKLISTBOX(winid, func) ! %define_event wxEVT_COMMAND_LISTBOX_DOUBLECLICKED // EVT_LISTBOX_DCLICK(winid, func) ! %define_event wxEVT_COMMAND_LISTBOX_SELECTED // EVT_LISTBOX(winid, func) ! %define_event wxEVT_COMMAND_COMBOBOX_SELECTED // EVT_COMBOBOX(winid, func) ! %define_event wxEVT_COMMAND_CHOICE_SELECTED // EVT_CHOICE(winid, func) ! %define_event wxEVT_COMMAND_CHECKBOX_CLICKED // EVT_CHECKBOX(winid, func) ! %define_event wxEVT_COMMAND_BUTTON_CLICKED // EVT_BUTTON(winid, func) ! %wxchkver_2_4 %define_event wxEVT_COMMAND_TOGGLEBUTTON_CLICKED // EVT_TOGGLEBUTTON(id, fn) wxCommandEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) *************** *** 178,184 **** %class %delete wxActivateEvent, wxEvent ! %define_event wxEVT_ACTIVATE ! %define_event wxEVT_ACTIVATE_APP ! %define_event wxEVT_HIBERNATE wxActivateEvent(wxEventType eventType = wxEVT_NULL, bool active = true, int id = 0) --- 178,184 ---- %class %delete wxActivateEvent, wxEvent ! %define_event wxEVT_ACTIVATE // EVT_ACTIVATE(func) ! %define_event wxEVT_ACTIVATE_APP // EVT_ACTIVATE_APP(func) ! %define_event wxEVT_HIBERNATE // EVT_HIBERNATE(func) wxActivateEvent(wxEventType eventType = wxEVT_NULL, bool active = true, int id = 0) *************** *** 193,199 **** %class %delete wxCloseEvent, wxEvent ! %define_event wxEVT_CLOSE_WINDOW ! %define_event wxEVT_QUERY_END_SESSION ! %define_event wxEVT_END_SESSION wxCloseEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) --- 193,199 ---- %class %delete wxCloseEvent, wxEvent ! %define_event wxEVT_CLOSE_WINDOW // EVT_CLOSE(func) ! %define_event wxEVT_QUERY_END_SESSION // EVT_QUERY_END_SESSION(func) ! %define_event wxEVT_END_SESSION // EVT_END_SESSION(func) wxCloseEvent(wxEventType commandEventType = wxEVT_NULL, int id = 0) *************** *** 213,218 **** //%class %noclassinfo wxDialUpEvent, wxCommandEvent ! // %define_event wxEVT_DIALUP_CONNECTED ! // %define_event wxEVT_DIALUP_DISCONNECTED // wxDialUpEvent(bool isConnected, bool isOwnEvent) --- 213,218 ---- //%class %noclassinfo wxDialUpEvent, wxCommandEvent ! // %define_event wxEVT_DIALUP_CONNECTED // EVT_DIALUP_CONNECTED(func) ! // %define_event wxEVT_DIALUP_DISCONNECTED // EVT_DIALUP_DISCONNECTED(func) // wxDialUpEvent(bool isConnected, bool isOwnEvent) *************** *** 228,234 **** %class %delete wxEraseEvent, wxEvent ! %define_event wxEVT_ERASE_BACKGROUND wxEraseEvent(int id = 0, wxDC* dc = NULL) wxDC* GetDC() const %endclass --- 228,235 ---- %class %delete wxEraseEvent, wxEvent ! %define_event wxEVT_ERASE_BACKGROUND // EVT_ERASE_BACKGROUND(func) wxEraseEvent(int id = 0, wxDC* dc = NULL) + wxDC* GetDC() const %endclass *************** *** 240,245 **** %class %delete wxFocusEvent, wxEvent ! %define_event wxEVT_SET_FOCUS ! %define_event wxEVT_KILL_FOCUS wxFocusEvent(wxEventType eventType = wxEVT_NULL, int id = 0) --- 241,246 ---- %class %delete wxFocusEvent, wxEvent ! %define_event wxEVT_SET_FOCUS // EVT_SET_FOCUS(func) ! %define_event wxEVT_KILL_FOCUS // EVT_KILL_FOCUS(func) wxFocusEvent(wxEventType eventType = wxEVT_NULL, int id = 0) *************** *** 255,259 **** %class %delete wxChildFocusEvent, wxCommandEvent ! %define_event wxEVT_CHILD_FOCUS wxChildFocusEvent(wxWindow *win = NULL) --- 256,260 ---- %class %delete wxChildFocusEvent, wxCommandEvent ! %define_event wxEVT_CHILD_FOCUS // EVT_CHILD_FOCUS(func) wxChildFocusEvent(wxWindow *win = NULL) *************** *** 268,272 **** %class %delete wxQueryNewPaletteEvent, wxEvent ! %define_event wxEVT_QUERY_NEW_PALETTE wxQueryNewPaletteEvent(wxWindowID winid = 0) --- 269,273 ---- %class %delete wxQueryNewPaletteEvent, wxEvent ! %define_event wxEVT_QUERY_NEW_PALETTE // EVT_QUERY_NEW_PALETTE(func) wxQueryNewPaletteEvent(wxWindowID winid = 0) *************** *** 282,288 **** %class %delete wxPaletteChangedEvent, wxEvent ! %define_event wxEVT_PALETTE_CHANGED ! wxPaletteChangedEvent(wxWindowID winid = 0) void SetChangedWindow(wxWindow* win) --- 283,289 ---- %class %delete wxPaletteChangedEvent, wxEvent ! %define_event wxEVT_PALETTE_CHANGED // EVT_PALETTE_CHANGED(func) + wxPaletteChangedEvent(wxWindowID winid = 0) void SetChangedWindow(wxWindow* win) *************** *** 402,410 **** %class %delete wxKeyEvent, wxEvent ! %define_event wxEVT_KEY_DOWN ! %define_event wxEVT_KEY_UP ! %define_event wxEVT_CHAR ! %define_event wxEVT_CHAR_HOOK ! wxUSE_HOTKEY %define_event wxEVT_HOTKEY wxKeyEvent(wxEventType keyEventType) --- 403,411 ---- %class %delete wxKeyEvent, wxEvent ! %define_event wxEVT_KEY_DOWN // EVT_KEY_DOWN(func) ! %define_event wxEVT_KEY_UP ... [truncated message content] |
From: John L. <jr...@us...> - 2007-06-11 03:58:32
|
Update of /cvsroot/wxlua/wxLua/bindings/wxstc In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/bindings/wxstc Modified Files: stc.i Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: stc.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxstc/stc.i,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** stc.i 1 Jun 2007 18:19:46 -0000 1.11 --- stc.i 11 Jun 2007 03:57:58 -0000 1.12 *************** *** 3201,3231 **** %class %delete wxStyledTextEvent, wxCommandEvent ! %define_event wxEVT_STC_CHANGE ! %define_event wxEVT_STC_STYLENEEDED ! %define_event wxEVT_STC_CHARADDED ! %define_event wxEVT_STC_SAVEPOINTREACHED ! %define_event wxEVT_STC_SAVEPOINTLEFT ! %define_event wxEVT_STC_ROMODIFYATTEMPT ! %define_event wxEVT_STC_KEY ! %define_event wxEVT_STC_DOUBLECLICK ! %define_event wxEVT_STC_UPDATEUI ! %define_event wxEVT_STC_MODIFIED ! %define_event wxEVT_STC_MACRORECORD ! %define_event wxEVT_STC_MARGINCLICK ! %define_event wxEVT_STC_NEEDSHOWN ! !%wxchkver_2_5 %define_event wxEVT_STC_POSCHANGED ! %define_event wxEVT_STC_PAINTED ! %define_event wxEVT_STC_USERLISTSELECTION ! %define_event wxEVT_STC_URIDROPPED ! %define_event wxEVT_STC_DWELLSTART ! %define_event wxEVT_STC_DWELLEND ! %define_event wxEVT_STC_START_DRAG ! %define_event wxEVT_STC_DRAG_OVER ! %define_event wxEVT_STC_DO_DROP ! %define_event wxEVT_STC_ZOOM ! %define_event wxEVT_STC_HOTSPOT_CLICK, ! %define_event wxEVT_STC_HOTSPOT_DCLICK, ! %define_event wxEVT_STC_CALLTIP_CLICK, ! %define_event wxEVT_STC_AUTOCOMP_SELECTION wxStyledTextEvent(wxEventType commandType = 0, int id = 0) --- 3201,3231 ---- %class %delete wxStyledTextEvent, wxCommandEvent ! %define_event wxEVT_STC_CHANGE // EVT_STC_CHANGE(id, fn) ! %define_event wxEVT_STC_STYLENEEDED // EVT_STC_STYLENEEDED(id, fn) ! %define_event wxEVT_STC_CHARADDED // EVT_STC_CHARADDED(id, fn) ! %define_event wxEVT_STC_SAVEPOINTREACHED // EVT_STC_SAVEPOINTREACHED(id, fn) ! %define_event wxEVT_STC_SAVEPOINTLEFT // EVT_STC_SAVEPOINTLEFT(id, fn) ! %define_event wxEVT_STC_ROMODIFYATTEMPT // EVT_STC_ROMODIFYATTEMPT(id, fn) ! %define_event wxEVT_STC_KEY // EVT_STC_KEY(id, fn) ! %define_event wxEVT_STC_DOUBLECLICK // EVT_STC_DOUBLECLICK(id, fn) ! %define_event wxEVT_STC_UPDATEUI // EVT_STC_UPDATEUI(id, fn) ! %define_event wxEVT_STC_MODIFIED // EVT_STC_MODIFIED(id, fn) ! %define_event wxEVT_STC_MACRORECORD // EVT_STC_MACRORECORD(id, fn) ! %define_event wxEVT_STC_MARGINCLICK // EVT_STC_MARGINCLICK(id, fn) ! %define_event wxEVT_STC_NEEDSHOWN // EVT_STC_NEEDSHOWN(id, fn) ! !%wxchkver_2_5 %define_event wxEVT_STC_POSCHANGED // ?? ! %define_event wxEVT_STC_PAINTED // EVT_STC_PAINTED(id, fn) ! %define_event wxEVT_STC_USERLISTSELECTION // EVT_STC_USERLISTSELECTION(id, fn) ! %define_event wxEVT_STC_URIDROPPED // EVT_STC_URIDROPPED(id, fn) ! %define_event wxEVT_STC_DWELLSTART // EVT_STC_DWELLSTART(id, fn) ! %define_event wxEVT_STC_DWELLEND // EVT_STC_DWELLEND(id, fn) ! %define_event wxEVT_STC_START_DRAG // EVT_STC_START_DRAG(id, fn) ! %define_event wxEVT_STC_DRAG_OVER // EVT_STC_DRAG_OVER(id, fn) ! %define_event wxEVT_STC_DO_DROP // EVT_STC_DO_DROP(id, fn) ! %define_event wxEVT_STC_ZOOM // EVT_STC_ZOOM(id, fn) ! %define_event wxEVT_STC_HOTSPOT_CLICK // EVT_STC_HOTSPOT_CLICK(id, fn) ! %define_event wxEVT_STC_HOTSPOT_DCLICK // EVT_STC_HOTSPOT_DCLICK(id, fn) ! %define_event wxEVT_STC_CALLTIP_CLICK // EVT_STC_CALLTIP_CLICK(id, fn) ! %define_event wxEVT_STC_AUTOCOMP_SELECTION // EVT_STC_AUTOCOMP_SELECTION(id, fn) wxStyledTextEvent(wxEventType commandType = 0, int id = 0) |
From: John L. <jr...@us...> - 2007-06-11 03:58:31
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/bindings Modified Files: genwxbind.lua Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.116 retrieving revision 1.117 diff -C2 -d -r1.116 -r1.117 *** genwxbind.lua 8 Jun 2007 01:36:21 -0000 1.116 --- genwxbind.lua 11 Jun 2007 03:57:57 -0000 1.117 *************** *** 3077,3091 **** end ! -- our special notation to get wxStringArray from a lua table of strings ! if argType == "wxArrayString_FromLuaTable" then ! overload_argList = overload_argList.."&s_wxluaarg_LuaTable, " argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" declare = "wxArrayString " ! elseif argType == "wxArrayInt_FromLuaTable" then ! overload_argList = overload_argList.."&s_wxluaarg_LuaTable, " argItem = "wxArrayInt(); wxlState.GetwxArrayInt("..argNum..", "..argName..")" declare = "wxArrayInt " elseif argType == "IntArray_FromLuaTable" then ! overload_argList = overload_argList.."&s_wxluaarg_LuaTable, " argItem = "NULL; ptr = "..argName.." = wxlState.GetIntArray("..argNum..", count_)" declare = "int count_ = 0; wxLuaSmartIntArray ptr; int*" --- 3077,3097 ---- end ! -- our special notation to get wxString/IntArray from a lua table of strings ! -- BUT! it has to be const wxArrayString& arr or wxArrayString arr ! -- and NOT wxArrayString& arr or wxArrayString* arr ! if ((argType == "wxArrayString") and ! ((indirectionCount == 0) or ! ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then ! overload_argList = overload_argList.."&s_wxluatag_wxArrayString, " argItem = "wxArrayString(); wxlState.GetwxArrayString("..argNum..", "..argName..")" declare = "wxArrayString " ! elseif ((argType == "wxArrayInt") and ! ((indirectionCount == 0) or ! ((indirectionCount == 1) and (argPtr == "&") and string.find(argTypeWithAttrib, "const", 1, 1)))) then ! overload_argList = overload_argList.."&s_wxluatag_wxArrayInt, " argItem = "wxArrayInt(); wxlState.GetwxArrayInt("..argNum..", "..argName..")" declare = "wxArrayInt " elseif argType == "IntArray_FromLuaTable" then ! overload_argList = overload_argList.."&s_wxluatag_wxArrayString, " argItem = "NULL; ptr = "..argName.." = wxlState.GetIntArray("..argNum..", count_)" declare = "int count_ = 0; wxLuaSmartIntArray ptr; int*" |
From: John L. <jr...@us...> - 2007-06-11 03:58:31
|
Update of /cvsroot/wxlua/wxLua/bindings/wxluasocket In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/bindings/wxluasocket Modified Files: wxluasocket.i Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: wxluasocket.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxluasocket/wxluasocket.i,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxluasocket.i 31 May 2007 17:18:45 -0000 1.10 --- wxluasocket.i 11 Jun 2007 03:57:58 -0000 1.11 *************** *** 57,70 **** %class %delete wxLuaDebuggerEvent, wxEvent ! %define_event wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED ! %define_event wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED ! %define_event wxEVT_WXLUA_DEBUGGER_BREAK ! %define_event wxEVT_WXLUA_DEBUGGER_PRINT ! %define_event wxEVT_WXLUA_DEBUGGER_ERROR ! %define_event wxEVT_WXLUA_DEBUGGER_EXIT ! %define_event wxEVT_WXLUA_DEBUGGER_STACK_ENUM ! %define_event wxEVT_WXLUA_DEBUGGER_STACK_ENTRY_ENUM ! %define_event wxEVT_WXLUA_DEBUGGER_TABLE_ENUM ! %define_event wxEVT_WXLUA_DEBUGGER_EVALUATE_EXPR int GetLineNumber() const --- 57,70 ---- %class %delete wxLuaDebuggerEvent, wxEvent ! %define_event wxEVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED // EVT_WXLUA_DEBUGGER_DEBUGGEE_CONNECTED(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED // EVT_WXLUA_DEBUGGER_DEBUGGEE_DISCONNECTED(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_BREAK // EVT_WXLUA_DEBUGGER_BREAK(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_PRINT // EVT_WXLUA_DEBUGGER_PRINT(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_ERROR // EVT_WXLUA_DEBUGGER_ERROR(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_EXIT // EVT_WXLUA_DEBUGGER_EXIT(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_STACK_ENUM // EVT_WXLUA_DEBUGGER_STACK_ENUM(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_STACK_ENTRY_ENUM // EVT_WXLUA_DEBUGGER_STACK_ENTRY_ENUM(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_TABLE_ENUM // EVT_WXLUA_DEBUGGER_TABLE_ENUM(id, fn) ! %define_event wxEVT_WXLUA_DEBUGGER_EVALUATE_EXPR // EVT_WXLUA_DEBUGGER_EVALUATE_EXPR(id, fn) int GetLineNumber() const |
From: John L. <jr...@us...> - 2007-06-11 03:58:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv19140/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlcallb.cpp wxlstate.cpp Log Message: Remove wxArrayString_FromLuaTable and wxArrayInt_FromLuaTable binding tag since we convert from wxArrayInt/String automatically Fix listctrl sorting Fix validator code using wxLuaObject Rename wxLuaState::LuaCall to LuaPCall since that what it calls Lots more cleanup and shuffling of code to more appropriate places Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -C2 -d -r1.105 -r1.106 *** wxlstate.cpp 8 Jun 2007 22:50:17 -0000 1.105 --- wxlstate.cpp 11 Jun 2007 03:58:10 -0000 1.106 *************** *** 441,445 **** return true; } ! return false; } --- 441,445 ---- return true; } ! return false; } *************** *** 470,473 **** --- 470,545 ---- } + const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, int class_tag) + { + // note: wxlua_tget doesn't leave anything on the stack on failure + if (wxlua_tget(L, class_tag) && lua_istable(L, -1)) + { + // t[class_tag] = { ["wxLuaBindClass"] = lightuserdata wxLuaBindClass... (or nil if not a class tag) + lua_pushstring(L, "wxLuaBindClass"); + lua_rawget(L, -2); + const wxLuaBindClass* wxlClass = (wxLuaBindClass *)lua_touserdata(L, -1); // actually lightuserdata + + lua_pop(L, 2); // pop wxLuaReferences table and lightuserdata (or nil if none) + + return wxlClass; + } + + return NULL; + } + + const wxLuaBindClass* LUACALL wxlua_tgetclass(lua_State* L, const char* class_name) + { + wxlua_pushstring_wxLuaClasses(L); + lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) + + lua_pushstring(L, class_name); // t["class_name"] = lightuserdata wxLuaBindClass (or nil if not a class tag) + lua_rawget(L, -2); + const wxLuaBindClass* wxlClass = (wxLuaBindClass *)lua_touserdata(L, -1); // actually lightuserdata + + lua_pop(L, 2); // pop wxLuaClasses table and lightuserdata + + return wxlClass; + } + + int LUACALL wxlua_isderivedclass(lua_State* L, int class_tag, int base_class_tag) + { + if (class_tag == base_class_tag) + return 0; + + const wxLuaBindClass *wxlClass = wxlua_tgetclass(L, class_tag); + + int levels = 1; + + while (wxlClass != NULL) // check level by level + { + if (wxlClass->baseclass && (*wxlClass->baseclass->class_tag == base_class_tag)) + return levels; + + wxlClass = wxlClass->baseclass; + levels++; + } + + return -1; + } + + int LUACALL wxlua_isderivedclass(const wxLuaBindClass* wxlClass, const wxLuaBindClass* wxlBaseClass) + { + if ((wxlClass == NULL) || (wxlBaseClass == NULL)) + return -1; + + const wxLuaBindClass* c = wxlClass; + int levels = 0; + while (c != NULL) + { + if (c->class_tag == wxlBaseClass->class_tag) + return levels; + + c = c->baseclass; + levels++; + } + + return -1; + } + int LUACALL wxlua_iswxluatype(int luatype, int wxluaarg_tag) { *************** *** 644,702 **** } - wxString* LUACALL wxlua_getwxStringarray(lua_State *L, int stack_idx, int &count) - { - wxString *strArray = NULL; - wxArrayString wxarrString; - count = 0; - - if (wxlua_getwxArrayString(L, stack_idx, wxarrString) > 0) - { - count = (int)wxarrString.GetCount(); - strArray = new wxString[count]; - for (int idx = 0; idx < count; idx++) - strArray[idx] = wxarrString[idx]; - } - - return strArray; - } - int LUACALL wxlua_getwxArrayString(lua_State* L, int stack_idx, wxArrayString& wxarrString) - { - int count = 0; - - if (lua_istable(L, stack_idx)) - { - while(1) - { - lua_rawgeti(L, stack_idx, count+1); - - if (lua_isnil(L, -1)) - { - lua_pop(L, 1); - break; - } - else if (!wxlua_isstringtype(L, -1)) - { - wxString msg(wxString::Format(_("wxLua: Expected a table of strings for parameter %d, but table index %d is '%s'."), - stack_idx, count+1, lua2wx(lua_typename(L, lua_type(L, -1))).c_str())); - wxlua_terror(L, wx2lua(msg)); - return count; - } - - const char *pString = lua_tostring(L, -1); - wxarrString.Add(lua2wx(pString)); - ++count; - - lua_pop(L, 1); - } - } - else - { - wxString msg(wxString::Format(_("wxLua: Expected a table of strings for parameter %d, but got '%s'."), - stack_idx, lua2wx(lua_typename(L, lua_type(L, stack_idx))).c_str())); - wxlua_terror(L, wx2lua(msg)); - } - - return count; - } const char** LUACALL wxlua_getchararray(lua_State *L, int stack_idx, int &count) { --- 716,719 ---- *************** *** 724,783 **** return pItems; } - int * LUACALL wxlua_getintarray(lua_State *L, int stack_idx, int &count) - { - int *intArray = NULL; - wxArrayInt wxarrInt; - count = 0; - - if (wxlua_getwxArrayInt(L, stack_idx, wxarrInt) > 0) - { - count = (int)wxarrInt.GetCount(); - intArray = new int[count]; - for (int idx = 0; idx < count; idx++) - intArray[idx] = wxarrInt[idx]; - } - - return intArray; - } - - int LUACALL wxlua_getwxArrayInt(lua_State *L, int stack_idx, wxArrayInt &wxarrInt) - { - int count = 0; - - if (lua_istable(L, stack_idx)) - { - while(1) - { - lua_rawgeti(L, stack_idx, count+1); - - if (lua_isnil(L, -1)) - { - lua_pop(L, 1); - break; - } - else if (!wxlua_isnumbertype(L, -1)) - { - wxString msg(wxString::Format(_("wxLua: Expected a table of integers for parameter %d, but table index %d is '%s'."), - stack_idx, count+1, lua2wx(lua_typename(L, lua_type(L, -1))).c_str())); - wxlua_terror(L, wx2lua(msg)); - return count; - } - - int iValue = (int)lua_tonumber(L, -1); - wxarrInt.Add(iValue); - ++count; - - lua_pop(L, 1); - } - } - else - { - wxString msg(wxString::Format(_("wxLua: Expected a table of integers for parameter %d, but got '%s'."), - stack_idx, lua2wx(lua_typename(L, lua_type(L, stack_idx))).c_str())); - wxlua_terror(L, wx2lua(msg)); - } - - return count; - } int LUACALL wxlua_pushwxArrayStringtable(lua_State *L, const wxArrayString &strArray) --- 741,744 ---- *************** *** 1156,1160 **** // try to get the state we've stored ! lua_pushstring( L, "__wxLuaStateRefData" ); lua_rawget( L, LUA_REGISTRYINDEX ); --- 1117,1121 ---- // try to get the state we've stored ! wxlua_pushstring_wxLuaStateRefData(L); lua_rawget( L, LUA_REGISTRYINDEX ); *************** *** 1212,1216 **** // Stick us into the lua_State - push key, value ! lua_pushstring( L, "__wxLuaStateRefData" ); lua_pushlightuserdata( L, (void*)m_refData ); // set the value --- 1173,1177 ---- // Stick us into the lua_State - push key, value ! wxlua_pushstring_wxLuaStateRefData(L); lua_pushlightuserdata( L, (void*)m_refData ); // set the value *************** *** 1218,1222 **** // Create a table for overridden functions for C++ objects ! lua_pushstring( L, "__wxLuaDerivedFunctions" ); lua_newtable(L); // set the value --- 1179,1183 ---- // Create a table for overridden functions for C++ objects ! wxlua_pushstring_wxLuaDerivedFunctions(L); lua_newtable(L); // set the value *************** *** 1261,1265 **** // Stick us into the lua_State - push key, value ! lua_pushstring( L, "__wxLuaStateRefData" ); lua_pushlightuserdata( L, (void*)m_refData ); // set the value --- 1222,1226 ---- // Stick us into the lua_State - push key, value ! wxlua_pushstring_wxLuaStateRefData(L); lua_pushlightuserdata( L, (void*)m_refData ); // set the value *************** *** 1267,1271 **** // Create a table for overridden functions for C++ objects ! lua_pushstring( L, "__wxLuaDerivedFunctions" ); lua_newtable(L); // set the value --- 1228,1232 ---- // Create a table for overridden functions for C++ objects ! wxlua_pushstring_wxLuaDerivedFunctions(L); lua_newtable(L); // set the value *************** *** 1432,1436 **** if (status == 0) { ! status = LuaCall(0, 0); //status = lua_pcall(L, 0, LUA_MULTRET, 0); // call main } --- 1393,1397 ---- if (status == 0) { ! status = LuaPCall(0, 0); //status = lua_pcall(L, 0, LUA_MULTRET, 0); // call main } *************** *** 1467,1471 **** if (status == 0) { ! status = LuaCall(0, 0); //status = lua_pcall(L, 0, LUA_MULTRET, 0); // call main } --- 1428,1432 ---- if (status == 0) { ! status = LuaPCall(0, 0); //status = lua_pcall(L, 0, LUA_MULTRET, 0); // call main } *************** *** 1523,1527 **** } ! int wxLuaState::LuaCall(int narg, int clear) { wxCHECK_MSG(Ok(), LUA_ERRRUN, wxT("Invalid wxLuaState")); --- 1484,1488 ---- } ! int wxLuaState::LuaPCall(int narg, int nresults) { wxCHECK_MSG(Ok(), LUA_ERRRUN, wxT("Invalid wxLuaState")); *************** *** 1538,1542 **** lua_insert(L, base); // put it under chunk and args ! status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); lua_remove(L, base); // remove traceback function --- 1499,1503 ---- lua_insert(L, base); // put it under chunk and args ! status = lua_pcall(L, narg, nresults, base); lua_remove(L, base); // remove traceback function *************** *** 1825,1843 **** const wxLuaBindClass* wxLuaState::GetLuaClass(int class_tag) const { ! wxCHECK_MSG(GetRefData() != NULL, NULL, wxT("Invalid wxLuaState")); lua_State* L = M_WXLSTATEDATA->m_lua_State; ! if (wxlua_tget(L, class_tag) && lua_istable(L, -1)) ! { ! lua_pushstring(L, "wxLuaBindClass"); // t[class_tag] = { __gc = wxLuaBindClass (or nil if not a class tag) ! lua_rawget(L, -2); ! const wxLuaBindClass* wxlClass = (wxLuaBindClass *)lua_touserdata(L, -1); // actually lightuserdata ! ! lua_pop(L, 2); // pop wxLuaReferences table and lightuserdata (or nil if none) ! ! return wxlClass; ! } ! else { // we shouldn't ever need this code --- 1786,1795 ---- const wxLuaBindClass* wxLuaState::GetLuaClass(int class_tag) const { ! wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); lua_State* L = M_WXLSTATEDATA->m_lua_State; + const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, class_tag); ! if (wxlClass == NULL) { // we shouldn't ever need this code *************** *** 1846,1857 **** { wxLuaBinding* binding = node->GetData(); ! const wxLuaBindClass *wxlClass = binding->GetLuaClass(class_tag); ! ! if (wxlClass) ! return wxlClass; } } ! return NULL; } --- 1798,1808 ---- { wxLuaBinding* binding = node->GetData(); ! wxlClass = binding->GetLuaClass(class_tag); ! ! if (wxlClass) break; } } ! return wxlClass; } *************** *** 1861,1875 **** lua_State* L = M_WXLSTATEDATA->m_lua_State; ! ! wxlua_pushstring_wxLuaClasses(L); ! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the classes table) ! ! lua_pushstring(L, className); // t["className"] = wxLuaBindClass (or nil if not a class tag) ! lua_rawget(L, -2); ! const wxLuaBindClass* wxlClass = (wxLuaBindClass *)lua_touserdata(L, -1); // actually lightuserdata ! ! lua_pop(L, 2); // pop wxLuaClasses table and lightuserdata ! ! return wxlClass; } --- 1812,1816 ---- lua_State* L = M_WXLSTATEDATA->m_lua_State; ! return wxlua_tgetclass(L, className); } *************** *** 1903,1916 **** } ! bool wxLuaState::IsDerivedClass(int iClassTag, int iBaseClassTag) const { ! if (iClassTag == iBaseClassTag) ! return true; ! ! const wxLuaBindClass *pLuaClass = GetLuaClass(iClassTag); ! if (pLuaClass && pLuaClass->baseclass) ! return IsDerivedClass(*pLuaClass->baseclass->class_tag, iBaseClassTag); ! return false; } --- 1844,1853 ---- } ! int wxLuaState::IsDerivedClass(int iClassTag, int iBaseClassTag) const { ! wxCHECK_MSG(Ok(), -1, wxT("Invalid wxLuaState")); ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! return wxlua_isderivedclass(L, iClassTag, iBaseClassTag); } *************** *** 1989,1993 **** wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! // Find the wxWindow tag once and store it for later use if (M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_wxString == 0) { --- 1926,1930 ---- wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! // Find the wxString tag once and store it for later use if (M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_wxString == 0) { *************** *** 2211,2214 **** --- 2148,2177 ---- // wxLua get data type + int wxLuaState::IswxLuaType(int luatype, int wxluaarg_tag) const + { + wxCHECK_MSG(Ok(), -1, wxT("Invalid wxLuaState")); + + int ok = wxlua_iswxluatype(luatype, wxluaarg_tag); + + // if we don't know the type (it's not predefined) + if (ok < 0) + { + if (luatype == LUA_TTABLE) + { + lua_State* L = M_WXLSTATEDATA->m_lua_State; + + const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, "wxArrayString"); + if (wxlClass && IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag)) + return 1; + + wxlClass = wxlua_tgetclass(L, "wxArrayInt"); + if (wxlClass && IsDerivedClass(wxluaarg_tag, *wxlClass->class_tag)) + return 1; + } + } + + return ok; + } + bool wxLuaState::IsUserDataType(int stack_idx, int tag) const { *************** *** 2219,2225 **** { int stack_tag = ttag(stack_idx); ! if ((M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_NULL == stack_tag) || // FIXME ! (M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_wxLuaFunction == stack_tag) || ! IsDerivedClass(stack_tag, tag)) return true; } --- 2182,2189 ---- { int stack_tag = ttag(stack_idx); ! if ((GetLuaNULLTag() == stack_tag) || // FIXME ! (GetwxLuaFunctionTag() == stack_tag) || ! ((tag == WXLUAARG_String) && (IsDerivedClass(stack_tag, GetwxStringTag()) >= 0)) || ! (IsDerivedClass(stack_tag, tag) >= 0)) return true; } *************** *** 2244,2248 **** else if (M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_NULL == stack_tag) return NULL; ! else if (IsDerivedClass(stack_tag, tag)) return ttouserdata(stack_idx); } --- 2208,2212 ---- else if (M_WXLSTATEDATA->m_wxlStateData->m_wxluatag_NULL == stack_tag) return NULL; ! else if (IsDerivedClass(stack_tag, tag) >= 0) return ttouserdata(stack_idx); } *************** *** 2262,2266 **** // if the object we are referencing is derived from wxWindow ! if (IsDerivedClass(tag, GetwxWindowTag())) // s_wxluatag_wxWindow { wxWindow* win = wxDynamicCast(data, wxWindow); --- 2226,2230 ---- // if the object we are referencing is derived from wxWindow ! if (IsDerivedClass(tag, GetwxWindowTag()) >= 0) { wxWindow* win = wxDynamicCast(data, wxWindow); *************** *** 2325,2329 **** int stack_tag = wxlua_ttag(L, stack_idx); ! if (IsDerivedClass(stack_tag, GetwxStringTag())) { wxString* wxstr = (wxString*)wxlua_ttouserdata(L, stack_idx, false); --- 2289,2293 ---- int stack_tag = wxlua_ttag(L, stack_idx); ! if (IsDerivedClass(stack_tag, GetwxStringTag()) >= 0) { wxString* wxstr = (wxString*)wxlua_ttouserdata(L, stack_idx, false); *************** *** 2357,2361 **** { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! return wxlua_isstringtype(M_WXLSTATEDATA->m_lua_State, stack_idx); } bool wxLuaState::IsBooleanType(int stack_idx) const --- 2321,2337 ---- { wxCHECK_MSG(Ok(), false, wxT("Invalid wxLuaState")); ! ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! ! if (!wxlua_isstringtype(M_WXLSTATEDATA->m_lua_State, stack_idx)) ! { ! if (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) ! { ! int stack_tag = wxlua_ttag(L, stack_idx); ! return (IsDerivedClass(stack_tag, GetwxStringTag()) >= 0); ! } ! } ! ! return true; } bool wxLuaState::IsBooleanType(int stack_idx) const *************** *** 2377,2388 **** wxString* wxLuaState::GetStringArray(int stack_idx, int &count) { ! wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return wxlua_getwxStringarray(M_WXLSTATEDATA->m_lua_State, stack_idx, count); } ! int wxLuaState::GetwxArrayString(int stack_idx, wxArrayString &strArray) { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return wxlua_getwxArrayString(M_WXLSTATEDATA->m_lua_State, stack_idx, strArray); } --- 2353,2432 ---- wxString* wxLuaState::GetStringArray(int stack_idx, int &count) { ! // GetwxArrayString will error out if !Ok() and we'll return NULL ! wxString *strArray = NULL; ! wxArrayString wxarrString; ! count = 0; ! ! if (GetwxArrayString(stack_idx, wxarrString) > 0) ! { ! count = (int)wxarrString.GetCount(); ! strArray = new wxString[count]; ! for (int idx = 0; idx < count; idx++) ! strArray[idx] = wxarrString[idx]; ! } ! ! return strArray; } ! int wxLuaState::GetwxArrayString(int stack_idx, wxArrayString &wxarrString) { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! int count = -1; ! ! if (lua_istable(L, stack_idx)) ! { ! count = 0; ! ! while(1) ! { ! lua_rawgeti(L, stack_idx, count+1); ! ! if (lua_isnil(L, -1)) ! { ! lua_pop(L, 1); ! break; ! } ! else if (!IsStringType(-1)) ! { ! wxString msg(wxString::Format(_("wxLua: Expected a table of strings for parameter %d, but table index %d is '%s'."), ! stack_idx, count+1, lua2wx(lua_typename(L, lua_type(L, -1))).c_str())); ! terror(msg); ! return count; ! } ! ! wxarrString.Add(GetwxStringType(-1)); ! ++count; ! ! lua_pop(L, 1); ! } ! } ! else if (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) ! { ! int class_tag = wxlua_ttag(L, stack_idx); ! const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, class_tag); ! const wxLuaBindClass* arrStrClass = wxlua_tgetclass(L, "wxArrayString"); ! ! if (wxlua_isderivedclass(wxlClass, arrStrClass) >= 0) ! { ! wxLuaState wxlState(L); ! wxArrayString *arrStr = (wxArrayString *)wxlState.GetUserDataType(stack_idx, *arrStrClass->class_tag); ! if (arrStr) ! { ! count = arrStr->GetCount(); ! wxarrString = *arrStr; ! } ! } ! } ! ! if (count < 0) ! { ! wxString msg(wxString::Format(_("wxLua: Expected a wxArrayString or table of strings for parameter %d, but got '%s'."), ! stack_idx, lua2wx(lua_typename(L, lua_type(L, stack_idx))).c_str())); ! terror(msg); ! } ! ! return count; } *************** *** 2407,2418 **** int* wxLuaState::GetIntArray(int stack_idx, int &count) { ! wxCHECK_MSG(Ok(), NULL, wxT("Invalid wxLuaState")); ! return wxlua_getintarray(M_WXLSTATEDATA->m_lua_State, stack_idx, count); } ! int wxLuaState::GetwxArrayInt(int stack_idx, wxArrayInt &intArray) { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! return wxlua_getwxArrayInt(M_WXLSTATEDATA->m_lua_State, stack_idx, intArray); } --- 2451,2531 ---- int* wxLuaState::GetIntArray(int stack_idx, int &count) { ! // GetwxArrayInt will error out if !Ok() and we'll return NULL ! int *intArray = NULL; ! wxArrayInt wxarrInt; ! count = 0; ! ! if (GetwxArrayInt(stack_idx, wxarrInt) > 0) ! { ! count = (int)wxarrInt.GetCount(); ! intArray = new int[count]; ! for (int idx = 0; idx < count; idx++) ! intArray[idx] = wxarrInt[idx]; ! } ! ! return intArray; } ! int wxLuaState::GetwxArrayInt(int stack_idx, wxArrayInt &wxarrInt) { wxCHECK_MSG(Ok(), 0, wxT("Invalid wxLuaState")); ! ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! int count = -1; ! ! if (lua_istable(L, stack_idx)) ! { ! count = 0; ! ! while(1) ! { ! lua_rawgeti(L, stack_idx, count+1); ! ! if (lua_isnil(L, -1)) ! { ! lua_pop(L, 1); ! break; ! } ! else if (!wxlua_isnumbertype(L, -1)) ! { ! wxString msg(wxString::Format(_("wxLua: Expected a table of integers for parameter %d, but table index %d is '%s'."), ! stack_idx, count+1, lua2wx(lua_typename(L, lua_type(L, -1))).c_str())); ! terror(msg); ! return count; ! } ! ! int iValue = (int)lua_tonumber(L, -1); ! wxarrInt.Add(iValue); ! ++count; ! ! lua_pop(L, 1); ! } ! } ! else if (lua_isuserdata(L, stack_idx) && !lua_islightuserdata(L, stack_idx)) ! { ! int class_tag = wxlua_ttag(L, stack_idx); ! const wxLuaBindClass* wxlClass = wxlua_tgetclass(L, class_tag); ! const wxLuaBindClass* arrIntClass = wxlua_tgetclass(L, "wxArrayInt"); ! ! if (wxlua_isderivedclass(wxlClass, arrIntClass) >= 0) ! { ! wxLuaState wxlState(L); ! wxArrayInt *arrInt = (wxArrayInt *)wxlState.GetUserDataType(stack_idx, *arrIntClass->class_tag); ! if (arrInt) ! { ! count = arrInt->GetCount(); ! wxarrInt = *arrInt; ! } ! } ! } ! ! if (count < 0) ! { ! wxString msg(wxString::Format(_("wxLua: Expected a wxArrayInt or a table of integers for parameter %d, but got '%s'."), ! stack_idx, lua2wx(lua_typename(L, lua_type(L, stack_idx))).c_str())); ! terror(msg); ! } ! ! return count; } *************** *** 2436,2512 **** } ! wxLuaBindMethod* wxLuaState::GetLuaMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses) { ! wxCHECK_MSG(wxlClass, NULL, wxT("Invalid wxLuaBindClass to find method from.")); ! ! int i_method, method_count = wxlClass->methods_n; ! // find a method in the class, recurse through classes from which this class is derived. ! for (i_method = 0; i_method < method_count; ++i_method) ! { ! wxLuaBindMethod *wxlMethod = wxlClass->methods + i_method; ! if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD | WXLUAMETHOD_GETPROP) ! && (strcmp(wxlMethod->name, methodName) == 0)) ! { ! // iterate through the base classes to find if this function is ! // an overload, but only if we haven't checked already. ! if (!WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_OVERLOAD_BASE)) ! { ! wxLuaBindClass *baseClass = wxlClass->baseclass; ! wxLuaBindMethod *parentMethod = wxlMethod; ! while (baseClass) ! { ! parentMethod->type |= WXLUAMETHOD_OVERLOAD_BASE; // have checked this ! wxLuaBindMethod* baseMethod = GetLuaMethod(baseClass, methodName, false); ! if (baseMethod) ! { ! parentMethod->basemethod = baseMethod; ! parentMethod = baseMethod; ! // we have already checked the base classes below this ! if (WXLUA_HASBIT(baseMethod->type, WXLUAMETHOD_OVERLOAD_BASE)) ! break; ! } ! baseClass = baseClass->baseclass; ! } ! } ! return wxlMethod; ! } } ! if (search_baseclasses && wxlClass->baseclass) ! return GetLuaMethod(wxlClass->baseclass, methodName); ! ! return NULL; ! } ! ! wxLuaBindMethod* wxLuaState::GetLuaProperty(const wxLuaBindClass *wxlClass, const char *propName, bool isLuaSetProp) ! { ! wxCHECK_MSG(wxlClass, NULL, wxT("Invalid wxLuaBindClass in wxLuaState::GetLuaProperty")); ! int i_method, method_count = wxlClass->methods_n; ! // find a method in the class, recurse through classes from which this class is derived. ! for (i_method = 0; i_method < method_count; ++i_method) { ! wxLuaBindMethod *wxlMethod = wxlClass->methods + i_method; ! if (isLuaSetProp) ! { ! if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_SETPROP) && (strcmp(wxlMethod->name, propName) == 0)) ! return wxlMethod; ! } ! else ! { ! if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_GETPROP) && (strcmp(wxlMethod->name, propName) == 0)) ! return wxlMethod; ! } } ! if (wxlClass->baseclass) ! return GetLuaProperty(wxlClass->baseclass, propName, isLuaSetProp); ! return NULL; } --- 2549,2597 ---- } ! bool wxLuaState::SetDerivedMethod(void *pObject, const char *name, wxLuaObject* wxlObj) { ! wxCHECK_MSG(Ok() && pObject, false, wxT("Invalid wxLuaState or object to set derived method for.")); ! lua_State* L = M_WXLSTATEDATA->m_lua_State; ! wxlua_pushstring_wxLuaDerivedFunctions(L); ! lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table ! lua_pushlightuserdata(L, (void *)pObject); ! lua_rawget(L, -2); // pop key, push table or nil ! if (!lua_istable(L, -1)) ! { ! lua_pop(L, 1); // pop nil value ! // add new table for this object ! lua_pushlightuserdata(L, (void *)pObject); ! lua_newtable(L); ! lua_rawset(L, -3); ! // put the new table back on the top of the stack ! lua_pushlightuserdata(L, (void *)pObject); ! lua_rawget(L, -2); } ! // see if there already is a method ! lua_pushstring( L, name ); ! lua_rawget(L, -2); ! if (lua_islightuserdata(L, -1)) { ! // already have a method, delete it before replacing it ! wxLuaObject* o = (wxLuaObject*)lua_touserdata( L, -1 ); ! delete o; } ! lua_pop(L, 1); // pop the deleted old object, or nil ! lua_pushstring( L, name ); ! lua_pushlightuserdata(L, (void*)wxlObj); ! lua_rawset(L, -3); ! ! lua_pop(L, 2); // pop the object and overridden function table ! ! return true; } *************** *** 2519,2523 **** bool found = false; ! lua_pushstring( L, "__wxLuaDerivedFunctions" ); lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table --- 2604,2608 ---- bool found = false; ! wxlua_pushstring_wxLuaDerivedFunctions(L); lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table *************** *** 2549,2552 **** --- 2634,2681 ---- } + bool wxLuaState::RemoveDerivedMethod(void *pObject) const + { + wxCHECK_MSG(Ok() && pObject, false, wxT("Invalid wxLuaState or object to remove.")); + + lua_State* L = M_WXLSTATEDATA->m_lua_State; + bool found = false; + + wxlua_pushstring_wxLuaDerivedFunctions(L); + lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table + + lua_pushlightuserdata(L, (void *)pObject); + lua_rawget(L, -2); // pop key, push table or nil + if (lua_istable(L, -1)) + { + found = true; + int t = lua_gettop(L); + lua_pushnil(L); /* first key */ + while (lua_next(L, t) != 0) + { + // uses 'key' (at index -2) and 'value' (at index -1) + //wxPrintf(wxT("%s - %s\n"), lua2wx(lua_tostring(L, -2)).c_str(), lua2wx(lua_typename(L, lua_type(L, -1))).c_str()); + + if (lua_islightuserdata(L, -1)) + { + wxLuaObject* o = (wxLuaObject*)lua_touserdata(L, -1); + delete o; + } + + // removes 'value'; keeps 'key' for next iteration + lua_pop(L, 1); + } + + lua_pop(L, 1); // pop the obj table + lua_pushlightuserdata(L, (void *)pObject); + lua_pushnil(L); + lua_rawset(L, -3); // nil the obj table + lua_pop(L, 1); // pop reg table + } + else + lua_pop(L, 2); // pop the reg table and nil for the obj table + + return found; + } + wxLuaState wxLuaState::GetDerivedMethodState(void *pObject, const char *method) { *************** *** 3431,3438 **** // Does the lua type match the wxlua arg tag type ! int is_ok = wxlua_iswxluatype(ltype, tag); ! // unknown standard wxlua arg type, check binding tag ! if (is_ok == -1) { is_ok = (IsUserDataType(arg_lua, tag) || --- 3560,3567 ---- // Does the lua type match the wxlua arg tag type ! int is_ok = IswxLuaType(ltype, tag); ! // unknown/invalid standard wxlua arg type, check binding tag ! if ((is_ok == -1) || ((is_ok == 0) && (tag == WXLUAARG_String))) { is_ok = (IsUserDataType(arg_lua, tag) || Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** wxlbind.cpp 8 Jun 2007 22:50:17 -0000 1.68 --- wxlbind.cpp 11 Jun 2007 03:58:10 -0000 1.69 *************** *** 77,83 **** (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { ! wxLuaFunction *pFunction = (wxLuaFunction *)wxlState.ttouserdata(1, true); ! if (pFunction != NULL) ! delete pFunction; } return 0; --- 77,83 ---- (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { ! wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, true); ! if (wxlFunction != NULL) ! delete wxlFunction; } return 0; *************** *** 93,104 **** (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { ! wxLuaFunction *pFunction = (wxLuaFunction *)wxlState.ttouserdata(1, false); // remove the userdata *this from the stack // can't do this for static and nonstatic overloaded functions ! //if (pFunction->m_wxlMethod && WXLUA_HASBIT(pFunction->m_wxlMethod->type, WXLUAMETHOD_STATIC)) // lua_remove(L, 1); ! return pFunction->CallMethod(L); } return 0; --- 93,104 ---- (wxlState.ttag(1) == wxlState.GetwxLuaFunctionTag())) { ! wxLuaFunction *wxlFunction = (wxLuaFunction *)wxlState.ttouserdata(1, false); // remove the userdata *this from the stack // can't do this for static and nonstatic overloaded functions ! //if (wxlFunction->m_wxlMethod && WXLUA_HASBIT(wxlFunction->m_wxlMethod->type, WXLUAMETHOD_STATIC)) // lua_remove(L, 1); ! return wxlFunction->CallMethod(L); } return 0; *************** *** 110,119 **** IMPLEMENT_ABSTRACT_CLASS(wxLuaObject, wxObject) ! wxLuaObject::wxLuaObject(const wxLuaState& wxlState, int iParam) : m_wxlState(new wxLuaState(wxlState)), m_bool(false), m_int(0), m_alloc_flags(wxLUAOBJECT_NONE) { ! // set up the reference ! m_iReference = m_wxlState->tinsert(iParam); } --- 110,119 ---- IMPLEMENT_ABSTRACT_CLASS(wxLuaObject, wxObject) ! wxLuaObject::wxLuaObject(const wxLuaState& wxlState, int stack_idx) : m_wxlState(new wxLuaState(wxlState)), m_bool(false), m_int(0), m_alloc_flags(wxLUAOBJECT_NONE) { ! // set up the reference to the item on the stack ! m_iReference = m_wxlState->tinsert(stack_idx); } *************** *** 149,153 **** if (HasAllocationFlag(wxLUAOBJECT_BOOL)) { ! lua_pushnumber(L, m_bool); return true; } --- 149,153 ---- if (HasAllocationFlag(wxLUAOBJECT_BOOL)) { ! lua_pushboolean(L, m_bool); return true; } *************** *** 164,186 **** else if (HasAllocationFlag(wxLUAOBJECT_ARRAYINT)) { ! lua_newtable(L); ! ! size_t idx, count = m_arrayInt.GetCount(); ! for (idx = 0; idx < count; ++idx) ! { ! lua_pushnumber(L, m_arrayInt.Item(idx)); ! lua_rawseti(L, -2, idx); ! } return true; } ! ! if (m_wxlState->tget(m_iReference)) return true; ! lua_pushnil(L); // oops, put something on the stack ! return false; } ! void wxLuaObject::SetObject(int iParam) { wxCHECK_RET(m_wxlState->Ok(), wxT("Invalid wxLuaState")); --- 164,177 ---- else if (HasAllocationFlag(wxLUAOBJECT_ARRAYINT)) { ! wxlua_pushwxArrayInttable(L, m_arrayInt); return true; } ! else if (m_wxlState->tget(m_iReference)) return true; ! return false; // nothing on the stack } ! void wxLuaObject::SetObject(int stack_idx) { wxCHECK_RET(m_wxlState->Ok(), wxT("Invalid wxLuaState")); *************** *** 191,195 **** if (m_wxlState->Ok()) ! m_iReference = m_wxlState->tinsert(iParam); } --- 182,186 ---- if (m_wxlState->Ok()) ! m_iReference = m_wxlState->tinsert(stack_idx); } *************** *** 199,204 **** if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { ! m_bool = (lua_tonumber(m_wxlState->GetLuaState(), -1) != 0); m_alloc_flags |= wxLUAOBJECT_BOOL; } return &m_bool; --- 190,196 ---- if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { ! m_bool = (lua_toboolean(m_wxlState->GetLuaState(), -1) != 0); m_alloc_flags |= wxLUAOBJECT_BOOL; + m_wxlState->lua_Pop(1); } return &m_bool; *************** *** 212,215 **** --- 204,208 ---- m_int = (int) lua_tonumber(m_wxlState->GetLuaState(), -1); m_alloc_flags |= wxLUAOBJECT_INT; + m_wxlState->lua_Pop(1); } return &m_int; *************** *** 223,227 **** --- 216,222 ---- m_string = lua2wx(lua_tostring(m_wxlState->GetLuaState(), -1)); m_alloc_flags |= wxLUAOBJECT_STRING; + m_wxlState->lua_Pop(1); } + return &m_string; } *************** *** 232,249 **** if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { ! lua_State* L = m_wxlState->GetLuaState(); ! if (lua_istable(L, -1)) ! { ! int idx, nItems = luaL_getn(L, -1); ! for (idx = 1; idx <= nItems; ++idx) ! { ! lua_rawgeti(L, -1, idx); ! int iValue = (int) m_wxlState->GetNumberType(-1); ! m_arrayInt.Add(iValue); ! lua_pop(L, 1); ! } ! } ! lua_pop(L, 1); m_alloc_flags |= wxLUAOBJECT_ARRAYINT; } return &m_arrayInt; --- 227,233 ---- if (m_wxlState->Ok() && (m_iReference != LUA_NOREF) && GetObject()) { ! m_wxlState->GetwxArrayInt(-1, m_arrayInt); m_alloc_flags |= wxLUAOBJECT_ARRAYINT; + m_wxlState->lua_Pop(1); } return &m_arrayInt; *************** *** 284,320 **** //tracked = wxlState.RemoveTrackedObject((void*)key, true); // delete from m_pTrackedList ! ! lua_pushstring( L, "__wxLuaDerivedFunctions" ); ! lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table ! ! lua_pushlightuserdata(L, (void *)key); ! lua_rawget(L, -2); // pop key, push table or nil ! if (lua_istable(L, -1)) ! { ! int t = lua_gettop(L); ! lua_pushnil(L); /* first key */ ! while (lua_next(L, t) != 0) ! { ! // uses 'key' (at index -2) and 'value' (at index -1) ! //wxPrintf(wxT("%s - %s\n"), lua2wx(lua_tostring(L, -2)).c_str(), lua2wx(lua_typename(L, lua_type(L, -1))).c_str()); ! ! if (lua_islightuserdata(L, -1)) ! { ! wxLuaObject* o = (wxLuaObject*)lua_touserdata(L, -1); ! delete o; ! } ! ! // removes 'value'; keeps 'key' for next iteration ! lua_pop(L, 1); ! } ! ! lua_pop(L, 1); // pop the obj table ! lua_pushlightuserdata(L, (void *)key); ! lua_pushnil(L); ! lua_rawset(L, -3); // nil the obj table ! lua_pop(L, 1); // pop reg table ! } ! else ! lua_pop(L, 2); // pop the reg table and nil for the obj table } --- 268,272 ---- //tracked = wxlState.RemoveTrackedObject((void*)key, true); // delete from m_pTrackedList ! wxlState.RemoveDerivedMethod((void*)key); } *************** *** 390,394 **** if (!found) { ! wxLuaBindMethod* wxlMethod = wxlState.GetLuaMethod(wxlClass, name); if (wxlMethod != NULL) { --- 342,346 ---- if (!found) { ! wxLuaBindMethod* wxlMethod = wxLuaBinding::GetClassMethod(wxlClass, name); if (wxlMethod != NULL) { *************** *** 417,421 **** memcpy(str+3, name, len+1); // include terminating NULL ! wxlMethod = wxlState.GetLuaMethod(wxlClass, str); if ((wxlMethod != NULL) && WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD)) --- 369,373 ---- memcpy(str+3, name, len+1); // include terminating NULL ! wxlMethod = wxLuaBinding::GetClassMethod(wxlClass, str); if ((wxlMethod != NULL) && WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD)) *************** *** 468,472 **** { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods ! wxLuaBindMethod *wxlMethod = wxlState.GetLuaProperty(wxlClass, name, true); if (wxlMethod != NULL) { --- 420,424 ---- { // See if there is a WXLUAMETHOD_SETPROP in the wxLuaBindClass's wxLuaBindMethods ! wxLuaBindMethod *wxlMethod = wxLuaBinding::GetClassProperty(wxlClass, name, true); if (wxlMethod != NULL) { *************** *** 489,493 **** //stk.DumpStack(); ! wxlMethod = wxlState.GetLuaMethod(wxlClass, str); if ((wxlMethod != NULL) && WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD)) { --- 441,445 ---- //stk.DumpStack(); ! wxlMethod = wxLuaBinding::GetClassMethod(wxlClass, str); if ((wxlMethod != NULL) && WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD)) { *************** *** 502,543 **** void *pObject = wxlState.ttouserdata(1); wxLuaObject* wxlObj = new wxLuaObject(wxlState, 3); ! ! lua_pushstring( L, "__wxLuaDerivedFunctions" ); ! lua_rawget( L, LUA_REGISTRYINDEX ); // pop key, push table ! ! lua_pushlightuserdata(L, (void *)pObject); ! lua_rawget(L, -2); // pop key, push table or nil ! if (!lua_istable(L, -1)) ! { ! lua_pop(L, 1); // pop nil value ! ! // add new table for this object ! lua_pushlightuserdata(L, (void *)pObject); ! lua_newtable(L); ! lua_rawset(L, -3); ! ! // put the new table back on the top of the stack ! lua_pushlightuserdata(L, (void *)pObject); ! lua_rawget(L, -2); ! } ! ! // see if there already is a method ! lua_pushstring( L, name ); ! lua_rawget(L, -2); ! ! if (lua_islightuserdata(L, -1)) ! { ! // already have a method, delete it before replacing it ! wxLuaObject* o = (wxLuaObject*)lua_touserdata( L, -1 ); ! delete o; ! } ! ! lua_pop(L, 1); // pop the deleted old object, or nil ! ! lua_pushstring( L, name ); ! lua_pushlightuserdata(L, (void*)wxlObj); ! lua_rawset(L, -3); ! ! lua_pop(L, 2); // pop the object and overridden function table } } --- 454,458 ---- void *pObject = wxlState.ttouserdata(1); wxLuaObject* wxlObj = new wxLuaObject(wxlState, 3); ! wxlState.SetDerivedMethod(pObject, name, wxlObj); } } *************** *** 1063,1066 **** --- 978,1056 ---- } + wxLuaBindMethod* wxLuaBinding::GetClassMethod(const wxLuaBindClass *wxlClass, const char *methodName, bool search_baseclasses) + { + wxCHECK_MSG(wxlClass, NULL, wxT("Invalid wxLuaBindClass to find method from.")); + + int i_method, method_count = wxlClass->methods_n; + // find a method in the class, recurse through classes from which this class is derived. + for (i_method = 0; i_method < method_count; ++i_method) + { + wxLuaBindMethod *wxlMethod = wxlClass->methods + i_method; + if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_METHOD | WXLUAMETHOD_GETPROP) + && (strcmp(wxlMethod->name, methodName) == 0)) + { + // iterate through the base classes to find if this function is + // an overload, but only if we haven't checked already. + if (!WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_OVERLOAD_BASE)) + { + wxLuaBindClass *baseClass = wxlClass->baseclass; + wxLuaBindMethod *parentMethod = wxlMethod; + + while (baseClass) + { + parentMethod->type |= WXLUAMETHOD_OVERLOAD_BASE; // have checked this + + wxLuaBindMethod* baseMethod = GetClassMethod(baseClass, methodName, false); + if (baseMethod) + { + parentMethod->basemethod = baseMethod; + parentMethod = baseMethod; + + // we have already checked the base classes below this + if (WXLUA_HASBIT(baseMethod->type, WXLUAMETHOD_OVERLOAD_BASE)) + break; + } + + baseClass = baseClass->baseclass; + } + } + + return wxlMethod; + } + } + + if (search_baseclasses && wxlClass->baseclass) + return GetClassMethod(wxlClass->baseclass, methodName); + + return NULL; + } + + wxLuaBindMethod* wxLuaBinding::GetClassProperty(const wxLuaBindClass *wxlClass, const char *propName, bool isLuaSetProp) + { + wxCHECK_MSG(wxlClass, NULL, wxT("Invalid wxLuaBindClass in wxLuaState::GetClassProperty")); + + int i_method, method_count = wxlClass->methods_n; + // find a method in the class, recurse through classes from which this class is derived. + for (i_method = 0; i_method < method_count; ++i_method) + { + wxLuaBindMethod *wxlMethod = wxlClass->methods + i_method; + if (isLuaSetProp) + { + if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_SETPROP) && (strcmp(wxlMethod->name, propName) == 0)) + return wxlMethod; + } + else + { + if (WXLUA_HASBIT(wxlMethod->type, WXLUAMETHOD_GETPROP) && (strcmp(wxlMethod->name, propName) == 0)) + return wxlMethod; + } + } + + if (wxlClass->baseclass) + return GetClassProperty(wxlClass->baseclass, propName, isLuaSetProp); + + return NULL; + } + //----------------------------------------------------------------------------- // wxluabind_wxLuaBindCFunc_index *************** *** 1245,1249 **** { // Force the baseclass methods to be found ! wxlState.GetLuaMethod(wxlClass, wxlMethod->name, true); // Create table { wxLuaBindClass userdata } --- 1235,1239 ---- { // Force the baseclass methods to be found ! wxLuaBinding::GetClassMethod(wxlClass, wxlMethod->name, true); // Create table { wxLuaBindClass userdata } Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wxlcallb.cpp 6 Jun 2007 23:43:16 -0000 1.29 --- wxlcallb.cpp 11 Jun 2007 03:58:10 -0000 1.30 *************** *** 130,134 **** { wxlState.tpushusertag(pEvent, eventClassTag); ! wxlState.LuaCall(1, true); } else --- 130,134 ---- { wxlState.tpushusertag(pEvent, eventClassTag); ! wxlState.LuaPCall(1, 0); } else |