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:
List of all members.
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's possible that in order to calculate the item's index the 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.
Constructor & Destructor Documentation
| VCF::Item::Item |
( |
|
) |
[inline] |
|
| virtual VCF::Item::~Item |
( |
|
) |
[inline, virtual] |
|
Member Function Documentation
| virtual bool VCF::Item::canPaint |
( |
|
) |
const [inline, virtual] |
|
|
|
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.
Reimplemented in VCF::DefaultMenuItem, and VCF::DefaultTableCellItem. |
| virtual bool VCF::Item::containsPoint |
( |
Point * |
pt |
) |
const [inline, virtual] |
|
|
|
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. |
| virtual Rect VCF::Item::getBounds |
( |
|
) |
[inline, virtual] |
|
|
|
returns the Bounds for the Item or NULL if not applicable.
|
| Control* VCF::Item::getControl |
( |
|
) |
const [inline] |
|
|
|
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. |
| void* VCF::Item::getData |
( |
|
) |
const [inline] |
|
|
|
Returns some application defined data.
This can be anything you want, hence the void* storage. |
| uint32 VCF::Item::getDisplayState |
( |
|
) |
const [inline] |
|
|
|
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. |
| Font * VCF::Item::getFont |
( |
|
) |
[inline] |
|
| virtual int32 VCF::Item::getImageIndex |
( |
|
) |
const [inline, virtual] |
|
| Model* VCF::Item::getModel |
( |
|
) |
const [inline] |
|
|
|
Returns the model that this item belongs to.
|
| virtual int32 VCF::Item::getStateImageIndex |
( |
|
) |
const [inline, virtual] |
|
|
|
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.
Reimplemented in VCF::TreeItem. |
| bool VCF::Item::isChecked |
( |
|
) |
const [inline] |
|
| bool VCF::Item::isFontDefault |
( |
|
) |
[inline] |
|
|
|
Indicates that the default font for this item should be used.
It's also an indicator that the font is NULL and no attempts at modifications have been attempted. |
| bool VCF::Item::isRadioPressed |
( |
|
) |
const [inline] |
|
| bool VCF::Item::isRadioUnpressed |
( |
|
) |
const [inline] |
|
| bool VCF::Item::isSelected |
( |
|
) |
const [inline] |
|
| bool VCF::Item::isUnchecked |
( |
|
) |
const [inline] |
|
| virtual void VCF::Item::paint |
( |
GraphicsContext * |
context, |
|
|
Rect * |
paintRect |
|
) |
[inline, virtual] |
|
| virtual void VCF::Item::setBounds |
( |
const Rect & |
bounds |
) |
[inline, virtual] |
|
| void VCF::Item::setChecked |
( |
const bool & |
val |
) |
[inline] |
|
| virtual void VCF::Item::setControl |
( |
Control * |
control |
) |
[inline, virtual] |
|
|
|
Sets the owning control for this item.
It's made virtual so that subclasses can override the behaviour if they need to. |
| void VCF::Item::setData |
( |
void * |
data |
) |
[inline] |
|
|
|
Sets the application defined data.
|
| virtual void VCF::Item::setDisplayState |
( |
const uint32 & |
state |
) |
[inline, virtual] |
|
|
|
Sets the state for the item.
This is made virtual to allow subclasses to customize the behaviour. |
| void VCF::Item::setFont |
( |
Font * |
val |
) |
[inline] |
|
| virtual void VCF::Item::setImageIndex |
( |
const int32 & |
imageIndex |
) |
[inline, virtual] |
|
| void VCF::Item::setKeyValue |
( |
const VariantData & |
val |
) |
[inline] |
|
| virtual void VCF::Item::setModel |
( |
Model * |
model |
) |
[inline, virtual] |
|
|
|
Sets the model that this item is a part of.
Subclasses may need or want to customize this. |
| void VCF::Item::setRadioPressed |
( |
const bool & |
val |
) |
[inline] |
|
| virtual void VCF::Item::setSelected |
( |
const bool & |
selected |
) |
[inline, virtual] |
|
| virtual void VCF::Item::setStateImageIndex |
( |
const int32 & |
index |
) |
[inline, virtual] |
|
| void VCF::Item::stateChanged |
( |
|
) |
[inline, protected] |
|
Member Data Documentation
The documentation for this class was generated from the following file: