Version: 3.0.3
wxGridSizesInfo Class Reference

#include <wx/grid.h>

Detailed Description

wxGridSizesInfo stores information about sizes of all wxGrid rows or columns.

It assumes that most of the rows or columns (which are both called elements here as the difference between them doesn't matter at this class level) have the default size and so stores it separately. And it uses a wxHashMap to store the sizes of all elements which have the non-default size.

This structure is particularly useful for serializing the sizes of all wxGrid elements at once.

Library:  wxAdvanced
Category:  Grid Related Classes

Public Member Functions

 wxGridSizesInfo ()
 Default constructor. More...
 
 wxGridSizesInfo (int defSize, const wxArrayInt &allSizes)
 Constructor. More...
 
int GetSize (unsigned pos) const
 Get the element size. More...
 

Public Attributes

int m_sizeDefault
 Default size. More...
 
wxUnsignedToIntHashMap m_customSizes
 Map with element indices as keys and their sizes as values. More...
 

Constructor & Destructor Documentation

wxGridSizesInfo::wxGridSizesInfo ( )

Default constructor.

m_sizeDefault and m_customSizes must be initialized later.

wxGridSizesInfo::wxGridSizesInfo ( int  defSize,
const wxArrayInt allSizes 
)

Constructor.

This constructor is used by wxGrid::GetRowSizes() and GetColSizes() methods. User code will usually use the default constructor instead.

Parameters
defSizeThe default element size.
allSizesArray containing the sizes of all elements, including those which have the default size.

Member Function Documentation

int wxGridSizesInfo::GetSize ( unsigned  pos) const

Get the element size.

Parameters
posThe index of the element.
Returns
The size for this element, using m_customSizes if pos is in it or m_sizeDefault otherwise.

Member Data Documentation

wxUnsignedToIntHashMap wxGridSizesInfo::m_customSizes

Map with element indices as keys and their sizes as values.

This map only contains the elements with non-default size.

int wxGridSizesInfo::m_sizeDefault

Default size.