24 #ifndef FXSCROLLAREA_H 25 #include "FXScrollArea.h" 39 TREELIST_EXTENDEDSELECT = 0,
40 TREELIST_SINGLESELECT = 0x00100000,
41 TREELIST_BROWSESELECT = 0x00200000,
42 TREELIST_MULTIPLESELECT = 0x00300000,
43 TREELIST_AUTOSELECT = 0x00400000,
44 TREELIST_SHOWS_LINES = 0x00800000,
45 TREELIST_SHOWS_BOXES = 0x01000000,
46 TREELIST_ROOT_BOXES = 0x02000000,
47 TREELIST_NORMAL = TREELIST_EXTENDEDSELECT
72 FXTreeItem():parent(
nullptr),prev(
nullptr),next(
nullptr),first(
nullptr),last(
nullptr),openIcon(
nullptr),closedIcon(
nullptr),data(
nullptr),state(0),x(0),y(0){}
73 virtual void draw(
const FXTreeList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
74 virtual FXint hitItem(
const FXTreeList* list,FXint x,FXint y)
const;
90 FXTreeItem(
const FXString& text,
FXIcon* oi=
nullptr,
FXIcon* ci=
nullptr,FXptr ptr=
nullptr):parent(nullptr),prev(nullptr),next(nullptr),first(nullptr),last(nullptr),label(text),openIcon(oi),closedIcon(ci),data(ptr),state(0),x(0),y(0){}
114 FXint getNumChildren()
const;
117 virtual void setText(
const FXString& txt);
123 virtual void setOpenIcon(
FXIcon* icn,FXbool owned=
false);
129 virtual void setClosedIcon(
FXIcon* icn,FXbool owned=
false);
141 virtual void setFocus(FXbool focus);
144 FXbool
hasFocus()
const {
return (state&FOCUS)!=0; }
147 virtual void setSelected(FXbool selected);
153 virtual void setOpened(FXbool opened);
156 FXbool
isOpened()
const {
return (state&OPENED)!=0; }
159 virtual void setExpanded(FXbool expanded);
165 virtual void setEnabled(FXbool enabled);
168 FXbool
isEnabled()
const {
return (state&DISABLED)==0; }
171 virtual void setDraggable(FXbool draggable);
177 FXbool
hasItems()
const {
return (state&HASITEMS)!=0; }
180 void setHasItems(FXbool flag);
183 FXbool isChildOf(
const FXTreeItem* item)
const;
186 FXbool isParentOf(
const FXTreeItem* item)
const;
189 virtual FXString getTipText()
const;
192 virtual FXint getWidth(
const FXTreeList* list)
const;
195 virtual FXint getHeight(
const FXTreeList* list)
const;
198 virtual void create();
201 virtual void detach();
204 virtual void destroy();
207 virtual void save(
FXStream& store)
const;
219 typedef FXint (*FXTreeListSortFunc)(
const FXTreeItem*,
const FXTreeItem*);
253 FXTreeListSortFunc sortfunc;
255 FXColor selbackColor;
256 FXColor seltextColor;
277 long onPaint(
FXObject*,FXSelector,
void*);
278 long onEnter(
FXObject*,FXSelector,
void*);
279 long onLeave(
FXObject*,FXSelector,
void*);
280 long onUngrabbed(
FXObject*,FXSelector,
void*);
281 long onMotion(
FXObject*,FXSelector,
void*);
282 long onKeyPress(
FXObject*,FXSelector,
void*);
283 long onKeyRelease(
FXObject*,FXSelector,
void*);
284 long onLeftBtnPress(
FXObject*,FXSelector,
void*);
285 long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
286 long onRightBtnPress(
FXObject*,FXSelector,
void*);
287 long onRightBtnRelease(
FXObject*,FXSelector,
void*);
288 long onQueryTip(
FXObject*,FXSelector,
void*);
289 long onQueryHelp(
FXObject*,FXSelector,
void*);
290 long onTipTimer(
FXObject*,FXSelector,
void*);
291 long onFocusIn(
FXObject*,FXSelector,
void*);
292 long onFocusOut(
FXObject*,FXSelector,
void*);
293 long onAutoScroll(
FXObject*,FXSelector,
void*);
294 long onClicked(
FXObject*,FXSelector,
void*);
295 long onDoubleClicked(
FXObject*,FXSelector,
void*);
296 long onTripleClicked(
FXObject*,FXSelector,
void*);
297 long onCommand(
FXObject*,FXSelector,
void*);
298 long onLookupTimer(
FXObject*,FXSelector,
void*);
306 ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
315 virtual void create();
318 virtual void detach();
321 virtual void layout();
324 virtual FXint getDefaultWidth();
327 virtual FXint getDefaultHeight();
330 virtual FXint getContentWidth();
333 virtual FXint getContentHeight();
336 virtual void recalc();
339 virtual FXbool canFocus()
const;
342 virtual void setFocus();
345 virtual void killFocus();
348 FXint getNumItems()
const;
354 void setNumVisible(FXint nvis);
363 FXint fillItems(
FXTreeItem* father,
const FXchar *
const *strings,
FXIcon* oi=
nullptr,
FXIcon* ci=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
399 void removeItem(
FXTreeItem* item,FXbool notify=
false);
405 void clearItems(FXbool notify=
false);
414 virtual FXTreeItem* getItemAt(FXint x,FXint y)
const;
417 FXint hitItem(
const FXTreeItem* item,FXint x,FXint y)
const;
420 virtual void makeItemVisible(
FXTreeItem* item);
441 FXTreeItem* findItemByData(FXptr ptr,
FXTreeItem* start=
nullptr,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP)
const;
462 void setItemData(
FXTreeItem* item,
void* ptr)
const;
465 void* getItemData(
const FXTreeItem* item)
const;
468 FXbool isItemSelected(
const FXTreeItem* item)
const;
471 FXbool isItemCurrent(
const FXTreeItem* item)
const;
474 FXbool isItemVisible(
const FXTreeItem* item)
const;
477 FXbool isItemOpened(
const FXTreeItem* item)
const;
480 FXbool isItemExpanded(
const FXTreeItem* item)
const;
483 FXbool isItemLeaf(
const FXTreeItem* item)
const;
486 FXbool isItemEnabled(
const FXTreeItem* item)
const;
498 virtual FXbool selectItem(
FXTreeItem* item,FXbool notify=
false);
501 virtual FXbool deselectItem(
FXTreeItem* item,FXbool notify=
false);
504 virtual FXbool toggleItem(
FXTreeItem* item,FXbool notify=
false);
507 virtual FXbool extendSelection(
FXTreeItem* item,FXbool notify=
false);
510 virtual FXbool selectAll(FXbool notify=
false);
513 virtual FXbool killSelection(FXbool notify=
false);
516 virtual FXbool openItem(
FXTreeItem* item,FXbool notify=
false);
519 virtual FXbool closeItem(
FXTreeItem* item,FXbool notify=
false);
522 virtual FXbool collapseTree(
FXTreeItem* tree,FXbool notify=
false);
525 virtual FXbool expandTree(
FXTreeItem* tree,FXbool notify=
false);
528 virtual void setCurrentItem(
FXTreeItem* item,FXbool notify=
false);
543 void sortRootItems();
555 void setFont(
FXFont* fnt);
561 void setIndent(FXint in);
570 void setTextColor(FXColor clr);
576 void setSelBackColor(FXColor clr);
582 void setSelTextColor(FXColor clr);
588 void setLineColor(FXColor clr);
591 FXuint getListStyle()
const;
594 void setListStyle(FXuint style);
597 void setHelpText(
const FXString& text);
603 virtual void save(
FXStream& store)
const;
FXIcon * getOpenIcon() const
Get open icon.
Definition: FXTreeList.h:126
const FXString & getText() const
Get item label.
Definition: FXTreeList.h:120
FXbool isExpanded() const
Return true if this item is expanded into sub items.
Definition: FXTreeList.h:162
FXTreeItem(const FXString &text, FXIcon *oi=nullptr, FXIcon *ci=nullptr, FXptr ptr=nullptr)
Constructor.
Definition: FXTreeList.h:90
const FXString & getHelpText() const
Get the status line help text for this list.
Definition: FXTreeList.h:600
Tree list Item.
Definition: FXTreeList.h:52
FXTreeListSortFunc getSortFunc() const
Return sort function.
Definition: FXTreeList.h:549
A Tree List Widget organizes items in a hierarchical, tree-like fashion.
Definition: FXTreeList.h:243
FXFont * getFont() const
Return text font.
Definition: FXTreeList.h:558
Base composite.
Definition: FXComposite.h:32
FXTreeItem * getNext() const
Get next sibling item.
Definition: FXTreeList.h:96
FXTreeItem * getFirst() const
Get first child item.
Definition: FXTreeList.h:102
FXint getItemWidth(const FXTreeItem *item) const
Return item width.
Definition: FXTreeList.h:408
FXint getNumVisible() const
Return number of visible items.
Definition: FXTreeList.h:351
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
FXbool isSelected() const
Return true if this item is selected.
Definition: FXTreeList.h:150
FXColor getSelTextColor() const
Return selected text color.
Definition: FXTreeList.h:579
FXTreeItem * getLast() const
Get last child item.
Definition: FXTreeList.h:105
virtual FXint getHeight(const FXTreeList *list) const
Return height of item as drawn in list.
FXTreeItem * getAnchorItem() const
Return anchor item, if any.
Definition: FXTreeList.h:537
Abstract Device Context.
Definition: FXDC.h:153
FXbool isOpened() const
Return true if this item is open.
Definition: FXTreeList.h:156
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
FXint getIndent() const
Return parent-child indent amount.
Definition: FXTreeList.h:564
FXColor getLineColor() const
Return line color.
Definition: FXTreeList.h:585
FXTreeItem * getPrev() const
Get previous sibling item.
Definition: FXTreeList.h:99
FXTreeItem * getCurrentItem() const
Return current item, if any.
Definition: FXTreeList.h:531
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXIcon * getClosedIcon() const
Get closed icon.
Definition: FXTreeList.h:132
FXTreeItem * getFirstItem() const
Return first root item.
Definition: FXTreeList.h:357
FXTreeItem * getParent() const
Get parent item.
Definition: FXTreeList.h:93
FXbool hasItems() const
Return true if subitems, real or imagined.
Definition: FXTreeList.h:177
FXColor getTextColor() const
Return normal text color.
Definition: FXTreeList.h:567
void setData(FXptr ptr)
Change item user data.
Definition: FXTreeList.h:135
void setSortFunc(FXTreeListSortFunc func)
Change sort function.
Definition: FXTreeList.h:552
A Directory List widget provides a tree-structured view of the file system.
Definition: FXDirList.h:124
FXbool isEnabled() const
Return true if this item is enabled.
Definition: FXTreeList.h:168
FXbool hasFocus() const
Return true if item has focus.
Definition: FXTreeList.h:144
FXptr getData() const
Get item user data.
Definition: FXTreeList.h:138
Font class.
Definition: FXFont.h:137
FXbool isDraggable() const
Return true if this item is draggable.
Definition: FXTreeList.h:174
FXColor getSelBackColor() const
Return selected text background.
Definition: FXTreeList.h:573
virtual FXint getWidth(const FXTreeList *list) const
Return width of item as drawn in list.
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42
FXTreeItem * getLastItem() const
Return last root item.
Definition: FXTreeList.h:360
FXint getItemHeight(const FXTreeItem *item) const
Return item height.
Definition: FXTreeList.h:411