VCF::Item Class Reference
The Item class can be used represent a single element in a model. More...
#include <vcf/ApplicationKit/Item.h>
Inheritance diagram for VCF::Item:

Public Types | |
| enum | ItemDisplayState { idsNone = 0x0000, idsChecked = 0x0005, idsUnChecked = 0x0006, idsRadioUnpressed = 0x0007, idsRadioPressed = 0x0008, idsCanPaint = 0x0010 } |
| these are a general set of enumeration masks that can be used to describe the items state above and beyond whether the item is selected More... | |
Public Member Functions | |
| Item () | |
| virtual | ~Item () |
| void | addItemPaintHandler (EventHandler *handler) |
| void | addItemChangedHandler (EventHandler *handler) |
| void | addItemSelectedHandler (EventHandler *handler) |
| void | addItemAddedHandler (EventHandler *handler) |
| void | addItemDeletedHandler (EventHandler *handler) |
| void | removeItemPaintHandler (EventHandler *handler) |
| void | removeItemChangedHandler (EventHandler *handler) |
| void | removeItemSelectedHandler (EventHandler *handler) |
| void | removeItemAddedHandler (EventHandler *handler) |
| void | removeItemDeletedHandler (EventHandler *handler) |
| virtual bool | containsPoint (Point *pt)=0 |
| This is called to determine if a given point is within the bounds of the item. | |
| virtual Rect * | getBounds ()=0 |
| returns the Bounds for the Item or NULL if not applicable. | |
| virtual void | setBounds (Rect *bounds)=0 |
| virtual int32 | getStateImageIndex ()=0 |
| This image index represents the state of an particular item separate from whether or not it is selected. | |
| virtual void | setStateImageIndex (const int32 &index)=0 |
| virtual uint32 | getIndex ()=0 |
| Returns the index of the item within it's model. | |
| virtual int32 | getImageIndex ()=0 |
| virtual void | setImageIndex (const int32 &imageIndex)=0 |
| virtual void | setIndex (const uint32 &index)=0 |
| virtual void * | getData ()=0 |
| Returns some application defined data. | |
| virtual void | setData (void *data)=0 |
| Sets the application defined data. | |
| virtual bool | canPaint ()=0 |
| indicates whether the item can paint itself. | |
| virtual void | paint (GraphicsContext *context, Rect *paintRect)=0 |
| virtual bool | isSelected ()=0 |
| virtual void | setSelected (const bool &selected)=0 |
| int32 | getState () |
| Represents the current state of the item that is entirely item specific as well as specific to the control that is hosting the item(s). | |
| virtual void | setState (const int32 &state) |
| Sets the state for the item. | |
| Model * | getModel () |
| Returns the model that this item belongs to. | |
| virtual void | setModel (Model *model) |
| Sets the model that this item is a part of. | |
| Control * | getControl () |
| All items may have a control that "owns" them. | |
| virtual void | setControl (Control *control) |
| Sets the owning control for this item. | |
Public Attributes | |
| VCF::Delegate | ItemPaint |
| VCF::Delegate | ItemChanged |
| VCF::Delegate | ItemSelected |
| VCF::Delegate | ItemAdded |
| VCF::Delegate | ItemDeleted |
Protected Attributes | |
| int32 | itemState_ |
| Model * | model_ |
| Control * | owningControl_ |
Detailed Description
The Item class can be used represent a single element in a model.It's useful because as a component it gets all the automatic persistance abilities of a component and the ability to easily edit it at design time through a visual form editor (like the VCF Builder).
The Item class has a number of virtual methods that must be implemented, but the exact methods of implementation may vary widely. For example it possible that in order to calculate the item's index hte item may simply carry around a member variable that stores the index. An alternate approach would be to query the model the item is attached to and ask the model for the item's index position.
Member Enumeration Documentation
|
|
these are a general set of enumeration masks that can be used to describe the items state above and beyond whether the item is selected
|
Constructor & Destructor Documentation
|
|
|
|
|
|
Member Function Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
indicates whether the item can paint itself. In general this is often false, but when true, the control that contains the item should call the item's paint() method whenever the item needs repainting. Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
This is called to determine if a given point is within the bounds of the item. The bounds may be slightly different than what is returned by getBounds(). For example, an item may not support getBounds(), but may have a non-rectangular region and may implement containsPoint() accordingly. Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
returns the Bounds for the Item or NULL if not applicable.
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
All items may have a control that "owns" them. so in a ListControl, the ListItem::getControl() would return the ListControl the items were part of. The control for item must match with the view control of the item's model. Reimplemented in VCF::DefaultTabPage. |
|
|
Returns some application defined data. This can be anything you want, hence the void* storage. Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Returns the index of the item within it's model.
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Returns the model that this item belongs to.
|
|
|
Represents the current state of the item that is entirely item specific as well as specific to the control that is hosting the item(s). Some controls will completely ignore this value. |
|
|
This image index represents the state of an particular item separate from whether or not it is selected. Typically it is offset horizontally from the regular image that getImageIndex() represents. This image is frequently used to represent check marks for things like tree or list controls. Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, VCF::TableCellItem, and VCF::ToolbarItem. |
|
||||||||||||
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Sets the owning control for this item. It's made virtual so that subclasses can override the behaviour if they need to. Reimplemented in VCF::DefaultTabPage, and VCF::DefaultTreeItem. |
|
|
Sets the application defined data.
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
|
|
Sets the model that this item is a part of. Subclasses may need or want to customize this. Reimplemented in VCF::DefaultTableCellItem, and VCF::DefaultTreeItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, VCF::TableCellItem, and VCF::ToolbarItem. |
|
|
Sets the state for the item. This is made virtual to allow subclasses to customize the behaviour. Reimplemented in VCF::ToolbarItem. |
|
|
Implemented in VCF::DefaultColumnItem, VCF::DefaultListItem, VCF::DefaultMenuItem, VCF::DefaultTableCellItem, VCF::DefaultTabPage, VCF::DefaultTreeItem, and VCF::ToolbarItem. |
Member Data Documentation
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The documentation for this class was generated from the following file:
- vcf/ApplicationKit/Item.h
