wxWidgets: wxGridSizesInfo Class Reference

| Version: 3.1.5

Public Member Functions | Public Attributes | List of all members
wxGridSizesInfo Class Reference
Class List by Category » Grid Related Classes

`#include </home/Hamis/wxwidgets-3.1/wxWidgets3.1-3.1.5-1.i686/src/wxWidgets-3.1.5/interface/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: wxCore

<>< =''>:</>&;&;< =''>\ </></>

## 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() [1/2]

wxGridSizesInfo::wxGridSizesInfo | ( |  | ) |

Default constructor.

m_sizeDefault and m_customSizes must be initialized later.

## ◆ wxGridSizesInfo() [2/2]

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

  defSize | The default element size.
  allSizes | Array containing the sizes of all elements, including those which have the default size.

## Member Function Documentation

## ◆ GetSize()

int wxGridSizesInfo::GetSize | ( | unsigned | pos | ) | const

Get the element size.

Parameters

  pos | The 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

## ◆ m_customSizes

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.

## ◆ m_sizeDefault

int wxGridSizesInfo::m_sizeDefault

Default size.