diff --git a/wxLua/bindings/wxwidgets/wxadv_override.hpp b/wxLua/bindings/wxwidgets/wxadv_override.hpp index f9183076..6a0a6221 100644 --- a/wxLua/bindings/wxwidgets/wxadv_override.hpp +++ b/wxLua/bindings/wxwidgets/wxadv_override.hpp @@ -455,7 +455,7 @@ int wxLua_wxDataViewListCtrl_InsertItem(lua_State *L) unsigned int row = (unsigned int)lua_tonumber(L, 2); - wxUIntPtr data = argCount >= 3 ? (wxUIntPtr)wxlua_getnumbertype(L, 4) : NULL; + wxUIntPtr data = argCount >= 3 ? (wxUIntPtr)wxlua_getnumbertype(L, 4) : (wxUIntPtr)NULL; if (!wxlua_iswxluatype(lua_type(L, 3), WXLUA_TTABLE)) wxlua_argerror(L, 3, wxT("a 'table'")); @@ -502,7 +502,7 @@ int wxLua_wxDataViewListCtrl_AppendItem(lua_State *L) // get number of arguments int argCount = lua_gettop(L); - wxUIntPtr data = argCount >= 2 ? (wxUIntPtr)wxlua_getnumbertype(L, 3) : NULL; + wxUIntPtr data = argCount >= 2 ? (wxUIntPtr)wxlua_getnumbertype(L, 3) : (wxUIntPtr)NULL; if (!wxlua_iswxluatype(lua_type(L, 2), WXLUA_TTABLE)) wxlua_argerror(L, 2, wxT("a 'table'")); diff --git a/wxLua/bindings/wxwidgets/wxcore_override.hpp b/wxLua/bindings/wxwidgets/wxcore_override.hpp index 27025ab8..efeccfe1 100644 --- a/wxLua/bindings/wxwidgets/wxcore_override.hpp +++ b/wxLua/bindings/wxwidgets/wxcore_override.hpp @@ -2501,6 +2501,37 @@ static int LUACALL wxLua_wxMenuItem_constructor(lua_State *L) } %end +%override wxLua_wxToolBarBase_AddTool1 +// wxToolBarToolBase* AddTool(int toolId, const wxString& label, const wxBitmap& bitmap1, const wxString& shortHelpString = "", wxItemKind kind = wxITEM_NORMAL); +static int LUACALL wxLua_wxToolBarBase_AddTool1(lua_State *L) +{ + // get number of arguments + int argCount = lua_gettop(L); + // wxItemKind kind = wxITEM_NORMAL + wxItemKind kind = (argCount >= 6 ? (wxItemKind)wxlua_getenumtype(L, 6) : wxITEM_NORMAL); + // const wxString shortHelpString = "" + const wxString shortHelpString = (argCount >= 5 ? wxlua_getwxStringtype(L, 5) : wxString(wxEmptyString)); + // const wxBitmap bitmap1 + const wxBitmap * bitmap1 = (const wxBitmap *)wxluaT_getuserdatatype(L, 4, wxluatype_wxBitmap); + // const wxString label + const wxString label = wxlua_getwxStringtype(L, 3); + // int toolId + int toolId = (int)wxlua_getnumbertype(L, 2); + // get this + wxToolBarBase * self = (wxToolBarBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxToolBarBase); + // call AddTool +#if wxCHECK_VERSION(3, 1, 6) + wxToolBarToolBase* returns = (wxToolBarToolBase*)self->AddTool(toolId, label, wxBitmapBundle(*bitmap1), shortHelpString, kind); +#else + wxToolBarToolBase* returns = (wxToolBarToolBase*)self->AddTool(toolId, label, *bitmap1, shortHelpString, kind); +#endif + // push the result datatype + wxluaT_pushuserdatatype(L, returns, wxluatype_wxToolBarToolBase); + + return 1; +} +%end + // ---------------------------------------------------------------------------- // Overrides for print.i // ---------------------------------------------------------------------------- diff --git a/wxLua/modules/wxbind/src/wxadv_bind.cpp b/wxLua/modules/wxbind/src/wxadv_bind.cpp index 3fbacf9d..de21b456 100644 --- a/wxLua/modules/wxbind/src/wxadv_bind.cpp +++ b/wxLua/modules/wxbind/src/wxadv_bind.cpp @@ -14837,7 +14837,7 @@ int wxLua_wxDataViewListCtrl_AppendItem(lua_State *L) // get number of arguments int argCount = lua_gettop(L); - wxUIntPtr data = argCount >= 2 ? (wxUIntPtr)wxlua_getnumbertype(L, 3) : NULL; + wxUIntPtr data = argCount >= 2 ? (wxUIntPtr)wxlua_getnumbertype(L, 3) : (wxUIntPtr)NULL; if (!wxlua_iswxluatype(lua_type(L, 2), WXLUA_TTABLE)) wxlua_argerror(L, 2, wxT("a 'table'")); @@ -15224,7 +15224,7 @@ int wxLua_wxDataViewListCtrl_InsertItem(lua_State *L) unsigned int row = (unsigned int)lua_tonumber(L, 2); - wxUIntPtr data = argCount >= 3 ? (wxUIntPtr)wxlua_getnumbertype(L, 4) : NULL; + wxUIntPtr data = argCount >= 3 ? (wxUIntPtr)wxlua_getnumbertype(L, 4) : (wxUIntPtr)NULL; if (!wxlua_iswxluatype(lua_type(L, 3), WXLUA_TTABLE)) wxlua_argerror(L, 3, wxT("a 'table'")); diff --git a/wxLua/modules/wxbind/src/wxcore_menutool.cpp b/wxLua/modules/wxbind/src/wxcore_menutool.cpp index 0112e2d6..0d2a1dd7 100644 --- a/wxLua/modules/wxbind/src/wxcore_menutool.cpp +++ b/wxLua/modules/wxbind/src/wxcore_menutool.cpp @@ -3679,6 +3679,7 @@ static int LUACALL wxLua_wxToolBarBase_AddSeparator(lua_State *L) static wxLuaArgType s_wxluatypeArray_wxLua_wxToolBarBase_AddTool1[] = { &wxluatype_wxToolBarBase, &wxluatype_TNUMBER, &wxluatype_TSTRING, &wxluatype_wxBitmap, &wxluatype_TSTRING, &wxluatype_TINTEGER, NULL }; static int LUACALL wxLua_wxToolBarBase_AddTool1(lua_State *L); // static wxLuaBindCFunc s_wxluafunc_wxLua_wxToolBarBase_AddTool1[1] = {{ wxLua_wxToolBarBase_AddTool1, WXLUAMETHOD_METHOD, 4, 6, s_wxluatypeArray_wxLua_wxToolBarBase_AddTool1 }}; +// %override wxLua_wxToolBarBase_AddTool1 // wxToolBarToolBase* AddTool(int toolId, const wxString& label, const wxBitmap& bitmap1, const wxString& shortHelpString = "", wxItemKind kind = wxITEM_NORMAL); static int LUACALL wxLua_wxToolBarBase_AddTool1(lua_State *L) { @@ -3697,13 +3698,18 @@ static int LUACALL wxLua_wxToolBarBase_AddTool1(lua_State *L) // get this wxToolBarBase * self = (wxToolBarBase *)wxluaT_getuserdatatype(L, 1, wxluatype_wxToolBarBase); // call AddTool +#if wxCHECK_VERSION(3, 1, 6) + wxToolBarToolBase* returns = (wxToolBarToolBase*)self->AddTool(toolId, label, wxBitmapBundle(*bitmap1), shortHelpString, kind); +#else wxToolBarToolBase* returns = (wxToolBarToolBase*)self->AddTool(toolId, label, *bitmap1, shortHelpString, kind); +#endif // push the result datatype wxluaT_pushuserdatatype(L, returns, wxluatype_wxToolBarToolBase); return 1; } + #endif // ((wxLUA_USE_wxBitmap) && (wxLUA_USE_wxMenu && wxUSE_MENUS)) && (wxLUA_USE_wxToolbar) #if (((wxLUA_USE_wxBitmap) && (wxLUA_USE_wxMenu && wxUSE_MENUS)) && (wxLUA_USE_wxObject)) && (wxLUA_USE_wxToolbar)