Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv27299/wxLua/modules/wxbind/src Modified Files: appframe.cpp controls.cpp defsutil.cpp dialogs.cpp event.cpp gdi.cpp wave.cpp wx_bind.cpp Log Message: add all conditions to genwxbind.lua add more wxLUA_USE_XXX Add wxJoystick, wxBusyInfo, wxPasswordEntryDialog, wxSplashScreen remove duplicate code in wxldebug.cpp Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** controls.cpp 18 May 2006 05:47:39 -0000 1.26 --- controls.cpp 25 May 2006 22:50:05 -0000 1.27 *************** *** 431,435 **** ! #if wxLUA_USE_wxButton // ------------------------------------------------------------------------------------------------- // Bind class wxToggleButton --- 431,435 ---- ! #if wxLUA_USE_wxToggleButton // ------------------------------------------------------------------------------------------------- // Bind class wxToggleButton *************** *** 440,444 **** ! #if ((wxLUA_USE_wxButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) // wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxToggleButton") static int LUACALL wxLua_wxToggleButton_constructor(lua_State *L) --- 440,444 ---- ! #if ((wxLUA_USE_wxToggleButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) // wxToggleButton(wxWindow *parent, wxWindowID id, const wxString& label, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = "wxToggleButton") static int LUACALL wxLua_wxToggleButton_constructor(lua_State *L) *************** *** 551,555 **** static WXLUAMETHOD s_wxToggleButton_methods[] = { ! #if ((wxLUA_USE_wxButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) { LuaConstructor, "wxToggleButton", wxLua_wxToggleButton_constructor, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, { LuaMethod, "Create", wxLua_wxToggleButton_Create, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, --- 551,555 ---- static WXLUAMETHOD s_wxToggleButton_methods[] = { ! #if ((wxLUA_USE_wxToggleButton) && (wxLUA_USE_wxValidator)) && (wxLUA_USE_wxPointSizeRect) { LuaConstructor, "wxToggleButton", wxLua_wxToggleButton_constructor, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, { LuaMethod, "Create", wxLua_wxToggleButton_Create, 8, 3, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluatag_wxValidator, &s_wxluaarg_String, 0 } }, *************** *** 784,788 **** ! #if wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox // ------------------------------------------------------------------------------------------------- // Bind class wxControlWithItems --- 784,788 ---- ! #if wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox // ------------------------------------------------------------------------------------------------- // Bind class wxControlWithItems *************** *** 793,797 **** ! #if (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) && (wxLUA_USE_wxArrayString) // %overload %rename AppendStrings void Append(const wxArrayString& strings) static int LUACALL wxLua_wxControlWithItems_AppendStrings(lua_State *L) --- 793,797 ---- ! #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox) // %overload %rename AppendStrings void Append(const wxArrayString& strings) static int LUACALL wxLua_wxControlWithItems_AppendStrings(lua_State *L) *************** *** 1109,1113 **** // Overloaded function bindings ! #if ((wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) && (wxLUA_USE_wxArrayString))||(wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) // Overloaded functions for wxLua_wxControlWithItems_Append static int LUACALL wxLua_wxControlWithItems_Append(lua_State *L) --- 1109,1113 ---- // Overloaded function bindings ! #if ((wxLUA_USE_wxArrayString) && (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox))||(wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox) // Overloaded functions for wxLua_wxControlWithItems_Append static int LUACALL wxLua_wxControlWithItems_Append(lua_State *L) *************** *** 1117,1121 **** { ! #if (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) && (wxLUA_USE_wxArrayString) { LuaMethod, "AppendStrings", wxLua_wxControlWithItems_AppendStrings, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, #endif --- 1117,1121 ---- { ! #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox) { LuaMethod, "AppendStrings", wxLua_wxControlWithItems_AppendStrings, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, #endif *************** *** 1131,1135 **** ! #if (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) // Overloaded functions for wxLua_wxControlWithItems_Insert static int LUACALL wxLua_wxControlWithItems_Insert(lua_State *L) --- 1131,1135 ---- ! #if (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox) // Overloaded functions for wxLua_wxControlWithItems_Insert static int LUACALL wxLua_wxControlWithItems_Insert(lua_State *L) *************** *** 1152,1156 **** static WXLUAMETHOD s_wxControlWithItems_methods[] = { ! #if (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox) && (wxLUA_USE_wxArrayString) { LuaMethod, "AppendStrings", wxLua_wxControlWithItems_AppendStrings, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, #endif --- 1152,1156 ---- static WXLUAMETHOD s_wxControlWithItems_methods[] = { ! #if (wxLUA_USE_wxArrayString) && (wxLUA_USE_wxChoice || wxLUA_USE_wxComboBox || wxLUA_USE_wxListBox) { LuaMethod, "AppendStrings", wxLua_wxControlWithItems_AppendStrings, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, #endif *************** *** 9925,9929 **** } ! // bool IsOk() static int LUACALL wxLua_wxTreeItemId_IsOk(lua_State *L) { --- 9925,9929 ---- } ! // bool IsOk() static int LUACALL wxLua_wxTreeItemId_IsOk(lua_State *L) { *************** *** 9941,9949 **** // %override wxLua_wxTreeItemId_GetValue ! // double GetValue() const; static int LUACALL wxLua_wxTreeItemId_GetValue(lua_State *L) { wxLuaState wxlState(L); ! double returns; // get this wxTreeItemId *self = (wxTreeItemId *)wxlState.GetUserDataType(1, s_wxluatag_wxTreeItemId); --- 9941,9949 ---- // %override wxLua_wxTreeItemId_GetValue ! // long GetValue() const; static int LUACALL wxLua_wxTreeItemId_GetValue(lua_State *L) { wxLuaState wxlState(L); ! long returns; // get this wxTreeItemId *self = (wxTreeItemId *)wxlState.GetUserDataType(1, s_wxluatag_wxTreeItemId); *************** *** 9956,9974 **** } - // %override wxLua_wxTreeItemId_SetValue - // void SetValue(double value); - static int LUACALL wxLua_wxTreeItemId_SetValue(lua_State *L) - { - wxLuaState wxlState(L); - // double value - long value = (long)wxlState.GetNumberType(2); - // get this - wxTreeItemId *self = (wxTreeItemId *)wxlState.GetUserDataType(1, s_wxluatag_wxTreeItemId); - // call SetValue - self->m_pItem = (void *) value; - // return the number of parameters - return 0; - } - // %operator wxTreeItemId& operator=(const wxTreeItemId& otherId) static int LUACALL wxLua_wxTreeItemId_op_assign(lua_State *L) --- 9956,9959 ---- *************** *** 10059,10067 **** { LuaMethod, "IsOk", wxLua_wxTreeItemId_IsOk, 0, 0, { 0 } }, { LuaMethod, "GetValue", wxLua_wxTreeItemId_GetValue, 0, 0, { 0 } }, - { LuaMethod, "SetValue", wxLua_wxTreeItemId_SetValue, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "op_assign", wxLua_wxTreeItemId_op_assign, 1, 1, { &s_wxluatag_wxTreeItemId, 0 } }, { LuaMethod, "op_eq", wxLua_wxTreeItemId_op_eq, 1, 1, { &s_wxluatag_wxTreeItemId, 0 } }, { LuaGetProp, "Value", wxLua_wxTreeItemId_GetValue, 0, 0, {0} }, - { LuaSetProp, "Value", wxLua_wxTreeItemId_SetValue, 1, 1, {0} }, { LuaDelete, "wxTreeItemId", wxLua_wxTreeItemId_destructor, 0, 0, {0} }, { LuaMethod, "Delete", wxLua_wxTreeItemId_Delete, 0, 0, {0} }, --- 10044,10050 ---- *************** *** 10374,10375 **** --- 10357,10742 ---- #endif + + #if wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG + // ------------------------------------------------------------------------------------------------- + // Bind class wxGenericDirCtrl + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxGenericDirCtrl = -1; + + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG) + // wxGenericDirCtrl(wxWindow *parent, const wxWindowID id = wxID_ANY, const wxString &dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, const wxString& filter = "", int defaultFilter = 0, const wxString& name = "wxGenericDirCtrl") + static int LUACALL wxLua_wxGenericDirCtrl_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxGenericDirCtrl *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxGenericDirCtrl" + const wxString name = (argCount >= 9 ? lua2wx(wxlState.GetStringType(9)) : wxString(wxT("wxGenericDirCtrl"))); + // int defaultFilter = 0 + int defaultFilter = (argCount >= 8 ? (int)wxlState.GetNumberType(8) : 0); + // const wxString filter = "" + const wxString filter = (argCount >= 7 ? lua2wx(wxlState.GetStringType(7)) : wxString(wxEmptyString)); + // long style = wxDIRCTRL_3D_INTERNAL | wxSUNKEN_BORDER + long style = (argCount >= 6 ? (long)wxlState.GetNumberType(6) : wxDIRCTRL_3D_INTERNAL | wxSUNKEN_BORDER); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 5 ? (const wxSize *)wxlState.GetUserDataType(5, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 4 ? (const wxPoint *)wxlState.GetUserDataType(4, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxString dir = wxDirDialogDefaultFolderStr + const wxString dir = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxDirDialogDefaultFolderStr)); + // const wxWindowID id = wxID_ANY + const wxWindowID id = (argCount >= 2 ? (wxWindowID)wxlState.GetNumberType(2) : wxID_ANY); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxGenericDirCtrl(parent, id, dir, *pos, *size, style, filter, defaultFilter, name); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxGenericDirCtrl, returns); + + return 1; + } + + // bool Create(wxWindow *parent, const wxWindowID id = wxID_ANY, const wxString &dir = wxDirDialogDefaultFolderStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDIRCTRL_3D_INTERNAL|wxSUNKEN_BORDER, const wxString& filter = "", int defaultFilter = 0, const wxString& name = "wxGenericDirCtrl") + static int LUACALL wxLua_wxGenericDirCtrl_Create(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxString name = "wxGenericDirCtrl" + const wxString name = (argCount >= 10 ? lua2wx(wxlState.GetStringType(10)) : wxString(wxT("wxGenericDirCtrl"))); + // int defaultFilter = 0 + int defaultFilter = (argCount >= 9 ? (int)wxlState.GetNumberType(9) : 0); + // const wxString filter = "" + const wxString filter = (argCount >= 8 ? lua2wx(wxlState.GetStringType(8)) : wxString(wxEmptyString)); + // long style = wxDIRCTRL_3D_INTERNAL | wxSUNKEN_BORDER + long style = (argCount >= 7 ? (long)wxlState.GetNumberType(7) : wxDIRCTRL_3D_INTERNAL | wxSUNKEN_BORDER); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 6 ? (const wxSize *)wxlState.GetUserDataType(6, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 5 ? (const wxPoint *)wxlState.GetUserDataType(5, s_wxluatag_wxPoint) : &wxDefaultPosition); + // const wxString dir = wxDirDialogDefaultFolderStr + const wxString dir = (argCount >= 4 ? lua2wx(wxlState.GetStringType(4)) : wxString(wxDirDialogDefaultFolderStr)); + // const wxWindowID id = wxID_ANY + const wxWindowID id = (argCount >= 3 ? (wxWindowID)wxlState.GetNumberType(3) : wxID_ANY); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call Create + returns = self->Create(parent, id, dir, *pos, *size, style, filter, defaultFilter, name); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif + + + #if (wxLUA_USE_wxTreeCtrl) && (wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG) + // wxTreeItemId GetRootId() + static int LUACALL wxLua_wxGenericDirCtrl_GetRootId(lua_State *L) + { + wxLuaState wxlState(L); + wxTreeItemId *returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetRootId + // allocate a new object using the copy constructor + returns = new wxTreeItemId(self->GetRootId()); + // add the new object to the tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxTreeItemId *)returns); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxTreeItemId, returns); + + return 1; + } + + // wxTreeCtrl* GetTreeCtrl() const + static int LUACALL wxLua_wxGenericDirCtrl_GetTreeCtrl(lua_State *L) + { + wxLuaState wxlState(L); + wxTreeCtrl *returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetTreeCtrl + returns = self->GetTreeCtrl(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxTreeCtrl, returns); + + return 1; + } + + #endif + + // %constructor wxGenericDirCtrlDefault() + static int LUACALL wxLua_wxGenericDirCtrlDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxGenericDirCtrl *returns; + // call constructor + returns = new wxGenericDirCtrl(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxGenericDirCtrl, returns); + + return 1; + } + + // void CollapseTree() + static int LUACALL wxLua_wxGenericDirCtrl_CollapseTree(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call CollapseTree + self->CollapseTree(); + + return 0; + } + + // bool ExpandPath(const wxString& path) + static int LUACALL wxLua_wxGenericDirCtrl_ExpandPath(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // const wxString path + const wxString path = lua2wx(wxlState.GetStringType(2)); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call ExpandPath + returns = self->ExpandPath(path); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // wxString GetDefaultPath() const + static int LUACALL wxLua_wxGenericDirCtrl_GetDefaultPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetDefaultPath + returns = self->GetDefaultPath(); + // push the result string + lua_pushstring(L, wx2lua(returns) ); + + return 1; + } + + // wxString GetPath() const + static int LUACALL wxLua_wxGenericDirCtrl_GetPath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetPath + returns = self->GetPath(); + // push the result string + lua_pushstring(L, wx2lua(returns) ); + + return 1; + } + + // wxString GetFilePath() const + static int LUACALL wxLua_wxGenericDirCtrl_GetFilePath(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetFilePath + returns = self->GetFilePath(); + // push the result string + lua_pushstring(L, wx2lua(returns) ); + + return 1; + } + + // wxString GetFilter() const + static int LUACALL wxLua_wxGenericDirCtrl_GetFilter(lua_State *L) + { + wxLuaState wxlState(L); + wxString returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetFilter + returns = self->GetFilter(); + // push the result string + lua_pushstring(L, wx2lua(returns) ); + + return 1; + } + + // int GetFilterIndex() const + static int LUACALL wxLua_wxGenericDirCtrl_GetFilterIndex(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetFilterIndex + returns = self->GetFilterIndex(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // void ReCreateTree() + static int LUACALL wxLua_wxGenericDirCtrl_ReCreateTree(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call ReCreateTree + self->ReCreateTree(); + + return 0; + } + + // void SetDefaultPath(const wxString& path) + static int LUACALL wxLua_wxGenericDirCtrl_SetDefaultPath(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString path + const wxString path = lua2wx(wxlState.GetStringType(2)); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call SetDefaultPath + self->SetDefaultPath(path); + + return 0; + } + + // void SetFilter(const wxString& filter) + static int LUACALL wxLua_wxGenericDirCtrl_SetFilter(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString filter + const wxString filter = lua2wx(wxlState.GetStringType(2)); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call SetFilter + self->SetFilter(filter); + + return 0; + } + + // void SetFilterIndex(int n) + static int LUACALL wxLua_wxGenericDirCtrl_SetFilterIndex(lua_State *L) + { + wxLuaState wxlState(L); + // int n + int n = (int)wxlState.GetNumberType(2); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call SetFilterIndex + self->SetFilterIndex(n); + + return 0; + } + + // void SetPath(const wxString& path) + static int LUACALL wxLua_wxGenericDirCtrl_SetPath(lua_State *L) + { + wxLuaState wxlState(L); + // const wxString path + const wxString path = lua2wx(wxlState.GetStringType(2)); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call SetPath + self->SetPath(path); + + return 0; + } + + // void ShowHidden( bool show ) + static int LUACALL wxLua_wxGenericDirCtrl_ShowHidden(lua_State *L) + { + wxLuaState wxlState(L); + // bool show + bool show = wxlState.GetBooleanType(2); + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call ShowHidden + self->ShowHidden(show); + + return 0; + } + + // bool GetShowHidden() + static int LUACALL wxLua_wxGenericDirCtrl_GetShowHidden(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxGenericDirCtrl * self = (wxGenericDirCtrl *)wxlState.GetUserDataType(1, s_wxluatag_wxGenericDirCtrl); + // call GetShowHidden + returns = self->GetShowHidden(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxGenericDirCtrl_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxGenericDirCtrl_methods[] = { + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG) + { LuaConstructor, "wxGenericDirCtrl", wxLua_wxGenericDirCtrl_constructor, 9, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_String, 0 } }, + { LuaMethod, "Create", wxLua_wxGenericDirCtrl_Create, 9, 1, { &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_String, 0 } }, + #endif + + + #if (wxLUA_USE_wxTreeCtrl) && (wxLUA_USE_wxGenericDirCtrl && wxUSE_DIRDLG) + { LuaMethod, "GetRootId", wxLua_wxGenericDirCtrl_GetRootId, 0, 0, { 0 } }, + { LuaMethod, "GetTreeCtrl", wxLua_wxGenericDirCtrl_GetTreeCtrl, 0, 0, { 0 } }, + #endif + + { LuaConstructor, "wxGenericDirCtrlDefault", wxLua_wxGenericDirCtrlDefault_constructor, 0, 0, { 0 } }, + { LuaMethod, "CollapseTree", wxLua_wxGenericDirCtrl_CollapseTree, 0, 0, { 0 } }, + { LuaMethod, "ExpandPath", wxLua_wxGenericDirCtrl_ExpandPath, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "GetDefaultPath", wxLua_wxGenericDirCtrl_GetDefaultPath, 0, 0, { 0 } }, + { LuaMethod, "GetPath", wxLua_wxGenericDirCtrl_GetPath, 0, 0, { 0 } }, + { LuaMethod, "GetFilePath", wxLua_wxGenericDirCtrl_GetFilePath, 0, 0, { 0 } }, + { LuaMethod, "GetFilter", wxLua_wxGenericDirCtrl_GetFilter, 0, 0, { 0 } }, + { LuaMethod, "GetFilterIndex", wxLua_wxGenericDirCtrl_GetFilterIndex, 0, 0, { 0 } }, + { LuaMethod, "ReCreateTree", wxLua_wxGenericDirCtrl_ReCreateTree, 0, 0, { 0 } }, + { LuaMethod, "SetDefaultPath", wxLua_wxGenericDirCtrl_SetDefaultPath, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetFilter", wxLua_wxGenericDirCtrl_SetFilter, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "SetFilterIndex", wxLua_wxGenericDirCtrl_SetFilterIndex, 1, 1, { &s_wxluaarg_Number, 0 } }, + { LuaMethod, "SetPath", wxLua_wxGenericDirCtrl_SetPath, 1, 1, { &s_wxluaarg_String, 0 } }, + { LuaMethod, "ShowHidden", wxLua_wxGenericDirCtrl_ShowHidden, 1, 1, { &s_wxluaarg_Boolean, 0 } }, + { LuaMethod, "GetShowHidden", wxLua_wxGenericDirCtrl_GetShowHidden, 0, 0, { 0 } }, + { LuaDelete, "wxGenericDirCtrl", wxLua_wxGenericDirCtrl_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxGenericDirCtrl_methods = s_wxGenericDirCtrl_methods; + int wxGenericDirCtrl_methodCount = sizeof(s_wxGenericDirCtrl_methods)/sizeof(s_wxGenericDirCtrl_methods[0]); + #endif + Index: dialogs.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/dialogs.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** dialogs.cpp 17 May 2006 22:47:10 -0000 1.16 --- dialogs.cpp 25 May 2006 22:50:05 -0000 1.17 *************** *** 1152,1155 **** --- 1152,1157 ---- #endif + + #if wxLUA_USE_wxMultiChoiceDialog // ------------------------------------------------------------------------------------------------- // Bind class wxMultiChoiceDialog *************** *** 1159,1169 **** int s_wxluatag_wxMultiChoiceDialog = -1; - static int LUACALL wxLua_wxMultiChoiceDialog_destructor(lua_State *) - { - return 0; - } - ! #if wxLUA_USE_wxArrayInt // wxArrayInt GetSelections() const // FIXME static int LUACALL wxLua_wxMultiChoiceDialog_GetSelections(lua_State *L) --- 1161,1166 ---- int s_wxluatag_wxMultiChoiceDialog = -1; ! #if (wxLUA_USE_wxArrayInt) && (wxLUA_USE_wxMultiChoiceDialog) // wxArrayInt GetSelections() const // FIXME static int LUACALL wxLua_wxMultiChoiceDialog_GetSelections(lua_State *L) *************** *** 1201,1205 **** ! #if wxLUA_USE_wxPointSizeRect // wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L) --- 1198,1202 ---- ! #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxMultiChoiceDialog) // wxMultiChoiceDialog(wxWindow* parent, const wxString& message, const wxString& caption, const wxArrayString_FromLuaTable& choices, long style = wxCHOICEDLG_STYLE, const wxPoint& pos = wxDefaultPosition) static int LUACALL wxLua_wxMultiChoiceDialog_constructor(lua_State *L) *************** *** 1234,1237 **** --- 1231,1239 ---- #endif + static int LUACALL wxLua_wxMultiChoiceDialog_destructor(lua_State *) + { + return 0; + } + *************** *** 1240,1246 **** // Map Lua Class Methods to C Binding Functions static WXLUAMETHOD s_wxMultiChoiceDialog_methods[] = { - { LuaDelete, "wxMultiChoiceDialog", wxLua_wxMultiChoiceDialog_destructor, 0, 0, {0} }, ! #if wxLUA_USE_wxArrayInt { LuaMethod, "GetSelections", wxLua_wxMultiChoiceDialog_GetSelections, 0, 0, { 0 } }, { LuaMethod, "SetSelections", wxLua_wxMultiChoiceDialog_SetSelections, 1, 1, { &s_wxluatag_wxArrayInt, 0 } }, --- 1242,1247 ---- // Map Lua Class Methods to C Binding Functions static WXLUAMETHOD s_wxMultiChoiceDialog_methods[] = { ! #if (wxLUA_USE_wxArrayInt) && (wxLUA_USE_wxMultiChoiceDialog) { LuaMethod, "GetSelections", wxLua_wxMultiChoiceDialog_GetSelections, 0, 0, { 0 } }, { LuaMethod, "SetSelections", wxLua_wxMultiChoiceDialog_SetSelections, 1, 1, { &s_wxluatag_wxArrayInt, 0 } }, *************** *** 1248,1255 **** ! #if wxLUA_USE_wxPointSizeRect { LuaConstructor, "wxMultiChoiceDialog", wxLua_wxMultiChoiceDialog_constructor, 6, 4, { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_LuaTable, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 } }, #endif }; --- 1249,1257 ---- ! #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxMultiChoiceDialog) { LuaConstructor, "wxMultiChoiceDialog", wxLua_wxMultiChoiceDialog_constructor, 6, 4, { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_LuaTable, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 } }, #endif + { LuaDelete, "wxMultiChoiceDialog", wxLua_wxMultiChoiceDialog_destructor, 0, 0, {0} }, }; *************** *** 1257,1260 **** --- 1259,1263 ---- WXLUAMETHOD* wxMultiChoiceDialog_methods = s_wxMultiChoiceDialog_methods; int wxMultiChoiceDialog_methodCount = sizeof(s_wxMultiChoiceDialog_methods)/sizeof(s_wxMultiChoiceDialog_methods[0]); + #endif *************** *** 1477,1480 **** --- 1480,1550 ---- + #if wxLUA_USE_wxTextEntryDialog + // ------------------------------------------------------------------------------------------------- + // Bind class wxPasswordEntryDialog + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxPasswordEntryDialog = -1; + + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxTextEntryDialog) + // wxPasswordEntryDialog(wxWindow *parent, const wxString& message, const wxString& caption = wxGetPasswordFromUserPromptStr, const wxString& value = "", long style = wxTextEntryDialogStyle, const wxPoint& pos = wxDefaultPosition) + static int LUACALL wxLua_wxPasswordEntryDialog_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxPasswordEntryDialog *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 6 ? (const wxPoint *)wxlState.GetUserDataType(6, s_wxluatag_wxPoint) : &wxDefaultPosition); + // long style = wxTextEntryDialogStyle + long style = (argCount >= 5 ? (long)wxlState.GetNumberType(5) : wxTextEntryDialogStyle); + // const wxString value = "" + const wxString value = (argCount >= 4 ? lua2wx(wxlState.GetStringType(4)) : wxString(wxEmptyString)); + // const wxString caption = wxGetPasswordFromUserPromptStr + const wxString caption = (argCount >= 3 ? lua2wx(wxlState.GetStringType(3)) : wxString(wxGetPasswordFromUserPromptStr)); + // const wxString message + const wxString message = lua2wx(wxlState.GetStringType(2)); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxWindow); + // call constructor + returns = new wxPasswordEntryDialog(parent, message, caption, value, style, *pos); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxPasswordEntryDialog, returns); + + return 1; + } + + #endif + + static int LUACALL wxLua_wxPasswordEntryDialog_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxPasswordEntryDialog_methods[] = { + + #if (wxLUA_USE_wxPointSizeRect) && (wxLUA_USE_wxTextEntryDialog) + { LuaConstructor, "wxPasswordEntryDialog", wxLua_wxPasswordEntryDialog_constructor, 6, 2, { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluatag_wxPoint, 0 } }, + #endif + + { LuaDelete, "wxPasswordEntryDialog", wxLua_wxPasswordEntryDialog_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxPasswordEntryDialog_methods = s_wxPasswordEntryDialog_methods; + int wxPasswordEntryDialog_methodCount = sizeof(s_wxPasswordEntryDialog_methods)/sizeof(s_wxPasswordEntryDialog_methods[0]); + #endif + + #if wxLUA_USE_wxFontDialog // ------------------------------------------------------------------------------------------------- *************** *** 2449,2452 **** --- 2519,2708 ---- + #if wxLUA_USE_wxSplashScreen + // ------------------------------------------------------------------------------------------------- + // Bind class wxSplashScreen + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxSplashScreen = -1; + + + #if ((wxLUA_USE_wxSplashScreen) && (wxLUA_USE_wxBitmap)) && (wxLUA_USE_wxPointSizeRect) + // wxSplashScreen(const wxBitmap& bitmap, long splashStyle, int milliseconds, wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSIMPLE_BORDER|wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP) + static int LUACALL wxLua_wxSplashScreen_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSplashScreen *returns; + // get number of arguments + int argCount = lua_gettop(L); + // long style = wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP + long style = (argCount >= 8 ? (long)wxlState.GetNumberType(8) : wxSIMPLE_BORDER | wxFRAME_NO_TASKBAR | wxSTAY_ON_TOP); + // const wxSize size = wxDefaultSize + const wxSize * size = (argCount >= 7 ? (const wxSize *)wxlState.GetUserDataType(7, s_wxluatag_wxSize) : &wxDefaultSize); + // const wxPoint pos = wxDefaultPosition + const wxPoint * pos = (argCount >= 6 ? (const wxPoint *)wxlState.GetUserDataType(6, s_wxluatag_wxPoint) : &wxDefaultPosition); + // wxWindowID id + wxWindowID id = (wxWindowID)wxlState.GetNumberType(5); + // wxWindow parent + wxWindow * parent = (wxWindow *)wxlState.GetUserDataType(4, s_wxluatag_wxWindow); + // int milliseconds + int milliseconds = (int)wxlState.GetNumberType(3); + // long splashStyle + long splashStyle = (long)wxlState.GetNumberType(2); + // const wxBitmap bitmap + const wxBitmap * bitmap = (const wxBitmap *)wxlState.GetUserDataType(1, s_wxluatag_wxBitmap); + // call constructor + returns = new wxSplashScreen(*bitmap, splashStyle, milliseconds, parent, id, *pos, *size, style); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSplashScreen, returns); + + return 1; + } + + #endif + + // long GetSplashStyle() const + static int LUACALL wxLua_wxSplashScreen_GetSplashStyle(lua_State *L) + { + wxLuaState wxlState(L); + long returns; + // get this + wxSplashScreen * self = (wxSplashScreen *)wxlState.GetUserDataType(1, s_wxluatag_wxSplashScreen); + // call GetSplashStyle + returns = self->GetSplashStyle(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + // wxSplashScreenWindow* GetSplashWindow() const + static int LUACALL wxLua_wxSplashScreen_GetSplashWindow(lua_State *L) + { + wxLuaState wxlState(L); + wxSplashScreenWindow *returns; + // get this + wxSplashScreen * self = (wxSplashScreen *)wxlState.GetUserDataType(1, s_wxluatag_wxSplashScreen); + // call GetSplashWindow + returns = self->GetSplashWindow(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxSplashScreenWindow, returns); + + return 1; + } + + // int GetTimeout() const + static int LUACALL wxLua_wxSplashScreen_GetTimeout(lua_State *L) + { + wxLuaState wxlState(L); + int returns; + // get this + wxSplashScreen * self = (wxSplashScreen *)wxlState.GetUserDataType(1, s_wxluatag_wxSplashScreen); + // call GetTimeout + returns = self->GetTimeout(); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static int LUACALL wxLua_wxSplashScreen_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxSplashScreen_methods[] = { + + #if ((wxLUA_USE_wxSplashScreen) && (wxLUA_USE_wxBitmap)) && (wxLUA_USE_wxPointSizeRect) + { LuaConstructor, "wxSplashScreen", wxLua_wxSplashScreen_constructor, 8, 5, { &s_wxluatag_wxBitmap, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxWindow, &s_wxluaarg_Number, &s_wxluatag_wxPoint, &s_wxluatag_wxSize, &s_wxluaarg_Number, 0 } }, + #endif + + { LuaMethod, "GetSplashStyle", wxLua_wxSplashScreen_GetSplashStyle, 0, 0, { 0 } }, + { LuaMethod, "GetSplashWindow", wxLua_wxSplashScreen_GetSplashWindow, 0, 0, { 0 } }, + { LuaMethod, "GetTimeout", wxLua_wxSplashScreen_GetTimeout, 0, 0, { 0 } }, + { LuaDelete, "wxSplashScreen", wxLua_wxSplashScreen_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxSplashScreen_methods = s_wxSplashScreen_methods; + int wxSplashScreen_methodCount = sizeof(s_wxSplashScreen_methods)/sizeof(s_wxSplashScreen_methods[0]); + #endif + + + #if wxLUA_USE_wxSplashScreen + // ------------------------------------------------------------------------------------------------- + // Bind class wxSplashScreenWindow + // ------------------------------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class + int s_wxluatag_wxSplashScreenWindow = -1; + + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxSplashScreen) + // void SetBitmap(const wxBitmap& bitmap) + static int LUACALL wxLua_wxSplashScreenWindow_SetBitmap(lua_State *L) + { + wxLuaState wxlState(L); + // const wxBitmap bitmap + const wxBitmap * bitmap = (const wxBitmap *)wxlState.GetUserDataType(2, s_wxluatag_wxBitmap); + // get this + wxSplashScreenWindow * self = (wxSplashScreenWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxSplashScreenWindow); + // call SetBitmap + self->SetBitmap(*bitmap); + + return 0; + } + + // wxBitmap& GetBitmap() + static int LUACALL wxLua_wxSplashScreenWindow_GetBitmap(lua_State *L) + { + wxLuaState wxlState(L); + wxBitmap *returns; + // get this + wxSplashScreenWindow * self = (wxSplashScreenWindow *)wxlState.GetUserDataType(1, s_wxluatag_wxSplashScreenWindow); + // call GetBitmap + returns = &self->GetBitmap(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxBitmap, returns); + + return 1; + } + + #endif + + static int LUACALL wxLua_wxSplashScreenWindow_destructor(lua_State *) + { + return 0; + } + + + + + + // Map Lua Class Methods to C Binding Functions + static WXLUAMETHOD s_wxSplashScreenWindow_methods[] = { + + #if (wxLUA_USE_wxBitmap) && (wxLUA_USE_wxSplashScreen) + { LuaMethod, "SetBitmap", wxLua_wxSplashScreenWindow_SetBitmap, 1, 1, { &s_wxluatag_wxBitmap, 0 } }, + { LuaMethod, "GetBitmap", wxLua_wxSplashScreenWindow_GetBitmap, 0, 0, { 0 } }, + #endif + + { LuaDelete, "wxSplashScreenWindow", wxLua_wxSplashScreenWindow_destructor, 0, 0, {0} }, + }; + + // Extern accessor to class method map + WXLUAMETHOD* wxSplashScreenWindow_methods = s_wxSplashScreenWindow_methods; + int wxSplashScreenWindow_methodCount = sizeof(s_wxSplashScreenWindow_methods)/sizeof(s_wxSplashScreenWindow_methods[0]); + #endif + + #if wxLUA_USE_wxWizard // ------------------------------------------------------------------------------------------------- Index: defsutil.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/defsutil.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** defsutil.cpp 16 May 2006 22:47:09 -0000 1.15 --- defsutil.cpp 25 May 2006 22:50:05 -0000 1.16 *************** *** 29,32 **** --- 29,34 ---- + + #if wxLUA_USE_wxProcess // ------------------------------------------------------------------------------------------------- // Bind class wxProcess *************** *** 36,39 **** --- 38,169 ---- int s_wxluatag_wxProcess = -1; + + #if ((wxUSE_STREAMS) && (wxLUA_USE_wxProcess)) && (wxUSE_STREAMS) + // wxInputStream *GetErrorStream() const + static int LUACALL wxLua_wxProcess_GetErrorStream(lua_State *L) + { + wxLuaState wxlState(L); + wxInputStream *returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call GetErrorStream + returns = self->GetErrorStream(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxInputStream, returns); + + return 1; + } + + // wxInputStream *GetInputStream() const + static int LUACALL wxLua_wxProcess_GetInputStream(lua_State *L) + { + wxLuaState wxlState(L); + wxInputStream *returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call GetInputStream + returns = self->GetInputStream(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxInputStream, returns); + + return 1; + } + + // wxOutputStream *GetOutputStream() const + static int LUACALL wxLua_wxProcess_GetOutputStream(lua_State *L) + { + wxLuaState wxlState(L); + wxOutputStream *returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call GetOutputStream + returns = self->GetOutputStream(); + // push the result datatype + wxlState.PushUserDataType(s_wxluatag_wxOutputStream, returns); + + return 1; + } + + // void SetPipeStreams(wxInputStream *outStream, wxOutputStream *inStream, wxInputStream *errStream) + static int LUACALL wxLua_wxProcess_SetPipeStreams(lua_State *L) + { + wxLuaState wxlState(L); + // wxInputStream errStream + wxInputStream * errStream = (wxInputStream *)wxlState.GetUserDataType(4, s_wxluatag_wxInputStream); + // wxOutputStream inStream + wxOutputStream * inStream = (wxOutputStream *)wxlState.GetUserDataType(3, s_wxluatag_wxOutputStream); + // wxInputStream outStream + wxInputStream * outStream = (wxInputStream *)wxlState.GetUserDataType(2, s_wxluatag_wxInputStream); + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call SetPipeStreams + self->SetPipeStreams(outStream, inStream, errStream); + + return 0; + } + + #endif + + + #if (wxUSE_STREAMS) && (wxLUA_USE_wxProcess) + // void CloseOutput() + static int LUACALL wxLua_wxProcess_CloseOutput(lua_State *L) + { + wxLuaState wxlState(L); + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call CloseOutput + self->CloseOutput(); + + return 0; + } + + // bool IsErrorAvailable() const + static int LUACALL wxLua_wxProcess_IsErrorAvailable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call IsErrorAvailable + returns = self->IsErrorAvailable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // bool IsInputAvailable() const + static int LUACALL wxLua_wxProcess_IsInputAvailable(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call IsInputAvailable + returns = self->IsInputAvailable(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + // bool IsInputOpened() const + static int LUACALL wxLua_wxProcess_IsInputOpened(lua_State *L) + { + wxLuaState wxlState(L); + bool returns; + // get this + wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); + // call IsInputOpened + returns = self->IsInputOpened(); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif + // wxProcess(wxEvtHandler *parent = NULL, int nId = wxID_ANY) static int LUACALL wxLua_wxProcess_constructor(lua_State *L) *************** *** 177,309 **** - #if wxUSE_STREAMS - // void CloseOutput() - static int LUACALL wxLua_wxProcess_CloseOutput(lua_State *L) - { - wxLuaState wxlState(L); - // get this - wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); - // call CloseOutput - self->CloseOutput(); - return 0; - } - // wxInputStream *GetErrorStream() const - static int LUACALL wxLua_wxProcess_GetErrorStream(lua_State *L) - { - wxLuaState wxlState(L); - wxInputStream *returns; - // get this - wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); - // call GetErrorStream - returns = self->GetErrorStream(); - // push the result datatype - wxlState.PushUserDataType(s_wxluatag_wxInputStream, returns); ! return 1; ! } ! ! // wxInputStream *GetInputStream() const ! static int LUACALL wxLua_wxProcess_GetInputStream(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxInputStream *returns; ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call GetInputStream ! returns = self->GetInputStream(); ! // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxInputStream, returns); ! ! return 1; ! } ! ! // wxOutputStream *GetOutputStream() const ! static int LUACALL wxLua_wxProcess_GetOutputStream(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxOutputStream *returns; ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call GetOutputStream ! returns = self->GetOutputStream(); ! // push the result datatype ! wxlState.PushUserDataType(s_wxluatag_wxOutputStream, returns); ! ! return 1; ! } ! ! // bool IsErrorAvailable() const ! static int LUACALL wxLua_wxProcess_IsErrorAvailable(lua_State *L) ! { ! wxLuaState wxlState(L); ! bool returns; ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call IsErrorAvailable ! returns = self->IsErrorAvailable(); ! // push the result flag ! lua_pushboolean(L, returns); ! ! return 1; ! } ! ! // bool IsInputAvailable() const ! static int LUACALL wxLua_wxProcess_IsInputAvailable(lua_State *L) ! { ! wxLuaState wxlState(L); ! bool returns; ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call IsInputAvailable ! returns = self->IsInputAvailable(); ! // push the result flag ! lua_pushboolean(L, returns); ! ! return 1; ! } ! ! // bool IsInputOpened() const ! static int LUACALL wxLua_wxProcess_IsInputOpened(lua_State *L) ! { ! wxLuaState wxlState(L); ! bool returns; ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call IsInputOpened ! returns = self->IsInputOpened(); ! // push the result flag ! lua_pushboolean(L, returns); ! ! return 1; ! } ! ! // void SetPipeStreams(wxInputStream *outStream, wxOutputStream *inStream, wxInputStream *errStream) ! static int LUACALL wxLua_wxProcess_SetPipeStreams(lua_State *L) ! { ! wxLuaState wxlState(L); ! // wxInputStream errStream ! wxInputStream * errStream = (wxInputStream *)wxlState.GetUserDataType(4, s_wxluatag_wxInputStream); ! // wxOutputStream inStream ! wxOutputStream * inStream = (wxOutputStream *)wxlState.GetUserDataType(3, s_wxluatag_wxOutputStream); ! // wxInputStream outStream ! wxInputStream * outStream = (wxInputStream *)wxlState.GetUserDataType(2, s_wxluatag_wxInputStream); ! // get this ! wxProcess * self = (wxProcess *)wxlState.GetUserDataType(1, s_wxluatag_wxProcess); ! // call SetPipeStreams ! self->SetPipeStreams(outStream, inStream, errStream); ! ! return 0; ! } #endif - - - // Map Lua Class Methods to C Binding Functions - static WXLUAMETHOD s_wxProcess_methods[] = { { LuaConstructor, "wxProcess", wxLua_wxProcess_constructor, 2, 0, { &s_wxluatag_wxEvtHandler, &s_wxluaarg_Number, 0 } }, { LuaMethod, "Detach", wxLua_wxProcess_Detach, 0, 0, { 0 } }, --- 307,331 ---- ! // Map Lua Class Methods to C Binding Functions ! static WXLUAMETHOD s_wxProcess_methods[] = { + #if ((wxUSE_STREAMS) && (wxLUA_USE_wxProcess)) && (wxUSE_STREAMS) + { LuaMethod, "GetErrorStream", wxLua_wxProcess_GetErrorStream, 0, 0, { 0 } }, + { LuaMethod, "GetInputStream", wxLua_wxProcess_GetInputStream, 0, 0, { 0 } }, + { LuaMethod, "GetOutputStream", wxLua_wxProcess_GetOutputStream, 0, 0, { 0 } }, + { LuaMethod, "SetPipeStreams", wxLua_wxProcess_SetPipeStreams, 3, 3, { &s_wxluatag_wxInputStream, &s_wxluatag_wxOutputStream, &s_wxluatag_wxInputStream, 0 } }, #endif + #if (wxUSE_STREAMS) && (wxLUA_USE_wxProcess) + { LuaMethod, "CloseOutput", wxLua_wxProcess_CloseOutput, 0, 0, { 0 } }, + { LuaMethod, "IsErrorAvailable", wxLua_wxProcess_IsErrorAvailable, 0, 0, { 0 } }, + { LuaMethod, "IsInputAvailable", wxLua_wxProcess_IsInputAvailable, 0, 0, { 0 } }, + { LuaMethod, "IsInputOpened", wxLua_wxProcess_IsInputOpened, 0, 0, { 0 } }, + #endif { LuaConstructor, "wxProcess", wxLua_wxProcess_constructor, 2, 0, { &s_wxluatag_wxEvtHandler, &s_wxluaarg_Number, 0 } }, { LuaMethod, "Detach", wxLua_wxProcess_Detach, 0, 0, { 0 } }, *************** *** 315,330 **** { LuaDelete, "wxProcess", wxLua_wxProcess_destructor, 0, 0, {0} }, { LuaMethod, "Delete", wxLua_wxProcess_Delete, 0, 0, {0} }, - - #if wxUSE_STREAMS - { LuaMethod, "CloseOutput", wxLua_wxProcess_CloseOutput, 0, 0, { 0 } }, - { LuaMethod, "GetErrorStream", wxLua_wxProcess_GetErrorStream, 0, 0, { 0 } }, - { LuaMethod, "GetInputStream", wxLua_wxProcess_GetInputStream, 0, 0, { 0 } }, - { LuaMethod, "GetOutputStream", wxLua_wxProcess_GetOutputStream, 0, 0, { 0 } }, - { LuaMethod, "IsErrorAvailable", wxLua_wxProcess_IsErrorAvailable, 0, 0, { 0 } }, - { LuaMethod, "IsInputAvailable", wxLua_wxProcess_IsInputAvailable, 0, 0, { 0 } }, - { LuaMethod, "IsInputOpened", wxLua_wxProcess_IsInputOpened, 0, 0, { 0 } }, - { LuaMethod, "SetPipeStreams", wxLua_wxProcess_SetPipeStreams, 3, 3, { &s_wxluatag_wxInputStream, &s_wxluatag_wxOutputStream, &s_wxluatag_wxInputStream, 0 } }, - #endif - }; --- 337,340 ---- *************** *** 332,335 **** --- 342,346 ---- WXLUAMETHOD* wxProcess_methods = s_wxProcess_methods; int wxProcess_methodCount = sizeof(s_wxProcess_methods)/sizeof(s_wxProcess_methods[0]); + #endif *************** *** 693,696 **** --- 704,709 ---- #endif + + #if wxLUA_USE_wxBusyCursor // ------------------------------------------------------------------------------------------------- // Bind class wxBusyCursor *************** *** 700,703 **** --- 713,742 ---- int s_wxluatag_wxBusyCursor = -1; + + #if (wxLUA_USE_wxBusyCursor) && (wxLUA_USE_wxCursor) + // %override wxLua_wxBusyCursor_constructor + // wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) + static int LUACALL wxLua_wxBusyCursor_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBusyCursor *returns; + // get number of arguments + int argCount = lua_gettop(L); + // const wxCursor cursor = wxHOURGLASS_CURSOR + + // NOTE: gcc complains that wxHOURGLASS_CURSOR is const, if changed to const MSVC complains wxBusyCursor takes non const + wxCursor * cursor = (argCount >= 1 ? (wxCursor *)wxlState.GetUserDataType(1, s_wxluatag_wxCursor) : (wxCursor*)wxHOURGLASS_CURSOR); + // call constructor + returns = new wxBusyCursor(cursor); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); + + return 1; + } + + #endif + static int LUACALL wxLua_wxBusyCursor_destructor(lua_State *L) { *************** *** 726,771 **** ! #if wxLUA_USE_wxCursor ! // %override wxLua_wxBusyCursor_constructor ! // wxBusyCursor(wxCursor* cursor = wxHOURGLASS_CURSOR) ! static int LUACALL wxLua_wxBusyCursor_constructor(lua_State *L) { wxLuaState wxlState(L); ! wxBusyCursor *returns; // get number of arguments int argCount = lua_gettop(L); ! // const wxCursor cursor = wxHOURGLASS_CURSOR ! ! // NOTE: gcc complains that wxHOURGLASS_CURSOR is const, if changed to const MSVC complains wxBusyCursor takes non const ! wxCursor * cursor = (argCount >= 1 ? (wxCursor *)wxlState.GetUserDataType(1, s_wxluatag_wxCursor) : (wxCursor*)wxHOURGLASS_CURSOR); // call constructor ! returns = new wxBusyCursor(cursor); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyCursor *)returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxBusyCursor, returns); return 1; } ! #endif - // Map Lua Class Methods to C Binding Functions - static WXLUAMETHOD s_wxBusyCursor_methods[] = { - { LuaDelete, "wxBusyCursor", wxLua_wxBusyCursor_destructor, 0, 0, {0} }, - { LuaMethod, "Delete", wxLua_wxBusyCursor_Delete, 0, 0, {0} }, - #if wxLUA_USE_wxCursor - { LuaConstructor, "wxBusyCursor", wxLua_wxBusyCursor_constructor, 1, 0, { &s_wxluatag_wxCursor, 0 } }, - #endif }; // Extern accessor to class method map ! WXLUAMETHOD* wxBusyCursor_methods = s_wxBusyCursor_methods; ! int wxBusyCursor_methodCount = sizeof(s_wxBusyCursor_methods)/sizeof(s_wxBusyCursor_methods[0]); --- 765,856 ---- ! ! ! ! // Map Lua Class Methods to C Binding Functions ! static WXLUAMETHOD s_wxBusyCursor_methods[] = { ! ! #if (wxLUA_USE_wxBusyCursor) && (wxLUA_USE_wxCursor) ! { LuaConstructor, "wxBusyCursor", wxLua_wxBusyCursor_constructor, 1, 0, { &s_wxluatag_wxCursor, 0 } }, ! #endif ! ! { LuaDelete, "wxBusyCursor", wxLua_wxBusyCursor_destructor, 0, 0, {0} }, ! { LuaMethod, "Delete", wxLua_wxBusyCursor_Delete, 0, 0, {0} }, ! }; ! ! // Extern accessor to class method map ! WXLUAMETHOD* wxBusyCursor_methods = s_wxBusyCursor_methods; ! int wxBusyCursor_methodCount = sizeof(s_wxBusyCursor_methods)/sizeof(s_wxBusyCursor_methods[0]); ! #endif ! ! ! #if wxLUA_USE_wxBusyInfo && wxUSE_BUSYINFO ! // ------------------------------------------------------------------------------------------------- ! // Bind class wxBusyInfo ! // ------------------------------------------------------------------------------------------------- ! ! // Lua MetaTable Tag for Class ! int s_wxluatag_wxBusyInfo = -1; ! ! // wxBusyInfo(const wxString& message, wxWindow *parent = NULL) ! static int LUACALL wxLua_wxBusyInfo_constructor(lua_State *L) { wxLuaState wxlState(L); ! wxBusyInfo *returns; // get number of arguments int argCount = lua_gettop(L); ! // wxWindow parent = NULL ! wxWindow * parent = (argCount >= 2 ? (wxWindow *)wxlState.GetUserDataType(2, s_wxluatag_wxWindow) : NULL); ! // const wxString message ! const wxString message = lua2wx(wxlState.GetStringType(1)); // call constructor ! returns = new wxBusyInfo(message, parent); // add to tracked memory list ! wxLua_AddToTrackedMemoryList(wxlState, (wxBusyInfo *)returns); // push the constructed class pointer ! wxlState.PushUserDataType(s_wxluatag_wxBusyInfo, returns); return 1; } ! static int LUACALL wxLua_wxBusyInfo_destructor(lua_State *L) ! { ! wxLuaState wxlState(L); ! wxBusyInfo * self = (wxBusyInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxBusyInfo); + // remove from tracked memory list + if (self != 0) + wxlState.RemoveTrackedMemory(self); + return 0; + } + static int LUACALL wxLua_wxBusyInfo_Delete(lua_State *L) + { + wxLuaState wxlState(L); + wxBusyInfo * self = (wxBusyInfo *)wxlState.GetUserDataType(1, s_wxluatag_wxBusyInfo); + // remove from tracked memory list + if (self != 0) + if (wxlState.RemoveTrackedMemory(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 + static WXLUAMETHOD s_wxBusyInfo_methods[] = { + { LuaConstructor, "wxBusyInfo", wxLua_wxBusyInfo_constructor, 2, 1, { &s_wxluaarg_String, &s_wxluatag_wxWindow, 0 } }, + { LuaDelete, "wxBusyInfo", wxLua_wxBusyInfo_destructor, 0, 0, {0} }, + { LuaMethod, "Delete", wxLua_wxBusyInfo_Delete, 0, 0, {0} }, }; // Extern accessor to class method map ! WXLUAMETHOD* wxBusyInfo_methods = s_wxBusyInfo_methods; ! int wxBusyInfo_methodCount = sizeof(s_wxBusyInfo_methods)/sizeof(s_wxBusyInfo_methods[0]); ! #endif Index: event.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/event.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** event.cpp 25 May 2006 03:55:23 -0000 1.20 --- event.cpp 25 May 2006 22:50:05 -0000 1.21 *************** *** 269,273 **** else { ! wxlState.terror(wxString::Format(wxT("wxLua: ConnectEvent: Invalid event type, expected a number for parameter %d, got '%s'."), evttype_idx - 1, wxlState.lua_TypeNameIndex(evttype_idx).c_str())); return 0; --- 269,273 ---- else { ! wxlState.terror(wxString::Format(wxT("wxLua: Disconnect: Invalid event type, expected a number for parameter %d, got '%s'."), evttype_idx - 1, wxlState.lua_TypeNameIndex(evttype_idx).c_str())); return 0; *************** *** 1283,1364 **** int wxCloseEvent_methodCount = sizeof(s_wxCloseEvent_methods)/sizeof(s_wxCloseEvent_methods[0]); - - #if !defined(__WXMAC__) - // ------------------------------------------------------------------------------------------------- - // Bind class wxDialUpEvent - // ------------------------------------------------------------------------------------------------- - - // Lua MetaTable Tag for Class - int s_wxluatag_wxDialUpEvent = -1; - - // wxDialUpEvent(bool isConnected, bool isOwnEvent) - static int LUACALL wxLua_wxDialUpEvent_constructor(lua_State *L) - { - wxLuaState wxlState(L); - wxDialUpEvent *returns; - // bool isOwnEvent - bool isOwnEvent = wxlState.GetBooleanType(2); - // bool isConnected - bool isConnected = wxlState.GetBooleanType(1); - // call constructor - returns = new wxDialUpEvent(isConnected, isOwnEvent); - // push the constructed class pointer - wxlState.PushUserDataType(s_wxluatag_wxDialUpEvent, returns); - - return 1; - } - - // bool IsConnectedEvent() const - static int LUACALL wxLua_wxDialUpEvent_IsConnectedEvent(lua_State *L) - { - wxLuaState wxlState(L); - bool returns; - // get this - wxDialUpEvent * self = (wxDialUpEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDialUpEvent); - // call IsConnectedEvent - returns = self->IsConnectedEvent(); - // push the result flag - lua_pushboolean(L, returns); - - return 1; - } - - // bool IsOwnEvent() const - static int LUACALL wxLua_wxDialUpEvent_IsOwnEvent(lua_State *L) - { - wxLuaState wxlState(L); - bool returns; - // get this - wxDialUpEvent * self = (wxDialUpEvent *)wxlState.GetUserDataType(1, s_wxluatag_wxDialUpEvent); - // call IsOwnEvent - returns = self->IsOwnEvent(); - // push the result flag - lua_pushboolean(L, returns); - - return 1; - } - - static int LUACALL wxLua_wxDialUpEvent_destructor(lua_State *) - { - return 0; - } - - - - - - // Map Lua Class Methods to C Binding Functions - static WXLUAMETHOD s_wxDialUpEvent_methods[] = { - { LuaConstructor, "wxDialUpEvent", wxLua_wxDialUpEvent_constructor, 2, 2, { &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, 0 } }, - { LuaMethod, "IsConnectedEvent", wxLua_wxDialUpEvent_IsConnectedEvent, 0, 0, { 0 } }, - { LuaMethod, "IsOwnEvent", wxLua_wxDialUpEvent_... [truncated message content] |