From: John L. <jr...@us...> - 2007-03-12 23:12:45
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv22784/wxLua/modules/wxbind/src Modified Files: controls.cpp dialogs.cpp file.cpp gdi.cpp help.cpp html.cpp wx_bind.cpp Log Message: update bindings to wxWidgets 2.8 using headers Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** controls.cpp 9 Mar 2007 06:10:17 -0000 1.46 --- controls.cpp 12 Mar 2007 23:12:34 -0000 1.47 *************** *** 1988,1991 **** --- 1988,2007 ---- #endif // ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + // %wxchkver_2_8 void Pulse() + static int LUACALL wxLua_wxGauge_Pulse(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxGauge * self = (wxGauge *)wxlState.GetUserDataType(1, s_wxluatag_wxGauge); + // call Pulse + self->Pulse(); + + return 0; + } + + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + // %constructor wxGaugeDefault() static int LUACALL wxLua_wxGaugeDefault_constructor(lua_State *L) *************** *** 2154,2157 **** --- 2170,2178 ---- #endif // ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + { LuaMethod, "Pulse", wxLua_wxGauge_Pulse, 0, 0, s_wxluaargArray_None }, + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxGauge && wxUSE_GAUGE) + { LuaConstructor, "wxGaugeDefault", wxLua_wxGaugeDefault_constructor, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetBezelFace", wxLua_wxGauge_GetBezelFace, 0, 0, s_wxluaargArray_None }, Index: file.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/file.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** file.cpp 9 Mar 2007 00:15:15 -0000 1.35 --- file.cpp 12 Mar 2007 23:12:35 -0000 1.36 *************** *** 26,29 **** --- 26,243 ---- + // --------------------------------------------------------------------------- + // Bind class wxPathList + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxPathList' + int s_wxluatag_wxPathList = -1; + + + #if !wxCHECK_VERSION(2,8,0) + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_Add[] = { &s_wxluaarg_String, 0 }; + // !%wxchkver_2_8 void Add(const wxString& path) + static int LUACALL wxLua_wxPathList_Add(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString path + const wxString path = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call Add + self->Add(path); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_EnsureFileAccessible[] = { &s_wxluaarg_String, 0 }; + // !%wxchkver_2_8 void EnsureFileAccessible(const wxString& path) + static int LUACALL wxLua_wxPathList_EnsureFileAccessible(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString path + const wxString path = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call EnsureFileAccessible + self->EnsureFileAccessible(path); + + return 0; + } + + #endif // !wxCHECK_VERSION(2,8,0) + + // wxPathList() + static int LUACALL wxLua_wxPathList_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPathList *returns; + // call constructor + returns = new wxPathList(); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxPathList *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxPathList, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_AddEnvList[] = { &s_wxluaarg_String, 0 }; + // void AddEnvList(const wxString& envVariable) + static int LUACALL wxLua_wxPathList_AddEnvList(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString envVariable + const wxString envVariable = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call AddEnvList + self->AddEnvList(envVariable); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_FindValidPath[] = { &s_wxluaarg_String, 0 }; + // wxString FindValidPath(const wxString& filename) const + static int LUACALL wxLua_wxPathList_FindValidPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // const wxString filename + const wxString filename = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call FindValidPath + returns = self->FindValidPath(filename); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_FindAbsoluteValidPath[] = { &s_wxluaarg_String, 0 }; + // wxString FindAbsoluteValidPath(const wxString& filename) const + static int LUACALL wxLua_wxPathList_FindAbsoluteValidPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // const wxString filename + const wxString filename = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call FindAbsoluteValidPath + returns = self->FindAbsoluteValidPath(filename); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static int LUACALL wxLua_wxPathList_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxPathList_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedObject(self)) + { // if removed, reset the tag so that gc() is not called on this object. + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + #if wxCHECK_VERSION(2,8,0) + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_Add[] = { &s_wxluaarg_String, 0 }; + // %wxchkver_2_8 bool Add(const wxString& path) + static int LUACALL wxLua_wxPathList_Add(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString path + const wxString path = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call Add + returns = self->Add(path); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_AddArray[] = { &s_wxluaarg_LuaTable, 0 }; + // %wxchkver_2_8 %rename AddArray void Add(const wxArrayString_FromLuaTable& paths) + static int LUACALL wxLua_wxPathList_AddArray(lua_State *L) + { + wxLuaState wxlState(L); + // const wxArrayString_FromLuaTable paths + wxArrayString paths = wxArrayString(); wxlState.GetwxArrayString(2, paths); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call Add + self->Add(paths); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxPathList_EnsureFileAccessible[] = { &s_wxluaarg_String, 0 }; + // %wxchkver_2_8 bool EnsureFileAccessible(const wxString& path) + static int LUACALL wxLua_wxPathList_EnsureFileAccessible(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString path + const wxString path = wxlState.GetwxStringType(2); + // get this + wxPathList * self = (wxPathList *)wxlState.GetUserDataType(1, s_wxluatag_wxPathList); + // call EnsureFileAccessible + returns = self->EnsureFileAccessible(path); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // wxCHECK_VERSION(2,8,0) + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxPathList_methods[] = { + + #if !wxCHECK_VERSION(2,8,0) + { LuaMethod, "Add", wxLua_wxPathList_Add, 1, 1, s_wxluatagArray_wxLua_wxPathList_Add }, + { LuaMethod, "EnsureFileAccessible", wxLua_wxPathList_EnsureFileAccessible, 1, 1, s_wxluatagArray_wxLua_wxPathList_EnsureFileAccessible }, + #endif // !wxCHECK_VERSION(2,8,0) + + { LuaConstructor, "wxPathList", wxLua_wxPathList_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "AddEnvList", wxLua_wxPathList_AddEnvList, 1, 1, s_wxluatagArray_wxLua_wxPathList_AddEnvList }, + { LuaMethod, "FindValidPath", wxLua_wxPathList_FindValidPath, 1, 1, s_wxluatagArray_wxLua_wxPathList_FindValidPath }, + { LuaMethod, "FindAbsoluteValidPath", wxLua_wxPathList_FindAbsoluteValidPath, 1, 1, s_wxluatagArray_wxLua_wxPathList_FindAbsoluteValidPath }, + { LuaDelete, "wxPathList", wxLua_wxPathList_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxPathList_Delete, 0, 0, s_wxluaargArray_None }, + + #if wxCHECK_VERSION(2,8,0) + { LuaMethod, "Add", wxLua_wxPathList_Add, 1, 1, s_wxluatagArray_wxLua_wxPathList_Add }, + { LuaMethod, "AddArray", wxLua_wxPathList_AddArray, 1, 1, s_wxluatagArray_wxLua_wxPathList_AddArray }, + { LuaMethod, "EnsureFileAccessible", wxLua_wxPathList_EnsureFileAccessible, 1, 1, s_wxluatagArray_wxLua_wxPathList_EnsureFileAccessible }, + #endif // wxCHECK_VERSION(2,8,0) + + }; + + int wxPathList_methodCount = sizeof(wxPathList_methods)/sizeof(wxPathList_methods[0]); + #if wxLUA_USE_wxFileName *************** *** 36,39 **** --- 250,396 ---- + #if ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxLUA_USE_wxFile && wxUSE_FILE) + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignTempFileName[] = { &s_wxluaarg_String, &s_wxluatag_wxFile, 0 }; + // !%wxchkver_2_8 void AssignTempFileName(const wxString& prefix, wxFile *fileTemp = NULL) + static int LUACALL wxLua_wxFileName_AssignTempFileName(lua_State *L) + { + wxLuaState wxlState(L); + // get number of arguments + int argCount = lua_gettop(L); + // wxFile fileTemp = NULL + wxFile * fileTemp = (argCount >= 3 ? (wxFile *)wxlState.GetUserDataType(3, s_wxluatag_wxFile) : NULL); + // const wxString prefix + const wxString prefix = wxlState.GetwxStringType(2); + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call AssignTempFileName + self->AssignTempFileName(prefix, fileTemp); + + return 0; + } + + #endif // ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxLUA_USE_wxFile && wxUSE_FILE) + + + #if (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignTempFileNameGetName[] = { &s_wxluaarg_String, 0 }; + // %wxchkver_2_8&&(wxUSE_FILE||wxUSE_FFILE) %rename AssignTempFileNameGetName void AssignTempFileName(const wxString& prefix) + static int LUACALL wxLua_wxFileName_AssignTempFileNameGetName(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString prefix + const wxString prefix = wxlState.GetwxStringType(2); + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call AssignTempFileName + self->AssignTempFileName(prefix); + + return 0; + } + + #endif // (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) + + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName) + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_GetHumanReadableSize[] = { &s_wxluaarg_String, &s_wxluaarg_Number, 0 }; + // %wxchkver_2_8 wxString GetHumanReadableSize(const wxString &nullsize = "Not available", int precision = 1) const + static int LUACALL wxLua_wxFileName_GetHumanReadableSize(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get number of arguments + int argCount = lua_gettop(L); + // int precision = 1 + int precision = (argCount >= 3 ? (int)wxlState.GetNumberType(3) : 1); + // const wxString nullsize = "Not available" + const wxString nullsize = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxT("Not available"))); + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call GetHumanReadableSize + returns = self->GetHumanReadableSize(nullsize, precision); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + // %wxchkver_2_8 bool IsDirWritable() const + static int LUACALL wxLua_wxFileName_IsDirWritable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call IsDirWritable + returns = self->IsDirWritable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %wxchkver_2_8 bool IsDirReadable() const + static int LUACALL wxLua_wxFileName_IsDirReadable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call IsDirReadable + returns = self->IsDirReadable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %wxchkver_2_8 bool IsFileWritable() const + static int LUACALL wxLua_wxFileName_IsFileWritable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call IsFileWritable + returns = self->IsFileWritable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %wxchkver_2_8 bool IsFileReadable() const + static int LUACALL wxLua_wxFileName_IsFileReadable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call IsFileReadable + returns = self->IsFileReadable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // %wxchkver_2_8 bool IsFileExecutable() const + static int LUACALL wxLua_wxFileName_IsFileExecutable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxFileName * self = (wxFileName *)wxlState.GetUserDataType(1, s_wxluatag_wxFileName); + // call IsFileExecutable + returns = self->IsFileExecutable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName) + + #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxFileName) // %override wxLua_wxFileName_GetDirs *************** *** 128,141 **** ! #if (wxLUA_USE_wxFile && wxUSE_FILE) && (wxLUA_USE_wxFileName) static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignTempFileName[] = { &s_wxluaarg_String, &s_wxluatag_wxFile, 0 }; ! // void AssignTempFileName(const wxString& prefix, wxFile *fileTemp = NULL) static int LUACALL wxLua_wxFileName_AssignTempFileName(lua_State *L) { wxLuaState wxlState(L); ! // get number of arguments ! int argCount = lua_gettop(L); ! // wxFile fileTemp = NULL ! wxFile * fileTemp = (argCount >= 3 ? (wxFile *)wxlState.GetUserDataType(3, s_wxluatag_wxFile) : NULL); // const wxString prefix const wxString prefix = wxlState.GetwxStringType(2); --- 485,496 ---- ! #if (wxLUA_USE_wxFile && wxUSE_FILE) && ((wxCHECK_VERSION(2,8,0) && wxUSE_FILE) && (wxLUA_USE_wxFileName)) static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_AssignTempFileName[] = { &s_wxluaarg_String, &s_wxluatag_wxFile, 0 }; ! // %wxchkver_2_8&&wxUSE_FILE void AssignTempFileName(const wxString& prefix, wxFile *fileTemp) static int LUACALL wxLua_wxFileName_AssignTempFileName(lua_State *L) { wxLuaState wxlState(L); ! // wxFile fileTemp ! wxFile * fileTemp = (wxFile *)wxlState.GetUserDataType(3, s_wxluatag_wxFile); // const wxString prefix const wxString prefix = wxlState.GetwxStringType(2); *************** *** 148,172 **** } ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileName_CreateTempFileName[] = { &s_wxluaarg_String, &s_wxluatag_wxFile, 0 }; ! // static wxString CreateTempFileName(const wxString& prefix, wxFile *fileTemp = NULL) ! static int LUACALL wxLua_wxFileName_CreateTempFileName(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxString returns; ! // get number of arguments ! int argCount = lua_gettop(L); ! // wxFile fileTemp = NULL ! wxFile * fileTemp = (argCount >= 3 ? (wxFile *)wxlState.GetUserDataType(3, s_wxluatag_wxFile) : NULL); ! // const wxString prefix ! const wxString prefix = wxlState.GetwxStringType(2); ! // call CreateTempFileName ! returns = wxFileName::CreateTempFileName(prefix, fileTemp); ! // push the result string ! wxlState.lua_PushString(returns); ! ! return 1; ! } ! ! #endif // (wxLUA_USE_wxFile && wxUSE_FILE) && (wxLUA_USE_wxFileName) // %constructor wxFileNameDefault() --- 503,507 ---- } ! #endif // (wxLUA_USE_wxFile && wxUSE_FILE) && ((wxCHECK_VERSION(2,8,0) && wxUSE_FILE) && (wxLUA_USE_wxFileName)) // %constructor wxFileNameDefault() *************** *** 1500,1503 **** --- 1835,1858 ---- WXLUAMETHOD wxFileName_methods[] = { + #if ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxLUA_USE_wxFile && wxUSE_FILE) + { LuaMethod, "AssignTempFileName", wxLua_wxFileName_AssignTempFileName, 2, 1, s_wxluatagArray_wxLua_wxFileName_AssignTempFileName }, + #endif // ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName)) && (wxLUA_USE_wxFile && wxUSE_FILE) + + + #if (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) + { LuaMethod, "AssignTempFileNameGetName", wxLua_wxFileName_AssignTempFileNameGetName, 1, 1, s_wxluatagArray_wxLua_wxFileName_AssignTempFileNameGetName }, + #endif // (wxCHECK_VERSION(2,8,0) && (wxUSE_FILE || wxUSE_FFILE )) && (wxLUA_USE_wxFileName) + + + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName) + { LuaMethod, "GetHumanReadableSize", wxLua_wxFileName_GetHumanReadableSize, 2, 0, s_wxluatagArray_wxLua_wxFileName_GetHumanReadableSize }, + { LuaMethod, "IsDirWritable", wxLua_wxFileName_IsDirWritable, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsDirReadable", wxLua_wxFileName_IsDirReadable, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsFileWritable", wxLua_wxFileName_IsFileWritable, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsFileReadable", wxLua_wxFileName_IsFileReadable, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "IsFileExecutable", wxLua_wxFileName_IsFileExecutable, 0, 0, s_wxluaargArray_None }, + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileName) + + #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxFileName) { LuaMethod, "GetDirs", wxLua_wxFileName_GetDirs, 0, 0, s_wxluaargArray_None }, *************** *** 1512,1519 **** ! #if (wxLUA_USE_wxFile && wxUSE_FILE) && (wxLUA_USE_wxFileName) ! { LuaMethod, "AssignTempFileName", wxLua_wxFileName_AssignTempFileName, 2, 1, s_wxluatagArray_wxLua_wxFileName_AssignTempFileName }, ! { LuaMethod, "CreateTempFileName", wxLua_wxFileName_CreateTempFileName, 2, 1, s_wxluatagArray_wxLua_wxFileName_CreateTempFileName }, ! #endif // (wxLUA_USE_wxFile && wxUSE_FILE) && (wxLUA_USE_wxFileName) { LuaConstructor, "wxFileNameDefault", wxLua_wxFileNameDefault_constructor, 0, 0, s_wxluaargArray_None }, --- 1867,1873 ---- ! #if (wxLUA_USE_wxFile && wxUSE_FILE) && ((wxCHECK_VERSION(2,8,0) && wxUSE_FILE) && (wxLUA_USE_wxFileName)) ! { LuaMethod, "AssignTempFileName", wxLua_wxFileName_AssignTempFileName, 2, 2, s_wxluatagArray_wxLua_wxFileName_AssignTempFileName }, ! #endif // (wxLUA_USE_wxFile && wxUSE_FILE) && ((wxCHECK_VERSION(2,8,0) && wxUSE_FILE) && (wxLUA_USE_wxFileName)) { LuaConstructor, "wxFileNameDefault", wxLua_wxFileNameDefault_constructor, 0, 0, s_wxluaargArray_None }, *************** *** 1959,1963 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxFile_WriteString[] = { &s_wxluaarg_String, 0 }; ! // %rename WriteString size_t Write(const wxString &str) static int LUACALL wxLua_wxFile_WriteString(lua_State *L) { --- 2313,2317 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxFile_WriteString[] = { &s_wxluaarg_String, 0 }; ! // %rename WriteString size_t Write(const wxString &str) //, const wxMBConv& conv = wxConvUTF8) static int LUACALL wxLua_wxFile_WriteString(lua_State *L) { *************** *** 2034,2037 **** --- 2388,2609 ---- + #if wxLUA_USE_wxFile && wxUSE_FILE + // --------------------------------------------------------------------------- + // Bind class wxTempFile + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxTempFile' + int s_wxluatag_wxTempFile = -1; + + // %constructor wxTempFileDefault() + static int LUACALL wxLua_wxTempFileDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxTempFile *returns; + // call constructor + returns = new wxTempFile(); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxTempFile *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxTempFile, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxTempFile_constructor[] = { &s_wxluaarg_String, 0 }; + // wxTempFile(const wxString& strName) + static int LUACALL wxLua_wxTempFile_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxTempFile *returns; + // const wxString strName + const wxString strName = wxlState.GetwxStringType(1); + // call constructor + returns = new wxTempFile(strName); + // add to tracked memory list + wxLua_AddTrackedObject(wxlState, (wxTempFile *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxTempFile, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxTempFile_Open[] = { &s_wxluaarg_String, 0 }; + // bool Open(const wxString& strName) + static int LUACALL wxLua_wxTempFile_Open(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString strName + const wxString strName = wxlState.GetwxStringType(2); + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Open + returns = self->Open(strName); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // bool IsOpened() const + static int LUACALL wxLua_wxTempFile_IsOpened(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call IsOpened + returns = self->IsOpened(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxFileOffset Length() const + static int LUACALL wxLua_wxTempFile_Length(lua_State *L) + { + wxLuaState wxlState(L); + wxFileOffset returns; + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Length + returns = self->Length(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxTempFile_Seek[] = { &s_wxluaarg_Number, &s_wxluaarg_Enumeration, 0 }; + // wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart) + static int LUACALL wxLua_wxTempFile_Seek(lua_State *L) + { + wxLuaState wxlState(L); + wxFileOffset returns; + // get number of arguments + int argCount = lua_gettop(L); + // wxSeekMode mode = wxFromStart + wxSeekMode mode = (argCount >= 3 ? (wxSeekMode)wxlState.GetEnumerationType(3) : wxFromStart); + // wxFileOffset ofs + wxFileOffset ofs = (wxFileOffset)wxlState.GetNumberType(2); + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Seek + returns = self->Seek(ofs, mode); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxFileOffset Tell() const + static int LUACALL wxLua_wxTempFile_Tell(lua_State *L) + { + wxLuaState wxlState(L); + wxFileOffset returns; + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Tell + returns = self->Tell(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxTempFile_Write[] = { &s_wxluaarg_String, 0 }; + // bool Write(const wxString& str) //, const wxMBConv& conv = wxConvUTF8) + static int LUACALL wxLua_wxTempFile_Write(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString str + const wxString str = wxlState.GetwxStringType(2); + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Write + returns = self->Write(str); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // bool Commit() + static int LUACALL wxLua_wxTempFile_Commit(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Commit + returns = self->Commit(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // void Discard(); + static int LUACALL wxLua_wxTempFile_Discard(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // call Discard + self->Discard(); + + return 0; + } + + static int LUACALL wxLua_wxTempFile_destructor(lua_State *L) + { + wxLuaState wxlState(L); + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedObject(self); + return 0; + } + + static int LUACALL wxLua_wxTempFile_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxTempFile * self = (wxTempFile *)wxlState.GetUserDataType(1, s_wxluatag_wxTempFile); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedObject(self)) + { // if removed, reset the tag so that gc() is not called on this object. + lua_pushnil(L); + lua_setmetatable(L, -2); + } + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxTempFile_methods[] = { + { LuaConstructor, "wxTempFileDefault", wxLua_wxTempFileDefault_constructor, 0, 0, s_wxluaargArray_None }, + { LuaConstructor, "wxTempFile", wxLua_wxTempFile_constructor, 1, 1, s_wxluatagArray_wxLua_wxTempFile_constructor }, + { LuaMethod, "Open", wxLua_wxTempFile_Open, 1, 1, s_wxluatagArray_wxLua_wxTempFile_Open }, + { LuaMethod, "IsOpened", wxLua_wxTempFile_IsOpened, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Length", wxLua_wxTempFile_Length, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Seek", wxLua_wxTempFile_Seek, 2, 1, s_wxluatagArray_wxLua_wxTempFile_Seek }, + { LuaMethod, "Tell", wxLua_wxTempFile_Tell, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Write", wxLua_wxTempFile_Write, 1, 1, s_wxluatagArray_wxLua_wxTempFile_Write }, + { LuaMethod, "Commit", wxLua_wxTempFile_Commit, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Discard", wxLua_wxTempFile_Discard, 0, 0, s_wxluaargArray_None }, + { LuaDelete, "wxTempFile", wxLua_wxTempFile_destructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxTempFile_Delete, 0, 0, s_wxluaargArray_None }, + }; + + int wxTempFile_methodCount = sizeof(wxTempFile_methods)/sizeof(wxTempFile_methods[0]); + #endif // wxLUA_USE_wxFile && wxUSE_FILE + + #if wxLUA_USE_wxDir // --------------------------------------------------------------------------- Index: help.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/help.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** help.cpp 9 Mar 2007 00:15:16 -0000 1.25 --- help.cpp 12 Mar 2007 23:12:36 -0000 1.26 *************** *** 481,484 **** --- 481,518 ---- + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxHelpController && wxUSE_HELP) + // %wxchkver_2_8 virtual wxWindow* GetParentWindow() const + static int LUACALL wxLua_wxHelpController_GetParentWindow(lua_State *L) + { + wxLuaState wxlState(L); + wxWindow *returns; + // get this + wxHelpController * self = (wxHelpController *)wxlState.GetUserDataType(1, s_wxluatag_wxHelpController); + // call GetParentWindow + returns = (wxWindow *)self->GetParentWindow(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxWindow, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpController_SetParentWindow[] = { &s_wxluatag_wxWindow, 0 }; + // %wxchkver_2_8 virtual void SetParentWindow(wxWindow* win) + static int LUACALL wxLua_wxHelpController_SetParentWindow(lua_State *L) + { + wxLuaState wxlState(L); + // wxWindow win + wxWindow * win = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); + // get this + wxHelpController * self = (wxHelpController *)wxlState.GetUserDataType(1, s_wxluatag_wxHelpController); + // call SetParentWindow + self->SetParentWindow(win); + + return 0; + } + + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxHelpController && wxUSE_HELP) + + #if (wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxPointSizeRect) static wxLuaArgTag s_wxluatagArray_wxLua_wxHelpController_DisplayTextPopup[] = { &s_wxluaarg_String, &s_wxluatag_wxPoint, 0 }; *************** *** 753,756 **** --- 787,796 ---- + #if (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxHelpController && wxUSE_HELP) + { LuaMethod, "GetParentWindow", wxLua_wxHelpController_GetParentWindow, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetParentWindow", wxLua_wxHelpController_SetParentWindow, 1, 1, s_wxluatagArray_wxLua_wxHelpController_SetParentWindow }, + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxHelpController && wxUSE_HELP) + + #if (wxLUA_USE_wxHelpController && wxUSE_HELP) && (wxLUA_USE_wxPointSizeRect) { LuaMethod, "DisplayTextPopup", wxLua_wxHelpController_DisplayTextPopup, 2, 2, s_wxluatagArray_wxLua_wxHelpController_DisplayTextPopup }, Index: dialogs.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/dialogs.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** dialogs.cpp 9 Mar 2007 00:15:14 -0000 1.30 --- dialogs.cpp 12 Mar 2007 23:12:35 -0000 1.31 *************** *** 1394,1397 **** --- 1394,1475 ---- + #if (((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_String, 0 }; + // %wxchkver_2_8 wxFileDialog(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = "wxFileDialog") + static int LUACALL wxLua_wxFileDialog_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxFileDialog *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxFileDialog" + const wxString name = (argCount >= 9 ? wxlState.GetwxStringType(9) : wxString(wxT("wxFileDialog"))); + // const wxSize sz = wxDefaultSize + const wxSize * sz = (argCount >= 8 ? (const wxSize *)wxlState.GetUserDataType(8, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 7 ? (const wxPoint *)wxlState.GetUserDataType(7, s_wxluatag_wxPoint) : &wxDefaultPosition); + // long style = wxFD_DEFAULT_STYLE + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : wxFD_DEFAULT_STYLE); + // const wxString wildCard = wxFileSelectorDefaultWildcardStr + const wxString wildCard = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxFileSelectorDefaultWildcardStr)); + // const wxString defaultFile = "" + const wxString defaultFile = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); + // const wxString defaultDir = "" + const wxString defaultDir = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); + // const wxString message = wxFileSelectorPromptStr + const wxString message = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxFileSelectorPromptStr)); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, *pos, *sz, name); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddTrackedWindow((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxFileDialog, returns); + + return 1; + } + + #endif // (((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + + + #if ((wxLUA_USE_wxPointSizeRect) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG))) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 }; + // !%wxchkver_2_8 wxFileDialog(wxWindow* parent, const wxString& message = "Choose a file", const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildcard = "*.*", long style = 0, const wxPoint& pos = wxDefaultPosition) + static int LUACALL wxLua_wxFileDialog_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxFileDialog *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 7 ? (const wxPoint *)wxlState.GetUserDataType(7, s_wxluatag_wxPoint) : &wxDefaultPosition); + // long style = 0 + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : 0); + // const wxString wildcard = "*.*" + const wxString wildcard = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxT("*.*"))); + // const wxString defaultFile = "" + const wxString defaultFile = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); + // const wxString defaultDir = "" + const wxString defaultDir = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); + // const wxString message = "Choose a file" + const wxString message = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxT("Choose a file"))); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxFileDialog(parent, message, defaultDir, defaultFile, wildcard, style, *pos); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddTrackedWindow((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxFileDialog, returns); + + return 1; + } + + #endif // ((wxLUA_USE_wxPointSizeRect) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG))) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + + #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDialog_GetFilenames[] = { &s_wxluatag_wxArrayString, 0 }; *************** *** 1430,1458 **** ! #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDialog_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 }; ! // wxFileDialog(wxWindow* parent, const wxString& message = "Choose a file", const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildcard = "*.*", long style = 0, const wxPoint& pos = wxDefaultPosition) ! static int LUACALL wxLua_wxFileDialog_constructor(lua_State *L) { wxLuaState wxlState(L); ! wxFileDialog *returns; // get number of arguments int argCount = lua_gettop(L); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 7 ? (const wxPoint *)wxlState.GetUserDataType(7, s_wxluatag_wxPoint) : &wxDefaultPosition); ! // long style = 0 ! long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : 0); ! // const wxString wildcard = "*.*" ! const wxString wildcard = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxT("*.*"))); // const wxString defaultFile = "" ! const wxString defaultFile = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); // const wxString defaultDir = "" ! const wxString defaultDir = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxEmptyString)); ! // const wxString message = "Choose a file" ! const wxString message = (argCount >= 2 ? wxlState.GetwxStringType(2) : wxString(wxT("Choose a file"))); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); // call constructor ! returns = new wxFileDialog(parent, message, defaultDir, defaultFile, wildcard, style, *pos); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) --- 1508,1557 ---- ! #if (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) ! static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDialog_Create[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_String, 0 }; ! // %wxchkver_2_8 bool Create(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = "", const wxString& defaultFile = "", const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = "wxFileDialog") ! static int LUACALL wxLua_wxFileDialog_Create(lua_State *L) { wxLuaState wxlState(L); ! bool returns; // get number of arguments int argCount = lua_gettop(L); + // const wxString name = "wxFileDialog" + const wxString name = (argCount >= 10 ? wxlState.GetwxStringType(10) : wxString(wxT("wxFileDialog"))); + // const wxSize sz = wxDefaultSize + const wxSize * sz = (argCount >= 9 ? (const wxSize *)wxlState.GetUserDataType(9, s_wxluatag_wxSize) : &wxDefaultSize); // const wxPoint pos = wxDefaultPosition ! const wxPoint * pos = (argCount >= 8 ? (const wxPoint *)wxlState.GetUserDataType(8, s_wxluatag_wxPoint) : &wxDefaultPosition); ! // long style = wxFD_DEFAULT_STYLE ! long style = (argCount >= 7 ? (long)wxlState.GetNumberType(7) : wxFD_DEFAULT_STYLE); ! // const wxString wildCard = wxFileSelectorDefaultWildcardStr ! const wxString wildCard = (argCount >= 6 ? wxlState.GetwxStringType(6) : wxString(wxFileSelectorDefaultWildcardStr)); // const wxString defaultFile = "" ! const wxString defaultFile = (argCount >= 5 ? wxlState.GetwxStringType(5) : wxString(wxEmptyString)); // const wxString defaultDir = "" ! const wxString defaultDir = (argCount >= 4 ? wxlState.GetwxStringType(4) : wxString(wxEmptyString)); ! // const wxString message = wxFileSelectorPromptStr ! const wxString message = (argCount >= 3 ? wxlState.GetwxStringType(3) : wxString(wxFileSelectorPromptStr)); // wxWindow parent ! wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); ! // get this ! wxFileDialog * self = (wxFileDialog *)wxlState.GetUserDataType(1, s_wxluatag_wxFileDialog); ! // call Create ! returns = self->Create(parent, message, defaultDir, defaultFile, wildCard, style, *pos, *sz, name); ! // push the result flag ! lua_pushboolean(L, returns); ! ! return 1; ! } ! ! #endif // (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) ! ! // %constructor wxFileDialogDefault() ! static int LUACALL wxLua_wxFileDialogDefault_constructor(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxFileDialog *returns; // call constructor ! returns = new wxFileDialog(); // add to tracked window list if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) *************** *** 1464,1469 **** } - #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) - // wxString GetDirectory() const static int LUACALL wxLua_wxFileDialog_GetDirectory(lua_State *L) --- 1563,1566 ---- *************** *** 1664,1667 **** --- 1761,1774 ---- + #if (((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + { LuaConstructor, "wxFileDialog", wxLua_wxFileDialog_constructor, 9, 1, s_wxluatagArray_wxLua_wxFileDialog_constructor }, + #endif // (((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) && (wxLUA_USE_wxPointSizeRect)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + + + #if ((wxLUA_USE_wxPointSizeRect) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG))) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + { LuaConstructor, "wxFileDialog", wxLua_wxFileDialog_constructor, 7, 1, s_wxluatagArray_wxLua_wxFileDialog_constructor }, + #endif // ((wxLUA_USE_wxPointSizeRect) && ((!wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG))) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) + + #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) { LuaMethod, "GetFilenames", wxLua_wxFileDialog_GetFilenames, 1, 1, s_wxluatagArray_wxLua_wxFileDialog_GetFilenames }, *************** *** 1670,1677 **** ! #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) ! { LuaConstructor, "wxFileDialog", wxLua_wxFileDialog_constructor, 7, 1, s_wxluatagArray_wxLua_wxFileDialog_constructor }, ! #endif // (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG) { LuaMethod, "GetDirectory", wxLua_wxFileDialog_GetDirectory, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetFilename", wxLua_wxFileDialog_GetFilename, 0, 0, s_wxluaargArray_None }, --- 1777,1785 ---- ! #if (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) ! { LuaMethod, "Create", wxLua_wxFileDialog_Create, 9, 1, s_wxluatagArray_wxLua_wxFileDialog_Create }, ! #endif // (wxLUA_USE_wxPointSizeRect) && ((wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxFileDialog && wxUSE_FILEDLG)) + { LuaConstructor, "wxFileDialogDefault", wxLua_wxFileDialogDefault_constructor, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetDirectory", wxLua_wxFileDialog_GetDirectory, 0, 0, s_wxluaargArray_None }, { LuaMethod, "GetFilename", wxLua_wxFileDialog_GetFilename, 0, 0, s_wxluaargArray_None }, Index: html.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/html.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** html.cpp 9 Mar 2007 00:15:16 -0000 1.30 --- html.cpp 12 Mar 2007 23:12:37 -0000 1.31 *************** *** 2781,2784 **** --- 2781,3080 ---- + #if (wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML) + // --------------------------------------------------------------------------- + // Bind class wxSimpleHtmlListBox + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxSimpleHtmlListBox' + int s_wxluatag_wxSimpleHtmlListBox = -1; + + + #if ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML)) && (wxLUA_USE_wxArrayString) + // wxArrayString GetStrings() const + static int LUACALL wxLua_wxSimpleHtmlListBox_GetStrings(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString *returns; + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call GetStrings + // allocate a new object using the copy constructor + returns = new wxArrayString(self->GetStrings()); + // add the new object to the tracked memory list + wxLua_AddTrackedObject(wxlState, (wxArrayString *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxArrayString, returns); + + return 1; + } + + #endif // ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML)) && (wxLUA_USE_wxArrayString) + + + #if ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML))) && (wxLUA_USE_wxPointSizeRect) + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_LuaTable, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 }; + // wxSimpleHtmlListBox(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString_FromLuaTable& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") + static int LUACALL wxLua_wxSimpleHtmlListBox_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSimpleHtmlListBox *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxSimpleHtmlListBox" + const wxString name = (argCount >= 8 ? wxlState.GetwxStringType(8) : wxString(wxT("wxSimpleHtmlListBox"))); + // const wxValidator validator = wxDefaultValidator + const wxValidator * validator = (argCount >= 7 ? (const wxValidator *)wxlState.GetUserDataType(7, s_wxluatag_wxValidator) : &wxDefaultValidator); + // long style = wxHLB_DEFAULT_STYLE + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : wxHLB_DEFAULT_STYLE); + // const wxArrayString_FromLuaTable choices + wxArrayString choices = wxArrayString(); wxlState.GetwxArrayString(5, choices); + // const wxSize size + const wxSize * size = (const wxSize *)wxlState.GetUserDataType(4, s_wxluatag_wxSize); + // const wxPoint pos + const wxPoint * pos = (const wxPoint *)wxlState.GetUserDataType(3, s_wxluatag_wxPoint); + // wxWindowID id + wxWindowID id = (wxWindowID)wxlState.GetNumberType(2); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxSimpleHtmlListBox(parent, id, *pos, *size, choices, style, *validator, name); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddTrackedWindow((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSimpleHtmlListBox, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Create[] = { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_LuaTable, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 }; + // bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayString_FromLuaTable& choices, long style = wxHLB_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxSimpleHtmlListBox") + static int LUACALL wxLua_wxSimpleHtmlListBox_Create(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxSimpleHtmlListBox" + const wxString name = (argCount >= 9 ? wxlState.GetwxStringType(9) : wxString(wxT("wxSimpleHtmlListBox"))); + // const wxValidator validator = wxDefaultValidator + const wxValidator * validator = (argCount >= 8 ? (const wxValidator *)wxlState.GetUserDataType(8, s_wxluatag_wxValidator) : &wxDefaultValidator); + // long style = wxHLB_DEFAULT_STYLE + long style = (argCount >= 7 ? (long)wxlState.GetNumberType(7) : wxHLB_DEFAULT_STYLE); + // const wxArrayString_FromLuaTable choices + wxArrayString choices = wxArrayString(); wxlState.GetwxArrayString(6, choices); + // const wxSize size + const wxSize * size = (const wxSize *)wxlState.GetUserDataType(5, s_wxluatag_wxSize); + // const wxPoint pos + const wxPoint * pos = (const wxPoint *)wxlState.GetUserDataType(4, s_wxluatag_wxPoint); + // wxWindowID id + wxWindowID id = (wxWindowID)wxlState.GetNumberType(3); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call Create + returns = self->Create(parent, id, *pos, *size, choices, style, *validator, name); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML))) && (wxLUA_USE_wxPointSizeRect) + + // %constructor wxSimpleHtmlListBoxDefault() + static int LUACALL wxLua_wxSimpleHtmlListBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSimpleHtmlListBox *returns; + // call constructor + returns = new wxSimpleHtmlListBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddTrackedWindow((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSimpleHtmlListBox, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_SetSelection[] = { &s_wxluaarg_Number, 0 }; + // void SetSelection(int n) + static int LUACALL wxLua_wxSimpleHtmlListBox_SetSelection(lua_State *L) + { + wxLuaState wxlState(L); + // int n + int n = (int)wxlState.GetNumberType(2); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call SetSelection + self->SetSelection(n); + + return 0; + } + + // int GetSelection() const + static int LUACALL wxLua_wxSimpleHtmlListBox_GetSelection(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call GetSelection + returns = self->GetSelection(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // virtual unsigned int GetCount() const + static int LUACALL wxLua_wxSimpleHtmlListBox_GetCount(lua_State *L) + { + wxLuaState wxlState(L); + unsigned int returns; + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call GetCount + returns = self->GetCount(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_GetString[] = { &s_wxluaarg_Number, 0 }; + // virtual wxString GetString(unsigned int n) const + static int LUACALL wxLua_wxSimpleHtmlListBox_GetString(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // unsigned int n + unsigned int n = (int)wxlState.GetNumberType(2); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call GetString + returns = self->GetString(n); + // push the result string + wxlState.lua_PushString(returns); + + return 1; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_SetString[] = { &s_wxluaarg_Number, &s_wxluaarg_String, 0 }; + // virtual void SetString(unsigned int n, const wxString& s) + static int LUACALL wxLua_wxSimpleHtmlListBox_SetString(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString s + const wxString s = wxlState.GetwxStringType(3); + // unsigned int n + unsigned int n = (int)wxlState.GetNumberType(2); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call SetString + self->SetString(n, s); + + return 0; + } + + // virtual void Clear() + static int LUACALL wxLua_wxSimpleHtmlListBox_Clear(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call Clear + self->Clear(); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Delete[] = { &s_wxluaarg_Number, 0 }; + // virtual void Delete(unsigned int n) + static int LUACALL wxLua_wxSimpleHtmlListBox_Delete(lua_State *L) + { + wxLuaState wxlState(L); + // unsigned int n + unsigned int n = (int)wxlState.GetNumberType(2); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call Delete + self->Delete(n); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_AppendStrings[] = { &s_wxluaarg_LuaTable, 0 }; + // %rename AppendStrings void Append(const wxArrayString_FromLuaTable& strings) + static int LUACALL wxLua_wxSimpleHtmlListBox_AppendStrings(lua_State *L) + { + wxLuaState wxlState(L); + // const wxArrayString_FromLuaTable strings + wxArrayString strings = wxArrayString(); wxlState.GetwxArrayString(2, strings); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call Append + self->Append(strings); + + return 0; + } + + static wxLuaArgTag s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Append[] = { &s_wxluaarg_String, 0 }; + // int Append(const wxString& item) + static int LUACALL wxLua_wxSimpleHtmlListBox_Append(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // const wxString item + const wxString item = wxlState.GetwxStringType(2); + // get this + wxSimpleHtmlListBox * self = (wxSimpleHtmlListBox *)wxlState.GetUserDataType(1, s_wxluatag_wxSimpleHtmlListBox); + // call Append + returns = self->Append(item); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxSimpleHtmlListBox_destructor(lua_State *) + { + return 0; + } + + + + // Map Lua Class Methods to C Binding Functions + WXLUAMETHOD wxSimpleHtmlListBox_methods[] = { + + #if ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML)) && (wxLUA_USE_wxArrayString) + { LuaMethod, "GetStrings", wxLua_wxSimpleHtmlListBox_GetStrings, 0, 0, s_wxluaargArray_None }, + #endif // ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML)) && (wxLUA_USE_wxArrayString) + + + #if ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML))) && (wxLUA_USE_wxPointSizeRect) + { LuaConstructor, "wxSimpleHtmlListBox", wxLua_wxSimpleHtmlListBox_constructor, 8, 5, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_constructor }, + { LuaMethod, "Create", wxLua_wxSimpleHtmlListBox_Create, 8, 5, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Create }, + #endif // ((wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && ((wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML))) && (wxLUA_USE_wxPointSizeRect) + + { LuaConstructor, "wxSimpleHtmlListBoxDefault", wxLua_wxSimpleHtmlListBoxDefault_constructor, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "SetSelection", wxLua_wxSimpleHtmlListBox_SetSelection, 1, 1, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_SetSelection }, + { LuaMethod, "GetSelection", wxLua_wxSimpleHtmlListBox_GetSelection, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetCount", wxLua_wxSimpleHtmlListBox_GetCount, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "GetString", wxLua_wxSimpleHtmlListBox_GetString, 1, 1, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_GetString }, + { LuaMethod, "SetString", wxLua_wxSimpleHtmlListBox_SetString, 2, 2, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_SetString }, + { LuaMethod, "Clear", wxLua_wxSimpleHtmlListBox_Clear, 0, 0, s_wxluaargArray_None }, + { LuaMethod, "Delete", wxLua_wxSimpleHtmlListBox_Delete, 1, 1, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Delete }, + { LuaMethod, "AppendStrings", wxLua_wxSimpleHtmlListBox_AppendStrings, 1, 1, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_AppendStrings }, + { LuaMethod, "Append", wxLua_wxSimpleHtmlListBox_Append, 1, 1, s_wxluatagArray_wxLua_wxSimpleHtmlListBox_Append }, + { LuaDelete, "wxSimpleHtmlListBox", wxLua_wxSimpleHtmlListBox_destructor, 0, 0, s_wxluaargArray_None }, + }; + + int wxSimpleHtmlListBox_methodCount = sizeof(wxSimpleHtmlListBox_methods)/sizeof(wxSimpleHtmlListBox_methods[0]); + #endif // (wxCHECK_VERSION(2,7,0)) && (wxLUA_USE_wxHTML && wxUSE_HTML) + + #if wxLUA_USE_wxHTML && wxUSE_HTML // --------------------------------------------------------------------------- Index: wx_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wx_bind.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -C2 -d -r1.84 -r1.85 *** wx_bind.cpp 9 Mar 2007 06:10:18 -0000 1.84 --- wx_bind.... [truncated message content] |