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

VCF::TreeListControl Class Reference

#include <TreeListControl.h>

Inheritance diagram for VCF::TreeListControl:

VCF::CustomControl VCF::DelegatedContainer< TreeListControl > VCF::Control VCF::Component VCF::AbstractView VCF::ObjectWithEvents VCF::View VCF::Object List of all members.

Public Types

enum  TreeListControlEvents { ITEM_STATECHANGE_REQUESTED = CUSTOM_EVENT_TYPES + ITEM_CONST + 10 }
enum  TreeDisplayOptions {
  tdoNone = 0, tdoShowHierarchyLines = 1, tdoShowRowLines = 2, tdoShowColumnLines = 4,
  tdoShowFullRowSelection = 8, tdoShowColumnHeader = 16
}

Public Member Functions

 TreeListControl ()
virtual ~TreeListControl ()
void init ()
 This is going to be removed from the bext release.
void setTreeModel (TreeModel *model)
TreeModelgetTreeModel ()
ColumnModelgetColumnModel ()
double getColumnWidth (const uint32 &index)
void setColumnWidth (const uint32 &index, const double &width)
virtual void paint (GraphicsContext *context)
 Paints the control.
void addItem (TreeItem *item, TreeItem *parent=NULL)
TreeItemaddItem (TreeItem *parent=NULL, const String &caption="", const uint32 imageIndex=0)
uint32 getItemIndent ()
void setItemIndent (const uint32 &itemIndent)
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 *e)
 called when the user presses the key down
void setImageList (ImageList *imageList)
void setStateImageList (ImageList *imageList)
ImageListgetImageList ()
ImageListgetStateImageList ()
int32 getDisplayOptions ()
void setDisplayOptions (const int32 &displayOptions)
TreeItemisPtOverItem (Point *point)
void setSelectedItem (TreeItem *item, const bool &isSelected)
TreeItemgetSelectedItem ()
bool getAllowLabelEditing ()
void setAllowLabelEditing (const bool &allowLabelEditing)
HeaderControlgetHeader ()
Enumerator< TreeItem * > * getSelectedItems ()
bool getAllowsMultipleSelection ()
void setAllowsMultipleSelection (const bool &multiSelect)
TreeItemhitTest (Point *pt, TreeItem *itemToTest)
TreeItemhitTest (Point *pt)
 searches all the items for a match for the point
bool stateHitTest (Point *pt, TreeItem *itemToTest)
void setDefaultItemHeight (const double &defaultItemHeight)
double getDefaultItemHeight ()
void showHierarchyLines (const bool &show)
void showRowLines (const bool &show)
void showColumnLines (const bool &show)
void showFullRowSelection (const bool &show)
void showColumnHeader (const bool &show)
void clearSelectedItems ()
TreeItemgetNextItem (TreeItem *item, bool skipChildren=false)
TreeItemgetPrevItem (TreeItem *item)
int hitTestForEditColumn (Point *pt)
Rect getBoundsForEdit (TreeItem *item, int column)
void scrollToNextItem (TreeItem *item, bool scrollDown)

Public Attributes

VCF::Delegate ItemSelected
VCF::Delegate ItemStateChangeRequested
VCF::Delegate ItemExpanded

Protected Member Functions

void onModelChanged (TreeModelEvent *event)
void onModelEmptied (Event *event)
bool singleSelectionChange (MouseEvent *event)
bool multiSelectionChange (MouseEvent *event)
virtual void paintItem (TreeItem *item, GraphicsContext *context, Rect *paintRect)
virtual void paintSubItem (TreeItem *item, GraphicsContext *context, const uint32 &subItemIndex, Rect *paintRect)
virtual void paintExpander (TreeItem *item, GraphicsContext *context, Rect *paintRect)
virtual void paintItemState (TreeItem *item, GraphicsContext *context, Rect *paintRect, const int32 &currentIndent)
virtual void paintItemImage (TreeItem *item, GraphicsContext *context, Rect *paintRect, const int32 &currentIndent)
void onColumnWidthChanged (ItemEvent *event)
bool listVisibleItems (std::vector< TreeItem * > &items, TreeItem *itemToSearch, const double &top, const double &bottom)
bool listSelectedItems (std::vector< TreeItem * > &items, TreeItem *firstSelectedItem, TreeItem *lastSelectedItem, TreeItem *nextItem, bool &startFound)
void populateVisiblityList (std::vector< TreeItem * > &items, Rect *bounds=NULL)
double getCurrentIndent (TreeItem *item)
Rect getStateRect (TreeItem *item, const double &indent)
Rect getExpanderRect (TreeItem *item)
bool hitTest (Rect *rect, TreeItem *item, std::vector< TreeItem * > &hitTestList)
void recalcScrollable ()
void onEditingControlKeyPressed (KeyboardEvent *event)
void onEditorFocusLost (Event *e)
void postFinishedEditing (Event *e)
void cancelEditing ()
void finishEditing (bool applyEdit=true)
void editItem (TreeItem *item, Point *point)
virtual void finishEditingItem (TreeItem *item, Control *editControl)
 this is a no-op - sub classes need to derive this
virtual ControlcreateEditor (TreeItem *item, int column)
 this is a no-op - sub classes need to derive this
virtual bool finishEditingFromFocusLoss (Control *lostFocusCtrl, Control *currentFocusedCtrl)
 virtual function to control whether or not to allow an edit to finish due to focus loss.

Protected Attributes

HeaderControlheader_
ImageListimageList_
ImageListstateImageList_
TreeModeltreeModel_
double itemHeight_
double columnHeight_
uint32 itemIndent_
int32 displayOptions_
bool allowLabelEditing_
bool allowMultipleSelection_
double visibleItemsHeight_
std::vector< TreeItem * > selectedItems_
EnumeratorContainer< std::vector<
TreeItem * >, TreeItem * > 
selectedItemContainer_
int32 stateItemIndent_
Color rowLineColor_
Color columnLineColor_
std::map< TreeItem *, double > hierarchyHeightMap_
std::vector< TreeItem * > visibleDisplayItems_
Rect dragSelectionRect_
Point dragPoint_
bool draggingSelectionRect_
std::vector< TreeItem * > draggingSelectedItems_
int currentEditColumn_
ControlcurrentEditingControl_

Member Enumeration Documentation

enum VCF::TreeListControl::TreeDisplayOptions
 

Enumerator:
tdoNone 
tdoShowHierarchyLines 
tdoShowRowLines 
tdoShowColumnLines 
tdoShowFullRowSelection 
tdoShowColumnHeader 

enum VCF::TreeListControl::TreeListControlEvents
 

Enumerator:
ITEM_STATECHANGE_REQUESTED 


Constructor & Destructor Documentation

VCF::TreeListControl::TreeListControl  ) 
 

virtual VCF::TreeListControl::~TreeListControl  )  [virtual]
 


Member Function Documentation

TreeItem* VCF::TreeListControl::addItem TreeItem parent = NULL,
const String caption = "",
const uint32  imageIndex = 0
 

void VCF::TreeListControl::addItem TreeItem item,
TreeItem parent = NULL
 

void VCF::TreeListControl::cancelEditing  )  [protected]
 

void VCF::TreeListControl::clearSelectedItems  ) 
 

virtual Control* VCF::TreeListControl::createEditor TreeItem item,
int  column
[inline, protected, virtual]
 

this is a no-op - sub classes need to derive this

void VCF::TreeListControl::editItem TreeItem item,
Point point
[protected]
 

void VCF::TreeListControl::finishEditing bool  applyEdit = true  )  [protected]
 

virtual bool VCF::TreeListControl::finishEditingFromFocusLoss Control lostFocusCtrl,
Control currentFocusedCtrl
[protected, virtual]
 

virtual function to control whether or not to allow an edit to finish due to focus loss.

Returns:
bool return true to enable the edit session to finish, otherwise return false.

virtual void VCF::TreeListControl::finishEditingItem TreeItem item,
Control editControl
[inline, protected, virtual]
 

this is a no-op - sub classes need to derive this

bool VCF::TreeListControl::getAllowLabelEditing  ) 
 

bool VCF::TreeListControl::getAllowsMultipleSelection  )  [inline]
 

Rect VCF::TreeListControl::getBoundsForEdit TreeItem item,
int  column
 

ColumnModel* VCF::TreeListControl::getColumnModel  ) 
 

double VCF::TreeListControl::getColumnWidth const uint32 index  ) 
 

double VCF::TreeListControl::getCurrentIndent TreeItem item  )  [protected]
 

double VCF::TreeListControl::getDefaultItemHeight  ) 
 

int32 VCF::TreeListControl::getDisplayOptions  ) 
 

Rect VCF::TreeListControl::getExpanderRect TreeItem item  )  [protected]
 

HeaderControl* VCF::TreeListControl::getHeader  )  [inline]
 

ImageList* VCF::TreeListControl::getImageList  ) 
 

uint32 VCF::TreeListControl::getItemIndent  )  [inline]
 

TreeItem* VCF::TreeListControl::getNextItem TreeItem item,
bool  skipChildren = false
 

TreeItem* VCF::TreeListControl::getPrevItem TreeItem item  ) 
 

TreeItem* VCF::TreeListControl::getSelectedItem  ) 
 

Enumerator<TreeItem*>* VCF::TreeListControl::getSelectedItems  ) 
 

ImageList* VCF::TreeListControl::getStateImageList  ) 
 

Rect VCF::TreeListControl::getStateRect TreeItem item,
const double &  indent
[protected]
 

TreeModel* VCF::TreeListControl::getTreeModel  ) 
 

bool VCF::TreeListControl::hitTest Rect rect,
TreeItem item,
std::vector< TreeItem * > &  hitTestList
[protected]
 

TreeItem* VCF::TreeListControl::hitTest Point pt  ) 
 

searches all the items for a match for the point

TreeItem* VCF::TreeListControl::hitTest Point pt,
TreeItem itemToTest
 

int VCF::TreeListControl::hitTestForEditColumn Point pt  ) 
 

void VCF::TreeListControl::init  ) 
 

This is going to be removed from the bext release.

Deprecated:

Reimplemented from VCF::CustomControl.

TreeItem* VCF::TreeListControl::isPtOverItem Point point  ) 
 

virtual void VCF::TreeListControl::keyDown KeyboardEvent e  )  [virtual]
 

called when the user presses the key down

Reimplemented from VCF::Control.

bool VCF::TreeListControl::listSelectedItems std::vector< TreeItem * > &  items,
TreeItem firstSelectedItem,
TreeItem lastSelectedItem,
TreeItem nextItem,
bool &  startFound
[protected]
 

bool VCF::TreeListControl::listVisibleItems std::vector< TreeItem * > &  items,
TreeItem itemToSearch,
const double &  top,
const double &  bottom
[protected]
 

virtual void VCF::TreeListControl::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::TreeListControl::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::TreeListControl::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::TreeListControl::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::TreeListControl::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.

bool VCF::TreeListControl::multiSelectionChange MouseEvent event  )  [protected]
 

void VCF::TreeListControl::onColumnWidthChanged ItemEvent event  )  [protected]
 

void VCF::TreeListControl::onEditingControlKeyPressed KeyboardEvent event  )  [protected]
 

void VCF::TreeListControl::onEditorFocusLost Event e  )  [protected]
 

void VCF::TreeListControl::onModelChanged TreeModelEvent event  )  [protected]
 

void VCF::TreeListControl::onModelEmptied Event event  )  [protected]
 

virtual void VCF::TreeListControl::paint GraphicsContext context  )  [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.

virtual void VCF::TreeListControl::paintExpander TreeItem item,
GraphicsContext context,
Rect paintRect
[protected, virtual]
 

virtual void VCF::TreeListControl::paintItem TreeItem item,
GraphicsContext context,
Rect paintRect
[protected, virtual]
 

virtual void VCF::TreeListControl::paintItemImage TreeItem item,
GraphicsContext context,
Rect paintRect,
const int32 currentIndent
[protected, virtual]
 

virtual void VCF::TreeListControl::paintItemState TreeItem item,
GraphicsContext context,
Rect paintRect,
const int32 currentIndent
[protected, virtual]
 

virtual void VCF::TreeListControl::paintSubItem TreeItem item,
GraphicsContext context,
const uint32 subItemIndex,
Rect paintRect
[protected, virtual]
 

void VCF::TreeListControl::populateVisiblityList std::vector< TreeItem * > &  items,
Rect bounds = NULL
[protected]
 

void VCF::TreeListControl::postFinishedEditing Event e  )  [protected]
 

void VCF::TreeListControl::recalcScrollable  )  [protected]
 

void VCF::TreeListControl::scrollToNextItem TreeItem item,
bool  scrollDown
 

void VCF::TreeListControl::setAllowLabelEditing const bool &  allowLabelEditing  ) 
 

void VCF::TreeListControl::setAllowsMultipleSelection const bool &  multiSelect  ) 
 

void VCF::TreeListControl::setColumnWidth const uint32 index,
const double &  width
 

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

void VCF::TreeListControl::setDisplayOptions const int32 displayOptions  ) 
 

void VCF::TreeListControl::setImageList ImageList imageList  ) 
 

void VCF::TreeListControl::setItemIndent const uint32 itemIndent  ) 
 

void VCF::TreeListControl::setSelectedItem TreeItem item,
const bool &  isSelected
 

void VCF::TreeListControl::setStateImageList ImageList imageList  ) 
 

void VCF::TreeListControl::setTreeModel TreeModel model  ) 
 

void VCF::TreeListControl::showColumnHeader const bool &  show  ) 
 

void VCF::TreeListControl::showColumnLines const bool &  show  ) 
 

void VCF::TreeListControl::showFullRowSelection const bool &  show  ) 
 

void VCF::TreeListControl::showHierarchyLines const bool &  show  ) 
 

void VCF::TreeListControl::showRowLines const bool &  show  ) 
 

bool VCF::TreeListControl::singleSelectionChange MouseEvent event  )  [protected]
 

bool VCF::TreeListControl::stateHitTest Point pt,
TreeItem itemToTest
 


Member Data Documentation

bool VCF::TreeListControl::allowLabelEditing_ [protected]
 

bool VCF::TreeListControl::allowMultipleSelection_ [protected]
 

double VCF::TreeListControl::columnHeight_ [protected]
 

Color VCF::TreeListControl::columnLineColor_ [protected]
 

int VCF::TreeListControl::currentEditColumn_ [protected]
 

Control* VCF::TreeListControl::currentEditingControl_ [protected]
 

int32 VCF::TreeListControl::displayOptions_ [protected]
 

std::vector<TreeItem*> VCF::TreeListControl::draggingSelectedItems_ [protected]
 

bool VCF::TreeListControl::draggingSelectionRect_ [protected]
 

Point VCF::TreeListControl::dragPoint_ [protected]
 

Rect VCF::TreeListControl::dragSelectionRect_ [protected]
 

HeaderControl* VCF::TreeListControl::header_ [protected]
 

std::map<TreeItem*,double> VCF::TreeListControl::hierarchyHeightMap_ [protected]
 

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

VCF::Delegate VCF::TreeListControl::ItemExpanded
 

double VCF::TreeListControl::itemHeight_ [protected]
 

uint32 VCF::TreeListControl::itemIndent_ [protected]
 

VCF::Delegate VCF::TreeListControl::ItemSelected
 

VCF::Delegate VCF::TreeListControl::ItemStateChangeRequested
 

Color VCF::TreeListControl::rowLineColor_ [protected]
 

EnumeratorContainer<std::vector<TreeItem*>,TreeItem*> VCF::TreeListControl::selectedItemContainer_ [protected]
 

std::vector<TreeItem*> VCF::TreeListControl::selectedItems_ [protected]
 

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

int32 VCF::TreeListControl::stateItemIndent_ [protected]
 

TreeModel* VCF::TreeListControl::treeModel_ [protected]
 

std::vector<TreeItem*> VCF::TreeListControl::visibleDisplayItems_ [protected]
 

double VCF::TreeListControl::visibleItemsHeight_ [protected]
 


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