From: John L. <jr...@us...> - 2008-01-31 04:34:37
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20345/wxLua/bindings/wxwidgets Modified Files: wx_datatypes.lua wxadv_grid.i wxadv_override.hpp Log Message: Added wxLuaGridTableBase and it's sample gridtable.wx.lua. Thanks to Hakki Dogusan. Index: wx_datatypes.lua =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wx_datatypes.lua,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** wx_datatypes.lua 29 Jan 2008 00:49:10 -0000 1.92 --- wx_datatypes.lua 31 Jan 2008 04:34:02 -0000 1.93 *************** *** 1755,1758 **** --- 1755,1759 ---- }, wxGridCellAttr = { + ["%encapsulate"] = true, BaseClass = "wxClientDataContainer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1768,1771 **** --- 1769,1773 ---- }, wxGridCellAttrProvider = { + ["%encapsulate"] = true, BaseClass = "wxClientDataContainer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1775,1778 **** --- 1777,1781 ---- }, wxGridCellAutoWrapStringEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellTextEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1782,1785 **** --- 1785,1789 ---- }, wxGridCellAutoWrapStringRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellStringRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1789,1792 **** --- 1793,1797 ---- }, wxGridCellBoolEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1796,1799 **** --- 1801,1805 ---- }, wxGridCellBoolRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1803,1806 **** --- 1809,1813 ---- }, wxGridCellChoiceEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1817,1820 **** --- 1824,1828 ---- }, wxGridCellDateTimeRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellStringRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1824,1827 **** --- 1832,1836 ---- }, wxGridCellEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellWorker", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1831,1834 **** --- 1840,1844 ---- }, wxGridCellEnumEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellChoiceEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1838,1841 **** --- 1848,1852 ---- }, wxGridCellEnumRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellStringRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1845,1848 **** --- 1856,1860 ---- }, wxGridCellFloatEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellTextEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1852,1855 **** --- 1864,1868 ---- }, wxGridCellFloatRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellStringRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1859,1862 **** --- 1872,1876 ---- }, wxGridCellNumberEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellTextEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1866,1869 **** --- 1880,1884 ---- }, wxGridCellNumberRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellStringRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1873,1876 **** --- 1888,1892 ---- }, wxGridCellRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellWorker", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1880,1883 **** --- 1896,1900 ---- }, wxGridCellStringRenderer = { + ["%encapsulate"] = true, BaseClass = "wxGridCellRenderer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1887,1890 **** --- 1904,1908 ---- }, wxGridCellTextEditor = { + ["%encapsulate"] = true, BaseClass = "wxGridCellEditor", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 1894,1897 **** --- 1912,1916 ---- }, wxGridCellWorker = { + ["%encapsulate"] = true, BaseClass = "wxClientDataContainer", Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", *************** *** 2606,2609 **** --- 2625,2635 ---- ValueType = "class", }, + wxLuaGridTableBase = { + BaseClass = "wxGridTableBase", + Condition = "wxLUA_USE_wxGrid && wxUSE_GRID", + IsNumber = false, + Name = "wxLuaGridTableBase", + ValueType = "class", + }, wxLuaHtmlWinTagEvent = { BaseClass = "wxEvent", Index: wxadv_grid.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxadv_grid.i,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** wxadv_grid.i 16 Jul 2007 19:34:23 -0000 1.1 --- wxadv_grid.i 31 Jan 2008 04:34:02 -0000 1.2 *************** *** 38,42 **** // wxGridCellWorker ! %class %noclassinfo wxGridCellWorker, wxClientDataContainer // wxGridCellWorker() - base class only --- 38,42 ---- // wxGridCellWorker ! %class %delete %noclassinfo %encapsulate wxGridCellWorker, wxClientDataContainer // wxGridCellWorker() - base class only *************** *** 49,53 **** // wxGridCellRenderer ! %class %noclassinfo wxGridCellRenderer, wxGridCellWorker //wxGridCellRenderer() - no constructor abstract class --- 49,53 ---- // wxGridCellRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellRenderer, wxGridCellWorker //wxGridCellRenderer() - no constructor abstract class *************** *** 59,63 **** // wxGridCellStringRenderer ! %class %noclassinfo wxGridCellStringRenderer, wxGridCellRenderer wxGridCellStringRenderer() --- 59,63 ---- // wxGridCellStringRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellStringRenderer, wxGridCellRenderer wxGridCellStringRenderer() *************** *** 67,71 **** // wxGridCellNumberRenderer ! %class %noclassinfo wxGridCellNumberRenderer, wxGridCellStringRenderer wxGridCellNumberRenderer() %endclass --- 67,71 ---- // wxGridCellNumberRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellNumberRenderer, wxGridCellStringRenderer wxGridCellNumberRenderer() %endclass *************** *** 74,78 **** // wxGridCellFloatRenderer ! %class %noclassinfo wxGridCellFloatRenderer, wxGridCellStringRenderer wxGridCellFloatRenderer(int width = -1, int precision = -1) --- 74,78 ---- // wxGridCellFloatRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellFloatRenderer, wxGridCellStringRenderer wxGridCellFloatRenderer(int width = -1, int precision = -1) *************** *** 86,90 **** // wxGridCellBoolRenderer ! %class %noclassinfo wxGridCellBoolRenderer, wxGridCellRenderer wxGridCellBoolRenderer() %endclass --- 86,90 ---- // wxGridCellBoolRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellBoolRenderer, wxGridCellRenderer wxGridCellBoolRenderer() %endclass *************** *** 93,97 **** // wxGridCellDateTimeRenderer ! %class %noclassinfo wxGridCellDateTimeRenderer, wxGridCellStringRenderer wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, const wxString& informat = wxDefaultDateTimeFormat) %endclass --- 93,97 ---- // wxGridCellDateTimeRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellDateTimeRenderer, wxGridCellStringRenderer wxGridCellDateTimeRenderer(const wxString& outformat = wxDefaultDateTimeFormat, const wxString& informat = wxDefaultDateTimeFormat) %endclass *************** *** 100,104 **** // wxGridCellEnumRenderer ! %class %noclassinfo wxGridCellEnumRenderer, wxGridCellStringRenderer wxGridCellEnumRenderer( const wxString& choices = "" ) %endclass --- 100,104 ---- // wxGridCellEnumRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellEnumRenderer, wxGridCellStringRenderer wxGridCellEnumRenderer( const wxString& choices = "" ) %endclass *************** *** 107,111 **** // wxGridCellAutoWrapStringRenderer ! %class %noclassinfo wxGridCellAutoWrapStringRenderer, wxGridCellStringRenderer wxGridCellAutoWrapStringRenderer() %endclass --- 107,111 ---- // wxGridCellAutoWrapStringRenderer ! %class %delete %noclassinfo %encapsulate wxGridCellAutoWrapStringRenderer, wxGridCellStringRenderer wxGridCellAutoWrapStringRenderer() %endclass *************** *** 114,124 **** // wxGridCellEditor ! %class %noclassinfo wxGridCellEditor, wxGridCellWorker // wxGridCellEditor() - no constructor abstract class bool IsCreated() wxControl* GetControl() ! void SetControl(wxControl* control) wxGridCellAttr* GetCellAttr() void SetCellAttr(wxGridCellAttr* attr) --- 114,126 ---- // wxGridCellEditor ! %class %delete %noclassinfo %encapsulate wxGridCellEditor, wxGridCellWorker // wxGridCellEditor() - no constructor abstract class bool IsCreated() wxControl* GetControl() ! // wxLua Note: This will delete the control ! void SetControl(%ungc wxControl* control) wxGridCellAttr* GetCellAttr() + // wxLua Note: the attr must exist for the life of this object and it doesn't take ownership void SetCellAttr(wxGridCellAttr* attr) *************** *** 141,145 **** // wxGridCellTextEditor ! %class %noclassinfo wxGridCellTextEditor, wxGridCellEditor wxGridCellTextEditor() %endclass --- 143,147 ---- // wxGridCellTextEditor ! %class %delete %noclassinfo %encapsulate wxGridCellTextEditor, wxGridCellEditor wxGridCellTextEditor() %endclass *************** *** 148,152 **** // wxGridCellNumberEditor ! %class %noclassinfo wxGridCellNumberEditor, wxGridCellTextEditor wxGridCellNumberEditor(int min = -1, int max = -1) %endclass --- 150,154 ---- // wxGridCellNumberEditor ! %class %delete %noclassinfo %encapsulate wxGridCellNumberEditor, wxGridCellTextEditor wxGridCellNumberEditor(int min = -1, int max = -1) %endclass *************** *** 155,159 **** // wxGridCellFloatEditor ! %class %noclassinfo wxGridCellFloatEditor, wxGridCellTextEditor wxGridCellFloatEditor(int width = -1, int precision = -1) %endclass --- 157,161 ---- // wxGridCellFloatEditor ! %class %delete %noclassinfo %encapsulate wxGridCellFloatEditor, wxGridCellTextEditor wxGridCellFloatEditor(int width = -1, int precision = -1) %endclass *************** *** 162,166 **** // wxGridCellBoolEditor ! %class %noclassinfo wxGridCellBoolEditor, wxGridCellEditor wxGridCellBoolEditor() %endclass --- 164,168 ---- // wxGridCellBoolEditor ! %class %delete %noclassinfo %encapsulate wxGridCellBoolEditor, wxGridCellEditor wxGridCellBoolEditor() %endclass *************** *** 169,173 **** // wxGridCellChoiceEditor ! %class %noclassinfo wxGridCellChoiceEditor, wxGridCellEditor wxGridCellChoiceEditor(const wxArrayString& choices, bool allowOthers = false) %endclass --- 171,175 ---- // wxGridCellChoiceEditor ! %class %delete %noclassinfo %encapsulate wxGridCellChoiceEditor, wxGridCellEditor wxGridCellChoiceEditor(const wxArrayString& choices, bool allowOthers = false) %endclass *************** *** 176,180 **** // wxGridCellEnumEditor ! %class %noclassinfo wxGridCellEnumEditor, wxGridCellChoiceEditor wxGridCellEnumEditor( const wxString& choices = "" ) %endclass --- 178,182 ---- // wxGridCellEnumEditor ! %class %delete %noclassinfo %encapsulate wxGridCellEnumEditor, wxGridCellChoiceEditor wxGridCellEnumEditor( const wxString& choices = "" ) %endclass *************** *** 183,187 **** // wxGridCellAutoWrapStringEditor ! %class %noclassinfo wxGridCellAutoWrapStringEditor, wxGridCellTextEditor wxGridCellAutoWrapStringEditor() %endclass --- 185,189 ---- // wxGridCellAutoWrapStringEditor ! %class %delete %noclassinfo %encapsulate wxGridCellAutoWrapStringEditor, wxGridCellTextEditor wxGridCellAutoWrapStringEditor() %endclass *************** *** 199,203 **** %endenum ! %class %noclassinfo wxGridCellAttr, wxClientDataContainer wxGridCellAttr() wxGridCellAttr(const wxColour& colText, const wxColour& colBack, const wxFont& font, int hAlign, int vAlign) --- 201,205 ---- %endenum ! %class %delete %noclassinfo %encapsulate wxGridCellAttr, wxClientDataContainer wxGridCellAttr() wxGridCellAttr(const wxColour& colText, const wxColour& colBack, const wxFont& font, int hAlign, int vAlign) *************** *** 213,217 **** --- 215,221 ---- void SetOverflow(bool allow = true) void SetReadOnly(bool isReadOnly = true) + // wxLua Note: the renderer must exist for the life of this object and it doesn't take ownership, but it does call DecRef() void SetRenderer(wxGridCellRenderer *renderer) + // wxLua Note: the editor must exist for the life of this object and it doesn't take ownership, but it does call DecRef() void SetEditor(wxGridCellEditor* editor) void SetKind(wxGridCellAttr::wxAttrKind kind) *************** *** 242,245 **** --- 246,250 ---- bool IsReadOnly() const wxGridCellAttr::wxAttrKind GetKind() + // wxLua Note: the attr must exist for the life of this object and it doesn't take ownership void SetDefAttr(wxGridCellAttr* defAttr) %endclass *************** *** 248,258 **** // wxGridCellAttrProvider ! %class %noclassinfo wxGridCellAttrProvider, wxClientDataContainer wxGridCellAttrProvider() wxGridCellAttr *GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) const ! void SetAttr(wxGridCellAttr *attr, int row, int col) ! void SetRowAttr(wxGridCellAttr *attr, int row) ! void SetColAttr(wxGridCellAttr *attr, int col) void UpdateAttrRows( size_t pos, int numRows ) void UpdateAttrCols( size_t pos, int numCols ) --- 253,264 ---- // wxGridCellAttrProvider ! %class %delete %noclassinfo %encapsulate wxGridCellAttrProvider, wxClientDataContainer wxGridCellAttrProvider() + // wxLua Note: You must call DecRef() on the returned attr. wxGridCellAttr *GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) const ! void SetAttr(%ungc wxGridCellAttr *attr, int row, int col) ! void SetRowAttr(%ungc wxGridCellAttr *attr, int row) ! void SetColAttr(%ungc wxGridCellAttr *attr, int col) void UpdateAttrRows( size_t pos, int numRows ) void UpdateAttrCols( size_t pos, int numCols ) *************** *** 265,304 **** // no constructor pure virtual base class ! int GetNumberRows() ! int GetNumberCols() ! bool IsEmptyCell( int row, int col ) ! wxString GetValue( int row, int col ) ! void SetValue( int row, int col, const wxString& value ) ! wxString GetTypeName( int row, int col ) ! bool CanGetValueAs( int row, int col, const wxString& typeName ) ! bool CanSetValueAs( int row, int col, const wxString& typeName ) ! bool GetValueAsBool( int row, int col ) ! long GetValueAsLong( int row, int col ) ! double GetValueAsDouble( int row, int col ) ! void SetValueAsBool( int row, int col, bool value ) ! void SetValueAsLong( int row, int col, long value ) ! void SetValueAsDouble( int row, int col, double value ) //virtual void* GetValueAsCustom( int row, int col, const wxString& typeName ) //virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value ) ! void SetView( wxGrid *grid ) ! wxGrid * GetView() const ! void Clear() ! bool InsertRows( size_t pos = 0, size_t numRows = 1 ) ! bool AppendRows( size_t numRows = 1 ) ! bool DeleteRows( size_t pos = 0, size_t numRows = 1 ) ! bool InsertCols( size_t pos = 0, size_t numCols = 1 ) ! bool AppendCols( size_t numCols = 1 ) ! bool DeleteCols( size_t pos = 0, size_t numCols = 1 ) ! wxString GetRowLabelValue( int row ) ! wxString GetColLabelValue( int col ) ! void SetRowLabelValue( int row, const wxString& value ) ! void SetColLabelValue( int col, const wxString& value ) void SetAttrProvider(wxGridCellAttrProvider *attrProvider) wxGridCellAttrProvider *GetAttrProvider() const ! bool CanHaveAttributes() ! wxGridCellAttr* GetAttr( int row, int col, wxGridCellAttr::wxAttrKind kind) ! void SetAttr(wxGridCellAttr* attr, int row, int col) ! void SetRowAttr(wxGridCellAttr *attr, int row) ! void SetColAttr(wxGridCellAttr *attr, int col) %endclass --- 271,389 ---- // no constructor pure virtual base class ! virtual int GetNumberRows() ! virtual int GetNumberCols() ! virtual bool IsEmptyCell( int row, int col ) ! virtual wxString GetValue( int row, int col ) ! virtual void SetValue( int row, int col, const wxString& value ) ! virtual wxString GetTypeName( int row, int col ) ! virtual bool CanGetValueAs( int row, int col, const wxString& typeName ) ! virtual bool CanSetValueAs( int row, int col, const wxString& typeName ) ! virtual bool GetValueAsBool( int row, int col ) ! virtual long GetValueAsLong( int row, int col ) ! virtual double GetValueAsDouble( int row, int col ) ! virtual void SetValueAsBool( int row, int col, bool value ) ! virtual void SetValueAsLong( int row, int col, long value ) ! virtual void SetValueAsDouble( int row, int col, double value ) //virtual void* GetValueAsCustom( int row, int col, const wxString& typeName ) //virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value ) ! virtual void SetView( wxGrid *grid ) ! virtual wxGrid * GetView() const ! virtual void Clear() ! virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 ) ! virtual bool AppendRows( size_t numRows = 1 ) ! virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 ) ! virtual bool InsertCols( size_t pos = 0, size_t numCols = 1 ) ! virtual bool AppendCols( size_t numCols = 1 ) ! virtual bool DeleteCols( size_t pos = 0, size_t numCols = 1 ) ! virtual wxString GetRowLabelValue( int row ) ! virtual wxString GetColLabelValue( int col ) ! virtual void SetRowLabelValue( int row, const wxString& value ) ! virtual void SetColLabelValue( int col, const wxString& value ) ! void SetAttrProvider(wxGridCellAttrProvider *attrProvider) wxGridCellAttrProvider *GetAttrProvider() const ! virtual bool CanHaveAttributes() ! virtual wxGridCellAttr* GetAttr( int row, int col, wxGridCellAttr::wxAttrKind kind) ! ! void SetAttr(%ungc wxGridCellAttr* attr, int row, int col) ! void SetRowAttr(%ungc wxGridCellAttr *attr, int row) ! void SetColAttr(%ungc wxGridCellAttr *attr, int col) ! %endclass ! ! // --------------------------------------------------------------------------- ! // wxLuaGridTableBase ! ! %include "wxbind/include/wxadv_wxladv.h" ! ! %class %delete wxLuaGridTableBase, wxGridTableBase ! // %override - the C++ function takes the wxLuaState as the first param ! wxLuaGridTableBase() ! ! // The functions below are all virtual functions that you override in Lua. ! ! // You must override these functions in a derived table class ! // ! //virtual int GetNumberRows(); ! //virtual int GetNumberCols(); ! //virtual bool IsEmptyCell( int row, int col ); ! //virtual wxString GetValue( int row, int col ); ! //virtual void SetValue( int row, int col, const wxString& value ); ! // ! // Data type determination and value access ! //virtual wxString GetTypeName( int row, int col ); ! //virtual bool CanGetValueAs( int row, int col, const wxString& typeName ); ! //virtual bool CanSetValueAs( int row, int col, const wxString& typeName ); ! // ! //virtual long GetValueAsLong( int row, int col ); ! //virtual double GetValueAsDouble( int row, int col ); ! //virtual bool GetValueAsBool( int row, int col ); ! // ! //virtual void SetValueAsLong( int row, int col, long value ); ! //virtual void SetValueAsDouble( int row, int col, double value ); ! //virtual void SetValueAsBool( int row, int col, bool value ); ! // ! // For user defined types ! //virtual void* GetValueAsCustom( int row, int col, const wxString& typeName ); ! //virtual void SetValueAsCustom( int row, int col, const wxString& typeName, void* value ); ! // ! // Overriding these is optional ! // ! //virtual void SetView( wxGrid *grid ) { m_view = grid; } ! //virtual wxGrid * GetView() const { return m_view; } ! // ! //virtual void Clear() {} ! //virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 ); ! //virtual bool AppendRows( size_t numRows = 1 ); ! //virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 ); ! //virtual bool InsertCols( size_t pos = 0, size_t numCols = 1 ); ! //virtual bool AppendCols( size_t numCols = 1 ); ! //virtual bool DeleteCols( size_t pos = 0, size_t numCols = 1 ); ! // ! //virtual wxString GetRowLabelValue( int row ); ! //virtual wxString GetColLabelValue( int col ); ! //virtual void SetRowLabelValue( int WXUNUSED(row), const wxString& ) {} ! //virtual void SetColLabelValue( int WXUNUSED(col), const wxString& ) {} ! // ! // Attribute handling ! // ! // give us the attr provider to use - we take ownership of the pointer ! //void SetAttrProvider(wxGridCellAttrProvider *attrProvider); ! // ! // get the currently used attr provider (may be NULL) ! //wxGridCellAttrProvider *GetAttrProvider() const { return m_attrProvider; } ! // ! // Does this table allow attributes? Default implementation creates ! // a wxGridCellAttrProvider if necessary. ! //virtual bool CanHaveAttributes(); ! // ! // by default forwarded to wxGridCellAttrProvider if any. May be ! // overridden to handle attributes directly in the table. ! //virtual wxGridCellAttr *GetAttr( int row, int col, ! // wxGridCellAttr::wxAttrKind kind ); ! // ! // these functions take ownership of the pointer ! //virtual void SetAttr(wxGridCellAttr* attr, int row, int col); ! //virtual void SetRowAttr(wxGridCellAttr *attr, int row); ! //virtual void SetColAttr(wxGridCellAttr *attr, int col); %endclass *************** *** 306,310 **** // wxGridStringTable ! %class wxGridStringTable, wxGridTableBase wxGridStringTable( int numRows=0, int numCols=0 ) %endclass --- 391,395 ---- // wxGridStringTable ! %class %delete wxGridStringTable, wxGridTableBase wxGridStringTable( int numRows=0, int numCols=0 ) %endclass *************** *** 387,390 **** --- 472,477 ---- wxGridTableBase * GetTable() const + + // %override so that takeOwnership releases the table from garbage collection by Lua bool SetTable( wxGridTableBase * table, bool takeOwnership = false, wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells ) *************** *** 466,471 **** --- 553,564 ---- wxColour GetLabelTextColour() wxFont GetLabelFont() + + // %override [int horiz, int vert] wxGrid::GetRowLabelAlignment() + // C++ Func: void GetRowLabelAlignment( int *horiz, int *vert ) void GetRowLabelAlignment( int *horz, int *vert ) + // %override [int horiz, int vert] wxGrid::GetColLabelAlignment() + // C++ Func: void GetColLabelAlignment( int *horiz, int *vert ) void GetColLabelAlignment( int *horz, int *vert ) + int GetColLabelTextOrientation() wxString GetRowLabelValue( int row ) *************** *** 502,508 **** bool CanDragCell() ! void SetAttr(int row, int col, wxGridCellAttr *attr) ! void SetRowAttr(int row, wxGridCellAttr *attr) ! void SetColAttr(int col, wxGridCellAttr *attr) wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const --- 595,601 ---- bool CanDragCell() ! void SetAttr(int row, int col, %ungc wxGridCellAttr *attr) ! void SetRowAttr(int row, %ungc wxGridCellAttr *attr) ! void SetColAttr(int col, %ungc wxGridCellAttr *attr) wxGridCellAttr *GetOrCreateCellAttr(int row, int col) const *************** *** 569,578 **** void SetCellSize( int row, int col, int num_rows, int num_cols ) ! void SetDefaultRenderer(wxGridCellRenderer *renderer) void SetCellRenderer(int row, int col, wxGridCellRenderer *renderer) wxGridCellRenderer* GetDefaultRenderer() const wxGridCellRenderer* GetCellRenderer(int row, int col) ! void SetDefaultEditor(wxGridCellEditor *editor) void SetCellEditor(int row, int col, wxGridCellEditor *editor) wxGridCellEditor* GetDefaultEditor() const --- 662,671 ---- void SetCellSize( int row, int col, int num_rows, int num_cols ) ! void SetDefaultRenderer(%ungc wxGridCellRenderer *renderer) void SetCellRenderer(int row, int col, wxGridCellRenderer *renderer) wxGridCellRenderer* GetDefaultRenderer() const wxGridCellRenderer* GetCellRenderer(int row, int col) ! void SetDefaultEditor(%ungc wxGridCellEditor *editor) void SetCellEditor(int row, int col, wxGridCellEditor *editor) wxGridCellEditor* GetDefaultEditor() const Index: wxadv_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxadv_override.hpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxadv_override.hpp 23 Jan 2008 06:43:34 -0000 1.5 --- wxadv_override.hpp 31 Jan 2008 04:34:02 -0000 1.6 *************** *** 192,193 **** --- 192,241 ---- } %end + + %override wxLua_wxGrid_SetTable + // bool SetTable(wxGridTableBase *table, bool takeOwnership = false, + // wxGrid::wxGridSelectionModes selmode = + // wxGrid::wxGridSelectCells) + static int LUACALL wxLua_wxGrid_SetTable(lua_State *L) + { + // get number of arguments + int argCount = lua_gettop(L); + // wxGrid::wxGridSelectionModes selmode = wxGrid::wxGridSelectCells + wxGrid::wxGridSelectionModes selmode = (argCount >= 4 ? (wxGrid::wxGridSelectionModes)wxlua_getintegertype(L, 4) : wxGrid::wxGridSelectCells); + // bool takeOwnership = false + bool takeOwnership = (argCount >= 3 ? wxlua_getbooleantype(L, 3) : false); + // wxGridTableBase table + wxGridTableBase * table = (wxGridTableBase *)wxluaT_getuserdatatype(L, 2, wxluatype_wxGridTableBase); + // get this + wxGrid * self = (wxGrid *)wxluaT_getuserdatatype(L, 1, wxluatype_wxGrid); + // call SetTable + bool returns = (self->SetTable(table, takeOwnership, selmode)); + + if (returns && takeOwnership) + { + if (!wxluaO_isgcobject(L, table)) wxluaO_addgcobject(L, table); + } + + // push the result flag + lua_pushboolean(L, returns); + + return 1; + } + %end + + %override wxLua_wxLuaGridTableBase_constructor + // wxLuaGridTableBase() + static int LUACALL wxLua_wxLuaGridTableBase_constructor(lua_State *L) + { + wxLuaState wxlState(L); + + // call constructor + wxLuaGridTableBase *returns = new wxLuaGridTableBase(wxlState); + // add to tracked memory list + wxluaO_addgcobject(L, (wxLuaGridTableBase *)returns); + // push the constructed class pointer + wxluaT_pushuserdatatype(L, returns, wxluatype_wxLuaGridTableBase); + + return 1; + } + %end |