Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::ListBoxControl Class Reference

#include <vcf/ApplicationKit/ListBoxControl.h>

Inheritance diagram for VCF::ListBoxControl:

VCF::CustomControl VCF::Control VCF::Component VCF::AbstractView VCF::ObjectWithEvents VCF::View VCF::Object List of all members.

Public Types

enum  ListBoxControlEvents { lbeItemStateChangeRequested = CUSTOM_EVENT_TYPES + ITEM_CONST + 100 }

Public Member Functions

 ListBoxControl ()
 ListBoxControl (ListModel *listModel)
virtual ~ListBoxControl ()
void init ()
 This is going to be removed from the bext release.
ListModelgetListModel ()
void setListModel (ListModel *model)
virtual void rangeSelect (const bool &isSelected, ListItem *first, ListItem *last)
void onListModelContentsChanged (ListModelEvent *event)
void onItemAdded (ListModelEvent *event)
void onItemDeleted (ListModelEvent *event)
virtual void paint (GraphicsContext *ctx)
 Paints the control.
virtual void mouseDown (MouseEvent *event)
 Called when one (or more) of the mouse buttons are held down.
virtual void mouseMove (MouseEvent *event)
 Called when the mouse moves over the control.
virtual void mouseUp (MouseEvent *event)
 Called when one (or more) of the mouse buttons are released.
virtual void mouseClick (MouseEvent *event)
 Called when one or mouse buttons are held down and immediately released ( a "mouse click" ).
virtual void mouseDblClick (MouseEvent *event)
 Called when one or mouse buttons are held down and immediately released ( a "mouse double click" ) twice, within some specific time period, as determined on the windowing system.
virtual void keyDown (KeyboardEvent *event)
 called when the user presses the key down
virtual void keyUp (KeyboardEvent *event)
 called when the user releases the key
virtual void keyPressed (KeyboardEvent *event)
 called when the user simply presses the key and represents a full key cycle having occurred, in other words the key has been pressed down and then released
double getDefaultItemHeight ()
void setDefaultItemHeight (const double &defaultItemHeight)
bool getAllowsMultiSelect ()
void setAllowsMultiSelect (const bool &allowsMultiSelect)
 Enables/disables the ability to have more than 1 item selected at any time.
bool getAllowsExtendedSelect ()
void setAllowsExtendedSelect (const bool &allowsExtendedSelect)
 Enables/disables the ability to have extended selection functionality, by handling Ctrl + mouseDown and Shift + mouseDown.
Enumerator< ListItem * > * getSelectedItems ()
ListItemgetSelectedItem ()
void setSelectedItem (ListItem *selectedItem)
void setLeftGutter (const double &leftgutter)
 Sets the spacing between the innermost-edge of the left border and the beginning of the Item captions when scrolled all the way to the left.
double getLeftGutter ()
void setRightGutter (const double &rightgutter)
 Sets the spacing between the innermost-edge of the right border and the end of the longest Item caption when scrolled all the way to the right.
double getRightGutter ()
void setTextBounded (const bool &istextbounded)
void deselectAllItems ()
void eraseFromSelectedItems (ListItem *item)
virtual void setScrollable (Scrollable *scrollable)
 sets the scrollable for the listbox control, and sets it for a discrete scrolling, item by item.
ImageListgetImageList ()
ImageListgetStateImageList ()
void setImageList (ImageList *imageList)
void setStateImageList (ImageList *stateImageList)
bool stateHitTest (Point *point, ListItem *item)

Public Attributes

VCF::Delegate SelectionChanged
VCF::Delegate ItemStateChangeRequested

Protected Member Functions

virtual void destroy ()
 called by the free() method.
void paintSelectionRect (GraphicsContext *ctx, Rect *rect, ListItem *item)
ListItemfindSingleSelectedItem (Point *pt)
void selectionChanged (ListItem *item)
void paintItem (GraphicsContext *ctx, Rect &itemRect, double currentTop, Color *selectedTextColor, const Rect &bounds, double scrollWidth, double offsetX, ListItem *item)
void paintItemState (GraphicsContext *ctx, Rect &itemRect, ListItem *item)
void paintItemImage (GraphicsContext *ctx, Rect &itemRect, ListItem *item)
Rect getStateRect (ListItem *item)

Protected Attributes

ListModellistModel_
double defaultItemHeight_
double currentMaxWidth_
double currentMaxHeight_
double leftGutter_
double rightGutter_
bool textBounded_
bool allowsMultiSelect_
bool allowsExtendedSelect_
ListItemsingleSelectedItem_
std::vector< ListItem * > selectedItems_
EnumeratorContainer< std::vector<
ListItem * >, ListItem * > 
selectedItemsContainer_
ImageListimageList_
ImageListstateImageList_
double stateItemIndent_

Member Enumeration Documentation

enum VCF::ListBoxControl::ListBoxControlEvents
 

Enumerator:
lbeItemStateChangeRequested 


Constructor & Destructor Documentation

VCF::ListBoxControl::ListBoxControl  ) 
 

VCF::ListBoxControl::ListBoxControl ListModel listModel  ) 
 

virtual VCF::ListBoxControl::~ListBoxControl  )  [virtual]
 


Member Function Documentation

void VCF::ListBoxControl::deselectAllItems  ) 
 

virtual void VCF::ListBoxControl::destroy  )  [protected, virtual]
 

called by the free() method.

Should be overriden and any clean up code performed here

Reimplemented from VCF::Control.

void VCF::ListBoxControl::eraseFromSelectedItems ListItem item  ) 
 

ListItem* VCF::ListBoxControl::findSingleSelectedItem Point pt  )  [protected]
 

bool VCF::ListBoxControl::getAllowsExtendedSelect  )  [inline]
 

bool VCF::ListBoxControl::getAllowsMultiSelect  )  [inline]
 

double VCF::ListBoxControl::getDefaultItemHeight  )  [inline]
 

ImageList* VCF::ListBoxControl::getImageList  )  [inline]
 

double VCF::ListBoxControl::getLeftGutter  )  [inline]
 

ListModel* VCF::ListBoxControl::getListModel  ) 
 

double VCF::ListBoxControl::getRightGutter  )  [inline]
 

ListItem* VCF::ListBoxControl::getSelectedItem  )  [inline]
 

Enumerator<ListItem*>* VCF::ListBoxControl::getSelectedItems  ) 
 

ImageList* VCF::ListBoxControl::getStateImageList  )  [inline]
 

Rect VCF::ListBoxControl::getStateRect ListItem item  )  [protected]
 

void VCF::ListBoxControl::init  ) 
 

This is going to be removed from the bext release.

Deprecated:

Reimplemented from VCF::CustomControl.

virtual void VCF::ListBoxControl::keyDown KeyboardEvent event  )  [virtual]
 

called when the user presses the key down

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::keyPressed KeyboardEvent event  )  [virtual]
 

called when the user simply presses the key and represents a full key cycle having occurred, in other words the key has been pressed down and then released

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::keyUp KeyboardEvent event  )  [virtual]
 

called when the user releases the key

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::mouseClick MouseEvent event  )  [virtual]
 

Called when one or mouse buttons are held down and immediately released ( a "mouse click" ).

override this to provide specific behaviours when a mouse click occurs

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::mouseDblClick MouseEvent event  )  [virtual]
 

Called when one or mouse buttons are held down and immediately released ( a "mouse double click" ) twice, within some specific time period, as determined on the windowing system.

override this to provide specific behaviours when a mouse double click occurs

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::mouseDown MouseEvent event  )  [virtual]
 

Called when one (or more) of the mouse buttons are held down.

override this to provide specific behaviours when the mouse buttons are held down

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::mouseMove MouseEvent event  )  [virtual]
 

Called when the mouse moves over the control.

override this to provide specific behaviours when the mouse moves over the control.

Reimplemented from VCF::Control.

virtual void VCF::ListBoxControl::mouseUp MouseEvent event  )  [virtual]
 

Called when one (or more) of the mouse buttons are released.

override this to provide specific behaviours when the mouse buttons are released.

Reimplemented from VCF::Control.

void VCF::ListBoxControl::onItemAdded ListModelEvent event  ) 
 

void VCF::ListBoxControl::onItemDeleted ListModelEvent event  ) 
 

void VCF::ListBoxControl::onListModelContentsChanged ListModelEvent event  ) 
 

virtual void VCF::ListBoxControl::paint GraphicsContext ctx  )  [virtual]
 

Paints the control.

Called by the underlying windowing system whenever the control needs to be painted. Note that in some cases the GraphicsContext passed in to this method may not be the same pointer as the GraphicsContext that the control holds itself. During the paint() method you should only use the context value for all your drawing and not the one returned in getContext(). The value returned by getContext() should be used for drawing that takes place outside of the paint() method.

If the control allows paint notification, then the framework will fire an event to the BeforeControlPainted delegate prior to calling the control's paint() method. After the paint() method has returned, if the control allows paint notification, the framework will fire an event to the AfterControlPainted delegate. This allows outside observers to take part in the paint cycle, but beware that this does come at a bit of a cost, so use this feature sparingly.

Note: This should NEVER be called by programmers using the VCF, it will be called for you during the course of your applications native event loop, and is only here for providing custom drawing routines for controls. In other words: you implement it, you never call it yourself.

See also:
getAllowPaintNotification

Reimplemented from VCF::CustomControl.

void VCF::ListBoxControl::paintItem GraphicsContext ctx,
Rect itemRect,
double  currentTop,
Color selectedTextColor,
const Rect bounds,
double  scrollWidth,
double  offsetX,
ListItem item
[protected]
 

void VCF::ListBoxControl::paintItemImage GraphicsContext ctx,
Rect itemRect,
ListItem item
[protected]
 

void VCF::ListBoxControl::paintItemState GraphicsContext ctx,
Rect itemRect,
ListItem item
[protected]
 

void VCF::ListBoxControl::paintSelectionRect GraphicsContext ctx,
Rect rect,
ListItem item
[protected]
 

virtual void VCF::ListBoxControl::rangeSelect const bool &  isSelected,
ListItem first,
ListItem last
[virtual]
 

void VCF::ListBoxControl::selectionChanged ListItem item  )  [protected]
 

void VCF::ListBoxControl::setAllowsExtendedSelect const bool &  allowsExtendedSelect  ) 
 

Enables/disables the ability to have extended selection functionality, by handling Ctrl + mouseDown and Shift + mouseDown.

Item pointers are automatically added and removed from the selectedItems_ container as they are selected and deselected, respectively.

If you set allowsExtendedSelect to true, allowsMultiSelect_ is automatically set to true for you. Therefore, don't forget to set allowsMultiSelect to false if you want to switch from extended selection behaviour to single selection behavior.

void VCF::ListBoxControl::setAllowsMultiSelect const bool &  allowsMultiSelect  ) 
 

Enables/disables the ability to have more than 1 item selected at any time.

Item pointers are automatically added and removed from the selectedItems_ container as they are selected and deselected, respectively.

void VCF::ListBoxControl::setDefaultItemHeight const double &  defaultItemHeight  ) 
 

void VCF::ListBoxControl::setImageList ImageList imageList  ) 
 

void VCF::ListBoxControl::setLeftGutter const double &  leftgutter  ) 
 

Sets the spacing between the innermost-edge of the left border and the beginning of the Item captions when scrolled all the way to the left.

Default value is currently 2.0

void VCF::ListBoxControl::setListModel ListModel model  ) 
 

void VCF::ListBoxControl::setRightGutter const double &  rightgutter  ) 
 

Sets the spacing between the innermost-edge of the right border and the end of the longest Item caption when scrolled all the way to the right.

Default value is currently 2.0

virtual void VCF::ListBoxControl::setScrollable Scrollable scrollable  )  [virtual]
 

sets the scrollable for the listbox control, and sets it for a discrete scrolling, item by item.

Reimplemented from VCF::Control.

void VCF::ListBoxControl::setSelectedItem ListItem selectedItem  ) 
 

void VCF::ListBoxControl::setStateImageList ImageList stateImageList  ) 
 

void VCF::ListBoxControl::setTextBounded const bool &  istextbounded  ) 
 

bool VCF::ListBoxControl::stateHitTest Point point,
ListItem item
 


Member Data Documentation

bool VCF::ListBoxControl::allowsExtendedSelect_ [protected]
 

bool VCF::ListBoxControl::allowsMultiSelect_ [protected]
 

double VCF::ListBoxControl::currentMaxHeight_ [protected]
 

double VCF::ListBoxControl::currentMaxWidth_ [protected]
 

double VCF::ListBoxControl::defaultItemHeight_ [protected]
 

ImageList* VCF::ListBoxControl::imageList_ [protected]
 

VCF::Delegate VCF::ListBoxControl::ItemStateChangeRequested
 

double VCF::ListBoxControl::leftGutter_ [protected]
 

ListModel* VCF::ListBoxControl::listModel_ [protected]
 

double VCF::ListBoxControl::rightGutter_ [protected]
 

std::vector<ListItem*> VCF::ListBoxControl::selectedItems_ [protected]
 

EnumeratorContainer<std::vector<ListItem*>,ListItem*> VCF::ListBoxControl::selectedItemsContainer_ [protected]
 

VCF::Delegate VCF::ListBoxControl::SelectionChanged
 

ListItem* VCF::ListBoxControl::singleSelectedItem_ [protected]
 

ImageList* VCF::ListBoxControl::stateImageList_ [protected]
 

double VCF::ListBoxControl::stateItemIndent_ [protected]
 

bool VCF::ListBoxControl::textBounded_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information