Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions wxLua/bindings/wxwidgets/wxadv_override.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'"));
Expand Down Expand Up @@ -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'"));
Expand Down
31 changes: 31 additions & 0 deletions wxLua/bindings/wxwidgets/wxcore_override.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
// ----------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions wxLua/modules/wxbind/src/wxadv_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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'"));
Expand Down Expand Up @@ -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'"));
Expand Down
6 changes: 6 additions & 0 deletions wxLua/modules/wxbind/src/wxcore_menutool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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)
Expand Down