[Classes] [Prev] [Next] [Methods]

CTableEvent

Methods Index

Heritage
Description
Usage
Enums
Public Data Members
Protected Data Members
Public Methods
Constructor Methods
Other Methods

CTableEvent


Heritage

Superclass: None

Subclasses: None


Description

CTableEvent provides a class of events sent by a CTable through its DoCommand mechanism. Each event on the table is a two-phased process. First, a permission event is sent before the action occurs. Any object in the chain of command can deny the action by calling Deny() on the event object. If the event is not denied, the table performs the action and sends the event again: this time as a notification. By default, CTable skips the permission event. You can control the event style by calling the CTable method SetEventStyle() with one of the parameters CTable::EventNone, CTable::EventPermission, CTable::EventNotify, or CTable::EventBoth.


Usage

You respond to table events from within a DoCommand() method up the chain of command from the table. For example, to take notice of a cell focus change:

	void CTableWin::DoCommand( long theCommand, void* theData ) 
{
// Is this a tree event?
if( theCommand == TableEventCmd )
{
CTableEvent* anEvent = (CTableEvent*)theData;

// Ignore any permission events
if( !anEvent->IsPermissionEvent() )
{
switch( anEvent->GetType() )
{
case CTableEvent::FocusIn:
cout << "Focus to cell (" <<
anEvent->CellEvent.itsCell->H() << ", " <<
anEvent->CellEvent.itsCell->V() << ")" << endl;
break;
}
}
}
else CWindow::DoCommand(theCommand, theData);
}

Enums

Type

DeleteRow,
DeleteColumn,
InsertRow,
InsertColumn,
SizeRow,
SizeColumn,
FocusOut, Focus removed from cell
FocusIn, Focus transferred to cell
Select, Change in selected rows/columns/cells
Key, Before processing a key event in CTable::DoKey
Origin Origin changed to a new cell


Public Data Members

The associated public structure (struct) for each event type:

DeleteInsertEvent (DeleteRow, DeleteColumn, InsertRow, InsertColumn)

long itsFirst; First affected
long itsCount; Number affected

SizeEvent (SizeRow, SizeColumn)

long itsRowColumn; Applicable row or column
UNITS itsSize; New size

CellEvent; (FocusOut, FocusIn, Origin)

const CCell* itsCell; Applicable cell coordinates

SelectEvent (Select)

BOOLEAN itsSelect; TRUE if select, FALSE if deselect
const CRegion* itsProposedRegion; New selection region

KeyEvent (Key)

const CCell* itsCell; Cell to receive key event
const CKey* itsKey; The key


Protected Data Members

Type itsType; The event type
CTable* itsTable; The event source
BOOLEAN itsPermitted; TRUE if the event has not been denied
BOOLEAN itsNotificationEvent; TRUE if the event is a notification event


Public Methods

Constructor Methods

Note: These constructors are used only by the table. They are not for public use.

CTableEvent(CTable* theTable, 
Type theType,
BOOLEAN theNotification = FALSE);
CTableEvent(CTable* theTable,
Type theType,
long theFirst,
long theCount,
BOOLEAN theNotification = FALSE);
CTableEvent(
CTable* theTable,
Type theType,
long theRowColumn,
UNITS theSize,
BOOLEAN theNotification = FALSE);
CTableEvent(
CTable* theTable,
Type theType,
const CCell* theCell,
BOOLEAN theNotification = FALSE);
CTableEvent(
CTable* theTable,
Type theType,
const CCell* theCell,
const CKey* theKey,
BOOLEAN theNotification = FALSE);
CTableEvent(
CTable* theTable,
Type theType,
const CRegion* theRegion,
BOOLEAN theSelect,
BOOLEAN theNotification = FALSE);

Other Methods

CTable* GetTable();
Type GetType() const;
BOOLEAN IsPermissionEvent() const;
void Deny();
BOOLEAN IsDenied() const;


[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.