#include <GTree.h>
Public Member Functions | |
const char * | GetClass () |
virtual void | OnItemClick (GTreeItem *Item, GMouse &m) |
Called when an item is clicked. | |
virtual void | OnItemBeginDrag (GTreeItem *Item, int Flags) |
Called when an item is dragged from it's position. | |
virtual void | OnItemExpand (GTreeItem *Item, bool Expand) |
Called when an item is expanded/contracted to show or hide it's children. | |
virtual void | OnItemSelect (GTreeItem *Item) |
Called when an item is selected. | |
void | OnMouseClick (GMouse &m) |
The mouse was clicked over this view. | |
void | OnMouseMove (GMouse &m) |
The mouse moves over the control. | |
void | OnMouseWheel (double Lines) |
The mouse wheel was scrolled. | |
void | OnPaint (GSurface *pDC) |
Called to paint the onscreen representation of the view. | |
void | OnFocus (bool b) |
The view gains or loses the keyboard focus. | |
void | OnPosChange () |
Called when the view position changes. | |
bool | OnKey (GKey &k) |
A key was pressed while this view has focus. | |
int | OnNotify (GViewI *Ctrl, int Flags) |
Called when a child view or view with it's SetNotify() set to this window changes. | |
int | OnEvent (GMessage *Msg) |
Handles the incoming events. | |
void | OnPulse () |
Called every so often by the timer system. | |
GTreeItem * | Insert (GTreeItem *Obj=0, int Pos=-1) |
Add a item to the tree. | |
bool | Delete (GTreeItem *Obj) |
Remove and delete an item. | |
bool | Remove (GTreeItem *Obj) |
Remove but don't delete an item. | |
GTreeItem * | ItemAt (int Pos) |
Gets the item at an index. | |
bool | Select (GTreeItem *Obj) |
Select the item 'Obj'. | |
GTreeItem * | Selection () |
Returns the first selected item. | |
GTreeItem * | ItemAtPoint (int x, int y) |
Returns the item at an x,y location. | |
void | SelectDropTarget (GTreeItem *Item) |
void | Empty () |
Delete all items (frees the items). | |
void | RemoveAll () |
Remove reference to items (doesn't free the items). | |
void | UpdateAllItems () |
Call 'Update' on all tree items. | |
Friends | |
class | GTreeItem |
const char* GTree::GetClass | ( | ) | [inline] |
The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().
Reimplemented from GLayout.
int GTree::OnNotify | ( | GViewI * | Ctrl, | |
int | Flags | |||
) |
Called when a child view or view with it's SetNotify() set to this window changes.
The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.
Reimplemented from GLayout.
References IDC_HSCROLL, IDC_VSCROLL, GView::Invalidate(), and GLayout::OnNotify().
void GTree::OnPulse | ( | ) |
Called every so often by the timer system.
Reimplemented from GView.
References GLayout::GetClient(), GView::GetMouse(), GLayout::HScroll, GView::SetPulse(), GScrollBar::Value(), GLayout::VScroll, GRect::X(), GMouse::x, GRect::Y(), and GMouse::y.
void GTree::SelectDropTarget | ( | GTreeItem * | Item | ) |
Temporarily selects one of the items as the drop target during a drag and drop operation. Call SelectDropTarget(0) when done.
References OnFocus(), and GTreeItem::Update().