From: John L. <jr...@us...> - 2008-01-31 04:34:11
|
Update of /cvsroot/wxlua/wxLua/modules/wxbind/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv20345/wxLua/modules/wxbind/include Modified Files: wxadv_bind.h Added Files: wxadv_wxladv.h Log Message: Added wxLuaGridTableBase and it's sample gridtable.wx.lua. Thanks to Hakki Dogusan. Index: wxadv_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/include/wxadv_bind.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** wxadv_bind.h 29 Jan 2008 00:49:11 -0000 1.13 --- wxadv_bind.h 31 Jan 2008 04:34:06 -0000 1.14 *************** *** 77,80 **** --- 77,81 ---- #include "wx/generic/gridctrl.h" #include "wx/grid.h" + #include "wxbind/include/wxadv_wxladv.h" #endif // wxLUA_USE_wxGrid && wxUSE_GRID *************** *** 251,254 **** --- 252,258 ---- extern WXDLLIMPEXP_BINDWXADV wxLuaBindMethod wxGridTableMessage_methods[]; extern WXDLLIMPEXP_DATA_BINDWXADV(int) wxGridTableMessage_methodCount; + extern WXDLLIMPEXP_DATA_BINDWXADV(int) wxluatype_wxLuaGridTableBase; + extern WXDLLIMPEXP_BINDWXADV wxLuaBindMethod wxLuaGridTableBase_methods[]; + extern WXDLLIMPEXP_DATA_BINDWXADV(int) wxLuaGridTableBase_methodCount; #endif // wxLUA_USE_wxGrid && wxUSE_GRID *************** *** 330,334 **** --- 334,357 ---- #if wxLUA_USE_wxGrid && wxUSE_GRID + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellAttr, wxGridCellAttr) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellAttrProvider, wxGridCellAttrProvider) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellAutoWrapStringEditor, wxGridCellAutoWrapStringEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellAutoWrapStringRenderer, wxGridCellAutoWrapStringRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellBoolEditor, wxGridCellBoolEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellBoolRenderer, wxGridCellBoolRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellChoiceEditor, wxGridCellChoiceEditor) wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellCoords, wxGridCellCoords) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellDateTimeRenderer, wxGridCellDateTimeRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellEditor, wxGridCellEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellEnumEditor, wxGridCellEnumEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellEnumRenderer, wxGridCellEnumRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellFloatEditor, wxGridCellFloatEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellFloatRenderer, wxGridCellFloatRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellNumberEditor, wxGridCellNumberEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellNumberRenderer, wxGridCellNumberRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellRenderer, wxGridCellRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellStringRenderer, wxGridCellStringRenderer) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellTextEditor, wxGridCellTextEditor) + wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridCellWorker, wxGridCellWorker) wxLUA_DECLARE_ENCAPSULATION(WXDLLIMPEXP_BINDWXADV, wxGridTableMessage, wxGridTableMessage) #endif // wxLUA_USE_wxGrid && wxUSE_GRID --- NEW FILE: wxadv_wxladv.h --- ///////////////////////////////////////////////////////////////////////////// // Purpose: Wrappers around wxAdv classes for wxLua // Author: J. Winwood // Created: July 2002 // Copyright: (c) 2002 Lomtick Software. All rights reserved. // Licence: wxWidgets licence ///////////////////////////////////////////////////////////////////////////// #ifndef WX_LUA_WXLADV_H #define WX_LUA_WXLADV_H #include "wxbind/include/wxbinddefs.h" #include "wxluasetup.h" #if wxUSE_GRID && wxLUA_USE_wxGrid #include "wx/grid.h" class WXDLLIMPEXP_BINDWXADV wxLuaGridTableBase : public wxGridTableBase { public: wxLuaGridTableBase(const wxLuaState& wxlState); // 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); private: wxLuaState m_wxlState; DECLARE_ABSTRACT_CLASS(wxLuaGridTableBase) }; #endif // wxUSE_GRID && wxLUA_USE_wxGrid #endif // WX_LUA_WXLADV_H |