From: John L. <jr...@us...> - 2006-05-26 03:51:32
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv24769/wxLua/modules/wxbind/src Modified Files: appframe.cpp clipdrag.cpp controls.cpp data.cpp Log Message: add wxArrayInt/String constructors and ToLuaTable() func add more default constructors Index: data.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/data.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** data.cpp 24 May 2006 04:50:01 -0000 1.22 --- data.cpp 26 May 2006 03:19:51 -0000 1.23 *************** *** 1651,1654 **** --- 1651,1713 ---- int s_wxluatag_wxArrayInt = -1; + // %overload wxArrayInt() + static int LUACALL wxLua_wxArrayInt_constructor1(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayInt *returns; + // call constructor + returns = new wxArrayInt(); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxArrayInt *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxArrayInt, returns); + + return 1; + } + + // %overload %constructor wxArrayIntCopy(const wxArrayInt& array) + static int LUACALL wxLua_wxArrayIntCopy_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayInt *returns; + // const wxArrayInt array + const wxArrayInt * array = (const wxArrayInt *)wxlState.GetUserDataType(1, s_wxluatag_wxArrayInt); + // call constructor + returns = new wxArrayInt(*array); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxArrayInt *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxArrayInt, returns); + + return 1; + } + + // %overload %constructor wxArrayIntFromTable(const wxArrayInt_FromLuaTable& array) + static int LUACALL wxLua_wxArrayIntFromTable_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayInt *returns; + // const wxArrayInt_FromLuaTable array + wxArrayInt array = wxArrayInt(); wxlState.GetwxArrayInt(1, array); + // call constructor + returns = new wxArrayInt(array); + // add to tracked memory list + wxLua_AddToTrackedMemoryList(wxlState, (wxArrayInt *)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxArrayInt, returns); + + return 1; + } + + // %override wxLua_wxArrayInt_ToLuaTable + // int ToLuaTable const + static int LUACALL wxLua_wxArrayInt_ToLuaTable(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayInt * self = (wxArrayInt *)wxlState.GetUserDataType(1, s_wxluatag_wxArrayInt); + wxlState.PushwxArrayIntTable(*self); + return 1; + } + // void Add( int num ) static int LUACALL wxLua_wxArrayInt_Add(lua_State *L) *************** *** 1858,1865 **** --- 1917,1947 ---- + // Overloaded function bindings + + #if (wxLUA_USE_wxArrayInt) + // Overloaded functions for wxLua_wxArrayInt_constructor + static int LUACALL wxLua_wxArrayInt_constructor(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaConstructor, "wxArrayInt", wxLua_wxArrayInt_constructor1, 0, 0, { 0 } }, + { LuaConstructor, "wxArrayIntCopy", wxLua_wxArrayIntCopy_constructor, 1, 1, { &s_wxluatag_wxArrayInt, 0 } }, + { LuaConstructor, "wxArrayIntFromTable", wxLua_wxArrayIntFromTable_constructor, 1, 1, { &s_wxluaarg_LuaTable, 0 } }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif + // Map Lua Class Methods to C Binding Functions static WXLUAMETHOD s_wxArrayInt_methods[] = { + { LuaConstructor, "wxArrayInt", wxLua_wxArrayInt_constructor, 0, 0, { 0 } }, + { LuaConstructor, "wxArrayIntCopy", wxLua_wxArrayIntCopy_constructor, 1, 1, { &s_wxluatag_wxArrayInt, 0 } }, + { LuaConstructor, "wxArrayIntFromTable", wxLua_wxArrayIntFromTable_constructor, 1, 1, { &s_wxluaarg_LuaTable, 0 } }, + { LuaMethod, "ToLuaTable", wxLua_wxArrayInt_ToLuaTable, 0, 0, { 0 } }, { LuaMethod, "Add", wxLua_wxArrayInt_Add, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "Alloc", wxLua_wxArrayInt_Alloc, 1, 1, { &s_wxluaarg_Number, 0 } }, *************** *** 1893,1898 **** int s_wxluatag_wxArrayString = -1; ! // wxArrayString() ! static int LUACALL wxLua_wxArrayString_constructor(lua_State *L) { wxLuaState wxlState(L); --- 1975,1980 ---- int s_wxluatag_wxArrayString = -1; ! // %overload wxArrayString() ! static int LUACALL wxLua_wxArrayString_constructor1(lua_State *L) { wxLuaState wxlState(L); *************** *** 1908,1912 **** } ! // %constructor wxArrayStringCopy(const wxArrayString& array) static int LUACALL wxLua_wxArrayStringCopy_constructor(lua_State *L) { --- 1990,1994 ---- } ! // %overload %constructor wxArrayStringCopy(const wxArrayString& array) static int LUACALL wxLua_wxArrayStringCopy_constructor(lua_State *L) { *************** *** 1925,1929 **** } ! // %constructor wxArrayStringFromTable(const wxArrayString_FromLuaTable& array) static int LUACALL wxLua_wxArrayStringFromTable_constructor(lua_State *L) { --- 2007,2011 ---- } ! // %overload %constructor wxArrayStringFromTable(const wxArrayString_FromLuaTable& array) static int LUACALL wxLua_wxArrayStringFromTable_constructor(lua_State *L) { *************** *** 1942,1945 **** --- 2024,2037 ---- } + // %override wxLua_wxArrayString_ToLuaTable + // int ToLuaTable const + static int LUACALL wxLua_wxArrayString_ToLuaTable(lua_State *L) + { + wxLuaState wxlState(L); + wxArrayString * self = (wxArrayString *)wxlState.GetUserDataType(1, s_wxluatag_wxArrayString); + wxlState.PushwxArrayStringTable(*self); + return 1; + } + // size_t Add(const wxString& str, size_t copies = 1) static int LUACALL wxLua_wxArrayString_Add(lua_State *L) *************** *** 2193,2196 **** --- 2285,2307 ---- + // Overloaded function bindings + + #if (wxLUA_USE_wxArrayString) + // Overloaded functions for wxLua_wxArrayString_constructor + static int LUACALL wxLua_wxArrayString_constructor(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaConstructor, "wxArrayString", wxLua_wxArrayString_constructor1, 0, 0, { 0 } }, + { LuaConstructor, "wxArrayStringCopy", wxLua_wxArrayStringCopy_constructor, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, + { LuaConstructor, "wxArrayStringFromTable", wxLua_wxArrayStringFromTable_constructor, 1, 1, { &s_wxluaarg_LuaTable, 0 } }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif + *************** *** 2200,2203 **** --- 2311,2315 ---- { LuaConstructor, "wxArrayStringCopy", wxLua_wxArrayStringCopy_constructor, 1, 1, { &s_wxluatag_wxArrayString, 0 } }, { LuaConstructor, "wxArrayStringFromTable", wxLua_wxArrayStringFromTable_constructor, 1, 1, { &s_wxluaarg_LuaTable, 0 } }, + { LuaMethod, "ToLuaTable", wxLua_wxArrayString_ToLuaTable, 0, 0, { 0 } }, { LuaMethod, "Add", wxLua_wxArrayString_Add, 2, 1, { &s_wxluaarg_String, &s_wxluaarg_Number, 0 } }, { LuaMethod, "Alloc", wxLua_wxArrayString_Alloc, 1, 1, { &s_wxluaarg_Number, 0 } }, Index: controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/controls.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** controls.cpp 25 May 2006 22:50:05 -0000 1.27 --- controls.cpp 26 May 2006 03:19:51 -0000 1.28 *************** *** 129,132 **** --- 129,148 ---- #endif + // %constructor wxButtonDefault() + static int LUACALL wxLua_wxButtonDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxButton *returns; + // call constructor + returns = new wxButton(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxButton, returns); + + return 1; + } + // void SetDefault() static int LUACALL wxLua_wxButton_SetDefault(lua_State *L) *************** *** 164,167 **** --- 180,184 ---- #endif + { LuaConstructor, "wxButtonDefault", wxLua_wxButtonDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "SetDefault", wxLua_wxButton_SetDefault, 0, 0, { 0 } }, { LuaDelete, "wxButton", wxLua_wxButton_destructor, 0, 0, {0} }, *************** *** 385,388 **** --- 402,421 ---- #endif + // %constructor wxBitmapButtonDefault() + static int LUACALL wxLua_wxBitmapButtonDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxBitmapButton *returns; + // call constructor + returns = new wxBitmapButton(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxBitmapButton, returns); + + return 1; + } + static int LUACALL wxLua_wxBitmapButton_destructor(lua_State *) { *************** *** 422,425 **** --- 455,459 ---- #endif + { LuaConstructor, "wxBitmapButtonDefault", wxLua_wxBitmapButtonDefault_constructor, 0, 0, { 0 } }, { LuaDelete, "wxBitmapButton", wxLua_wxBitmapButton_destructor, 0, 0, {0} }, }; *************** *** 510,513 **** --- 544,563 ---- #endif + // %constructor wxToggleButtonDefault() + static int LUACALL wxLua_wxToggleButtonDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxToggleButton *returns; + // call constructor + returns = new wxToggleButton(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxToggleButton, returns); + + return 1; + } + // void SetValue(bool state) static int LUACALL wxLua_wxToggleButton_SetValue(lua_State *L) *************** *** 556,559 **** --- 606,610 ---- #endif + { LuaConstructor, "wxToggleButtonDefault", wxLua_wxToggleButtonDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "SetValue", wxLua_wxToggleButton_SetValue, 1, 1, { &s_wxluaarg_Boolean, 0 } }, { LuaMethod, "GetValue", wxLua_wxToggleButton_GetValue, 0, 0, { 0 } }, *************** *** 646,649 **** --- 697,716 ---- #endif + // %constructor wxCheckBoxDefault() + static int LUACALL wxLua_wxCheckBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxCheckBox *returns; + // call constructor + returns = new wxCheckBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxCheckBox, returns); + + return 1; + } + // bool GetValue() const static int LUACALL wxLua_wxCheckBox_GetValue(lua_State *L) *************** *** 766,769 **** --- 833,837 ---- #endif + { LuaConstructor, "wxCheckBoxDefault", wxLua_wxCheckBoxDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetValue", wxLua_wxCheckBox_GetValue, 0, 0, { 0 } }, { LuaMethod, "Get3StateValue", wxLua_wxCheckBox_Get3StateValue, 0, 0, { 0 } }, *************** *** 1267,1270 **** --- 1335,1354 ---- #endif + // %constructor wxChoiceDefault() + static int LUACALL wxLua_wxChoiceDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxChoice *returns; + // call constructor + returns = new wxChoice(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxChoice, returns); + + return 1; + } + // int GetCurrentSelection() const static int LUACALL wxLua_wxChoice_GetCurrentSelection(lua_State *L) *************** *** 1299,1302 **** --- 1383,1387 ---- #endif + { LuaConstructor, "wxChoiceDefault", wxLua_wxChoiceDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetCurrentSelection", wxLua_wxChoice_GetCurrentSelection, 0, 0, { 0 } }, { LuaDelete, "wxChoice", wxLua_wxChoice_destructor, 0, 0, {0} }, *************** *** 1392,1395 **** --- 1477,1496 ---- #endif + // %constructor wxComboBoxDefault() + static int LUACALL wxLua_wxComboBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxComboBox *returns; + // call constructor + returns = new wxComboBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxComboBox, returns); + + return 1; + } + // bool CanCopy() const static int LUACALL wxLua_wxComboBox_CanCopy(lua_State *L) *************** *** 1679,1682 **** --- 1780,1784 ---- #endif + { LuaConstructor, "wxComboBoxDefault", wxLua_wxComboBoxDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "CanCopy", wxLua_wxComboBox_CanCopy, 0, 0, { 0 } }, { LuaMethod, "CanCut", wxLua_wxComboBox_CanCut, 0, 0, { 0 } }, *************** *** 1790,1793 **** --- 1892,1911 ---- #endif + // %constructor wxGaugeDefault() + static int LUACALL wxLua_wxGaugeDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxGauge *returns; + // call constructor + returns = new wxGauge(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxGauge, returns); + + return 1; + } + // int GetBezelFace() const static int LUACALL wxLua_wxGauge_GetBezelFace(lua_State *L) *************** *** 1938,1941 **** --- 2056,2060 ---- #endif + { LuaConstructor, "wxGaugeDefault", wxLua_wxGaugeDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetBezelFace", wxLua_wxGauge_GetBezelFace, 0, 0, { 0 } }, { LuaMethod, "GetRange", wxLua_wxGauge_GetRange, 0, 0, { 0 } }, *************** *** 2043,2046 **** --- 2162,2181 ---- #endif + // %constructor wxListBoxDefault() + static int LUACALL wxLua_wxListBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxListBox *returns; + // call constructor + returns = new wxListBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxListBox, returns); + + return 1; + } + // void Deselect(int n) static int LUACALL wxLua_wxListBox_Deselect(lua_State *L) *************** *** 2191,2194 **** --- 2326,2330 ---- #endif + { LuaConstructor, "wxListBoxDefault", wxLua_wxListBoxDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "Deselect", wxLua_wxListBox_Deselect, 1, 1, { &s_wxluaarg_Number, 0 } }, { LuaMethod, "GetSelections", wxLua_wxListBox_GetSelections, 0, 0, { 0 } }, *************** *** 2287,2290 **** --- 2423,2442 ---- #endif + // %constructor wxCheckListBoxDefault() + static int LUACALL wxLua_wxCheckListBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxCheckListBox *returns; + // call constructor + returns = new wxCheckListBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxCheckListBox, returns); + + return 1; + } + // void Check(int item, bool check = true) static int LUACALL wxLua_wxCheckListBox_Check(lua_State *L) *************** *** 2339,2342 **** --- 2491,2495 ---- #endif + { LuaConstructor, "wxCheckListBoxDefault", wxLua_wxCheckListBoxDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "Check", wxLua_wxCheckListBox_Check, 2, 1, { &s_wxluaarg_Number, &s_wxluaarg_Boolean, 0 } }, { LuaMethod, "IsChecked", wxLua_wxCheckListBox_IsChecked, 1, 1, { &s_wxluaarg_Number, 0 } }, *************** *** 5139,5142 **** --- 5292,5311 ---- #endif + // %constructor wxRadioBoxDefault() + static int LUACALL wxLua_wxRadioBoxDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxRadioBox *returns; + // call constructor + returns = new wxRadioBox(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxRadioBox, returns); + + return 1; + } + // %overload void Enable(bool enable) static int LUACALL wxLua_wxRadioBox_Enable1(lua_State *L) *************** *** 5384,5387 **** --- 5553,5557 ---- #endif + { LuaConstructor, "wxRadioBoxDefault", wxLua_wxRadioBoxDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "Enable", wxLua_wxRadioBox_Enable, 1, 1, { &s_wxluaarg_Boolean, 0 } }, { LuaMethod, "EnableItem", wxLua_wxRadioBox_EnableItem, 2, 2, { &s_wxluaarg_Number, &s_wxluaarg_Boolean, 0 } }, *************** *** 5489,5492 **** --- 5659,5678 ---- #endif + // %constructor wxRadioButtonDefault() + static int LUACALL wxLua_wxRadioButtonDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxRadioButton *returns; + // call constructor + returns = new wxRadioButton(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxRadioButton, returns); + + return 1; + } + // bool GetValue() const static int LUACALL wxLua_wxRadioButton_GetValue(lua_State *L) *************** *** 5535,5538 **** --- 5721,5725 ---- #endif + { LuaConstructor, "wxRadioButtonDefault", wxLua_wxRadioButtonDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetValue", wxLua_wxRadioButton_GetValue, 0, 0, { 0 } }, { LuaMethod, "SetValue", wxLua_wxRadioButton_SetValue, 1, 1, { &s_wxluaarg_Boolean, 0 } }, *************** *** 5623,5626 **** --- 5810,5829 ---- #endif + // %constructor wxScrollBarDefault() + static int LUACALL wxLua_wxScrollBarDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxScrollBar *returns; + // call constructor + returns = new wxScrollBar(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxScrollBar, returns); + + return 1; + } + // int GetRange() const static int LUACALL wxLua_wxScrollBar_GetRange(lua_State *L) *************** *** 5738,5741 **** --- 5941,5945 ---- #endif + { LuaConstructor, "wxScrollBarDefault", wxLua_wxScrollBarDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetRange", wxLua_wxScrollBar_GetRange, 0, 0, { 0 } }, { LuaMethod, "GetPageSize", wxLua_wxScrollBar_GetPageSize, 0, 0, { 0 } }, *************** *** 5844,5847 **** --- 6048,6067 ---- #endif + // %constructor wxSliderDefault() + static int LUACALL wxLua_wxSliderDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSlider *returns; + // call constructor + returns = new wxSlider(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSlider, returns); + + return 1; + } + // void ClearSel() static int LUACALL wxLua_wxSlider_ClearSel(lua_State *L) *************** *** 6138,6141 **** --- 6358,6362 ---- #endif + { LuaConstructor, "wxSliderDefault", wxLua_wxSliderDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "ClearSel", wxLua_wxSlider_ClearSel, 0, 0, { 0 } }, { LuaMethod, "ClearTicks", wxLua_wxSlider_ClearTicks, 0, 0, { 0 } }, *************** *** 6249,6252 **** --- 6470,6489 ---- #endif + // %constructor wxSpinButtonDefault() + static int LUACALL wxLua_wxSpinButtonDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSpinButton *returns; + // call constructor + returns = new wxSpinButton(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSpinButton, returns); + + return 1; + } + // int GetMax() const static int LUACALL wxLua_wxSpinButton_GetMax(lua_State *L) *************** *** 6341,6344 **** --- 6578,6582 ---- #endif + { LuaConstructor, "wxSpinButtonDefault", wxLua_wxSpinButtonDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetMax", wxLua_wxSpinButton_GetMax, 0, 0, { 0 } }, { LuaMethod, "GetMin", wxLua_wxSpinButton_GetMin, 0, 0, { 0 } }, *************** *** 6550,6553 **** --- 6788,6807 ---- #endif + // %constructor wxSpinCtrlDefault() + static int LUACALL wxLua_wxSpinCtrlDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxSpinCtrl *returns; + // call constructor + returns = new wxSpinCtrl(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxSpinCtrl, returns); + + return 1; + } + // int GetMax() const static int LUACALL wxLua_wxSpinCtrl_GetMax(lua_State *L) *************** *** 6690,6693 **** --- 6944,6948 ---- #endif + { LuaConstructor, "wxSpinCtrlDefault", wxLua_wxSpinCtrlDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "GetMax", wxLua_wxSpinCtrl_GetMax, 0, 0, { 0 } }, { LuaMethod, "GetMin", wxLua_wxSpinCtrl_GetMin, 0, 0, { 0 } }, *************** *** 6838,6841 **** --- 7093,7112 ---- #endif + // %constructor wxTextCtrlDefault() + static int LUACALL wxLua_wxTextCtrlDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxTextCtrl *returns; + // call constructor + returns = new wxTextCtrl(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxTextCtrl, returns); + + return 1; + } + // void AppendText(const wxString& text) static int LUACALL wxLua_wxTextCtrl_AppendText(lua_State *L) *************** *** 7561,7564 **** --- 7832,7836 ---- #endif + { LuaConstructor, "wxTextCtrlDefault", wxLua_wxTextCtrlDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "AppendText", wxLua_wxTextCtrl_AppendText, 1, 1, { &s_wxluaarg_String, 0 } }, { LuaMethod, "CanCopy", wxLua_wxTextCtrl_CanCopy, 0, 0, { 0 } }, *************** *** 8605,8608 **** --- 8877,8896 ---- #endif + // %constructor wxTreeCtrlDefault() + static int LUACALL wxLua_wxTreeCtrlDefault_constructor(lua_State *L) + { + wxLuaState wxlState(L); + wxTreeCtrl *returns; + // call constructor + returns = new wxTreeCtrl(); + // add to tracked window list + if (returns && returns->IsKindOf(CLASSINFO(wxWindow))) + wxlState.AddToTrackedWindowList((wxWindow*)returns); + // push the constructed class pointer + wxlState.PushUserDataType(s_wxluatag_wxTreeCtrl, returns); + + return 1; + } + // wxTreeItemId AddRoot(const wxString& text, int image = -1, int selImage = -1, wxTreeItemData* data = NULL) static int LUACALL wxLua_wxTreeCtrl_AddRoot(lua_State *L) *************** *** 9563,9566 **** --- 9851,9855 ---- #endif + { LuaConstructor, "wxTreeCtrlDefault", wxLua_wxTreeCtrlDefault_constructor, 0, 0, { 0 } }, { LuaMethod, "AddRoot", wxLua_wxTreeCtrl_AddRoot, 4, 1, { &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxTreeItemData, 0 } }, { LuaMethod, "AppendItem", wxLua_wxTreeCtrl_AppendItem, 5, 2, { &s_wxluatag_wxTreeItemId, &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluatag_wxTreeItemData, 0 } }, Index: clipdrag.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/clipdrag.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** clipdrag.cpp 18 May 2006 05:47:39 -0000 1.19 --- clipdrag.cpp 26 May 2006 03:19:51 -0000 1.20 *************** *** 237,242 **** int s_wxluatag_wxDataFormat = -1; ! // %override wxDataFormat(wxDataFormatId format = wxDF_INVALID) ! static int LUACALL wxLua_wxDataFormat_constructor(lua_State *L) { wxLuaState wxlState(L); --- 237,242 ---- int s_wxluatag_wxDataFormat = -1; ! // %overload wxDataFormat(wxDataFormatId format = wxDF_INVALID) ! static int LUACALL wxLua_wxDataFormat_constructor1(lua_State *L) { wxLuaState wxlState(L); *************** *** 256,260 **** } ! // %override %constructor wxDataFormatUser(const wxString &format) static int LUACALL wxLua_wxDataFormatUser_constructor(lua_State *L) { --- 256,260 ---- } ! // %overload %constructor wxDataFormatUser(const wxString &format) static int LUACALL wxLua_wxDataFormatUser_constructor(lua_State *L) { *************** *** 375,378 **** --- 375,396 ---- + // Overloaded function bindings + + #if (wxLUA_USE_wxDataObject) + // Overloaded functions for wxLua_wxDataFormat_constructor + static int LUACALL wxLua_wxDataFormat_constructor(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaConstructor, "wxDataFormat", wxLua_wxDataFormat_constructor1, 1, 0, { &s_wxluaarg_Enumeration, 0 } }, + { LuaConstructor, "wxDataFormatUser", wxLua_wxDataFormatUser_constructor, 1, 1, { &s_wxluaarg_String, 0 } }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif + Index: appframe.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/appframe.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** appframe.cpp 25 May 2006 22:50:05 -0000 1.18 --- appframe.cpp 26 May 2006 03:19:51 -0000 1.19 *************** *** 1835,1840 **** int s_wxluatag_wxAcceleratorEntry = -1; ! // wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0) ! static int LUACALL wxLua_wxAcceleratorEntry_constructor(lua_State *L) { wxLuaState wxlState(L); --- 1835,1840 ---- int s_wxluatag_wxAcceleratorEntry = -1; ! // %overload wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0) ! static int LUACALL wxLua_wxAcceleratorEntry_constructor1(lua_State *L) { wxLuaState wxlState(L); *************** *** 1858,1862 **** } ! // %constructor wxAcceleratorEntryCopy(const wxAcceleratorEntry& entry) static int LUACALL wxLua_wxAcceleratorEntryCopy_constructor(lua_State *L) { --- 1858,1862 ---- } ! // %overload %constructor wxAcceleratorEntryCopy(const wxAcceleratorEntry& entry) static int LUACALL wxLua_wxAcceleratorEntryCopy_constructor(lua_State *L) { *************** *** 1965,1968 **** --- 1965,1986 ---- + // Overloaded function bindings + + #if (wxLUA_USE_wxAcceleratorTable) + // Overloaded functions for wxLua_wxAcceleratorEntry_constructor + static int LUACALL wxLua_wxAcceleratorEntry_constructor(lua_State *L) + { + // function overload table + static WXLUAMETHOD overloaded_methods[] = + { + { LuaConstructor, "wxAcceleratorEntry", wxLua_wxAcceleratorEntry_constructor1, 3, 0, { &s_wxluaarg_Number, &s_wxluaarg_Number, &s_wxluaarg_Number, 0 } }, + { LuaConstructor, "wxAcceleratorEntryCopy", wxLua_wxAcceleratorEntryCopy_constructor, 1, 1, { &s_wxluatag_wxAcceleratorEntry, 0 } }, + }; + static int overloaded_methodCount = sizeof(overloaded_methods)/sizeof(overloaded_methods[0]); + wxLuaState wxlState(L); + return wxlState.CallOverloadedFunction(overloaded_methods, overloaded_methodCount); + } + #endif + |