From: John L. <jr...@us...> - 2006-05-06 16:58:34
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13749/wxLua/modules/wxbind/src Modified Files: mdi.cpp wx_bind.cpp Log Message: update mdi.i to wxWidgets 2.6.3 Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** wx_bind.cpp 5 May 2006 22:02:44 -0000 1.33 --- wx_bind.cpp 6 May 2006 16:58:30 -0000 1.34 *************** *** 554,558 **** { "wxBACKINGSTORE", wxBACKINGSTORE }, { "wxBACKWARD", wxBACKWARD }, - { "wxBOTH", wxBOTH }, { "wxBOTTOM", wxBOTTOM }, { "wxCANCEL", wxCANCEL }, --- 554,557 ---- *************** *** 571,575 **** { "wxGTK", wxGTK }, { "wxHELP", wxHELP }, - { "wxHORIZONTAL", wxHORIZONTAL }, { "wxHSCROLL", wxHSCROLL }, { "wxICON_ASTERISK", wxICON_ASTERISK }, --- 570,573 ---- *************** *** 617,621 **** { "wxTRANSPARENT_WINDOW", wxTRANSPARENT_WINDOW }, { "wxUNKNOWN_PLATFORM", wxUNKNOWN_PLATFORM }, - { "wxVERTICAL", wxVERTICAL }, { "wxVSCROLL", wxVSCROLL }, { "wxWANTS_CHARS", wxWANTS_CHARS }, --- 615,618 ---- *************** *** 1646,1649 **** --- 1643,1647 ---- { "wxBITMAP_TYPE_XPM", wxBITMAP_TYPE_XPM }, { "wxBITMAP_TYPE_XPM_DATA", wxBITMAP_TYPE_XPM_DATA }, + { "wxBOTH", wxBOTH }, { "wxBOTTOM", wxBOTTOM }, { "wxCOSE_X", wxCOSE_X }, *************** *** 1665,1668 **** --- 1663,1667 ---- { "wxGTK_OS2", wxGTK_OS2 }, { "wxGTK_WIN32", wxGTK_WIN32 }, + { "wxHORIZONTAL", wxHORIZONTAL }, { "wxIDLE_PROCESS_ALL", wxIDLE_PROCESS_ALL }, { "wxIDLE_PROCESS_SPECIFIED", wxIDLE_PROCESS_SPECIFIED }, *************** *** 1730,1733 **** --- 1729,1733 ---- { "wxUPDATE_UI_PROCESS_SPECIFIED", wxUPDATE_UI_PROCESS_SPECIFIED }, { "wxUPDATE_UI_RECURSE", wxUPDATE_UI_RECURSE }, + { "wxVERTICAL", wxVERTICAL }, { "wxWEST", wxWEST }, { "wxWIN32S", wxWIN32S }, Index: mdi.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/mdi.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** mdi.cpp 2 May 2006 05:25:02 -0000 1.13 --- mdi.cpp 6 May 2006 16:58:30 -0000 1.14 *************** *** 309,320 **** } ! // void Tile() static int LUACALL wxLua_wxMDIParentFrame_Tile(lua_State *L) { wxLuaState wxlState(L); // get this wxMDIParentFrame * self = (wxMDIParentFrame *)wxlState.GetUserDataType(1, s_wxluatag_wxMDIParentFrame); // call Tile ! self->Tile(); return 0; --- 309,324 ---- } ! // void Tile(wxOrientation orient = wxHORIZONTAL) static int LUACALL wxLua_wxMDIParentFrame_Tile(lua_State *L) { wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // wxOrientation orient = wxHORIZONTAL + wxOrientation orient = (argCount >= 2 ? (wxOrientation)wxlState.GetEnumerationType(2) : wxHORIZONTAL); // get this wxMDIParentFrame * self = (wxMDIParentFrame *)wxlState.GetUserDataType(1, s_wxluatag_wxMDIParentFrame); // call Tile ! self->Tile(orient); return 0; *************** *** 358,368 **** { LuaMethod, "GetClientSize", wxLua_wxMDIParentFrame_GetClientSize, 2, 2, { &s_wxluaarg_LightUserData, &s_wxluaarg_LightUserData, 0 } }, { LuaMethod, "GetActiveChild", wxLua_wxMDIParentFrame_GetActiveChild, 0, 0, { 0 } }, - { LuaGetProp, "ActiveChild", wxLua_wxMDIParentFrame_GetActiveChild, 0, 0, {0} }, { LuaMethod, "GetClientWindow", wxLua_wxMDIParentFrame_GetClientWindow, 0, 0, { 0 } }, - { LuaGetProp, "ClientWindow", wxLua_wxMDIParentFrame_GetClientWindow, 0, 0, {0} }, { LuaMethod, "GetToolBar", wxLua_wxMDIParentFrame_GetToolBar, 0, 0, { 0 } }, { LuaGetProp, "ToolBar", wxLua_wxMDIParentFrame_GetToolBar, 0, 0, {0} }, { LuaSetProp, "ToolBar", wxLua_wxMDIParentFrame_SetToolBar, 1, 1, {0} }, - { LuaMethod, "Tile", wxLua_wxMDIParentFrame_Tile, 0, 0, { 0 } }, { LuaDelete, "wxMDIParentFrame", wxLua_wxMDIParentFrame_destructor, 0, 0, {0} }, }; --- 362,372 ---- { LuaMethod, "GetClientSize", wxLua_wxMDIParentFrame_GetClientSize, 2, 2, { &s_wxluaarg_LightUserData, &s_wxluaarg_LightUserData, 0 } }, { LuaMethod, "GetActiveChild", wxLua_wxMDIParentFrame_GetActiveChild, 0, 0, { 0 } }, { LuaMethod, "GetClientWindow", wxLua_wxMDIParentFrame_GetClientWindow, 0, 0, { 0 } }, { LuaMethod, "GetToolBar", wxLua_wxMDIParentFrame_GetToolBar, 0, 0, { 0 } }, + { LuaMethod, "Tile", wxLua_wxMDIParentFrame_Tile, 1, 0, { &s_wxluaarg_Enumeration, 0 } }, + { LuaGetProp, "ActiveChild", wxLua_wxMDIParentFrame_GetActiveChild, 0, 0, {0} }, + { LuaGetProp, "ClientWindow", wxLua_wxMDIParentFrame_GetClientWindow, 0, 0, {0} }, { LuaGetProp, "ToolBar", wxLua_wxMDIParentFrame_GetToolBar, 0, 0, {0} }, { LuaSetProp, "ToolBar", wxLua_wxMDIParentFrame_SetToolBar, 1, 1, {0} }, { LuaDelete, "wxMDIParentFrame", wxLua_wxMDIParentFrame_destructor, 0, 0, {0} }, }; *************** *** 747,751 **** #if (wxCHECK_VERSION(2,6,0)) && (wxLUA_USE_MDI) ! // %wxchkver26 size_t GetHistoryFilesCount() const; static int LUACALL wxLua_wxDocManager_GetHistoryFilesCount(lua_State *L) { --- 751,755 ---- #if (wxCHECK_VERSION(2,6,0)) && (wxLUA_USE_MDI) ! // %wxchkver26 size_t GetHistoryFilesCount() const static int LUACALL wxLua_wxDocManager_GetHistoryFilesCount(lua_State *L) { *************** *** 813,817 **** } ! // wxFileHistory * OnCreateFileHistory() static int LUACALL wxLua_wxDocManager_OnCreateFileHistory(lua_State *L) { --- 817,821 ---- } ! // wxFileHistory* OnCreateFileHistory() static int LUACALL wxLua_wxDocManager_OnCreateFileHistory(lua_State *L) { *************** *** 849,852 **** --- 853,873 ---- } + // %override wxLua_wxDocManager_GetTemplates + // wxList& GetTemplates() + static int LUACALL wxLua_wxDocManager_GetTemplates(lua_State *L) + { + wxLuaState wxlState(L); + wxList *returns; + // get this + wxDocManager *self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); + // call GetDocuments + wxList &docs = self->GetTemplates(); + returns = new wxList(docs); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxList, returns); + // return the number of parameters + return 1; + } + #endif *************** *** 961,964 **** --- 982,1004 ---- } + // bool CloseDocuments(bool force = true) + static int LUACALL wxLua_wxDocManager_CloseDocuments(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool force = true + bool force = (argCount >= 2 ? wxlState.GetBooleanType(2) : true); + // get this + wxDocManager * self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); + // call CloseDocuments + returns = self->CloseDocuments(force); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + // wxDocument* CreateDocument(const wxString& path, long flags) static int LUACALL wxLua_wxDocManager_CreateDocument(lua_State *L) *************** *** 1117,1121 **** } ! // bool MakeDefaultName(wxString& buf) // FIXME needs override to return string static int LUACALL wxLua_wxDocManager_MakeDefaultName(lua_State *L) { --- 1157,1162 ---- } ! // %override wxLua_wxDocManager_MakeDefaultName ! // bool MakeDefaultName(wxString& buf) static int LUACALL wxLua_wxDocManager_MakeDefaultName(lua_State *L) { *************** *** 1130,1135 **** // push the result flag lua_pushboolean(L, returns); ! return 1; } --- 1171,1177 ---- // push the result flag lua_pushboolean(L, returns); + lua_pushstring(L, wx2lua(buf)); ! return 2; } *************** *** 1148,1151 **** --- 1190,1207 ---- } + // void OnFileCloseAll(wxCommandEvent& event) + static int LUACALL wxLua_wxDocManager_OnFileCloseAll(lua_State *L) + { + wxLuaState wxlState(L); + // wxCommandEvent event + wxCommandEvent * event = (wxCommandEvent *)wxlState.GetUserDataType(2, s_wxluatag_wxCommandEvent); + // get this + wxDocManager * self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); + // call OnFileCloseAll + self->OnFileCloseAll(*event); + + return 0; + } + // void OnFileNew(wxCommandEvent &event) static int LUACALL wxLua_wxDocManager_OnFileNew(lua_State *L) *************** *** 1176,1179 **** --- 1232,1249 ---- } + // void OnFileRevert(wxCommandEvent& event) + static int LUACALL wxLua_wxDocManager_OnFileRevert(lua_State *L) + { + wxLuaState wxlState(L); + // wxCommandEvent event + wxCommandEvent * event = (wxCommandEvent *)wxlState.GetUserDataType(2, s_wxluatag_wxCommandEvent); + // get this + wxDocManager * self = (wxDocManager *)wxlState.GetUserDataType(1, s_wxluatag_wxDocManager); + // call OnFileRevert + self->OnFileRevert(*event); + + return 0; + } + // void OnFileSave(wxCommandEvent &event) static int LUACALL wxLua_wxDocManager_OnFileSave(lua_State *L) *************** *** 1292,1295 **** --- 1362,1366 ---- #if (wxLUA_USE_MDI) && (wxLUA_USE_wxList) { LuaMethod, "GetDocuments", wxLua_wxDocManager_GetDocuments, 0, 0, { 0 } }, + { LuaMethod, "GetTemplates", wxLua_wxDocManager_GetTemplates, 0, 0, { 0 } }, #endif *************** *** 1305,1308 **** --- 1376,1380 ---- { LuaMethod, "AddFileToHistory", wxLua_wxDocManager_AddFileToHistory, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "AssociateTemplate", wxLua_wxDocManager_AssociateTemplate, 1, 1, { &s_wxluatag_wxDocTemplate, 0 } }, + { LuaMethod, "CloseDocuments", wxLua_wxDocManager_CloseDocuments, 1, 0, { &s_wxluaarg_Boolean, 0 } }, { LuaMethod, "CreateDocument", wxLua_wxDocManager_CreateDocument, 2, 2, { &s_wxluaarg_String, &s_wxluaarg_Number, 0 } }, { LuaMethod, "CreateView", wxLua_wxDocManager_CreateView, 2, 2, { &s_wxluatag_wxDocument, &s_wxluaarg_Number, 0 } }, *************** *** 1317,1329 **** { LuaMethod, "MakeDefaultName", wxLua_wxDocManager_MakeDefaultName, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "OnFileClose", wxLua_wxDocManager_OnFileClose, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileNew", wxLua_wxDocManager_OnFileNew, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileOpen", wxLua_wxDocManager_OnFileOpen, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileSave", wxLua_wxDocManager_OnFileSave, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileSaveAs", wxLua_wxDocManager_OnFileSaveAs, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "RemoveDocument", wxLua_wxDocManager_RemoveDocument, 1, 1, { &s_wxluatag_wxDocument, 0 } }, { LuaMethod, "SetLastDirectory", wxLua_wxDocManager_SetLastDirectory, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "LastDirectory", wxLua_wxDocManager_GetLastDirectory, 0, 0, {0} }, { LuaSetProp, "LastDirectory", wxLua_wxDocManager_SetLastDirectory, 1, 1, {0} }, - { LuaMethod, "SetMaxDocsOpen", wxLua_wxDocManager_SetMaxDocsOpen, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaGetProp, "MaxDocsOpen", wxLua_wxDocManager_GetMaxDocsOpen, 0, 0, {0} }, { LuaSetProp, "MaxDocsOpen", wxLua_wxDocManager_SetMaxDocsOpen, 1, 1, {0} }, --- 1389,1403 ---- { LuaMethod, "MakeDefaultName", wxLua_wxDocManager_MakeDefaultName, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "OnFileClose", wxLua_wxDocManager_OnFileClose, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, + { LuaMethod, "OnFileCloseAll", wxLua_wxDocManager_OnFileCloseAll, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileNew", wxLua_wxDocManager_OnFileNew, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileOpen", wxLua_wxDocManager_OnFileOpen, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, + { LuaMethod, "OnFileRevert", wxLua_wxDocManager_OnFileRevert, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileSave", wxLua_wxDocManager_OnFileSave, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "OnFileSaveAs", wxLua_wxDocManager_OnFileSaveAs, 1, 1, { &s_wxluatag_wxCommandEvent, 0 } }, { LuaMethod, "RemoveDocument", wxLua_wxDocManager_RemoveDocument, 1, 1, { &s_wxluatag_wxDocument, 0 } }, { LuaMethod, "SetLastDirectory", wxLua_wxDocManager_SetLastDirectory, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetMaxDocsOpen", wxLua_wxDocManager_SetMaxDocsOpen, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaGetProp, "LastDirectory", wxLua_wxDocManager_GetLastDirectory, 0, 0, {0} }, { LuaSetProp, "LastDirectory", wxLua_wxDocManager_SetLastDirectory, 1, 1, {0} }, { LuaGetProp, "MaxDocsOpen", wxLua_wxDocManager_GetMaxDocsOpen, 0, 0, {0} }, { LuaSetProp, "MaxDocsOpen", wxLua_wxDocManager_SetMaxDocsOpen, 1, 1, {0} }, *************** *** 1620,1623 **** --- 1694,1720 ---- } + // bool InitDocument(wxDocument* doc, const wxString& path, long flags = 0) + static int LUACALL wxLua_wxDocTemplate_InitDocument(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // long flags = 0 + long flags = (argCount >= 4 ? (long)wxlState.GetNumberType(4) : 0); + // const wxString path + const wxString path = lua2wx(wxlState.GetStringType(3)); + // wxDocument doc + wxDocument * doc = (wxDocument *)wxlState.GetUserDataType(2, s_wxluatag_wxDocument); + // get this + wxDocTemplate * self = (wxDocTemplate *)wxlState.GetUserDataType(1, s_wxluatag_wxDocTemplate); + // call InitDocument + returns = self->InitDocument(doc, path, flags); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + // bool IsVisible() static int LUACALL wxLua_wxDocTemplate_IsVisible(lua_State *L) *************** *** 1745,1765 **** { LuaMethod, "GetFlags", wxLua_wxDocTemplate_GetFlags, 0, 0, { 0 } }, { LuaMethod, "GetViewName", wxLua_wxDocTemplate_GetViewName, 0, 0, { 0 } }, { LuaMethod, "IsVisible", wxLua_wxDocTemplate_IsVisible, 0, 0, { 0 } }, { LuaMethod, "SetDefaultExtension", wxLua_wxDocTemplate_SetDefaultExtension, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "DefaultExtension", wxLua_wxDocTemplate_GetDefaultExtension, 0, 0, {0} }, { LuaSetProp, "DefaultExtension", wxLua_wxDocTemplate_SetDefaultExtension, 1, 1, {0} }, - { LuaMethod, "SetDescription", wxLua_wxDocTemplate_SetDescription, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "Description", wxLua_wxDocTemplate_GetDescription, 0, 0, {0} }, { LuaSetProp, "Description", wxLua_wxDocTemplate_SetDescription, 1, 1, {0} }, - { LuaMethod, "SetDirectory", wxLua_wxDocTemplate_SetDirectory, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "Directory", wxLua_wxDocTemplate_GetDirectory, 0, 0, {0} }, { LuaSetProp, "Directory", wxLua_wxDocTemplate_SetDirectory, 1, 1, {0} }, - { LuaMethod, "SetDocumentManager", wxLua_wxDocTemplate_SetDocumentManager, 1, 1, { &s_wxluatag_wxDocManager, 0 } }, { LuaGetProp, "DocumentManager", wxLua_wxDocTemplate_GetDocumentManager, 0, 0, {0} }, { LuaSetProp, "DocumentManager", wxLua_wxDocTemplate_SetDocumentManager, 1, 1, {0} }, - { LuaMethod, "SetFileFilter", wxLua_wxDocTemplate_SetFileFilter, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "FileFilter", wxLua_wxDocTemplate_GetFileFilter, 0, 0, {0} }, { LuaSetProp, "FileFilter", wxLua_wxDocTemplate_SetFileFilter, 1, 1, {0} }, - { LuaMethod, "SetFlags", wxLua_wxDocTemplate_SetFlags, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaGetProp, "Flags", wxLua_wxDocTemplate_GetFlags, 0, 0, {0} }, { LuaSetProp, "Flags", wxLua_wxDocTemplate_SetFlags, 1, 1, {0} }, --- 1842,1863 ---- { LuaMethod, "GetFlags", wxLua_wxDocTemplate_GetFlags, 0, 0, { 0 } }, { LuaMethod, "GetViewName", wxLua_wxDocTemplate_GetViewName, 0, 0, { 0 } }, + { LuaMethod, "InitDocument", wxLua_wxDocTemplate_InitDocument, 3, 2, { &s_wxluatag_wxDocument, &s_wxluaarg_String, &s_wxluaarg_Number, 0 } }, { LuaMethod, "IsVisible", wxLua_wxDocTemplate_IsVisible, 0, 0, { 0 } }, { LuaMethod, "SetDefaultExtension", wxLua_wxDocTemplate_SetDefaultExtension, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetDescription", wxLua_wxDocTemplate_SetDescription, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetDirectory", wxLua_wxDocTemplate_SetDirectory, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetDocumentManager", wxLua_wxDocTemplate_SetDocumentManager, 1, 1, { &s_wxluatag_wxDocManager, 0 } }, + { LuaMethod, "SetFileFilter", wxLua_wxDocTemplate_SetFileFilter, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetFlags", wxLua_wxDocTemplate_SetFlags, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaGetProp, "DefaultExtension", wxLua_wxDocTemplate_GetDefaultExtension, 0, 0, {0} }, { LuaSetProp, "DefaultExtension", wxLua_wxDocTemplate_SetDefaultExtension, 1, 1, {0} }, { LuaGetProp, "Description", wxLua_wxDocTemplate_GetDescription, 0, 0, {0} }, { LuaSetProp, "Description", wxLua_wxDocTemplate_SetDescription, 1, 1, {0} }, { LuaGetProp, "Directory", wxLua_wxDocTemplate_GetDirectory, 0, 0, {0} }, { LuaSetProp, "Directory", wxLua_wxDocTemplate_SetDirectory, 1, 1, {0} }, { LuaGetProp, "DocumentManager", wxLua_wxDocTemplate_GetDocumentManager, 0, 0, {0} }, { LuaSetProp, "DocumentManager", wxLua_wxDocTemplate_SetDocumentManager, 1, 1, {0} }, { LuaGetProp, "FileFilter", wxLua_wxDocTemplate_GetFileFilter, 0, 0, {0} }, { LuaSetProp, "FileFilter", wxLua_wxDocTemplate_SetFileFilter, 1, 1, {0} }, { LuaGetProp, "Flags", wxLua_wxDocTemplate_GetFlags, 0, 0, {0} }, { LuaSetProp, "Flags", wxLua_wxDocTemplate_SetFlags, 1, 1, {0} }, *************** *** 2025,2028 **** --- 2123,2127 ---- } + // %override wxLua_wxDocument_GetPrintableName // virtual void GetPrintableName(wxString& name) const static int LUACALL wxLua_wxDocument_GetPrintableName(lua_State *L) *************** *** 2035,2040 **** // call GetPrintableName self->GetPrintableName(name); ! return 0; } --- 2134,2140 ---- // call GetPrintableName self->GetPrintableName(name); + lua_pushstring(L, wx2lua(name)); ! return 1; } *************** *** 2353,2365 **** { LuaMethod, "SaveAs", wxLua_wxDocument_SaveAs, 0, 0, { 0 } }, { LuaMethod, "SetDocumentName", wxLua_wxDocument_SetDocumentName, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "DocumentName", wxLua_wxDocument_GetDocumentName, 0, 0, {0} }, { LuaSetProp, "DocumentName", wxLua_wxDocument_SetDocumentName, 1, 1, {0} }, - { LuaMethod, "SetDocumentTemplate", wxLua_wxDocument_SetDocumentTemplate, 1, 1, { &s_wxluatag_wxDocTemplate, 0 } }, { LuaGetProp, "DocumentTemplate", wxLua_wxDocument_GetDocumentTemplate, 0, 0, {0} }, { LuaSetProp, "DocumentTemplate", wxLua_wxDocument_SetDocumentTemplate, 1, 1, {0} }, - { LuaMethod, "SetFilename", wxLua_wxDocument_SetFilename, 2, 1, { &s_wxluaarg_String, &s_wxluaarg_Boolean, 0 } }, { LuaGetProp, "Filename", wxLua_wxDocument_GetFilename, 0, 0, {0} }, { LuaSetProp, "Filename", wxLua_wxDocument_SetFilename, 1, 1, {0} }, - { LuaMethod, "SetTitle", wxLua_wxDocument_SetTitle, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "Title", wxLua_wxDocument_GetTitle, 0, 0, {0} }, { LuaSetProp, "Title", wxLua_wxDocument_SetTitle, 1, 1, {0} }, --- 2453,2465 ---- { LuaMethod, "SaveAs", wxLua_wxDocument_SaveAs, 0, 0, { 0 } }, { LuaMethod, "SetDocumentName", wxLua_wxDocument_SetDocumentName, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetDocumentTemplate", wxLua_wxDocument_SetDocumentTemplate, 1, 1, { &s_wxluatag_wxDocTemplate, 0 } }, + { LuaMethod, "SetFilename", wxLua_wxDocument_SetFilename, 2, 1, { &s_wxluaarg_String, &s_wxluaarg_Boolean, 0 } }, + { LuaMethod, "SetTitle", wxLua_wxDocument_SetTitle, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "DocumentName", wxLua_wxDocument_GetDocumentName, 0, 0, {0} }, { LuaSetProp, "DocumentName", wxLua_wxDocument_SetDocumentName, 1, 1, {0} }, { LuaGetProp, "DocumentTemplate", wxLua_wxDocument_GetDocumentTemplate, 0, 0, {0} }, { LuaSetProp, "DocumentTemplate", wxLua_wxDocument_SetDocumentTemplate, 1, 1, {0} }, { LuaGetProp, "Filename", wxLua_wxDocument_GetFilename, 0, 0, {0} }, { LuaSetProp, "Filename", wxLua_wxDocument_SetFilename, 1, 1, {0} }, { LuaGetProp, "Title", wxLua_wxDocument_GetTitle, 0, 0, {0} }, { LuaSetProp, "Title", wxLua_wxDocument_SetTitle, 1, 1, {0} }, *************** *** 2662,2670 **** { LuaMethod, "OnCreate", wxLua_wxView_OnCreate, 2, 2, { &s_wxluatag_wxDocument, &s_wxluaarg_Number, 0 } }, { LuaMethod, "SetDocument", wxLua_wxView_SetDocument, 1, 1, { &s_wxluatag_wxDocument, 0 } }, { LuaGetProp, "Document", wxLua_wxView_GetDocument, 0, 0, {0} }, { LuaSetProp, "Document", wxLua_wxView_SetDocument, 1, 1, {0} }, { LuaGetProp, "Frame", wxLua_wxView_GetFrame, 0, 0, {0} }, { LuaSetProp, "Frame", wxLua_wxView_SetFrame, 1, 1, {0} }, - { LuaMethod, "SetViewName", wxLua_wxView_SetViewName, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "ViewName", wxLua_wxView_GetViewName, 0, 0, {0} }, { LuaSetProp, "ViewName", wxLua_wxView_SetViewName, 1, 1, {0} }, --- 2762,2770 ---- { LuaMethod, "OnCreate", wxLua_wxView_OnCreate, 2, 2, { &s_wxluatag_wxDocument, &s_wxluaarg_Number, 0 } }, { LuaMethod, "SetDocument", wxLua_wxView_SetDocument, 1, 1, { &s_wxluatag_wxDocument, 0 } }, + { LuaMethod, "SetViewName", wxLua_wxView_SetViewName, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaGetProp, "Document", wxLua_wxView_GetDocument, 0, 0, {0} }, { LuaSetProp, "Document", wxLua_wxView_SetDocument, 1, 1, {0} }, { LuaGetProp, "Frame", wxLua_wxView_GetFrame, 0, 0, {0} }, { LuaSetProp, "Frame", wxLua_wxView_SetFrame, 1, 1, {0} }, { LuaGetProp, "ViewName", wxLua_wxView_GetViewName, 0, 0, {0} }, { LuaSetProp, "ViewName", wxLua_wxView_SetViewName, 1, 1, {0} }, *************** *** 2742,2759 **** #if (wxLUA_USE_wxMenu) && (wxLUA_USE_wxCommandProcessor) - // void SetEditMenu(wxMenu *menu) - static int LUACALL wxLua_wxCommandProcessor_SetEditMenu(lua_State *L) - { - wxLuaState wxlState(L); - // wxMenu menu - wxMenu * menu = (wxMenu *)wxlState.GetUserDataType(2, s_wxluatag_wxMenu); - // get this - wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); - // call SetEditMenu - self->SetEditMenu(menu); - - return 0; - } - // wxMenu *GetEditMenu() const static int LUACALL wxLua_wxCommandProcessor_GetEditMenu(lua_State *L) --- 2842,2845 ---- *************** *** 2771,2774 **** --- 2857,2874 ---- } + // void SetEditMenu(wxMenu *menu) + static int LUACALL wxLua_wxCommandProcessor_SetEditMenu(lua_State *L) + { + wxLuaState wxlState(L); + // wxMenu menu + wxMenu * menu = (wxMenu *)wxlState.GetUserDataType(2, s_wxluatag_wxMenu); + // get this + wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); + // call SetEditMenu + self->SetEditMenu(menu); + + return 0; + } + #endif *************** *** 2793,2811 **** } ! // virtual bool Submit(wxCommand *command, bool storeIt = true) ! static int LUACALL wxLua_wxCommandProcessor_Submit(lua_State *L) { wxLuaState wxlState(L); bool returns; - // get number of arguments - int argCount = lua_gettop(L); - // bool storeIt = true - bool storeIt = (argCount >= 3 ? wxlState.GetBooleanType(3) : true); - // wxCommand command - wxCommand * command = (wxCommand *)wxlState.GetUserDataType(2, s_wxluatag_wxCommand); // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call Submit ! returns = self->Submit(command, storeIt); // push the result flag lua_pushboolean(L, returns); --- 2893,2905 ---- } ! // virtual bool CanRedo() const ! static int LUACALL wxLua_wxCommandProcessor_CanRedo(lua_State *L) { wxLuaState wxlState(L); bool returns; // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call CanRedo ! returns = self->CanRedo(); // push the result flag lua_pushboolean(L, returns); *************** *** 2814,2819 **** } ! // virtual bool Undo() ! static int LUACALL wxLua_wxCommandProcessor_Undo(lua_State *L) { wxLuaState wxlState(L); --- 2908,2913 ---- } ! // virtual bool CanUndo() const ! static int LUACALL wxLua_wxCommandProcessor_CanUndo(lua_State *L) { wxLuaState wxlState(L); *************** *** 2821,2826 **** // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call Undo ! returns = self->Undo(); // push the result flag lua_pushboolean(L, returns); --- 2915,2920 ---- // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call CanUndo ! returns = self->CanUndo(); // push the result flag lua_pushboolean(L, returns); *************** *** 2844,2849 **** } ! // virtual bool CanUndo() const ! static int LUACALL wxLua_wxCommandProcessor_CanUndo(lua_State *L) { wxLuaState wxlState(L); --- 2938,2943 ---- } ! // virtual bool Undo() ! static int LUACALL wxLua_wxCommandProcessor_Undo(lua_State *L) { wxLuaState wxlState(L); *************** *** 2851,2856 **** // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call CanUndo ! returns = self->CanUndo(); // push the result flag lua_pushboolean(L, returns); --- 2945,2950 ---- // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call Undo ! returns = self->Undo(); // push the result flag lua_pushboolean(L, returns); *************** *** 2859,2873 **** } ! // virtual bool CanRedo() const ! static int LUACALL wxLua_wxCommandProcessor_CanRedo(lua_State *L) { wxLuaState wxlState(L); - bool returns; // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call CanRedo ! returns = self->CanRedo(); ! // push the result flag ! lua_pushboolean(L, returns); return 1; --- 2953,3039 ---- } ! // virtual void ClearCommands() ! static int LUACALL wxLua_wxCommandProcessor_ClearCommands(lua_State *L) { wxLuaState wxlState(L); // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call ClearCommands ! self->ClearCommands(); ! ! return 0; ! } ! ! // int GetMaxCommands() const ! static int LUACALL wxLua_wxCommandProcessor_GetMaxCommands(lua_State *L) ! { ! wxLuaState wxlState(L); ! int returns; ! // get this ! wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetMaxCommands ! returns = self->GetMaxCommands(); ! // push the result number ! lua_pushnumber(L, returns); ! ! return 1; ! } ! ! // wxString GetRedoAccelerator() const ! static int LUACALL wxLua_wxCommandProcessor_GetRedoAccelerator(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxString returns; ! // get this ! wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetRedoAccelerator ! returns = self->GetRedoAccelerator(); ! // push the result string ! lua_pushstring(L, wx2lua(returns) ); ! ! return 1; ! } ! ! // wxString GetRedoMenuLabel() const ! static int LUACALL wxLua_wxCommandProcessor_GetRedoMenuLabel(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxString returns; ! // get this ! wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetRedoMenuLabel ! returns = self->GetRedoMenuLabel(); ! // push the result string ! lua_pushstring(L, wx2lua(returns) ); ! ! return 1; ! } ! ! // wxString GetUndoAccelerator() const ! static int LUACALL wxLua_wxCommandProcessor_GetUndoAccelerator(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxString returns; ! // get this ! wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetUndoAccelerator ! returns = self->GetUndoAccelerator(); ! // push the result string ! lua_pushstring(L, wx2lua(returns) ); ! ! return 1; ! } ! ! // wxString GetUndoMenuLabel() const ! static int LUACALL wxLua_wxCommandProcessor_GetUndoMenuLabel(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxString returns; ! // get this ! wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetUndoMenuLabel ! returns = self->GetUndoMenuLabel(); ! // push the result string ! lua_pushstring(L, wx2lua(returns) ); return 1; *************** *** 2886,2889 **** --- 3052,3082 ---- } + // virtual bool IsDirty() + static int LUACALL wxLua_wxCommandProcessor_IsDirty(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); + // call IsDirty + returns = self->IsDirty(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // virtual void MarkAsSaved() + static int LUACALL wxLua_wxCommandProcessor_MarkAsSaved(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); + // call MarkAsSaved + self->MarkAsSaved(); + + return 0; + } + // virtual void SetMenuStrings() static int LUACALL wxLua_wxCommandProcessor_SetMenuStrings(lua_State *L) *************** *** 2898,2928 **** } ! // int GetMaxCommands() const ! static int LUACALL wxLua_wxCommandProcessor_GetMaxCommands(lua_State *L) { wxLuaState wxlState(L); ! int returns; // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call GetMaxCommands ! returns = self->GetMaxCommands(); ! // push the result number ! lua_pushnumber(L, returns); ! return 1; } ! // virtual void ClearCommands() ! static int LUACALL wxLua_wxCommandProcessor_ClearCommands(lua_State *L) { wxLuaState wxlState(L); // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call ClearCommands ! self->ClearCommands(); return 0; } static int LUACALL wxLua_wxCommandProcessor_destructor(lua_State *) { --- 3091,3143 ---- } ! // void SetRedoAccelerator(const wxString& accel) ! static int LUACALL wxLua_wxCommandProcessor_SetRedoAccelerator(lua_State *L) { wxLuaState wxlState(L); ! // const wxString accel ! const wxString accel = lua2wx(wxlState.GetStringType(2)); // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call SetRedoAccelerator ! self->SetRedoAccelerator(accel); ! return 0; } ! // void SetUndoAccelerator(const wxString& accel) ! static int LUACALL wxLua_wxCommandProcessor_SetUndoAccelerator(lua_State *L) { wxLuaState wxlState(L); + // const wxString accel + const wxString accel = lua2wx(wxlState.GetStringType(2)); // get this wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); ! // call SetUndoAccelerator ! self->SetUndoAccelerator(accel); return 0; } + // virtual bool Submit(wxCommand *command, bool storeIt = true) + static int LUACALL wxLua_wxCommandProcessor_Submit(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // bool storeIt = true + bool storeIt = (argCount >= 3 ? wxlState.GetBooleanType(3) : true); + // wxCommand command + wxCommand * command = (wxCommand *)wxlState.GetUserDataType(2, s_wxluatag_wxCommand); + // get this + wxCommandProcessor * self = (wxCommandProcessor *)wxlState.GetUserDataType(1, s_wxluatag_wxCommandProcessor); + // call Submit + returns = self->Submit(command, storeIt); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + static int LUACALL wxLua_wxCommandProcessor_destructor(lua_State *) { *************** *** 2949,2966 **** #if (wxLUA_USE_wxMenu) && (wxLUA_USE_wxCommandProcessor) - { LuaMethod, "SetEditMenu", wxLua_wxCommandProcessor_SetEditMenu, 1, 1, { &s_wxluatag_wxMenu, 0 } }, { LuaMethod, "GetEditMenu", wxLua_wxCommandProcessor_GetEditMenu, 0, 0, { 0 } }, #endif { LuaConstructor, "wxCommandProcessor", wxLua_wxCommandProcessor_constructor, 1, 0, { &s_wxluaarg_Number, 0 } }, - { LuaMethod, "Submit", wxLua_wxCommandProcessor_Submit, 2, 1, { &s_wxluatag_wxCommand, &s_wxluaarg_Boolean, 0 } }, - { LuaMethod, "Undo", wxLua_wxCommandProcessor_Undo, 0, 0, { 0 } }, - { LuaMethod, "Redo", wxLua_wxCommandProcessor_Redo, 0, 0, { 0 } }, - { LuaMethod, "CanUndo", wxLua_wxCommandProcessor_CanUndo, 0, 0, { 0 } }, { LuaMethod, "CanRedo", wxLua_wxCommandProcessor_CanRedo, 0, 0, { 0 } }, { LuaMethod, "Initialize", wxLua_wxCommandProcessor_Initialize, 0, 0, { 0 } }, { LuaMethod, "SetMenuStrings", wxLua_wxCommandProcessor_SetMenuStrings, 0, 0, { 0 } }, ! { LuaMethod, "GetMaxCommands", wxLua_wxCommandProcessor_GetMaxCommands, 0, 0, { 0 } }, ! { LuaMethod, "ClearCommands", wxLua_wxCommandProcessor_ClearCommands, 0, 0, { 0 } }, { LuaDelete, "wxCommandProcessor", wxLua_wxCommandProcessor_destructor, 0, 0, {0} }, }; --- 3164,3189 ---- #if (wxLUA_USE_wxMenu) && (wxLUA_USE_wxCommandProcessor) { LuaMethod, "GetEditMenu", wxLua_wxCommandProcessor_GetEditMenu, 0, 0, { 0 } }, + { LuaMethod, "SetEditMenu", wxLua_wxCommandProcessor_SetEditMenu, 1, 1, { &s_wxluatag_wxMenu, 0 } }, #endif { LuaConstructor, "wxCommandProcessor", wxLua_wxCommandProcessor_constructor, 1, 0, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "CanRedo", wxLua_wxCommandProcessor_CanRedo, 0, 0, { 0 } }, + { LuaMethod, "CanUndo", wxLua_wxCommandProcessor_CanUndo, 0, 0, { 0 } }, + { LuaMethod, "Redo", wxLua_wxCommandProcessor_Redo, 0, 0, { 0 } }, + { LuaMethod, "Undo", wxLua_wxCommandProcessor_Undo, 0, 0, { 0 } }, + { LuaMethod, "ClearCommands", wxLua_wxCommandProcessor_ClearCommands, 0, 0, { 0 } }, + { LuaMethod, "GetMaxCommands", wxLua_wxCommandProcessor_GetMaxCommands, 0, 0, { 0 } }, + { LuaMethod, "GetRedoAccelerator", wxLua_wxCommandProcessor_GetRedoAccelerator, 0, 0, { 0 } }, + { LuaMethod, "GetRedoMenuLabel", wxLua_wxCommandProcessor_GetRedoMenuLabel, 0, 0, { 0 } }, + { LuaMethod, "GetUndoAccelerator", wxLua_wxCommandProcessor_GetUndoAccelerator, 0, 0, { 0 } }, + { LuaMethod, "GetUndoMenuLabel", wxLua_wxCommandProcessor_GetUndoMenuLabel, 0, 0, { 0 } }, { LuaMethod, "Initialize", wxLua_wxCommandProcessor_Initialize, 0, 0, { 0 } }, + { LuaMethod, "IsDirty", wxLua_wxCommandProcessor_IsDirty, 0, 0, { 0 } }, + { LuaMethod, "MarkAsSaved", wxLua_wxCommandProcessor_MarkAsSaved, 0, 0, { 0 } }, { LuaMethod, "SetMenuStrings", wxLua_wxCommandProcessor_SetMenuStrings, 0, 0, { 0 } }, ! { LuaMethod, "SetRedoAccelerator", wxLua_wxCommandProcessor_SetRedoAccelerator, 1, 1, { &s_wxluaarg_String, 0 } }, ! { LuaMethod, "SetUndoAccelerator", wxLua_wxCommandProcessor_SetUndoAccelerator, 1, 1, { &s_wxluaarg_String, 0 } }, ! { LuaMethod, "Submit", wxLua_wxCommandProcessor_Submit, 2, 1, { &s_wxluatag_wxCommand, &s_wxluaarg_Boolean, 0 } }, { LuaDelete, "wxCommandProcessor", wxLua_wxCommandProcessor_destructor, 0, 0, {0} }, }; *************** *** 3073,3095 **** - #if (wxCHECK_VERSION(2,2,0) && !wxCHECK_VERSION(2,3,0)) && (wxLUA_USE_wxFileHistory) - // %wxchkver22&!%wxchkver23 int GetNoHistoryFiles() const - static int LUACALL wxLua_wxFileHistory_GetNoHistoryFiles(lua_State *L) - { - wxLuaState wxlState(L); - int returns; - // get this - wxFileHistory * self = (wxFileHistory *)wxlState.GetUserDataType(1, s_wxluatag_wxFileHistory); - // call GetNoHistoryFiles - returns = self->GetNoHistoryFiles(); - // push the result number - lua_pushnumber(L, returns); - - return 1; - } - - #endif - - #if (wxLUA_USE_wxConfig) && (wxLUA_USE_wxFileHistory) // void Load(wxConfigBase& config) --- 3296,3299 ---- *************** *** 3169,3173 **** #endif ! // wxFileHistory(int maxFiles = 9) static int LUACALL wxLua_wxFileHistory_constructor(lua_State *L) { --- 3373,3377 ---- #endif ! // wxFileHistory(int maxFiles = 9, wxWindowID idBase = wxID_FILE1) static int LUACALL wxLua_wxFileHistory_constructor(lua_State *L) { *************** *** 3176,3183 **** // get number of arguments int argCount = lua_gettop(L); // int maxFiles = 9 int maxFiles = (argCount >= 1 ? (int)wxlState.GetNumberType(1) : 9); // call constructor ! returns = new wxFileHistory(maxFiles); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) --- 3380,3389 ---- // get number of arguments int argCount = lua_gettop(L); + // wxWindowID idBase = wxID_FILE1 + wxWindowID idBase = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : wxID_FILE1); // int maxFiles = 9 int maxFiles = (argCount >= 1 ? (int)wxlState.GetNumberType(1) : 9); // call constructor ! returns = new wxFileHistory(maxFiles, idBase); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) *************** *** 3247,3250 **** --- 3453,3485 ---- } + // size_t GetCount() const + static int LUACALL wxLua_wxFileHistory_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + size_t returns; + // get this + wxFileHistory * self = (wxFileHistory *)wxlState.GetUserDataType(1, s_wxluatag_wxFileHistory); + // call GetCount + returns = self->GetCount(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // void RemoveFileFromHistory(size_t i) + static int LUACALL wxLua_wxFileHistory_RemoveFileFromHistory(lua_State *L) + { + wxLuaState wxlState(L); + // size_t i + size_t i = (size_t)wxlState.GetNumberType(2); + // get this + wxFileHistory * self = (wxFileHistory *)wxlState.GetUserDataType(1, s_wxluatag_wxFileHistory); + // call RemoveFileFromHistory + self->RemoveFileFromHistory(i); + + return 0; + } + static int LUACALL wxLua_wxFileHistory_destructor(lua_State *) { *************** *** 3259,3267 **** static WXLUAMETHOD s_wxFileHistory_methods[] = { - #if (wxCHECK_VERSION(2,2,0) && !wxCHECK_VERSION(2,3,0)) && (wxLUA_USE_wxFileHistory) - { LuaMethod, "GetNoHistoryFiles", wxLua_wxFileHistory_GetNoHistoryFiles, 0, 0, { 0 } }, - #endif - - #if (wxLUA_USE_wxConfig) && (wxLUA_USE_wxFileHistory) { LuaMethod, "Load", wxLua_wxFileHistory_Load, 1, 1, { &s_wxluatag_wxConfigBase, 0 } }, --- 3494,3497 ---- *************** *** 3276,3284 **** #endif ! { LuaConstructor, "wxFileHistory", wxLua_wxFileHistory_constructor, 1, 0, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "AddFileToHistory", wxLua_wxFileHistory_AddFileToHistory, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "AddFilesToMenu", wxLua_wxFileHistory_AddFilesToMenu, 0, 0, { 0 } }, { LuaMethod, "GetHistoryFile", wxLua_wxFileHistory_GetHistoryFile, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "GetMaxFiles", wxLua_wxFileHistory_GetMaxFiles, 0, 0, { 0 } }, { LuaDelete, "wxFileHistory", wxLua_wxFileHistory_destructor, 0, 0, {0} }, }; --- 3506,3516 ---- #endif ! { LuaConstructor, "wxFileHistory", wxLua_wxFileHistory_constructor, 2, 0, { &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, { LuaMethod, "AddFileToHistory", wxLua_wxFileHistory_AddFileToHistory, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "AddFilesToMenu", wxLua_wxFileHistory_AddFilesToMenu, 0, 0, { 0 } }, { LuaMethod, "GetHistoryFile", wxLua_wxFileHistory_GetHistoryFile, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "GetMaxFiles", wxLua_wxFileHistory_GetMaxFiles, 0, 0, { 0 } }, + { LuaMethod, "GetCount", wxLua_wxFileHistory_GetCount, 0, 0, { 0 } }, + { LuaMethod, "RemoveFileFromHistory", wxLua_wxFileHistory_RemoveFileFromHistory, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaDelete, "wxFileHistory", wxLua_wxFileHistory_destructor, 0, 0, {0} }, }; |