make it possible to specify the virtual table size (this makes it easier to

see that the memory taken by the grid doesn't depend on it with top)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6182 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-02-21 17:37:07 +00:00
parent 6d55126d0b
commit 1618dca721
2 changed files with 37 additions and 17 deletions

View File

@@ -114,25 +114,35 @@ public:
bool isSelected);
};
// ----------------------------------------------------------------------------
// demonstration of virtual table which doesn't store all of its data in
// memory
// ----------------------------------------------------------------------------
class BigGridTable : public wxGridTableBase {
class BigGridTable : public wxGridTableBase
{
public:
long GetNumberRows() { return 10000; }
long GetNumberCols() { return 10000; }
BigGridTable(long sizeGrid) { m_sizeGrid = sizeGrid; }
wxString GetValue( int row, int col ) {
wxString str;
str.Printf("(%d, %d)", row, col);
return str;
long GetNumberRows() { return m_sizeGrid; }
long GetNumberCols() { return m_sizeGrid; }
wxString GetValue( int row, int col )
{
return wxString::Format("(%d, %d)", row, col);
}
void SetValue( int , int , const wxString& ) {}
void SetValue( int , int , const wxString& ) { /* ignore */ }
bool IsEmptyCell( int , int ) { return FALSE; }
private:
long m_sizeGrid;
};
class BigGridFrame : public wxFrame {
class BigGridFrame : public wxFrame
{
public:
BigGridFrame();
BigGridFrame(long sizeGrid);
private:
wxGrid* m_grid;
@@ -140,5 +150,5 @@ private:
};
#endif
#endif // griddemo_h