From: John L. <jr...@us...> - 2008-12-04 05:12:44
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv16045/wxLua/modules/wxbind/src Modified Files: wxcore_bind.cpp wxcore_controls.cpp Log Message: Added wxTextUrlEvent to the bindings. Index: wxcore_bind.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_bind.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** wxcore_bind.cpp 21 Oct 2008 04:23:18 -0000 1.18 --- wxcore_bind.cpp 4 Dec 2008 05:12:38 -0000 1.19 *************** *** 218,223 **** { "wxEVT_COMMAND_TEXT_UPDATED", &wxEVT_COMMAND_TEXT_UPDATED, &wxluatype_wxCommandEvent }, - { "wxEVT_COMMAND_TEXT_URL", &wxEVT_COMMAND_TEXT_URL, &wxluatype_wxCommandEvent }, #if wxCHECK_VERSION(2,4,0) { "wxEVT_COMMAND_TOGGLEBUTTON_CLICKED", &wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, &wxluatype_wxCommandEvent }, --- 218,227 ---- { "wxEVT_COMMAND_TEXT_UPDATED", &wxEVT_COMMAND_TEXT_UPDATED, &wxluatype_wxCommandEvent }, + #if !wxCHECK_VERSION(2,8,0) + { "wxEVT_COMMAND_TEXT_URL", &wxEVT_COMMAND_TEXT_URL, &wxluatype_wxCommandEvent }, + #elif (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL) + { "wxEVT_COMMAND_TEXT_URL", &wxEVT_COMMAND_TEXT_URL, &wxluatype_wxTextUrlEvent }, + #endif // (wxCHECK_VERSION(2,8,0)) && (wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL) #if wxCHECK_VERSION(2,4,0) { "wxEVT_COMMAND_TOGGLEBUTTON_CLICKED", &wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, &wxluatype_wxCommandEvent }, *************** *** 4949,4952 **** --- 4953,4960 ---- #endif // wxUSE_TEXTDLG && wxLUA_USE_wxTextEntryDialog + #if wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL + { "wxTextUrlEvent", wxTextUrlEvent_methods, wxTextUrlEvent_methodCount, CLASSINFO(wxTextUrlEvent), &wxluatype_wxTextUrlEvent, "wxCommandEvent", NULL ,g_wxluanumberArray_None, 0, }, + #endif // wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL + #if (wxLUA_USE_wxValidator && wxUSE_VALIDATORS) && (wxLUA_USE_wxTextValidator) { "wxTextValidator", wxTextValidator_methods, wxTextValidator_methodCount, CLASSINFO(wxTextValidator), &wxluatype_wxTextValidator, "wxValidator", NULL ,g_wxluanumberArray_None, 0, }, Index: wxcore_controls.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_controls.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** wxcore_controls.cpp 29 Oct 2008 04:44:33 -0000 1.16 --- wxcore_controls.cpp 4 Dec 2008 05:12:38 -0000 1.17 *************** *** 9243,9246 **** --- 9243,9348 ---- + #if wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL + // --------------------------------------------------------------------------- + // Bind class wxTextUrlEvent + // --------------------------------------------------------------------------- + + // Lua MetaTable Tag for Class 'wxTextUrlEvent' + int wxluatype_wxTextUrlEvent = WXLUA_TUNKNOWN; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxTextUrlEvent_GetMouseEvent[] = { &wxluatype_wxTextUrlEvent, NULL }; + static int LUACALL wxLua_wxTextUrlEvent_GetMouseEvent(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextUrlEvent_GetMouseEvent[1] = {{ wxLua_wxTextUrlEvent_GetMouseEvent, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxTextUrlEvent_GetMouseEvent }}; + // const wxMouseEvent& GetMouseEvent() const + static int LUACALL wxLua_wxTextUrlEvent_GetMouseEvent(lua_State *L) + { + // get this + wxTextUrlEvent * self = (wxTextUrlEvent *)wxluaT_getuserdatatype(L, 1, wxluatype_wxTextUrlEvent); + // call GetMouseEvent + const wxMouseEvent* returns = &self->GetMouseEvent(); + // push the result datatype + wxluaT_pushuserdatatype(L, returns, wxluatype_wxMouseEvent); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxTextUrlEvent_GetURLEnd[] = { &wxluatype_wxTextUrlEvent, NULL }; + static int LUACALL wxLua_wxTextUrlEvent_GetURLEnd(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextUrlEvent_GetURLEnd[1] = {{ wxLua_wxTextUrlEvent_GetURLEnd, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxTextUrlEvent_GetURLEnd }}; + // long GetURLEnd() const + static int LUACALL wxLua_wxTextUrlEvent_GetURLEnd(lua_State *L) + { + // get this + wxTextUrlEvent * self = (wxTextUrlEvent *)wxluaT_getuserdatatype(L, 1, wxluatype_wxTextUrlEvent); + // call GetURLEnd + long returns = (self->GetURLEnd()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxTextUrlEvent_GetURLStart[] = { &wxluatype_wxTextUrlEvent, NULL }; + static int LUACALL wxLua_wxTextUrlEvent_GetURLStart(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextUrlEvent_GetURLStart[1] = {{ wxLua_wxTextUrlEvent_GetURLStart, WXLUAMETHOD_METHOD, 1, 1, s_wxluatypeArray_wxLua_wxTextUrlEvent_GetURLStart }}; + // long GetURLStart() const + static int LUACALL wxLua_wxTextUrlEvent_GetURLStart(lua_State *L) + { + // get this + wxTextUrlEvent * self = (wxTextUrlEvent *)wxluaT_getuserdatatype(L, 1, wxluatype_wxTextUrlEvent); + // call GetURLStart + long returns = (self->GetURLStart()); + // push the result number + lua_pushnumber(L, returns); + + return 1; + } + + static wxLuaArgType s_wxluatypeArray_wxLua_wxTextUrlEvent_delete[] = { &wxluatype_wxTextUrlEvent, NULL }; + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextUrlEvent_delete[1] = {{ wxlua_userdata_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatypeArray_wxLua_wxTextUrlEvent_delete }}; + + static wxLuaArgType s_wxluatypeArray_wxLua_wxTextUrlEvent_constructor[] = { &wxluatype_TNUMBER, &wxluatype_wxMouseEvent, &wxluatype_TNUMBER, &wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxTextUrlEvent_constructor(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextUrlEvent_constructor[1] = {{ wxLua_wxTextUrlEvent_constructor, WXLUAMETHOD_CONSTRUCTOR, 4, 4, s_wxluatypeArray_wxLua_wxTextUrlEvent_constructor }}; + // wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse, long start, long end) + static int LUACALL wxLua_wxTextUrlEvent_constructor(lua_State *L) + { + // long end + long end = (long)wxlua_getnumbertype(L, 4); + // long start + long start = (long)wxlua_getnumbertype(L, 3); + // const wxMouseEvent evtMouse + const wxMouseEvent * evtMouse = (const wxMouseEvent *)wxluaT_getuserdatatype(L, 2, wxluatype_wxMouseEvent); + // int winid + int winid = (int)wxlua_getnumbertype(L, 1); + // call constructor + wxTextUrlEvent* returns = new wxTextUrlEvent(winid, *evtMouse, start, end); + // add to tracked memory list + wxluaO_addgcobject(L, returns); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxTextUrlEvent); + + return 1; + } + + + + + // Map Lua Class Methods to C Binding Functions + wxLuaBindMethod wxTextUrlEvent_methods[] = { + { "GetMouseEvent", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTextUrlEvent_GetMouseEvent, 1, NULL }, + { "GetURLEnd", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTextUrlEvent_GetURLEnd, 1, NULL }, + { "GetURLStart", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTextUrlEvent_GetURLStart, 1, NULL }, + { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxTextUrlEvent_delete, 1, NULL }, + { "wxTextUrlEvent", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxTextUrlEvent_constructor, 1, NULL }, + + { 0, 0, 0, 0 }, + }; + + int wxTextUrlEvent_methodCount = sizeof(wxTextUrlEvent_methods)/sizeof(wxLuaBindMethod) - 1; + + #endif // wxLUA_USE_wxTextCtrl && wxUSE_TEXTCTRL + + #if wxLUA_USE_wxTreeCtrl && wxUSE_TREECTRL // --------------------------------------------------------------------------- |