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...> - 2010-12-01 00:25:08
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv8979/src Modified Files: wxldebug.cpp Log Message: Unable to use wxstr.Printf("blah %s", wxstr.c_str()) in >= wx 2.8 anymore, use wxstr = wxString::Format("blah %s", wxstr.c_str()) instead. Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** wxldebug.cpp 23 Nov 2009 05:29:00 -0000 1.73 --- wxldebug.cpp 1 Dec 2010 00:25:00 -0000 1.74 *************** *** 416,429 **** wxWindow* win = (wxWindow*)lua_touserdata(L, -2); name += wxT(" ") + wxString(win->GetClassInfo()->GetClassName()); ! } else if (lightuserdata_reg_key == &wxlua_lreg_gcobjects_key) { int wxl_type_ = (int)lua_tonumber(L, -1); ! name.Printf(wxT("%s(%s)"), wxluaT_typename(L, wxl_type_).c_str(), name.c_str()); } else if (lightuserdata_reg_key == &wxlua_lreg_weakobjects_key) { wxString names_weak; ! // iterate the table of userdata lua_pushnil(L); --- 416,429 ---- wxWindow* win = (wxWindow*)lua_touserdata(L, -2); name += wxT(" ") + wxString(win->GetClassInfo()->GetClassName()); ! } else if (lightuserdata_reg_key == &wxlua_lreg_gcobjects_key) { int wxl_type_ = (int)lua_tonumber(L, -1); ! name = wxString::Format(wxT("%s(%s)"), wxluaT_typename(L, wxl_type_).c_str(), name.c_str()); } else if (lightuserdata_reg_key == &wxlua_lreg_weakobjects_key) { wxString names_weak; ! // iterate the table of userdata lua_pushnil(L); *************** *** 436,441 **** lua_pop(L, 1); // pop value, lua_next will pop key at end } ! ! name.Printf(wxT("%s (%s)"), names_weak.c_str(), name.c_str()); } } --- 436,441 ---- lua_pop(L, 1); // pop value, lua_next will pop key at end } ! ! name = wxString::Format(wxT("%s (%s)"), names_weak.c_str(), name.c_str()); } } |
From: John L. <jr...@us...> - 2010-11-24 07:18:45
|
Update of /cvsroot/wxlua/wxLua/apps/wxluafreeze/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv9537/src Modified Files: wxluafreeze.cpp Log Message: call CloseLuaState(true) in wxApp::OnExit() Index: wxluafreeze.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluafreeze/src/wxluafreeze.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** wxluafreeze.cpp 23 Nov 2010 04:28:48 -0000 1.19 --- wxluafreeze.cpp 24 Nov 2010 07:18:37 -0000 1.20 *************** *** 171,174 **** --- 171,177 ---- int wxLuaFreezeApp::OnExit() { + if (m_wxlState.Ok()) + m_wxlState.CloseLuaState(true); + return wxApp::OnExit(); } |
From: John L. <jr...@us...> - 2010-11-23 04:41:12
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv28816/wxLua/samples Modified Files: editor.wx.lua wxluasudoku.wx.lua Log Message: Ignore #! shebang at the beginning of Lua files for UNIX systems. Remove tabs in wxluasudoku Index: wxluasudoku.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/wxluasudoku.wx.lua,v retrieving revision 1.78 retrieving revision 1.79 diff -C2 -d -r1.78 -r1.79 *** wxluasudoku.wx.lua 14 May 2009 05:06:22 -0000 1.78 --- wxluasudoku.wx.lua 23 Nov 2010 04:41:04 -0000 1.79 *************** *** 1303,1311 **** --for k, v in pairs(possible) do -- use for loop to ensure direction ! local start_n = iff(backwards, 9, 1) local end_n = iff(backwards, 1, 9) local dir_n = iff(backwards, -1, 1) ! for n = start_n, end_n, dir_n do if possible[n] then --- 1303,1311 ---- --for k, v in pairs(possible) do -- use for loop to ensure direction ! local start_n = iff(backwards, 9, 1) local end_n = iff(backwards, 1, 9) local dir_n = iff(backwards, -1, 1) ! for n = start_n, end_n, dir_n do if possible[n] then *************** *** 2756,2760 **** printerDialog:ShowModal() sudokuGUI.printData = printerDialog:GetPrintDialogData():GetPrintData():Copy() ! --printerDialog:Destroy() end --- 2756,2760 ---- printerDialog:ShowModal() sudokuGUI.printData = printerDialog:GetPrintDialogData():GetPrintData():Copy() ! --printerDialog:Destroy() end *************** *** 2765,2769 **** sudokuGUI.printData = pageSetupDialog:GetPageSetupDialogData():GetPrintData():Copy() sudokuGUI.pageSetupData = pageSetupDialog:GetPageSetupDialogData():Copy() ! --pageSetupDialog:Destroy() end --- 2765,2769 ---- sudokuGUI.printData = pageSetupDialog:GetPageSetupDialogData():GetPrintData():Copy() sudokuGUI.pageSetupData = pageSetupDialog:GetPageSetupDialogData():Copy() ! --pageSetupDialog:Destroy() end Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -d -r1.60 -r1.61 *** editor.wx.lua 25 Aug 2010 02:31:13 -0000 1.60 --- editor.wx.lua 23 Nov 2010 04:41:04 -0000 1.61 *************** *** 1732,1735 **** --- 1732,1741 ---- function CompileProgram(editor) local editorText = editor:GetText() + + -- Ignore the shebang at the beginning, if it's there. + if string.sub(editorText, 1, 2) == "#!" then + editorText = "--"..editorText + end + local id = editor:GetId() local filePath = MakeDebugFileName(editor, openDocuments[id].filePath) |
From: John L. <jr...@us...> - 2010-11-23 04:41:12
|
Update of /cvsroot/wxlua/wxLua/apps/wxlua/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv28816/wxLua/apps/wxlua/src Modified Files: editor.h Log Message: Ignore #! shebang at the beginning of Lua files for UNIX systems. Remove tabs in wxluasudoku Index: editor.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/editor.h,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -d -r1.44 -r1.45 *** editor.h 25 Aug 2010 14:31:24 -0000 1.44 --- editor.h 23 Nov 2010 04:41:04 -0000 1.45 *************** *** 10,15 **** extern const unsigned char editor_wx_lua[]; ! const size_t editor_wx_lua_len = 91510; ! const unsigned char editor_wx_lua[91511] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 45, 45, 45, 10, 45, 45, 32, 78, 97,109,101, 58, 32, 32, 32, 32, 32, 32, 32, 32, 69,100,105,116,111,114, 46,119,120, 46,108,117, 97, 10, --- 10,15 ---- extern const unsigned char editor_wx_lua[]; ! const size_t editor_wx_lua_len = 91666; ! const unsigned char editor_wx_lua[91667] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 45, 45, 45, 10, 45, 45, 32, 78, 97,109,101, 58, 32, 32, 32, 32, 32, 32, 32, 32, 69,100,105,116,111,114, 46,119,120, 46,108,117, 97, 10, *************** *** 1745,1748 **** --- 1745,1754 ---- 102,117,110, 99,116,105,111,110, 32, 67,111,109,112,105,108,101, 80,114,111,103,114, 97,109, 40,101,100,105,116,111,114, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,101,100,105,116,111,114, 84,101,120,116, 32, 61, 32,101,100,105,116,111,114, 58, 71,101,116, 84,101,120,116, 40, 41, 10, + 10, + 32, 32, 32, 32, 45, 45, 32, 73,103,110,111,114,101, 32,116,104,101, 32,115,104,101, 98, 97,110,103, 32, 97,116, 32,116,104,101, 32, 98,101,103,105,110,110,105,110,103, 44, 32,105,102, 32,105,116, 39,115, 32,116,104,101,114,101, 46, 10, + 32, 32, 32, 32,105,102, 32,115,116,114,105,110,103, 46,115,117, 98, 40,101,100,105,116,111,114, 84,101,120,116, 44, 32, 49, 44, 32, 50, 41, 32, 61, 61, 32, 34, 35, 33, 34, 32,116,104,101,110, 10, + 32, 32, 32, 32, 32, 32, 32, 32,101,100,105,116,111,114, 84,101,120,116, 32, 61, 32, 34, 45, 45, 34, 46, 46,101,100,105,116,111,114, 84,101,120,116, 10, + 32, 32, 32, 32,101,110,100, 10, + 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,105,100, 32, 32, 32, 32, 32, 32, 32, 32, 32, 61, 32,101,100,105,116,111,114, 58, 71,101,116, 73,100, 40, 41, 10, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108,101, 80, 97,116,104, 32, 32, 32, 61, 32, 77, 97,107,101, 68,101, 98,117,103, 70,105,108,101, 78, 97,109,101, 40,101,100,105,116,111,114, 44, 32,111,112,101,110, 68,111, 99,117,109,101,110,116,115, 91,105,100, 93, 46,102,105,108,101, 80, 97,116,104, 41, 10, |
From: John L. <jr...@us...> - 2010-11-23 04:28:56
|
Update of /cvsroot/wxlua/wxLua/apps/wxluafreeze/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25025/src Modified Files: wxluafreeze.cpp Log Message: Replace tabs with spaces Use wxT() around string for unicode, "exe" extension. Index: wxluafreeze.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluafreeze/src/wxluafreeze.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wxluafreeze.cpp 9 Nov 2010 06:05:43 -0000 1.18 --- wxluafreeze.cpp 23 Nov 2010 04:28:48 -0000 1.19 *************** *** 111,115 **** // Find the full path this this executable ! wxFileName appFile = wxFindAppFullName(argv[0], wxGetCwd(), wxEmptyString); if (appFile.FileExists() == false) --- 111,115 ---- // Find the full path this this executable ! wxFileName appFile = wxFindAppFullName(argv[0], wxGetCwd(), wxEmptyString); if (appFile.FileExists() == false) *************** *** 273,320 **** wxFileName wxFindAppFullName(const wxString& argv0, const wxString& cwd, const wxString& appVariableName) { ! wxFileName fileName(argv0); ! wxString str; ! wxString path; #if defined(__WXMSW__) ! if (!fileName.HasExt()) ! fileName.SetExt("exe"); #endif ! // Try appVariableName ! if (!appVariableName.IsEmpty()) ! path = wxGetenv(appVariableName); #if defined(__WXMAC__) && !defined(__DARWIN__) ! // On Mac, the current directory is the relevant one when ! // the application starts. ! if (path.IsEmpty()) ! path = cwd; #endif ! if (path.IsEmpty()) ! { ! if (wxIsAbsolutePath(fileName.GetFullPath())) ! path = fileName.GetFullPath(); ! else ! { ! // Is it a relative path? ! wxString currentDir(cwd); ! if (currentDir.Last() != wxFILE_SEP_PATH) ! currentDir += wxFILE_SEP_PATH; ! if (wxFileExists(currentDir + fileName.GetFullName())) ! path = currentDir; ! } ! } ! if (path.IsEmpty()) ! { ! // OK, it's neither an absolute path nor a relative path. ! // Search PATH. ! wxPathList pathList; ! pathList.AddEnvList(wxT("PATH")); ! path = wxFileName(pathList.FindAbsoluteValidPath(fileName.GetFullName())).GetPath(); ! } ! fileName.SetPath(path); ! return fileName; } --- 273,320 ---- wxFileName wxFindAppFullName(const wxString& argv0, const wxString& cwd, const wxString& appVariableName) { ! wxFileName fileName(argv0); ! wxString str; ! wxString path; #if defined(__WXMSW__) ! if (!fileName.HasExt()) ! fileName.SetExt(wxT("exe")); #endif ! // Try appVariableName ! if (!appVariableName.IsEmpty()) ! path = wxGetenv(appVariableName); #if defined(__WXMAC__) && !defined(__DARWIN__) ! // On Mac, the current directory is the relevant one when ! // the application starts. ! if (path.IsEmpty()) ! path = cwd; #endif ! if (path.IsEmpty()) ! { ! if (wxIsAbsolutePath(fileName.GetFullPath())) ! path = fileName.GetFullPath(); ! else ! { ! // Is it a relative path? ! wxString currentDir(cwd); ! if (currentDir.Last() != wxFILE_SEP_PATH) ! currentDir += wxFILE_SEP_PATH; ! if (wxFileExists(currentDir + fileName.GetFullName())) ! path = currentDir; ! } ! } ! if (path.IsEmpty()) ! { ! // OK, it's neither an absolute path nor a relative path. ! // Search PATH. ! wxPathList pathList; ! pathList.AddEnvList(wxT("PATH")); ! path = wxFileName(pathList.FindAbsoluteValidPath(fileName.GetFullName())).GetPath(); ! } ! fileName.SetPath(path); ! return fileName; } |
From: John L. <jr...@us...> - 2010-11-09 06:06:27
|
Update of /cvsroot/wxlua/wxLua/build In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32260/wxLua/build Modified Files: Makefile_wx-config_targets.in Log Message: Use $(MAKE) and not make for distcc Index: Makefile_wx-config_targets.in =================================================================== RCS file: /cvsroot/wxlua/wxLua/build/Makefile_wx-config_targets.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile_wx-config_targets.in 9 Jan 2008 05:47:26 -0000 1.3 --- Makefile_wx-config_targets.in 9 Nov 2010 06:06:19 -0000 1.4 *************** *** 11,70 **** Lua: ! @(cd $(WXLUA_DIR)/modules/lua && make $(LUA_PLAT)) wxLuaLib: ! @(cd $(WXLUA_DIR)/modules/wxlua/src && make) wxLuaDebugLib: ! @(cd $(WXLUA_DIR)/modules/wxluadebug/src && make) wxLuaSocketLib: ! @(cd $(WXLUA_DIR)/modules/wxluasocket/src && make) LuaModule: ! @(cd $(WXLUA_DIR)/modules/luamodule/src && make) # ---------------------------------------------------------------------------- wxLuaBindAdvLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxadv) wxLuaBindAUILib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxaui) wxLuaBindBaseLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxbase) wxLuaBindCoreLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxcore) wxLuaBindGLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxgl) wxLuaBindHTMLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxhtml) wxLuaBindMediaLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxmedia) wxLuaBindNetLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxnet) wxLuaBindRichTextLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxrichtext) wxLuaBindSTCLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxstc) wxLuaBindXMLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxxml) wxLuaBindXRCLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile_wxxrc) # ---------------------------------------------------------------------------- wxStEdit: ! @(cd $(WXSTEDIT_DIR)/src && make) # ---------------------------------------------------------------------------- --- 11,70 ---- Lua: ! @(cd $(WXLUA_DIR)/modules/lua && $(MAKE) $(LUA_PLAT)) wxLuaLib: ! @(cd $(WXLUA_DIR)/modules/wxlua/src && $(MAKE)) wxLuaDebugLib: ! @(cd $(WXLUA_DIR)/modules/wxluadebug/src && $(MAKE)) wxLuaSocketLib: ! @(cd $(WXLUA_DIR)/modules/wxluasocket/src && $(MAKE)) LuaModule: ! @(cd $(WXLUA_DIR)/modules/luamodule/src && $(MAKE)) # ---------------------------------------------------------------------------- wxLuaBindAdvLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxadv) wxLuaBindAUILib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxaui) wxLuaBindBaseLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxbase) wxLuaBindCoreLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxcore) wxLuaBindGLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxgl) wxLuaBindHTMLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxhtml) wxLuaBindMediaLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxmedia) wxLuaBindNetLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxnet) wxLuaBindRichTextLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxrichtext) wxLuaBindSTCLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxstc) wxLuaBindXMLLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxxml) wxLuaBindXRCLib: ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile_wxxrc) # ---------------------------------------------------------------------------- wxStEdit: ! @(cd $(WXSTEDIT_DIR)/src && $(MAKE)) # ---------------------------------------------------------------------------- *************** *** 92,100 **** cleanall: ! @(cd $(WXLUA_DIR)/modules/lua && make clean) ! @(cd $(WXLUA_DIR)/modules/wxlua/src && make clean) ! @(cd $(WXLUA_DIR)/modules/wxluadebug/src && make clean) ! @(cd $(WXLUA_DIR)/modules/wxluasocket/src && make clean) ! @(cd $(WXLUA_DIR)/modules/luamodule/src && make clean) ! @(cd $(WXLUA_DIR)/modules/wxbind/src && make -f Makefile cleanwxbind) --- 92,100 ---- cleanall: ! @(cd $(WXLUA_DIR)/modules/lua && $(MAKE) clean) ! @(cd $(WXLUA_DIR)/modules/wxlua/src && $(MAKE) clean) ! @(cd $(WXLUA_DIR)/modules/wxluadebug/src && $(MAKE) clean) ! @(cd $(WXLUA_DIR)/modules/wxluasocket/src && $(MAKE) clean) ! @(cd $(WXLUA_DIR)/modules/luamodule/src && $(MAKE) clean) ! @(cd $(WXLUA_DIR)/modules/wxbind/src && $(MAKE) -f Makefile cleanwxbind) |
From: John L. <jr...@us...> - 2010-11-09 06:06:27
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv32260/wxLua/modules/wxbind/src Modified Files: Makefile Log Message: Use $(MAKE) and not make for distcc Index: Makefile =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/Makefile,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile 16 Jul 2007 19:34:44 -0000 1.17 --- Makefile 9 Nov 2010 06:06:19 -0000 1.18 *************** *** 29,44 **** cleanwxbind: ! @(make -f Makefile_wxadv clean) ! @(make -f Makefile_wxaui clean) ! @(make -f Makefile_wxbase clean) ! @(make -f Makefile_wxcore clean) ! @(make -f Makefile_wxgl clean) ! @(make -f Makefile_wxhtml clean) ! @(make -f Makefile_wxmedia clean) ! @(make -f Makefile_wxnet clean) ! @(make -f Makefile_wxrichtext clean) ! @(make -f Makefile_wxstc clean) ! @(make -f Makefile_wxxml clean) ! @(make -f Makefile_wxxrc clean) --- 29,44 ---- cleanwxbind: ! @($(MAKE) -f Makefile_wxadv clean) ! @($(MAKE) -f Makefile_wxaui clean) ! @($(MAKE) -f Makefile_wxbase clean) ! @($(MAKE) -f Makefile_wxcore clean) ! @($(MAKE) -f Makefile_wxgl clean) ! @($(MAKE) -f Makefile_wxhtml clean) ! @($(MAKE) -f Makefile_wxmedia clean) ! @($(MAKE) -f Makefile_wxnet clean) ! @($(MAKE) -f Makefile_wxrichtext clean) ! @($(MAKE) -f Makefile_wxstc clean) ! @($(MAKE) -f Makefile_wxxml clean) ! @($(MAKE) -f Makefile_wxxrc clean) |
From: John L. <jr...@us...> - 2010-11-09 06:05:51
|
Update of /cvsroot/wxlua/wxLua/apps/wxluafreeze/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31642/src Modified Files: wxluafreeze.cpp Log Message: Added Julian Smart's function to get full app path in any os when trying to run a frozen in script. Index: wxluafreeze.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluafreeze/src/wxluafreeze.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** wxluafreeze.cpp 23 Jan 2008 06:43:34 -0000 1.17 --- wxluafreeze.cpp 9 Nov 2010 06:05:43 -0000 1.18 *************** *** 34,37 **** --- 34,40 ---- #include "wxlua/include/wxlstate.h" + // implemented below + wxFileName wxFindAppFullName(const wxString& argv0, const wxString& cwd, const wxString& appVariableName); + // Declare the binding initialization functions // Note : We could also do this "extern bool wxLuaBinding_XXX_init();" and *************** *** 96,100 **** // you want to use decimal points in. That's because the file has been lexed // and compiler before the locale has changed, so the lexer - the part that ! // recognises numbers - will use the old locale. setlocale(LC_NUMERIC, "C"); #endif --- 99,103 ---- // you want to use decimal points in. That's because the file has been lexed // and compiler before the locale has changed, so the lexer - the part that ! // recognizes numbers - will use the old locale. setlocale(LC_NUMERIC, "C"); #endif *************** *** 107,111 **** WXLUA_IMPLEMENT_BIND_ALL ! m_fileName = argv[0]; // the filename of 'this' program // When this function returns wxApp:MainLoop() will be called by wxWidgets --- 110,124 ---- WXLUA_IMPLEMENT_BIND_ALL ! // Find the full path this this executable ! wxFileName appFile = wxFindAppFullName(argv[0], wxGetCwd(), wxEmptyString); ! ! if (appFile.FileExists() == false) ! { ! m_fileName = argv[0]; // the filename of 'this' program ! //OutputPrint(wxString::Format(wxT("Unable to find the path for '%s'\n"), argv[0])); ! } ! else ! m_fileName = appFile.GetFullPath(); ! // When this function returns wxApp:MainLoop() will be called by wxWidgets *************** *** 118,122 **** return false; ! // if no script attached try to run a the program on the command line if (LoadScript(m_fileName, true) == LOADSCRIPT_MISSING) { --- 131,135 ---- return false; ! // if no script attached try to run the program on the command line if (LoadScript(m_fileName, true) == LOADSCRIPT_MISSING) { *************** *** 249,250 **** --- 262,320 ---- #endif // __WXMSW__ } + + // -------------------------------------------------------------------------- + // Find the absolute path where this application has been run from. (Julian Smart) + // argv0 is wxTheApp->argv[0] + // cwd is the current working directory (at startup) + // appVariableName is the name of a variable containing the directory for this app, e.g. + // MYAPPDIR. This is checked first. + // -------------------------------------------------------------------------- + + wxFileName wxFindAppFullName(const wxString& argv0, const wxString& cwd, const wxString& appVariableName) + { + wxFileName fileName(argv0); + wxString str; + wxString path; + + #if defined(__WXMSW__) + if (!fileName.HasExt()) + fileName.SetExt("exe"); + #endif + + // Try appVariableName + if (!appVariableName.IsEmpty()) + path = wxGetenv(appVariableName); + + #if defined(__WXMAC__) && !defined(__DARWIN__) + // On Mac, the current directory is the relevant one when + // the application starts. + if (path.IsEmpty()) + path = cwd; + #endif + + if (path.IsEmpty()) + { + if (wxIsAbsolutePath(fileName.GetFullPath())) + path = fileName.GetFullPath(); + else + { + // Is it a relative path? + wxString currentDir(cwd); + if (currentDir.Last() != wxFILE_SEP_PATH) + currentDir += wxFILE_SEP_PATH; + if (wxFileExists(currentDir + fileName.GetFullName())) + path = currentDir; + } + } + + if (path.IsEmpty()) + { + // OK, it's neither an absolute path nor a relative path. + // Search PATH. + wxPathList pathList; + pathList.AddEnvList(wxT("PATH")); + path = wxFileName(pathList.FindAbsoluteValidPath(fileName.GetFullName())).GetPath(); + } + fileName.SetPath(path); + return fileName; + } |
From: John L. <jr...@us...> - 2010-11-09 05:03:30
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv19283/samples Added Files: catch.lua Log Message: Add sample game from Andre Arpin. Thanks! --- NEW FILE: catch.lua --- ----------------------------------------------------------------------------- -- Name: catch.wx.lua -- Purpose: 'Catch' wxLua sample -- Simple game using either the keyboard or one or two joysticks. -- Author: A. Arpin -- Modified by: -- Created: August 6, 2009 -- Licence: wxWidgets licence ----------------------------------------------------------------------------- -- Thanks to John Labenski for his suggestions ------------------------------------------------------------------------------ version = 0.9 package.cpath = package.cpath..";./?.dll;./?.so;../lib/?.so;../lib/vc_dll/?.dll;../lib/bcc_dll/?.dll;../lib/mingw_dll/?.dll;" require("wx") function iff(cond, a, b) if cond then return a else return b end end -- Generate a unique new wxWindowID local ids = {wx.wxID_HIGHEST + 1} function ids:NewID() ids[1] = ids[1] + 1 return ids[1] end math.randomseed(os.time()) local lastElapsed = -1 local minCellWidth = 16 local cellWidth = 18 local cellHeight = 18 local VerWall, HorWall, offScreenBitmap = nil, nil, nil local levelMenu local wallThickness = 5 local joyStick1 = wx.wxJoystick(wx.wxJOYSTICK1) local joyStick2 = wx.wxJoystick(wx.wxJOYSTICK2) local redrawRequired = true local frame = nil -- the main wxFrame local panel = nil -- the child wxPanel of the wxScrolledWindow to draw on local timer = nil local initialTimer = 50 local timeTimer = initialTimer ids.ID_EASY = ids:NewID() ids.ID_HARD = ids:NewID() ids.ID_HARDER = ids:NewID() ids.ID_HARDEST = ids:NewID() ids.ID_JOY_ONE_PLAYER = ids:NewID() ids.ID_JOY_TWO_PLAYERS = ids:NewID() ids.ID_JOY_MV_PERSON = ids:NewID() ids.ID_JOY_MV_PRESENT = ids:NewID() local numberOfPlayers = iff(wx.wxJoystick.GetNumberJoysticks() > 1, 2, 1) local joystick1Control = ids.ID_JOY_MV_PERSON local Present, Person local bitmapPost -- These sounds are from MS Windows, however wxSound doesn't assert in Linux so we -- create a tempory wxLogNull to ignore the warnings and use wxSound:IsOk() before -- we try to use them local logNo = wx.wxLogNull(); local soundTata = wx.wxSound(wx.wxGetOSDirectory()..[[\media\tada.wav]]) local soundRecycle = wx.wxSound(wx.wxGetOSDirectory()..[[\media\recycle.wav]]) logNo:delete(); function distance(m) local rd, cd = Present:Offet(m[1], m[2]) if rd then return ((Person.r - rd)^2 + (Person.c - cd)^2)^0.5 end return 0 end local Game = { width = 30; height = 20; hw = {}, -- horizontal walls vw = {}, -- vertical walls post = {}, randomPosition = function () return math.random(2, self.height), math.random(1,self.width) end, setLevel = function (self, level, menu) timeTimer = initialTimer self.levelId = level if level == ids.ID_EASY then self.level = 'Easy' self.numberOfWalls = 25 self.numberOfBlocks = 10 self.maxExtraMove = 1 self.maxHoleMoved = 1 self.maxWallMoved = 5 self.maxTimer = 500 elseif level == ids.ID_HARD then self.level = 'Hard' self.numberOfWalls = 35 self.numberOfBlocks = 15 self.maxExtraMove = 2 self.maxHoleMoved = 3 self.maxWallMoved = 10 self.maxTimer = 400 elseif level == ids.ID_HARDER then self.level = 'Harder' self.numberOfWalls = 100 self.numberOfBlocks = 20 self.maxExtraMove = 2 self.maxHoleMoved = 5 self.maxWallMoved = 15 self.maxTimer = 300 else level = ids.ID_HARDER self.level = 'Hardest !!!' self.numberOfWalls = 200 self.numberOfBlocks = 40 self.maxExtraMove = 2 self.maxHoleMoved = 6 self.maxWallMoved = 20 self.maxTimer = 100 end if levelMenu then levelMenu:Check(level, true) end end } Game:setLevel(ids.ID_EASY) local Location = {r=0, c=0, minR = 1, minC = 1, maxR = Game.height, maxC = Game.width} function Location:new (o) local o = o or {} setmetatable(o, self) self.__index = self return o end function Location:Position() return Position(self.r, self.c) end function Location:Offet(dr, dc) local nr, nc = self.r + dr, self.c + dc if (nr >= self.minR and nr<= self.maxR and nc >= self.minC and nc <= self.maxC) then return nr, nc end end function Location:Place(r,c) assert(r >= self.minR and r<= self.maxR and c >= self.minC and c <= self.maxC) self.r, self.c = r, c end local Occupant = Location:new() -- location for a bitmap -- vertical or horizontal wall function GenWall(w, h) local bm = wx.wxBitmap(w, h) local memDC = wx.wxMemoryDC() local pen = wx.wxPen("red", 0, wx.wxSOLID) local brush = wx.wxBrush('green', wx.wxSOLID) memDC:SelectObject(bm) memDC:SetBrush(brush) memDC:SetPen(pen) memDC:DrawRectangle(0, 0, w, h) pen:delete() brush:delete() memDC:SelectObject(wx.wxNullBitmap) memDC:delete() return bm end function PositionWall(r, c) return (c-1)*(cellWidth+wallThickness) , (r-1)*(cellHeight+wallThickness) end function Game:initBitMap() local w, h = Game.width*(cellWidth+wallThickness)+1, Game.height*(cellHeight+wallThickness)+1 return wx.wxBitmap(w, h) end function Game:Place(b, r, c) if self[r][c] then return end b:Place(r,c) self[r][c] = b return true end function Game:Remove(b) if b.r ~= 0 and self[b.r][b.c] == b then self[b.r][b.c]=nil end end function Location:Draw(dc) dc:DrawBitmap(bitmap, wallThickness+x, wallThickness+y, true) end function Game:RandomRC() return math.random(1, self.height), math.random(1,self.width) end function Game:RandomWall(h) if h then return math.random(1, self.height - 1), math.random(1, self.width) else return math.random(1, self.height), math.random(1, self.width - 1) end end function Game:RandomIncr() -- note: 0, 0 is possible return math.random(-1, 1), math.random(-1, 1) end function Game:Init() VerWall = GenWall(wallThickness, cellHeight + wallThickness) HorWall = GenWall(cellWidth + wallThickness, wallThickness) offScreenBitmap = Game:initBitMap() frame:SetClientSize(wx.wxSize(offScreenBitmap.Width, offScreenBitmap.Height)) local r, c for r = 1, self.height do self[r] = {} end for r = 1, self.height-1 do self.hw[r] = {} end for c = 1, self.width-1 do self.vw[c] = {} end repeat for _, v in ipairs(({Present, Person})) do self:Remove(v) repeat until self:Place(v, self:RandomRC()) end until distance({0,0}) > 20 self.post = {} for i= 1, 10 + self.maxHoleMoved do local post = Occupant:new{bitmap = bitmapPost} repeat until self:Place(post, self:RandomRC()) table.insert(self.post, post) end for i = 1, self.numberOfWalls do repeat r, c = self:RandomWall(false) until self.vw[c][r] == nil self.vw[c][r]=true repeat r, c = self:RandomWall(true) until self.hw[r][c]== nil self.hw[r][c]=true end self.start = os.time() RestartTimer() frame:Refresh() redrawRequired = true timeTimer = initialTimer end function main() bitmapPost = wx.wxBitmap(xpm('wall')) Person = Occupant:new{bitmap = wx.wxBitmap(xpm('Person'))} Present = Occupant:new{bitmap = wx.wxBitmap(xpm('Present'))} frame = wx.wxFrame( wx.NULL, wx.wxID_ANY, "wxLua Catch the present", wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxCAPTION+wx.wxSYSTEM_MENU+wx.wxCLOSE_BOX+wx.wxMINIMIZE_BOX) -- ----------------------------------------------------------------------- -- Create the menubar local fileMenu = wx.wxMenu() fileMenu:Append(wx.wxID_EXIT, "E&xit\tCtrl+Q", "Quit the program") local helpMenu = wx.wxMenu() helpMenu:Append(wx.wxID_ABOUT, "&About...", "About the wxLua Catch Application") levelMenu = wx.wxMenu() levelMenu:AppendRadioItem(ids.ID_EASY, "&1 Easy", "Level the game is being played") levelMenu:AppendRadioItem(ids.ID_HARD, "&2 Hard", "Level the game is being played") levelMenu:AppendRadioItem(ids.ID_HARDER, "&3 Harder", "Level the game is being played") levelMenu:AppendRadioItem(ids.ID_HARDEST, "&4 Hardest", "Level the game is being played") local joystickControlMenu = wx.wxMenu() joystickControlMenu:AppendRadioItem(ids.ID_JOY_ONE_PLAYER, "&1 One player", "One player present moves by itself") joystickControlMenu:AppendRadioItem(ids.ID_JOY_TWO_PLAYERS, "&2 Two players", "Two players") joystickControlMenu:AppendSeparator() joystickControlMenu:AppendRadioItem(ids.ID_JOY_MV_PERSON, "&3 Joystick:1 move Person", "Joystick with id set to 1") joystickControlMenu:AppendRadioItem(ids.ID_JOY_MV_PRESENT, "&4 JoyStick:1 move Present", "Joystick with id set to 1") local menuBar = wx.wxMenuBar() menuBar:Append(fileMenu, "&File") menuBar:Append(levelMenu, "&Level") menuBar:Append(joystickControlMenu, '&Joystick ('.. wx.wxJoystick.GetNumberJoysticks() ..')') menuBar:Append(helpMenu, "&Help") frame:SetMenuBar(menuBar) if (wx.wxJoystick.GetNumberJoysticks() == 0) then menuBar:EnableTop(2, false) end -- Create the statusbar local statusBar = frame:CreateStatusBar(2) frame:SetStatusText("Welcome to Catch.") panel = wx.wxPanel(frame, wx.wxID_ANY, wx.wxDefaultPosition, wx.wxDefaultSize, wx.wxWANTS_CHARS) timer = wx.wxTimer(panel) panel:Connect(wx.wxEVT_PAINT, OnPaint) panel:Connect(wx.wxEVT_TIMER, OnTimer) panel:Connect(wx.wxEVT_ERASE_BACKGROUND, function(event) --// intentionally empty end) panel:Connect(wx.wxEVT_KEY_DOWN, OnKeyDown) panel:Connect(wx.wxEVT_JOY_MOVE, OnJoyStick) if joyStick1:IsOk() then joyStick1:SetCapture(panel, 100) end if joyStick2:IsOk() then joyStick2:SetCapture(panel, 100) end Game:Init() frame:Connect(wx.wxEVT_CLOSE_WINDOW, function (event) -- prevent paint events using the memDC during closing if joyStick1:IsOk() then joyStick1:ReleaseCapture() end if joyStick2:IsOk() then joyStick2:ReleaseCapture() end if offScreenBitmap then offScreenBitmap:delete() offScreenBitmap = nil end soundTata:delete() if timer then timer:Stop() -- always stop before exiting or deleting it timer:delete() timer = nil end -- ensure the event is skipped to allow the frame to close event:Skip() end ) -- ----------------------------------------------------------------------- -- File menu events frame:Connect(wx.wxID_EXIT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) frame:Close(true) end ) -- ----------------------------------------------------------------------- -- Game type menu frame:Connect(ids.ID_JOY_ONE_PLAYER, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) numberOfPlayers = 1 joystickControlMenu:Check(ids.ID_JOY_MV_PERSON, true) joystick1Control = ids.ID_JOY_MV_PERSON end) frame:Connect(ids.ID_JOY_TWO_PLAYERS, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) numberOfPlayers = 2 end) frame:Connect(ids.ID_JOY_MV_PERSON, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) joystick1Control = event.Id end) frame:Connect(ids.ID_JOY_MV_PRESENT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) joystick1Control = event.Id joystickControlMenu:Check(ids.ID_JOY_TWO_PLAYERS, true) numberOfPlayers = 2 -- must have 2 players end) -- ----------------------------------------------------------------------- -- Level menu events frame:Connect(ids.ID_EASY, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) Game:setLevel(event.Id) Game:Init() end) frame:Connect(ids.ID_HARD, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) Game:setLevel(event.Id) Game:Init() end) frame:Connect(ids.ID_HARDER, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) Game:setLevel(event.Id) Game:Init() end) frame:Connect(ids.ID_HARDEST, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) Game:setLevel(event.Id) Game:Init() end) -- ----------------------------------------------------------------------- -- Help menu events frame:Connect(wx.wxID_ABOUT, wx.wxEVT_COMMAND_MENU_SELECTED, function (event) wx.wxMessageBox('"About" dialog for the Catch wxLua Sample.\n\n'.. "How long will it take you to catch the present\n".. 'Use either the arrow keys and/or a JoyStick(s)\n'.. 'Do not drop into the holes!\n'.. 'Walls move around and sometime disappear\n\n'.. "JOYSTICK: (not necessary)\nOne or 2 joysticks are supported\n\n".. wxlua.wxLUA_VERSION_STRING.." built with "..wx.wxVERSION_STRING, "About wxLua Catch v "..version, wx.wxOK + wx.wxICON_INFORMATION, frame ) end ) frame:Center() frame:Show(true) if (not joyStick1:IsOk() and joyStick2:IsOk()) then wx.wxMessageBox('Only one joystick and joystick id is set to 2\n change id to one or program will not work','Catch') end end function Game:Draw(dc) local function PositionPieces(r, c) return (c-1)*(cellWidth+wallThickness) + (cellWidth - minCellWidth)/2, (r-1)*(cellHeight+wallThickness) + (cellHeight - minCellWidth)/2 end for r,v in ipairs(self) do for c, bitmap in pairs(v) do local x,y = PositionPieces(r,c) dc:DrawBitmap(bitmap.bitmap, x+wallThickness, y+wallThickness, true) end end for r,v in ipairs(self.hw) do for c,v in pairs(v) do local x, y = PositionWall(r + 1, c) dc:DrawBitmap(HorWall, x+1, y, false) end end for c,v in ipairs(self.vw) do for r,v in pairs(v) do local x, y = PositionWall(r, c + 1) dc:DrawBitmap(VerWall, x, y+1, false) end end end function Game:DrawOffScreenBitMap(bmp) local dc = wx.wxMemoryDC() -- create off screen dc to draw on dc:SelectObject(bmp) -- select our bitmap to draw into dc:SetBackground(wx.wxBrush('turquoise', wx.wxSOLID)) dc:Clear() self:Draw(dc) dc:SelectObject(wx.wxNullBitmap) -- always release bitmap dc:delete() -- ALWAYS delete() any wxDCs created when done end function OnPaint(event) -- ALWAYS create wxPaintDC in wxEVT_PAINT handler, even if unused local dc = wx.wxPaintDC(panel) if offScreenBitmap and offScreenBitmap:Ok() then if redrawRequired then Game:DrawOffScreenBitMap(offScreenBitmap) redrawRequired = false end dc:DrawBitmap(offScreenBitmap, 0, 0, false) end dc:delete() -- ALWAYS delete() any wxDCs created when done end function Occupant:move(d_r, d_c) local r, c = self:Offet(d_r, d_c) if c then -- check if a gate is crossed, allow crossing corners (present does that on automatic) if d_r == 0 or d_c==0 then if d_r ~= 0 then if Game.hw[iff(d_r > 0, self.r, r)][c] then return end elseif d_c ~= 0 then if Game.vw[iff(d_c> 0, self.c, c)][r] then return end end end if Game[r][c] then return false, Game[r][c] end Game[self.r] [self.c] = nil Game:Place(self, r, c) return true end end function Game:Elapse() return os.time() - self.start end function Game:MoveAll() if numberOfPlayers == 1 then for i= 1, math.random(1, self.maxExtraMove) do local bestMove = {self:RandomIncr()} -- 70 % of the time we are moving away for the 1st 30 second if i==1 and math.mod(Game:Elapse(),10) > 2 then local otherMove = {self:RandomIncr()} if distance(bestMove) < distance(otherMove) then bestMove = otherMove end end Present:move(bestMove[1], bestMove[2]) end end for i= 1, math.random(1, self.maxHoleMoved) do local extra = math.random(1, #self.post) self.post[extra]:move(self:RandomIncr()) end for i= 1, math.random(1, self.maxWallMoved) do local r, c = self:RandomWall(true) local tr, tc = self:RandomWall(true) if not self.hw[tr][tc] then self.hw[r][c], self.hw[tr][tc] = self.hw[tr][tc], self.hw[r][c] end end for i= 1, math.random(1, self.maxWallMoved) do local r, c = self:RandomWall(false) local tr, tc = self:RandomWall(false) if not self.vw[tc][tr] then self.vw[c][r], self.vw[tc][tr] = self.vw[tc][tr], self.vw[c][r] end end RestartTimer() if lastElapsed ~= Game:Elapse() then local w = 0; for k,v in pairs(self.hw) do for k,v in pairs(v) do w = w + 1 end end for k,v in pairs(self.vw) do for k,v in pairs(v) do w = w + 1 end end frame:SetStatusText(string.format("<<< %s >>> %s%6d %s%6d %s%6d", string.upper(self.level),"TIME:",Game:Elapse(), 'Speed: ',600 - timeTimer ,'Walls:',w)) lastElapsed = Game:Elapse() -- removing walls makes the game easier as time goes byeselft. local r, c = self:RandomWall(false) self.vw[c][r] = nil local r, c = self:RandomWall(true) self.hw[r][c]= nil end redrawRequired = true frame:Refresh() end function Occupant:MovePlayer(keyCode) local moved, target if keyCode == wx.WXK_RIGHT then moved, target = self:move(0, 1) elseif keyCode == wx.WXK_LEFT then moved, target = self:move(0, -1) elseif keyCode == wx.WXK_UP then moved, target = self:move(-1, 0) elseif keyCode == wx.WXK_DOWN then moved, target = self:move(1, 0) end if target then timer:Stop() local message if target == Present or target == Person then message = "Got the present " if soundTata:IsOk() then soundTata:Play() end Game:setLevel(Game.levelId + 1) elseif self == Person then message = "Sorry you lost the present " end if message then local dialog = wx.wxMessageDialog( frame, message..Game:Elapse() .. ' second(s).\n\nPlay one more', "Catch", wx.wxCENTRE + wx.wxYES_NO) local result = dialog:ShowModal() dialog:Destroy() if result == wx.wxID_YES then Game:Init() else frame:Close(true) end return end RestartTimer() end if moved then Game:MoveAll() else if soundRecycle:IsOk() then soundRecycle:Play() end end end function OnKeyDown(event) if event.KeyCode == wx.WXK_ESCAPE then frame:Close() end if numberOfPlayers == 1 or joystick1Control == ids.ID_JOY_MV_PRESENT then Person:MovePlayer(event.KeyCode) else Present:MovePlayer(event.KeyCode) end end function OnJoyStick(event) if timer:IsRunning() then local player = Person if event:GetJoystick() == 1 then -- not the same as wx.wxJOYSTICK1 (sorry) joystick = joyStick1 if joystick1Control == ids.ID_JOY_MV_PRESENT then player = Present end else joystick = joyStick2 if joystick1Control ~= ids.ID_JOY_MV_PRESENT then player = Present end end local pt = joystick.Position local x, y = pt.X - joystick.XMax/2, pt.Y - joystick.YMax/2 local xym = math.max(math.abs(x), math.abs(y)) if xym > joystick.XMax/11 then if xym == math.abs(x) then player:MovePlayer(iff(x > 0, wx.WXK_RIGHT, wx.WXK_LEFT)) else player:MovePlayer(iff(y < 0, wx.WXK_UP, wx.WXK_DOWN)) end end end end function RestartTimer() -- the game slows down timeTimer = math.min(timeTimer+1, Game.maxTimer) timer:Start(timeTimer) collectgarbage("collect") end function OnTimer(event) Game:MoveAll() end -- XPM data function xpm(name) local names = {} names.Present = { "16 16 7 1", " c #FFFFFF", ". c #06985C", "+ c #091925", "@ c #E1B901", "# c #68F89B", "$ c #CBF95B", "% c #FF7611", " . ", ".......+++......", ". + + .", ". @@@@@+@+@@@@@.", ". @ .+ + @.", ". @ ###+#+####@.", ". @ #. + + #@.", "++++++++++++++++", "+.@ # $+ + $#@.", "++++++++++++++++", ". @ # $+%+ %$#@.", ". @ # $+%+%%$#@.", ". @ # $+$+$$$#@.", ". @ ###+#+####@.", ". @@@@@+@+@@@@@.", ".......+.+......"}; names.Person = { "16 16 2 1", " c none", ". c #000000", " ", " ... ", " .. .. ", " . . ", " . . . . ", " . . ", " .. .. ", " ... ", " . . ", " . ", " . . ", " . . ", " . . ", " . . ", " . . ", " "}; names.wall = { "16 16 11 1", " c None", ". c #00950B", "+ c #fFfF00", "@ c #EF0000", "# c #F01002", "$ c #F23007", "% c #F5600F", "& c #F67F13", "* c #F9AF1B", "= c #FCDF22", "- c #FBCF20", "................", "................", "..+@#$%&&%$#++..", "..++%*=++=*++@..", "..#%++++++++%#..", "..$*++++++++*$..", "..%=++++++++=%..", "..&++++++++++&..", "..&++++++++++&..", "..%=++++++++=%..", "..$*++++++++*$..", "..#%-++++++-%#..", "..@+++=++=*+#@..", "..++#$%&&%$+++..", "................", "................"}; return names[name] end main() -- set frame icon local icon = wx.wxIcon() local xpm = xpm('Person') xpm[2] = " c #FFFFFF" -- change background icon:CopyFromBitmap(wx.wxBitmap(xpm)) frame:SetIcon(icon) --~dump(_G) -- Call wx.wxGetApp():MainLoop() last to start the wxWidgets event loop, -- otherwise the wxLua program will exit immediately. -- Does nothing if running from wxLua, wxLuaFreeze, or wxLuaEdit since the -- MainLoop is already running or will be started by the C++ program. wx.wxGetApp():MainLoop() |
From: John L. <jr...@us...> - 2010-08-27 20:23:38
|
Update of /cvsroot/wxlua/wxLua/modules/wxluasocket/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv25213/modules/wxluasocket/src Modified Files: wxldtarg.cpp Log Message: Don't duplicate breakpoint entries. Remove the prepended '@' Lua puts on the filename retrieved from the LuaDebug struct. Index: wxldtarg.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluasocket/src/wxldtarg.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** wxldtarg.cpp 15 Nov 2009 17:56:04 -0000 1.49 --- wxldtarg.cpp 27 Aug 2010 20:23:30 -0000 1.50 *************** *** 353,358 **** bool wxLuaDebugTarget::AddBreakPoint(const wxString &fileName, int lineNumber) { wxCriticalSectionLocker locker(m_breakPointListCriticalSection); ! m_breakPointList.Add(CreateBreakPoint(fileName, lineNumber)); return true; } --- 353,360 ---- bool wxLuaDebugTarget::AddBreakPoint(const wxString &fileName, int lineNumber) { + wxString breakPoint = CreateBreakPoint(fileName, lineNumber); wxCriticalSectionLocker locker(m_breakPointListCriticalSection); ! if (m_breakPointList.Index(breakPoint) == wxNOT_FOUND) ! m_breakPointList.Add(breakPoint); return true; } *************** *** 669,672 **** --- 671,676 ---- lineNumber = luaDebug.currentline - 1; fileName = lua2wx(luaDebug.source); + if (!fileName.IsEmpty() && (fileName[0] == wxT('@'))) + fileName = fileName.Mid(1); } |
From: John L. <jr...@us...> - 2010-08-25 14:31:34
|
Update of /cvsroot/wxlua/wxLua/apps/wxlua/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv11109/src Modified Files: editor.h Log Message: Update editor, ask to overwrite Save As files. Index: editor.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxlua/src/editor.h,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** editor.h 5 Dec 2008 05:57:20 -0000 1.43 --- editor.h 25 Aug 2010 14:31:24 -0000 1.44 *************** *** 10,15 **** extern const unsigned char editor_wx_lua[]; ! const size_t editor_wx_lua_len = 91181; ! const unsigned char editor_wx_lua[91182] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 45, 45, 45, 10, 45, 45, 32, 78, 97,109,101, 58, 32, 32, 32, 32, 32, 32, 32, 32, 69,100,105,116,111,114, 46,119,120, 46,108,117, 97, 10, --- 10,15 ---- extern const unsigned char editor_wx_lua[]; ! const size_t editor_wx_lua_len = 91510; ! const unsigned char editor_wx_lua[91511] = { 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 45, 61, 45, 45, 45, 10, 45, 45, 32, 78, 97,109,101, 58, 32, 32, 32, 32, 32, 32, 32, 32, 69,100,105,116,111,114, 46,119,120, 46,108,117, 97, 10, *************** *** 988,992 **** 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108,101, 80, 97,116,104, 32, 61, 32,102,105,108,101, 68,105, 97,108,111,103, 58, 71,101,116, 80, 97,116,104, 40, 41, 10, 10, ! 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32, 83, 97,118,101, 70,105,108,101, 40,101,100,105,116,111,114, 44, 32,102,105,108,101, 80, 97,116,104, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 83,101,116,117,112, 75,101,121,119,111,114,100,115, 40,101,100,105,116,111,114, 44, 32, 73,115, 76,117, 97, 70,105,108,101, 40,102,105,108,101, 80, 97,116,104, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,118,101,100, 32, 61, 32,116,114,117,101, 10, --- 988,999 ---- 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,102,105,108,101, 80, 97,116,104, 32, 61, 32,102,105,108,101, 68,105, 97,108,111,103, 58, 71,101,116, 80, 97,116,104, 40, 41, 10, 10, ! 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,115, 97,118,101, 95,102,105,108,101, 32, 61, 32,116,114,117,101, 10, ! 10, ! 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,119,120, 46,119,120, 70,105,108,101, 69,120,105,115,116,115, 40,102,105,108,101, 80, 97,116,104, 41, 32,116,104,101,110, 10, ! 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,118,101, 95,102,105,108,101, 32, 61, 32, 40,119,120, 46,119,120, 89, 69, 83, 32, 61, 61, 32,119,120, 46,119,120, 77,101,115,115, 97,103,101, 66,111,120, 40,115,116,114,105,110,103, 46,102,111,114,109, 97,116, 40, 34, 82,101,112,108, 97, 99,101, 32,102,105,108,101, 58, 92,110, 37,115, 34, 44, 32,102,105,108,101, 80, 97,116,104, 41, 44, 32, 34,119,120, 76,117, 97, 32, 79,118,101,114,119,114,105,116,101, 32, 70,105,108,101, 34, 44, 10, ! 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,119,120, 46,119,120, 89, 69, 83, 95, 78, 79, 32, 43, 32,119,120, 46,119,120, 73, 67, 79, 78, 95, 81, 85, 69, 83, 84, 73, 79, 78, 44, 32,102,114, 97,109,101, 41, 41, 10, ! 32, 32, 32, 32, 32, 32, 32, 32,101,110,100, 10, ! 10, ! 32, 32, 32, 32, 32, 32, 32, 32,105,102, 32,115, 97,118,101, 95,102,105,108,101, 32, 97,110,100, 32, 83, 97,118,101, 70,105,108,101, 40,101,100,105,116,111,114, 44, 32,102,105,108,101, 80, 97,116,104, 41, 32,116,104,101,110, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 83,101,116,117,112, 75,101,121,119,111,114,100,115, 40,101,100,105,116,111,114, 44, 32, 73,115, 76,117, 97, 70,105,108,101, 40,102,105,108,101, 80, 97,116,104, 41, 41, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,115, 97,118,101,100, 32, 61, 32,116,114,117,101, 10, *************** *** 1812,1816 **** 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,105,100, 32, 61, 32,101,100,105,116,111,114, 58, 71,101,116, 73,100, 40, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,110,115,111,108,101, 32, 61, 32,105,102,102, 40,109,101,110,117, 66, 97,114, 58, 73,115, 67,104,101, 99,107,101,100, 40, 73, 68, 95, 85, 83, 69, 67, 79, 78, 83, 79, 76, 69, 41, 44, 32, 34, 32, 45, 99, 32, 34, 44, 32, 34, 34, 41, 10, ! 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,109,100, 32, 61, 32, 39, 34, 39, 46, 46,112,114,111,103,114, 97,109, 78, 97,109,101, 46, 46, 39, 34, 32, 39, 46, 46, 99,111,110,115,111,108,101, 46, 46,111,112,101,110, 68,111, 99,117,109,101,110,116,115, 91,105,100, 93, 46,102,105,108,101, 80, 97,116,104, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 68,105,115,112,108, 97,121, 79,117,116,112,117,116, 40, 34, 82,117,110,110,105,110,103, 32,112,114,111,103,114, 97,109, 58, 32, 34, 46, 46, 99,109,100, 46, 46, 34, 92,110, 34, 41, 10, --- 1819,1823 ---- 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32,105,100, 32, 61, 32,101,100,105,116,111,114, 58, 71,101,116, 73,100, 40, 41, 59, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,111,110,115,111,108,101, 32, 61, 32,105,102,102, 40,109,101,110,117, 66, 97,114, 58, 73,115, 67,104,101, 99,107,101,100, 40, 73, 68, 95, 85, 83, 69, 67, 79, 78, 83, 79, 76, 69, 41, 44, 32, 34, 32, 45, 99, 32, 34, 44, 32, 34, 34, 41, 10, ! 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32,108,111, 99, 97,108, 32, 99,109,100, 32, 61, 32, 39, 34, 39, 46, 46,112,114,111,103,114, 97,109, 78, 97,109,101, 46, 46, 39, 34, 32, 39, 46, 46, 99,111,110,115,111,108,101, 46, 46, 39, 34, 39, 46, 46,111,112,101,110, 68,111, 99,117,109,101,110,116,115, 91,105,100, 93, 46,102,105,108,101, 80, 97,116,104, 46, 46, 39, 34, 39, 10, 10, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 68,105,115,112,108, 97,121, 79,117,116,112,117,116, 40, 34, 82,117,110,110,105,110,103, 32,112,114,111,103,114, 97,109, 58, 32, 34, 46, 46, 99,109,100, 46, 46, 34, 92,110, 34, 41, 10, |
From: John L. <jr...@us...> - 2010-08-25 02:31:21
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv928/samples Modified Files: editor.wx.lua Log Message: Ask to overwrite the file in Save As dialog. Index: editor.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/editor.wx.lua,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** editor.wx.lua 1 Jun 2009 22:28:30 -0000 1.59 --- editor.wx.lua 25 Aug 2010 02:31:13 -0000 1.60 *************** *** 975,979 **** local filePath = fileDialog:GetPath() ! if SaveFile(editor, filePath) then SetupKeywords(editor, IsLuaFile(filePath)) saved = true --- 975,986 ---- local filePath = fileDialog:GetPath() ! local save_file = true ! ! if wx.wxFileExists(filePath) then ! save_file = (wx.wxYES == wx.wxMessageBox(string.format("Replace file:\n%s", filePath), "wxLua Overwrite File", ! wx.wxYES_NO + wx.wxICON_QUESTION, frame)) ! end ! ! if save_file and SaveFile(editor, filePath) then SetupKeywords(editor, IsLuaFile(filePath)) saved = true |
From: John L. <jr...@us...> - 2010-08-12 23:41:20
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31654/wxLua/bindings/wxwidgets Modified Files: wx_datatypes.lua wxbase_data.i Log Message: Add a few wxString methods, To/FromUTF8() Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.104 retrieving revision 1.105 diff -C2 -d -r1.104 -r1.105 *** wx_datatypes.lua 1 Oct 2009 04:21:00 -0000 1.104 --- wx_datatypes.lua 12 Aug 2010 23:41:09 -0000 1.105 *************** *** 752,755 **** --- 752,760 ---- ValueType = "number", }, + wxCharBuffer = { + IsNumber = true, + Name = "wxCharBuffer", + ValueType = "special", + }, wxCheckBox = { BaseClasses = { Index: wxbase_data.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxbase_data.i,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxbase_data.i 1 Oct 2009 04:21:00 -0000 1.5 --- wxbase_data.i 12 Aug 2010 23:41:09 -0000 1.6 *************** *** 20,23 **** --- 20,33 ---- wxString GetData() const + wxString AfterFirst(wxChar ch) const + wxString AfterLast(wxChar ch) const + wxString BeforeFirst(wxChar ch) const + wxString BeforeLast(wxChar ch) const + + size_t Len() const + + const wxCharBuffer ToUTF8() const + static wxString FromUTF8(const char* s) + %endclass |
From: John L. <jr...@us...> - 2010-08-12 23:41:17
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31654/wxLua/modules/wxbind/src Modified Files: wxbase_data.cpp Log Message: Add a few wxString methods, To/FromUTF8() Index: wxbase_data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxbase_data.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** wxbase_data.cpp 1 Oct 2009 04:21:01 -0000 1.22 --- wxbase_data.cpp 12 Aug 2010 23:41:09 -0000 1.23 *************** *** 33,36 **** --- 33,124 ---- int wxluatype_wxString = WXLUA_TUNKNOWN; + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_AfterFirst[] = { &wxluatype_wxString, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxString_AfterFirst(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_AfterFirst[1] = {{ wxLua_wxString_AfterFirst, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxString_AfterFirst }}; + // wxString AfterFirst(wxChar ch) const + static int LUACALL wxLua_wxString_AfterFirst(lua_State *L) + { + // wxChar ch + wxChar ch = (wxChar)wxlua_getnumbertype(L, 2); + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call AfterFirst + wxString returns = (self->AfterFirst(ch)); + // push the result string + wxlua_pushwxString(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_AfterLast[] = { &wxluatype_wxString, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxString_AfterLast(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_AfterLast[1] = {{ wxLua_wxString_AfterLast, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxString_AfterLast }}; + // wxString AfterLast(wxChar ch) const + static int LUACALL wxLua_wxString_AfterLast(lua_State *L) + { + // wxChar ch + wxChar ch = (wxChar)wxlua_getnumbertype(L, 2); + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call AfterLast + wxString returns = (self->AfterLast(ch)); + // push the result string + wxlua_pushwxString(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_BeforeFirst[] = { &wxluatype_wxString, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxString_BeforeFirst(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_BeforeFirst[1] = {{ wxLua_wxString_BeforeFirst, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxString_BeforeFirst }}; + // wxString BeforeFirst(wxChar ch) const + static int LUACALL wxLua_wxString_BeforeFirst(lua_State *L) + { + // wxChar ch + wxChar ch = (wxChar)wxlua_getnumbertype(L, 2); + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call BeforeFirst + wxString returns = (self->BeforeFirst(ch)); + // push the result string + wxlua_pushwxString(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_BeforeLast[] = { &wxluatype_wxString, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxString_BeforeLast(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_BeforeLast[1] = {{ wxLua_wxString_BeforeLast, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxString_BeforeLast }}; + // wxString BeforeLast(wxChar ch) const + static int LUACALL wxLua_wxString_BeforeLast(lua_State *L) + { + // wxChar ch + wxChar ch = (wxChar)wxlua_getnumbertype(L, 2); + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call BeforeLast + wxString returns = (self->BeforeLast(ch)); + // push the result string + wxlua_pushwxString(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_FromUTF8[] = { &wxluatype_TSTRING, NULL }; + static int LUACALL wxLua_wxString_FromUTF8(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_FromUTF8[1] = {{ wxLua_wxString_FromUTF8, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 1, s_wxluatypeArray_wxLua_wxString_FromUTF8 }}; + // static wxString FromUTF8(const char* s) + static int LUACALL wxLua_wxString_FromUTF8(lua_State *L) + { + // const char s + wxCharBuffer s = wxlua_getstringtype(L, 1); + // call FromUTF8 + wxString returns = (wxString::FromUTF8((const char*)s)); + // push the result string + wxlua_pushwxString(L, returns); + + return 1; + } + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_GetData[] = { &wxluatype_wxString, NULL }; static int LUACALL wxLua_wxString_GetData(lua_State *L); *************** *** 49,52 **** --- 137,172 ---- } + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_Len[] = { &wxluatype_wxString, NULL }; + static int LUACALL wxLua_wxString_Len(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_Len[1] = {{ wxLua_wxString_Len, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxString_Len }}; + // size_t Len() const + static int LUACALL wxLua_wxString_Len(lua_State *L) + { + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call Len + size_t returns = (self->Len()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_ToUTF8[] = { &wxluatype_wxString, NULL }; + static int LUACALL wxLua_wxString_ToUTF8(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_ToUTF8[1] = {{ wxLua_wxString_ToUTF8, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxString_ToUTF8 }}; + // const wxCharBuffer ToUTF8() const + static int LUACALL wxLua_wxString_ToUTF8(lua_State *L) + { + // get this + wxString * self = (wxString *)wxluaT_getuserdatatype(L, 1, wxluatype_wxString); + // call ToUTF8 + wxCharBuffer returns = (self->ToUTF8()); + // push the result string + lua_pushstring(L, returns.data()); + + return 1; + } + static wxLuaArgType s_wxluatypeArray_wxLua_wxString_delete[] = { &wxluatype_wxString, NULL }; static wxLuaBindCFunc s_wxluafunc_wxLua_wxString_delete[1] = {{ wxlua_userdata_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatypeArray_wxLua_wxString_delete }}; *************** *** 84,88 **** --- 204,215 ---- // Map Lua Class Methods to C Binding Functions wxLuaBindMethod wxString_methods[] = { + { "AfterFirst", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_AfterFirst, 1, NULL }, + { "AfterLast", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_AfterLast, 1, NULL }, + { "BeforeFirst", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_BeforeFirst, 1, NULL }, + { "BeforeLast", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_BeforeLast, 1, NULL }, + { "FromUTF8", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxString_FromUTF8, 1, NULL }, { "GetData", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_GetData, 1, NULL }, + { "Len", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_Len, 1, NULL }, + { "ToUTF8", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxString_ToUTF8, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxString_delete, 1, NULL }, { "wxString", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxString_constructor, 1, NULL }, |
From: John L. <jr...@us...> - 2010-08-12 23:41:17
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31654/wxLua/bindings Modified Files: genwxbind.lua Log Message: Add a few wxString methods, To/FromUTF8() Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.186 retrieving revision 1.187 diff -C2 -d -r1.186 -r1.187 *** genwxbind.lua 21 Dec 2009 04:06:10 -0000 1.186 --- genwxbind.lua 12 Aug 2010 23:41:09 -0000 1.187 *************** *** 273,276 **** --- 273,277 ---- AllocDataType("LuaTable", "special", true) AllocDataType("wxString", "special", true) + AllocDataType("wxCharBuffer", "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 *************** *** 2372,2376 **** lineState.Name = tag lineState.DataType = parseState.ObjectStack[1].Name ! -- If we're at the globals level they should have declared this as -- %define_object wxPoint wxDefaultPosition --- 2373,2377 ---- lineState.Name = tag lineState.DataType = parseState.ObjectStack[1].Name ! -- If we're at the globals level they should have declared this as -- %define_object wxPoint wxDefaultPosition *************** *** 2380,2384 **** t = t + 1 end ! lineState.Action = nil lineState.ActionMandatory = false --- 2381,2385 ---- t = t + 1 end ! lineState.Action = nil lineState.ActionMandatory = false *************** *** 3883,3886 **** --- 3884,3893 ---- CommentBindingTable(codeList, " // push the result string\n") table.insert(codeList, " wxlua_pushwxString(L, "..returnPtr.."returns);\n") + elseif (memberType == "char") and (returnPtr == "*") then + CommentBindingTable(codeList, " // push the result string\n") + table.insert(codeList, " lua_pushstring(L, (const char *)returns);\n") + elseif memberType == "wxCharBuffer" then + CommentBindingTable(codeList, " // push the result string\n") + table.insert(codeList, " lua_pushstring(L, returns.data());\n") elseif not numeric then CommentBindingTable(codeList, " // push the result datatype\n") *************** *** 4048,4052 **** local wxlua_delete_function_name = "wxLua_"..MakeVar(parseObject.Name).."_delete_function" ! -- Extern Class Tag Declaration local tagcondition = FixCondition(parseObject.Condition) --- 4055,4059 ---- local wxlua_delete_function_name = "wxLua_"..MakeVar(parseObject.Name).."_delete_function" ! -- Extern Class Tag Declaration local tagcondition = FixCondition(parseObject.Condition) *************** *** 4123,4127 **** table.insert(interface.objectData[o].BindTable, delMethodBinding) end ! local classcondition = FixCondition(parseObject.Condition) --- 4130,4134 ---- table.insert(interface.objectData[o].BindTable, delMethodBinding) end ! local classcondition = FixCondition(parseObject.Condition) *************** *** 4478,4482 **** table.insert(fileData, indent.."static int wxluabaseclass_vtable_offsets_"..classTypeBinding.LuaName.."[] = "..classTypeBinding.BaseClassVtableOffsets.."\n") end ! table.insert(fileData, indent..classTypeBinding.ExternDeleteFunction) end --- 4485,4489 ---- table.insert(fileData, indent.."static int wxluabaseclass_vtable_offsets_"..classTypeBinding.LuaName.."[] = "..classTypeBinding.BaseClassVtableOffsets.."\n") end ! table.insert(fileData, indent..classTypeBinding.ExternDeleteFunction) end *************** *** 4931,4935 **** wxlua_delete_function_code = table.concat(overrideTable[wxlua_delete_function_name]) else ! wxlua_delete_function_code = "void "..wxlua_delete_function_name.."(void** p)\n{\n".. " "..ObjectName.."* o = ("..ObjectName.."*)(*p);\n".. --- 4938,4942 ---- wxlua_delete_function_code = table.concat(overrideTable[wxlua_delete_function_name]) else ! wxlua_delete_function_code = "void "..wxlua_delete_function_name.."(void** p)\n{\n".. " "..ObjectName.."* o = ("..ObjectName.."*)(*p);\n".. |
From: John L. <jr...@us...> - 2010-08-12 23:40:41
|
Update of /cvsroot/wxlua/wxLua/apps/wxluacan/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31525/apps/wxluacan/src Modified Files: cansim.cpp Log Message: Fix signature of wxLuaBinding_XXX_init() in cansim.cpp Update wxledit.cpp for cvs version of wxStEdit in wxCode Index: cansim.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluacan/src/cansim.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** cansim.cpp 15 Jan 2008 01:04:04 -0000 1.16 --- cansim.cpp 12 Aug 2010 23:40:33 -0000 1.17 *************** *** 28,32 **** // Declare the binding initialization functions ! // Note : We could also do this "extern bool wxLuaBinding_XXX_init();" and // later call "wxLuaBinding_XXX_init();" to initialize it. // However we use the macros that include #if conditions to have a --- 28,32 ---- // Declare the binding initialization functions ! // Note : We could also do this "extern wxLuaBinding* wxLuaBinding_XXX_init();" and // later call "wxLuaBinding_XXX_init();" to initialize it. // However we use the macros that include #if conditions to have a *************** *** 36,40 **** #include "wxbind/include/wxbinddefs.h" WXLUA_DECLARE_BIND_STD ! extern bool wxLuaBinding_wxluacan_init(); // WDR: class implementations --- 36,40 ---- #include "wxbind/include/wxbinddefs.h" WXLUA_DECLARE_BIND_STD ! extern wxLuaBinding* wxLuaBinding_wxluacan_init(); // WDR: class implementations |
From: John L. <jr...@us...> - 2010-08-12 23:40:41
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv31525/apps/wxluaedit/src Modified Files: wxledit.cpp Log Message: Fix signature of wxLuaBinding_XXX_init() in cansim.cpp Update wxledit.cpp for cvs version of wxStEdit in wxCode Index: wxledit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxledit.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** wxledit.cpp 5 Dec 2008 21:15:11 -0000 1.37 --- wxledit.cpp 12 Aug 2010 23:40:33 -0000 1.38 *************** *** 65,70 **** return false; ! SetFileName(name, false); ! SetLanguage(wxT("a.lua")); // use the lua lexer return true; --- 65,70 ---- return false; ! SetFileName(wxFileName(name), false); ! SetLanguage(wxFileName(wxT("a.lua"))); // use the lua lexer return true; *************** *** 284,289 **** //SetMarginMask(marginError, (1<<markerError)|(1<<markerBreak)|(1<<STE_BOOKMARK_MARKER)); ! SetFileName(wxT("untitled.lua")); ! SetLanguage(wxT("untitled.lua")); return true; } --- 284,289 ---- //SetMarginMask(marginError, (1<<markerError)|(1<<markerBreak)|(1<<STE_BOOKMARK_MARKER)); ! SetFileName(wxFileName(wxT("untitled.lua"))); ! SetLanguage(wxFileName(wxT("untitled.lua"))); return true; } *************** *** 479,483 **** m_luaOutput->SetwxLuaState(m_wxlState, true); m_luaOutput->SetWrapMode(wxSTC_WRAP_NONE); ! m_luaOutput->SetFileName(wxT("Output")); --- 479,483 ---- m_luaOutput->SetwxLuaState(m_wxlState, true); m_luaOutput->SetWrapMode(wxSTC_WRAP_NONE); ! m_luaOutput->SetFileName(wxFileName(wxT("Output"))); *************** *** 666,675 **** case ID_WXLUAIDE_LOAD_LUA : { ! wxString filename = editor->GetFileName(); ! wxString path; ! if (!filename.IsEmpty()) { - wxFileName fn(filename); path = fn.GetPath(); filename = fn.GetFullName(); --- 666,674 ---- case ID_WXLUAIDE_LOAD_LUA : { ! wxFileName fn = editor->GetFileName(); ! wxString filename, path; ! if (fn.IsOk()) { path = fn.GetPath(); filename = fn.GetFullName(); *************** *** 727,731 **** wxSafeYield(); // allow tools to adjust (sometimes necessary?) ! if (!editor->GetFileName().IsEmpty()) { wxFileName fn(editor->GetFileName()); --- 726,730 ---- wxSafeYield(); // allow tools to adjust (sometimes necessary?) ! if (editor->GetFileName().IsOk()) { wxFileName fn(editor->GetFileName()); |
From: John L. <jr...@us...> - 2010-05-06 19:32:42
|
Update of /cvsroot/wxlua/wxLua/apps/wxluaedit/src In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv14754/src Modified Files: wxluaedit.cpp Log Message: Add virtual ~wxLuaEditorFrame destructor Index: wxluaedit.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/apps/wxluaedit/src/wxluaedit.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** wxluaedit.cpp 1 Oct 2009 04:20:59 -0000 1.42 --- wxluaedit.cpp 6 May 2010 19:32:33 -0000 1.43 *************** *** 119,122 **** --- 119,124 ---- } + virtual ~wxLuaEditorFrame() {} + bool Create(const wxString& title, const wxPoint& pos, const wxSize& size, long frame_style = wxDEFAULT_FRAME_STYLE); |
From: John L. <jr...@us...> - 2010-01-30 19:00:58
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30377/wxLua/modules/wxlua/src Modified Files: wxlbind.cpp wxlstate.cpp Log Message: Make wxluaO_addgcobject return a bool instead of void. Silence XRC warnings in calculator.wx.lua since we provide them. Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.187 retrieving revision 1.188 diff -C2 -d -r1.187 -r1.188 *** wxlstate.cpp 21 Dec 2009 04:06:14 -0000 1.187 --- wxlstate.cpp 30 Jan 2010 19:00:49 -0000 1.188 *************** *** 487,491 **** // ---------------------------------------------------------------------------- ! void LUACALL wxluaO_addgcobject(lua_State *L, void *obj_ptr, int wxl_type) { lua_pushlightuserdata(L, &wxlua_lreg_gcobjects_key); // push key --- 487,491 ---- // ---------------------------------------------------------------------------- ! bool LUACALL wxluaO_addgcobject(lua_State *L, void *obj_ptr, int wxl_type) { lua_pushlightuserdata(L, &wxlua_lreg_gcobjects_key); // push key *************** *** 495,504 **** lua_pushlightuserdata(L, obj_ptr); // push key lua_rawget(L, -2); // get t[key] = value, pops key if (!lua_isnil(L, -1)) { lua_pop(L, 2); // pop table and value ! wxFAIL_MSG(wxT("Tracking an object twice in wxluaO_addgcobject: ") + wxluaT_typename(L, wxl_type)); ! return; } lua_pop(L, 1); // pop nil --- 495,506 ---- lua_pushlightuserdata(L, obj_ptr); // push key lua_rawget(L, -2); // get t[key] = value, pops key + if (!lua_isnil(L, -1)) { lua_pop(L, 2); // pop table and value ! wxCHECK_MSG(false, false, wxT("Tracking an object twice in wxluaO_addgcobject: ") + wxluaT_typename(L, wxl_type)); ! return false; } + lua_pop(L, 1); // pop nil *************** *** 509,512 **** --- 511,516 ---- lua_pop(L, 1); // pop table + + return true; } *************** *** 1072,1076 **** const wxLuaBindClass* LUACALL wxluaT_getclass(lua_State* L, int wxl_type) { ! // note: wxluaR_getref() doesn't leave anything on the stack on failure if (wxluaT_getmetatable(L, wxl_type)) { --- 1076,1080 ---- const wxLuaBindClass* LUACALL wxluaT_getclass(lua_State* L, int wxl_type) { ! // note: wxluaT_getmetatable() doesn't leave anything on the stack on failure if (wxluaT_getmetatable(L, wxl_type)) { Index: wxlbind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v retrieving revision 1.127 retrieving revision 1.128 diff -C2 -d -r1.127 -r1.128 *** wxlbind.cpp 21 Dec 2009 04:06:13 -0000 1.127 --- wxlbind.cpp 30 Jan 2010 19:00:48 -0000 1.128 *************** *** 367,371 **** else { ! // if there's a derived method, push it onto the stack to be run if (wxlua_hasderivedmethod(L, obj_ptr, name, true)) { --- 367,371 ---- else { ! // if there's a derived method in Lua, push it onto the stack to be run if (wxlua_hasderivedmethod(L, obj_ptr, name, true)) { *************** *** 384,387 **** --- 384,391 ---- if (WXLUA_HASBIT(wxlMethod->method_type, WXLUAMETHOD_GETPROP)) { + // The user wants to call the C++ function as a property + // which is treated as though it were a member variable. + // It shouldn't have been called as a function with () + // and so we call the function here and leave the value on the stack. found = true; if (WXLUA_HASBIT(wxlMethod->method_type, WXLUAMETHOD_STATIC)) *************** *** 394,397 **** --- 398,404 ---- else { + // The user has called a real C++ function and if it's + // overloaded we call wxlua_callOverloadedFunction() to + // find the correct one to call. found = true; result = 1; |
From: John L. <jr...@us...> - 2010-01-30 19:00:58
|
Update of /cvsroot/wxlua/wxLua/samples In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30377/wxLua/samples Modified Files: calculator.wx.lua Log Message: Make wxluaO_addgcobject return a bool instead of void. Silence XRC warnings in calculator.wx.lua since we provide them. Index: calculator.wx.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/samples/calculator.wx.lua,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** calculator.wx.lua 22 Jan 2008 04:45:39 -0000 1.12 --- calculator.wx.lua 30 Jan 2010 19:00:49 -0000 1.13 *************** *** 19,23 **** xmlResource = nil -- the XML resource handle txtDisplay = nil -- statictext window for the display ! clearDisplay = nil lastNumber = 0 -- the last number pressed, 0 - 9 lastOperationId = nil -- the window id of last operation button pressed --- 19,23 ---- xmlResource = nil -- the XML resource handle txtDisplay = nil -- statictext window for the display ! clearDisplay = false lastNumber = 0 -- the last number pressed, 0 - 9 lastOperationId = nil -- the window id of last operation button pressed *************** *** 100,104 **** displayString = "" end ! clearDisplay = nil -- Limit string length to 12 chars --- 100,104 ---- displayString = "" end ! clearDisplay = false -- Limit string length to 12 chars *************** *** 125,129 **** displayString = "0" elseif displayString == "" then ! displayString = num else displayString = displayString..num --- 125,129 ---- displayString = "0" elseif displayString == "" then ! displayString = tostring(num) else displayString = displayString..num *************** *** 131,135 **** end ! txtDisplay:SetLabel(tostring(displayString)) end end --- 131,135 ---- end ! txtDisplay:SetLabel(displayString) end end *************** *** 177,181 **** txtDisplay:SetLabel(tostring(displayString)) end ! clearDisplay = 1 lastOperationId = operationId end --- 177,181 ---- txtDisplay:SetLabel(tostring(displayString)) end ! clearDisplay = true lastOperationId = operationId end *************** *** 202,205 **** --- 202,207 ---- local xrcFilename = GetExePath().."/calculator.xrc" + local logNo = wx.wxLogNull() -- silence wxXmlResource error msg since we provide them + -- try to load the resource and ask for path to it if not found while not xmlResource:Load(xrcFilename) do *************** *** 225,228 **** --- 227,232 ---- end + logNo:delete() -- turn error messages back on + dialog = wx.wxDialog() if not xmlResource:LoadDialog(dialog, wx.NULL, "Calculator") then *************** *** 236,241 **** -- ----------------------------------------------------------------------- -- This is a little awkward, but it's how it's done in C++ too ! bitmap = wx.wxBitmap(xpmdata) ! icon = wx.wxIcon() icon:CopyFromBitmap(bitmap) dialog:SetIcon(icon) --- 240,245 ---- -- ----------------------------------------------------------------------- -- This is a little awkward, but it's how it's done in C++ too ! local bitmap = wx.wxBitmap(xpmdata) ! local icon = wx.wxIcon() icon:CopyFromBitmap(bitmap) dialog:SetIcon(icon) |
From: John L. <jr...@us...> - 2010-01-30 19:00:57
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30377/wxLua/modules/wxbind/src Modified Files: wxcore_wxlcore.cpp Log Message: Make wxluaO_addgcobject return a bool instead of void. Silence XRC warnings in calculator.wx.lua since we provide them. Index: wxcore_wxlcore.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_wxlcore.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxcore_wxlcore.cpp 1 Oct 2009 04:21:01 -0000 1.5 --- wxcore_wxlcore.cpp 30 Jan 2010 19:00:47 -0000 1.6 *************** *** 123,127 **** // wxLuaPrintout::OnBeginDocument 1 call base 1 // wxLuaPrintout::OnBeginDocument 3 call base 1 ! // wxPrintout::OnBeginDocument (this is the call to the wxWidgets function in it's library) // wxLuaPrintout::OnBeginDocument 4 call base 1 // wxLuaPrintout::OnBeginDocument 2 call base 0 --- 123,127 ---- // wxLuaPrintout::OnBeginDocument 1 call base 1 // wxLuaPrintout::OnBeginDocument 3 call base 1 ! // wxPrintout::OnBeginDocument (this is the call to the wxWidgets function in its library) // wxLuaPrintout::OnBeginDocument 4 call base 1 // wxLuaPrintout::OnBeginDocument 2 call base 0 |
From: John L. <jr...@us...> - 2010-01-30 19:00:57
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv30377/wxLua/modules/wxlua/include Modified Files: wxlstate.h Log Message: Make wxluaO_addgcobject return a bool instead of void. Silence XRC warnings in calculator.wx.lua since we provide them. Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.128 retrieving revision 1.129 diff -C2 -d -r1.128 -r1.129 *** wxlstate.h 21 Dec 2009 04:06:13 -0000 1.128 --- wxlstate.h 30 Jan 2010 19:00:48 -0000 1.129 *************** *** 299,303 **** // The object is stored in the wxlua_lreg_gcobjects_key of the LUA_REGISTRYINDEX. // Note that the Lua userdata internal pointer is to the obj_ptr. ! WXDLLIMPEXP_WXLUA void LUACALL wxluaO_addgcobject(lua_State* L, void* obj_ptr, int wxl_type); // Remove the wxLua object wrapped in a Lua userdata at the stack index from the // wxlua_lreg_gcobjects_key table of the LUA_REGISTRYINDEX. --- 299,303 ---- // The object is stored in the wxlua_lreg_gcobjects_key of the LUA_REGISTRYINDEX. // Note that the Lua userdata internal pointer is to the obj_ptr. ! WXDLLIMPEXP_WXLUA bool LUACALL wxluaO_addgcobject(lua_State* L, void* obj_ptr, int wxl_type); // Remove the wxLua object wrapped in a Lua userdata at the stack index from the // wxlua_lreg_gcobjects_key table of the LUA_REGISTRYINDEX. |
From: John L. <jr...@us...> - 2009-12-22 22:57:11
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv22839/wxLua/modules/wxluadebug/src Modified Files: wxlstack.cpp Log Message: Fix using button to collapse treectrl generic. Index: wxlstack.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxlstack.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** wxlstack.cpp 23 Nov 2009 05:29:01 -0000 1.35 --- wxlstack.cpp 22 Dec 2009 22:57:02 -0000 1.36 *************** *** 532,536 **** RemoveAllLuaReferences(); // remove them now since we're starting from scratch ! m_stack_sel = stack_sel; int n_entry = m_stackEntries[m_stack_sel]; --- 532,536 ---- RemoveAllLuaReferences(); // remove them now since we're starting from scratch ! m_stack_sel = stack_sel; int n_entry = m_stackEntries[m_stack_sel]; *************** *** 693,697 **** wxTreeItemIdValue dummyCookie; wxTreeItemId dummyId = m_treeCtrl->GetFirstChild(treeId, dummyCookie); ! if ((m_treeCtrl->GetItemText(dummyId) == DUMMY_TREEITEM) && (m_treeCtrl->GetItemData(dummyId) == NULL)) { --- 693,697 ---- wxTreeItemIdValue dummyCookie; wxTreeItemId dummyId = m_treeCtrl->GetFirstChild(treeId, dummyCookie); ! if ((m_treeCtrl->GetItemText(dummyId) == DUMMY_TREEITEM) && (m_treeCtrl->GetItemData(dummyId) == NULL)) { *************** *** 767,771 **** --- 767,780 ---- ExpandItemChildren(start_item); else + { + wxLuaStackListData* stkListData = (wxLuaStackListData*)m_listData[start_item]; + wxCHECK_RET(stkListData != NULL, wxT("Invalid wxLuaStack data")); + + // Hack for WXLUA_STACK_MSWTREE, collapse tree first + if (stkListData->m_treeId && m_treeCtrl->IsExpanded(stkListData->m_treeId)) + m_treeCtrl->Collapse(stkListData->m_treeId); + CollapseItem(start_item); + } } *************** *** 1006,1010 **** else { ! // Hack for WXLUA_STACK_MSWTREE, need children to collapse if (stkListData->m_treeId && m_treeCtrl->IsExpanded(stkListData->m_treeId)) m_treeCtrl->Collapse(stkListData->m_treeId); --- 1015,1019 ---- else { ! // Hack for WXLUA_STACK_MSWTREE, collapse tree first if (stkListData->m_treeId && m_treeCtrl->IsExpanded(stkListData->m_treeId)) m_treeCtrl->Collapse(stkListData->m_treeId); *************** *** 1119,1123 **** wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; ! if ((n > lc_item) && (stkListData_n->m_level <= level)) break; --- 1128,1132 ---- wxLuaStackListData* stkListData_n = (wxLuaStackListData*)m_listData[n]; ! if ((n > lc_item) && (stkListData_n->m_level <= level)) break; *************** *** 1186,1195 **** m_expandedItems.erase(long_key); } ! // note that the debug item is a member of the parent debug data array debugItem_n->SetFlagBit(WXLUA_DEBUGITEM_EXPANDED, false); //m_listData.RemoveAt(n); // we remove them all at once for speed, see below ! //n--; //count = m_listData.GetCount(); delete stkListData_n; --- 1195,1204 ---- m_expandedItems.erase(long_key); } ! // note that the debug item is a member of the parent debug data array debugItem_n->SetFlagBit(WXLUA_DEBUGITEM_EXPANDED, false); //m_listData.RemoveAt(n); // we remove them all at once for speed, see below ! //n--; //count = m_listData.GetCount(); delete stkListData_n; |
From: John L. <jr...@us...> - 2009-12-21 04:06:56
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10162/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: Use a wxArray instead of a wxList for the wxLuaBindingArray (was List) Simplify and cleanup initializing the bindings, linking base class wxLuaBindMethods Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** wxlua.i 14 May 2009 05:06:21 -0000 1.20 --- wxlua.i 21 Dec 2009 04:06:10 -0000 1.21 *************** *** 92,100 **** // to delete this class and is not part of the // original class. - - WXLUAMETHOD_CHECKED_OVERLOAD // Class method has been checked to see if it is - // overloaded from the base class. - // Check WXLUAMETHOD::basemethod and if !NULL - // this method is an overload from the base class %endenum --- 92,95 ---- Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** override.hpp 1 Oct 2009 04:21:00 -0000 1.24 --- override.hpp 21 Dec 2009 04:06:10 -0000 1.25 *************** *** 238,253 **** int idx = 1; ! wxLuaBindingList::compatibility_iterator node; ! for (node = wxLuaBinding::GetBindingList()->GetFirst(); node; node = node->GetNext(), idx++) { - wxLuaBinding* binding = node->GetData(); - // Push function to access the binding info const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); ! *ptr = binding; lua_newtable(L); lua_pushstring(L, "__index"); ! lua_pushlightuserdata(L, binding); // push tag to recognize table call ! lua_pushcclosure(L, wxluabind_wxLuaBinding__index, 1); // push func with tag as upvalue lua_rawset(L, -3); --- 238,254 ---- int idx = 1; ! ! wxLuaBindingArray& wxlbArray = wxLuaBinding::GetBindingArray(); ! size_t n, count = wxlbArray.GetCount(); ! ! for (n = 0; n < count; n++, idx++) { // Push function to access the binding info const void **ptr = (const void **)lua_newuserdata(L, sizeof(void *)); ! *ptr = wxlbArray[n]; lua_newtable(L); lua_pushstring(L, "__index"); ! lua_pushlightuserdata(L, wxlbArray[n]); // push tag to recognize table call ! lua_pushcclosure(L, wxluabind_wxLuaBinding__index, 1); // push func with tag as upvalue lua_rawset(L, -3); |
From: John L. <jr...@us...> - 2009-12-21 04:06:54
|
Update of /cvsroot/wxlua/wxLua/bindings In directory sfp-cvsdas-1.v30.ch3.sourceforge.com:/tmp/cvs-serv10162/wxLua/bindings Modified Files: genwxbind.lua Log Message: Use a wxArray instead of a wxList for the wxLuaBindingArray (was List) Simplify and cleanup initializing the bindings, linking base class wxLuaBindMethods Index: genwxbind.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v retrieving revision 1.185 retrieving revision 1.186 diff -C2 -d -r1.185 -r1.186 *** genwxbind.lua 12 Oct 2009 01:50:03 -0000 1.185 --- genwxbind.lua 21 Dec 2009 04:06:10 -0000 1.186 *************** *** 18,22 **** -- --------------------------------------------------------------------------- ! WXLUA_BINDING_VERSION = 29 -- 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 = 30 -- Used to verify that the bindings are updated -- This must match modules/wxlua/include/wxldefs.h -- otherwise a compile time error will be generated. *************** *** 4283,4287 **** table.insert(fileData, "// initialize "..hook_cpp_binding_classname.." for all wxLuaStates\n") ! table.insert(fileData, "extern "..output_cpp_impexpsymbol.." bool "..hook_cpp_binding_classname.."_init();\n\n") if hook_bind_condition then --- 4283,4287 ---- table.insert(fileData, "// initialize "..hook_cpp_binding_classname.." for all wxLuaStates\n") ! table.insert(fileData, "extern "..output_cpp_impexpsymbol.." wxLuaBinding* "..hook_cpp_binding_classname.."_init();\n\n") if hook_bind_condition then *************** *** 4526,4529 **** --- 4526,4530 ---- 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\n") *************** *** 4532,4542 **** table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "bool "..hook_cpp_binding_classname.."_init()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " static "..hook_cpp_binding_classname.." m_binding;\n") ! --table.insert(fileData, " wxLuaBindingList::Node *node = wxLuaBinding::GetBindingList()->Find(&m_binding);\n") ! table.insert(fileData, " if (wxLuaBinding::GetBindingList()->Find(&m_binding)) return false;\n\n") ! table.insert(fileData, " wxLuaBinding::GetBindingList()->Append(&m_binding);\n") ! table.insert(fileData, " return true;\n") table.insert(fileData, "}\n\n") --- 4533,4542 ---- table.insert(fileData, "// ---------------------------------------------------------------------------\n\n") ! table.insert(fileData, "wxLuaBinding* "..hook_cpp_binding_classname.."_init()\n") table.insert(fileData, "{\n") ! table.insert(fileData, " static "..hook_cpp_binding_classname.." m_binding;\n\n") ! table.insert(fileData, " if (wxLuaBinding::GetBindingArray().Index(&m_binding) == wxNOT_FOUND)\n") ! table.insert(fileData, " wxLuaBinding::GetBindingArray().Add(&m_binding);\n\n") ! table.insert(fileData, " return &m_binding;\n") table.insert(fileData, "}\n\n") |