From: John L. <jr...@us...> - 2008-01-08 00:55:39
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13069/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxcore_print.cpp wxcore_wxlprint.cpp Log Message: Allow "%member static int m_var" to work Index: wxcore_wxlprint.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_wxlprint.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxcore_wxlprint.cpp 22 Dec 2007 06:07:14 -0000 1.6 --- wxcore_wxlprint.cpp 8 Jan 2008 00:55:35 -0000 1.7 *************** *** 31,34 **** --- 31,36 ---- // ---------------------------------------------------------------------------- + int wxLuaPrintout::ms_test_int = -1; + IMPLEMENT_ABSTRACT_CLASS(wxLuaPrintout, wxPrintout) Index: wxadv_adv.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxadv_adv.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxadv_adv.cpp 22 Dec 2007 06:07:11 -0000 1.10 --- wxadv_adv.cpp 8 Jan 2008 00:55:35 -0000 1.11 *************** *** 5300,5303 **** --- 5300,5324 ---- #endif // (wxCHECK_VERSION(2,4,0)) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + #if (wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + static wxLuaArgType s_wxluatypeArray_wxLua_wxTaskBarIcon_PopupMenu[] = { &g_wxluatype_wxTaskBarIcon, &g_wxluatype_wxMenu, NULL }; + static int LUACALL wxLua_wxTaskBarIcon_PopupMenu(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxTaskBarIcon_PopupMenu[1] = {{ wxLua_wxTaskBarIcon_PopupMenu, WXLUAMETHOD_METHOD, 2, 2, s_wxluatypeArray_wxLua_wxTaskBarIcon_PopupMenu }}; + // virtual bool PopupMenu(wxMenu* menu) + static int LUACALL wxLua_wxTaskBarIcon_PopupMenu(lua_State *L) + { + // wxMenu menu + wxMenu * menu = (wxMenu *)wxluaT_getuserdatatype(L, 2, g_wxluatype_wxMenu); + // get this + wxTaskBarIcon * self = (wxTaskBarIcon *)wxluaT_getuserdatatype(L, 1, g_wxluatype_wxTaskBarIcon); + // call PopupMenu + bool returns = (self->PopupMenu(menu)); + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + + #endif // (wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + static wxLuaArgType s_wxluatypeArray_wxLua_wxTaskBarIcon_RemoveIcon[] = { &g_wxluatype_wxTaskBarIcon, NULL }; static int LUACALL wxLua_wxTaskBarIcon_RemoveIcon(lua_State *L); *************** *** 5369,5372 **** --- 5390,5397 ---- #endif // (wxCHECK_VERSION(2,4,0)) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + #if (wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + { "PopupMenu", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTaskBarIcon_PopupMenu, 1, NULL }, + #endif // (wxLUA_USE_wxMenu && wxUSE_MENUS) && (wxLUA_USE_wxTaskBarIcon && defined (wxHAS_TASK_BAR_ICON )) + { "RemoveIcon", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxTaskBarIcon_RemoveIcon, 1, NULL }, Index: wxcore_print.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_print.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** wxcore_print.cpp 22 Dec 2007 06:07:14 -0000 1.10 --- wxcore_print.cpp 8 Jan 2008 00:55:35 -0000 1.11 *************** *** 358,361 **** --- 358,372 ---- } + static int LUACALL wxLua_wxLuaPrintout_Get_ms_test_int(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaPrintout_Get_ms_test_int[1] = {{ wxLua_wxLuaPrintout_Get_ms_test_int, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 1, 1, g_wxluaargtypeArray_None }}; + // %member static int ms_test_int + static int LUACALL wxLua_wxLuaPrintout_Get_ms_test_int(lua_State *L) + { + // push the result number + lua_pushnumber(L, wxLuaPrintout::ms_test_int); + // return the number of values + return 1; + } + static wxLuaArgType s_wxluatypeArray_wxLua_wxLuaPrintout_SetPageInfo[] = { &g_wxluatype_wxLuaPrintout, &g_wxluatype_TNUMBER, &g_wxluatype_TNUMBER, &g_wxluatype_TNUMBER, &g_wxluatype_TNUMBER, NULL }; static int LUACALL wxLua_wxLuaPrintout_SetPageInfo(lua_State *L); *************** *** 382,385 **** --- 393,409 ---- } + static wxLuaArgType s_wxluatypeArray_wxLua_wxLuaPrintout_Set_ms_test_int[] = { &g_wxluatype_TNUMBER, NULL }; + static int LUACALL wxLua_wxLuaPrintout_Set_ms_test_int(lua_State *L); + static wxLuaBindCFunc s_wxluafunc_wxLua_wxLuaPrintout_Set_ms_test_int[1] = {{ wxLua_wxLuaPrintout_Set_ms_test_int, WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, 2, 2, s_wxluatypeArray_wxLua_wxLuaPrintout_Set_ms_test_int }}; + // %member static int ms_test_int + static int LUACALL wxLua_wxLuaPrintout_Set_ms_test_int(lua_State *L) + { + // get the number value + int val = (int)wxlua_getnumbertype(L, 1); + wxLuaPrintout::ms_test_int = val; + // return the number of values + return 0; + } + static wxLuaArgType s_wxluatypeArray_wxLua_wxLuaPrintout_TestVirtualFunctionBinding[] = { &g_wxluatype_wxLuaPrintout, &g_wxluatype_TSTRING, NULL }; static int LUACALL wxLua_wxLuaPrintout_TestVirtualFunctionBinding(lua_State *L); *************** *** 435,441 **** --- 459,469 ---- wxLuaBindMethod wxLuaPrintout_methods[] = { { "GetID", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_GetID, 1, NULL }, + // %member { "Get_ms_test_int", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLuaPrintout_Get_ms_test_int, 1, NULL }, { "SetPageInfo", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_SetPageInfo, 1, NULL }, + // %member { "Set_ms_test_int", WXLUAMETHOD_METHOD|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLuaPrintout_Set_ms_test_int, 1, NULL }, { "TestVirtualFunctionBinding", WXLUAMETHOD_METHOD, s_wxluafunc_wxLua_wxLuaPrintout_TestVirtualFunctionBinding, 1, NULL }, { "delete", WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, s_wxluafunc_wxLua_wxLuaPrintout_delete, 1, NULL }, + { "ms_test_int", WXLUAMETHOD_SETPROP|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLuaPrintout_Set_ms_test_int, 1, NULL }, + { "ms_test_int", WXLUAMETHOD_GETPROP|WXLUAMETHOD_STATIC, s_wxluafunc_wxLua_wxLuaPrintout_Get_ms_test_int, 1, NULL }, { "wxLuaPrintout", WXLUAMETHOD_CONSTRUCTOR, s_wxluafunc_wxLua_wxLuaPrintout_constructor, 1, NULL }, |