Serialization | |
virtual void | Serialize (CArchive &ar) |
Serializes or deserializes data to/from the archive. | |
static int | GetSerializeVersion () |
Current serialization version. | |
Public Types | |
enum | NotificationType { ColumnAdded, ColumnRemoved, ColumnResized, ColumnModified, ColumnVisibleChanged, ColumnMoved, FixedCountChanged, SortChanged, NavigationColumnChanged, HeaderHeightChanged, FontChanged, ImageListChanged } |
Notification type. More... | |
Public Member Functions | |
CHeader (bool autoDelete=true) | |
Constructor. | |
CHeader (const CHeader &header, bool autoDelete=true) | |
Copy constructor. | |
virtual | ~CHeader () |
Virtual destructor. | |
virtual const CColumn * | GetHierarchicalColumn () const |
Indicates the current hierarchical column. | |
virtual bool | SetHierarchicalColumn (Common::FID fid) |
Sets a new hierarchical column. | |
Add/remove colums | |
virtual bool | Add (CColumn *column) |
Adds a new column. | |
virtual bool | Remove (Common::FID fid) |
Removes a column by its identifier. | |
virtual void | RemoveAll () |
Removes all columns. | |
Column count and fixed columns | |
virtual long | GetColumnCount () const |
Gets a count of all columns. | |
virtual long | GetVisibleColumnCount () const |
Gets a count of all visible columns. | |
virtual void | SetFixedColumnsCount (int fixedColumnsCount) |
Sets a new count of fixed columns. | |
virtual int | GetFixedColumnsCount () const |
Gets a count of fixed columns. | |
virtual bool | IsFixed (Common::FID fid) const |
Gets the value inficating whether a column is fixed. | |
Visibility | |
virtual bool | ShowColumn (Common::FID fid) |
Shows an already hidden column. | |
virtual bool | HideColumn (Common::FID fid) |
Hides a column. | |
Column moving & sizing | |
virtual bool | CanMoveFixedColumns () const |
Gets the value indicating whether fixed columns can be moved. | |
virtual bool | CanMoveScrollableColumns () const |
Gets the value indicating whether scrollable columns can be moved. | |
virtual bool | CanResizeColumn () const |
Gets the value indicating whether columns can be resized. | |
virtual void | AllowFixedColumnMove (bool enable) |
Sets the value indicating that fixed columns can be moved. | |
virtual void | AllowScrollableColumnMove (bool enable) |
Sets the value indicating that scrollable columns can be moved. | |
virtual void | AllowColumnResize (bool enable) |
Sets the value indicating that columns can be resized. | |
virtual bool | MoveBefore (Common::FID toMove, Common::FID before) |
Moves a specified column before another column. | |
virtual bool | MoveAfter (Common::FID toMove, Common::FID after) |
Moves a specified column after another column. | |
virtual bool | MoveToPosition (Common::FID toMove, int position) |
Moves a specified column to the specified location. | |
virtual bool | MoveToVisiblePosition (Common::FID toMove, int position) |
Moves a specified column to the specified visible position. | |
Fid to index and vice versa | |
virtual CColumn * | GetColumnByIndex (int index) const |
Gets a column by its zero-based index. | |
virtual CColumn * | GetVisibleColumnByIndex (int index) const |
Gets a visible column by its zero-based index. | |
virtual CColumn * | GetColumnByFid (Common::FID fid) const |
Gets a column by its identifier. | |
virtual CColumn * | GetVisibleColumnByFid (Common::FID fid) const |
Gets a visible column by its identifier. | |
virtual int | GetColumnIndex (Common::FID fid) const |
Gets an index of a column. | |
virtual int | GetVisibleColumnIndex (Common::FID fid) const |
Gets an index of a visible column. (in range of visible columns). | |
virtual CColumn * | GetFirstColumn () const |
Gets the first column. | |
virtual CColumn * | GetFirstVisibleColumn () const |
Gets the first visible column. | |
virtual CColumn * | GetLastColumn () const |
Gets the last column. | |
virtual CColumn * | GetLastVisibleColumn () const |
Gets the last visible column. | |
Position and dimensions | |
virtual CColumn * | HitTest (const CGrid &grid, CPoint point) const |
Gets a column of the header located within the given coordinates. | |
virtual CRect | GetVirtualRect (const CGrid &grid, Common::FID fid) const |
Gets virtual coordinates of the column with the specified identifier. | |
virtual CRect | GetVisibleRect (const CGrid &grid, Common::FID fid) const |
Gets visible coordinates of the column with the specified identifier. | |
virtual int | GetHeaderHeight () const |
Gets a height of the header. | |
virtual void | SetHeaderHeight (int height) |
Sets a new height of the header. | |
virtual int | GetFixedColumnWidth () const |
Gets the width occupied by all fixed columns. | |
virtual int | GetScrollableColumnWidth () const |
Gets the width occupied by all scrollable columns. | |
Navigation column | |
virtual void | SetNavigationColumn (int column) |
Sets a new navigation column. | |
virtual int | GetNavigationColumn () const |
Gets a current navigation column. | |
Sort functions | |
virtual void | AllowSort (bool enable) |
Sort functions. | |
virtual bool | CanSort () const |
Returns the value indicating if CGrid can perform lines sorting or not. | |
virtual void | AllowMultiSort (bool enable) |
Allows or forbids multiple sorting in the grid. | |
virtual bool | CanMultiSort () const |
Returns the value indicating if CGrid can perform lines multiple sorting or not. | |
virtual void | SetSort (int level, CSortInfo sortInfo) |
Sets or modifies sorting for a specified level. | |
virtual CSortInfo | GetSort (int level) const |
Gets sorting related information for a given level. | |
virtual int | GetSortLevels () const |
Retrieves a count of sorting levels. | |
virtual void | ResetSort () |
Resets a sort. | |
Font and images | |
virtual CFont * | SetFont (CFont *font) |
Sets a new font. | |
virtual CFont * | GetFont () const |
Gets a current font. | |
virtual CImageList * | SetImageList (CImageList *imageList) |
Sets a new images list to show icons in header columns. | |
virtual CImageList * | GetImageList () const |
Gets a current images list used to show icons in the header columns. | |
Notifications | |
void | Subscribe (INotify *callBack) |
Subscribes for events. | |
void | Unsubscribe (INotify *callBack) |
Unsubscribes from events. | |
IAutoDelete implementation | |
virtual bool | AutoDelete () const |
IAutoDelete implementation. Returns the value, passed in the constructor. | |
Classes | |
struct | INotify |
Interface to receive notifications about the header state modification. More... |
Stores columns and allows their handling and also stores the necessary information for sorting lines in the grid. All the columns inserted in the header have the identifiers corresponding to the identifiers of data object fields. The given identifiers should not repeat. While replacing headers in the grid, data objects contents can be presented in absolutely another way.
The header allows to do columns invisible, to replace them, to organize unscrolling columns. Also the header stores the information about sorting. While setting a new header the grid automatically makes line sorting according to the rules set in the header. Up to five levels of sorting (up to five columns which take part) are possible. At defining a line location in the grid there is a comparison of the unformatted values returned by data objects fields. This also considers hierarchical structure of the grid.
When columns are added to the header, there is a subscription to dispatch events which are transferred in the grid then. Also the header can generate its own events and notify the subscribers.
It is also important to note, that almost all the functions of CHeader class are thread-safe and can be called from any thread. All events are sent in such a way, that at the moment of their sending synchronizing objects of such type as critical section or mutex are not occupied.
enum NotificationType |
Notification type.
CHeader | ( | bool | autoDelete = true |
) |
bool Add | ( | CColumn * | column | ) | [virtual] |
Adds a new column.
The header can't have two columns with the same identifiers. The function can raise CHeader::ColumnAdded notification.
[in] | column | New column |
bool Remove | ( | Common::FID | fid | ) | [virtual] |
Removes a column by its identifier.
The function can raise CHeader::ColumnRemoved notification.
[in] | fid | Column's identifier |
void RemoveAll | ( | ) | [virtual] |
Removes all columns.
The function can raise CHeader::ColumnRemoved notification.
long GetColumnCount | ( | ) | const [virtual] |
Gets a count of all columns.
long GetVisibleColumnCount | ( | ) | const [virtual] |
Gets a count of all visible columns.
void SetFixedColumnsCount | ( | int | fixedColumnCount | ) | [virtual] |
Sets a new count of fixed columns.
The function can raise CHeader::FixedCountChanged notification.
[in] | fixedColumnCount | New count of visible columns. |
int GetFixedColumnsCount | ( | ) | const [virtual] |
Gets a count of fixed columns.
bool IsFixed | ( | Common::FID | fid | ) | const [virtual] |
Gets the value inficating whether a column is fixed.
[in] | fid | Column's identifier |
bool ShowColumn | ( | Common::FID | fid | ) | [virtual] |
Shows an already hidden column.
The function can raise CHeader::ColumnVisibleChanged notification.
[in] | fid | Column's identifier |
bool HideColumn | ( | Common::FID | fid | ) | [virtual] |
Hides a column.
The function can raise CHeader::ColumnVisibleChanged notification.
[in] | fid | Column's identifier |
bool CanMoveFixedColumns | ( | ) | const [virtual] |
Gets the value indicating whether fixed columns can be moved.
bool CanMoveScrollableColumns | ( | ) | const [virtual] |
Gets the value indicating whether scrollable columns can be moved.
bool CanResizeColumn | ( | ) | const [virtual] |
Gets the value indicating whether columns can be resized.
void AllowFixedColumnMove | ( | bool | enable | ) | [virtual] |
Sets the value indicating that fixed columns can be moved.
[in] | enable | True - columns can be moved. Otherwise - false. |
void AllowScrollableColumnMove | ( | bool | enable | ) | [virtual] |
Sets the value indicating that scrollable columns can be moved.
[in] | enable | True - columns can be moved. Otherwise - false. |
void AllowColumnResize | ( | bool | enable | ) | [virtual] |
Sets the value indicating that columns can be resized.
[in] | enable | True - columns can be resized. Otherwise - false. |
bool MoveBefore | ( | Common::FID | toMove, | |
Common::FID | before | |||
) | [virtual] |
Moves a specified column before another column.
The function can raise CHeader::ColumnMoved notification.
[in] | toMove | The column to be moved |
[in] | before | Position before which the column will be inserted |
bool MoveAfter | ( | Common::FID | toMove, | |
Common::FID | after | |||
) | [virtual] |
Moves a specified column after another column.
The function can raise CHeader::ColumnMoved notification.
[in] | toMove | The column to be moved |
[in] | after | Position after which the column will be inserted |
bool MoveToPosition | ( | Common::FID | toMove, | |
int | position | |||
) | [virtual] |
Moves a specified column to the specified location.
The function can raise CHeader::ColumnMoved notification.
[in] | toMove | The column to be moved |
[in] | position | Zero-based index indicating position to which the column will be inserted. |
bool MoveToVisiblePosition | ( | Common::FID | toMove, | |
int | position | |||
) | [virtual] |
Moves a specified column to the specified visible position.
The function can raise CHeader::ColumnMoved notification. The column must be visible.
[in] | toMove | The column to be moved |
[in] | position | Zero-based index in range of visible columns. |
CColumn * GetColumnByIndex | ( | int | index | ) | const [virtual] |
Gets a column by its zero-based index.
[in] | index | - Zero-based index of the columns stored in the header. |
CColumn * GetVisibleColumnByIndex | ( | int | index | ) | const [virtual] |
Gets a visible column by its zero-based index.
[in] | index | - Zero-based index of visible columns. |
CColumn * GetColumnByFid | ( | Common::FID | fid | ) | const [virtual] |
Gets a column by its identifier.
[in] | fid | - identifier of the column. |
CColumn * GetVisibleColumnByFid | ( | Common::FID | fid | ) | const [virtual] |
Gets a visible column by its identifier.
[in] | fid | - identifier of the column. |
int GetColumnIndex | ( | Common::FID | fid | ) | const [virtual] |
Gets an index of a column.
[in] | fid | - identifier of the column. |
int GetVisibleColumnIndex | ( | Common::FID | fid | ) | const [virtual] |
Gets an index of a visible column. (in range of visible columns).
[in] | fid | - identifier of the column. |
CColumn * GetFirstColumn | ( | ) | const [virtual] |
Gets the first column.
CColumn * GetFirstVisibleColumn | ( | ) | const [virtual] |
Gets the first visible column.
CColumn * GetLastColumn | ( | ) | const [virtual] |
Gets the last column.
CColumn * GetLastVisibleColumn | ( | ) | const [virtual] |
Gets the last visible column.
Gets a column of the header located within the given coordinates.
[in] | grid | The grid, which holds the header. |
[in] | point | the coordinates counted in the client's area of the grid. |
CRect GetVirtualRect | ( | const CGrid & | grid, | |
Common::FID | fid | |||
) | const [virtual] |
Gets virtual coordinates of the column with the specified identifier.
[in] | grid | The grid, which holds the header. |
[in] | fid | - identifier of the column. |
CRect GetVisibleRect | ( | const CGrid & | grid, | |
Common::FID | fid | |||
) | const [virtual] |
Gets visible coordinates of the column with the specified identifier.
[in] | grid | The grid, which holds the header. |
[in] | fid | - identifier of the column. |
int GetHeaderHeight | ( | ) | const [virtual] |
Gets a height of the header.
void SetHeaderHeight | ( | int | height | ) | [virtual] |
Sets a new height of the header.
The function can raise CHeader::HeaderHeightChanged notification.
[in] | height | New height of the header |
int GetFixedColumnWidth | ( | ) | const [virtual] |
Gets the width occupied by all fixed columns.
int GetScrollableColumnWidth | ( | ) | const [virtual] |
Gets the width occupied by all scrollable columns.
void SetNavigationColumn | ( | int | column | ) | [virtual] |
Sets a new navigation column.
[in] | column | New navigation column |
int GetNavigationColumn | ( | ) | const [virtual] |
Gets a current navigation column.
const CColumn * GetHierarchicalColumn | ( | ) | const [virtual] |
Indicates the current hierarchical column.
bool SetHierarchicalColumn | ( | Common::FID | fid | ) | [virtual] |
Sets a new hierarchical column.
void AllowSort | ( | bool | enable | ) | [virtual] |
Sort functions.
Allows or forbids sorting in the grid.
[in] | enable | Allows sorting in the grid. True - sorting is allowed, false - forbidden. |
bool CanSort | ( | ) | const [virtual] |
Returns the value indicating if CGrid can perform lines sorting or not.
void AllowMultiSort | ( | bool | enable | ) | [virtual] |
Allows or forbids multiple sorting in the grid.
[in] | enable | Allows multiple sorting in the grid. True - multiple sorting is allowed, false - forbidden. |
bool CanMultiSort | ( | ) | const [virtual] |
Returns the value indicating if CGrid can perform lines multiple sorting or not.
void SetSort | ( | int | level, | |
GUI::CSortInfo | sortInfo | |||
) | [virtual] |
Sets or modifies sorting for a specified level.
If CSortInfo::SetFid() returns the value equal to Common::fieldNotSpecified, then sorting is disabled on a given level. The function can raise CHeader::SortChanged notification.
[in] | level | zero-based sorting level. |
[in] | sortInfo | Sorting related information (field identifier, direction, ...) |
GUI::CSortInfo GetSort | ( | int | level | ) | const [virtual] |
Gets sorting related information for a given level.
[in] | level | zero-based sorting level. |
int GetSortLevels | ( | ) | const [virtual] |
Retrieves a count of sorting levels.
void ResetSort | ( | ) | [virtual] |
Resets a sort.
The function can raise CHeader::SortChanged notification.
CFont * SetFont | ( | CFont * | font | ) | [virtual] |
Sets a new font.
The function can raise CHeader::FontChanged notification.
[in] | font | New font |
CFont * GetFont | ( | ) | const [virtual] |
Gets a current font.
CImageList * SetImageList | ( | CImageList * | imageList | ) | [virtual] |
Sets a new images list to show icons in header columns.
[in] | imageList | New images list |
CImageList * GetImageList | ( | ) | const [virtual] |
Gets a current images list used to show icons in the header columns.
void Subscribe | ( | INotify * | callBack | ) |
Subscribes for events.
[in] | callBack | Callback interface to be called when an event is raised. |
void Unsubscribe | ( | INotify * | callBack | ) |
Unsubscribes from events.
[in] | callBack | Callback interface to be unsubscribed from events receiving. |
void Serialize | ( | CArchive & | ar | ) | [virtual] |
Serializes or deserializes data to/from the archive.
[in] | ar | Archive to store or restore the header's data. |
int GetSerializeVersion | ( | ) | [static] |
Current serialization version.
bool AutoDelete | ( | ) | const [virtual] |
IAutoDelete implementation. Returns the value, passed in the constructor.
Implements IAutoDelete.
Copyright Dapfor 2007-2009 | Generated on Wed Jul 7 03:24:43 2010 for MFCGrid by 1.5.5 |