From: John L. <jr...@us...> - 2006-02-02 17:05:50
|
Update of /cvsroot/wxlua/wxLua/modules/wxbindstc/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28688/wxLua/modules/wxbindstc/src Modified Files: stc.cpp Log Message: add the overrides to the wxstc module Index: stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbindstc/src/stc.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** stc.cpp 2 Feb 2006 16:11:33 -0000 1.1 --- stc.cpp 2 Feb 2006 17:05:42 -0000 1.2 *************** *** 368,388 **** } ! // wxString GetCurLine(int* linePos = NULL) static int LUACALL wxStyledTextCtrl_GetCurLine(lua_State *L) { wxLuaState wxlState(L); wxString returns; ! // get number of arguments ! int argCount = lua_gettop(L); ! // int linePos = NULL ! int * linePos = (argCount >= 2 ? (int *)wxlState.ttouserdata(2) : NULL); // get this ! wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call GetCurLine ! returns = self->GetCurLine(linePos); // push the result string ! lua_pushstring(L, wx2lua(returns) ); ! ! return 1; } --- 368,387 ---- } ! // %override wxStyledTextCtrl_GetCurLine ! // wxString GetCurLine(int* linePos=NULL) static int LUACALL wxStyledTextCtrl_GetCurLine(lua_State *L) { wxLuaState wxlState(L); wxString returns; ! int linePos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call GetCurLine ! returns = self->GetCurLine(&linePos); // push the result string ! lua_pushstring(L, wx2lua(returns)); ! lua_pushnumber(L, linePos); ! // return the number of parameters ! return 2; } *************** *** 983,1000 **** } ! // void SetStyleBytes(int length, char* styleBytes) static int LUACALL wxStyledTextCtrl_SetStyleBytes(lua_State *L) { wxLuaState wxlState(L); ! // char styleBytes ! char * styleBytes = (char *)wxlState.ttouserdata(3); // int length ! int length = (int)wxlState.getnumbertype(2); // get this ! wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call SetStyleBytes ! self->SetStyleBytes(length, styleBytes); ! ! return 0; } --- 982,1002 ---- } ! // %override wxStyledTextCtrl_SetStyleBytes ! // void SetStyleBytes(int length, const wxString &styleBytes) static int LUACALL wxStyledTextCtrl_SetStyleBytes(lua_State *L) { wxLuaState wxlState(L); ! // const wxString &styleBytes ! wxCharBuffer styleBytes(lua_tostring(L, 3)); // int length ! int length = (int)lua_tonumber(L, 2); // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call SetStyleBytes ! self->SetStyleBytes(length, styleBytes.data()); ! // push result ! lua_pushstring(L, styleBytes); ! // return the number of parameters ! return 1; } *************** *** 4061,4078 **** } ! // void GetSelection(int *startPos, int *endPos) static int LUACALL wxStyledTextCtrl_GetSelection(lua_State *L) { wxLuaState wxlState(L); ! // int endPos ! int * endPos = (int *)wxlState.ttouserdata(3); ! // int startPos ! int * startPos = (int *)wxlState.ttouserdata(2); // get this ! wxStyledTextCtrl * self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call GetSelection ! self->GetSelection(startPos, endPos); ! ! return 0; } --- 4063,4082 ---- } ! // %override wxStyledTextCtrl_GetSelection ! // void GetSelection(int* startPos, int* endPos) static int LUACALL wxStyledTextCtrl_GetSelection(lua_State *L) { wxLuaState wxlState(L); ! int endPos; ! int startPos; // get this ! wxStyledTextCtrl *self = (wxStyledTextCtrl *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextCtrl); // call GetSelection ! self->GetSelection(&startPos, &endPos); ! // push results ! lua_pushnumber(L, startPos); ! lua_pushnumber(L, endPos); ! // return the number of parameters ! return 2; } *************** *** 5795,5813 **** #if (wxLUA_USE_wxStyledTextCtrl) && (wxLUA_USE_wxDragDrop) ! // void SetDragResult(wxDragResult val) static int LUACALL wxStyledTextEvent_SetDragResult(lua_State *L) { wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)wxlState.getenumerationtype(2); // get this ! wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextEvent); // call SetDragResult self->SetDragResult(val); ! return 0; } ! // wxDragResult GetDragResult() static int LUACALL wxStyledTextEvent_GetDragResult(lua_State *L) { --- 5799,5819 ---- #if (wxLUA_USE_wxStyledTextCtrl) && (wxLUA_USE_wxDragDrop) ! // %override wxStyledTextEvent_SetDragResult ! // void SetDragResult(wxDragResult val) static int LUACALL wxStyledTextEvent_SetDragResult(lua_State *L) { wxLuaState wxlState(L); // wxDragResult val ! wxDragResult val = (wxDragResult)(int)lua_tonumber(L, 2); // get this ! wxStyledTextEvent *self = (wxStyledTextEvent *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextEvent); // call SetDragResult self->SetDragResult(val); ! // return the number of parameters return 0; } ! // %override wxStyledTextEvent_GetDragResult ! // wxDragResult GetDragResult() static int LUACALL wxStyledTextEvent_GetDragResult(lua_State *L) { *************** *** 5815,5824 **** wxDragResult returns; // get this ! wxStyledTextEvent * self = (wxStyledTextEvent *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextEvent); // call GetDragResult returns = self->GetDragResult(); ! // push the result number ! lua_pushnumber(L, returns); ! return 1; } --- 5821,5830 ---- wxDragResult returns; // get this ! wxStyledTextEvent *self = (wxStyledTextEvent *)wxlState.getuserdatatype(1, s_wxluatag_wxStyledTextEvent); // call GetDragResult returns = self->GetDragResult(); ! // push the result datatype ! lua_pushnumber(L, (long) returns); ! // return the number of parameters return 1; } |