21 #ifndef FXFOLDINGLIST_H 22 #define FXFOLDINGLIST_H 24 #ifndef FXSCROLLAREA_H 25 #include "FXScrollArea.h" 39 FOLDINGLIST_EXTENDEDSELECT = 0,
40 FOLDINGLIST_SINGLESELECT = 0x00100000,
41 FOLDINGLIST_BROWSESELECT = 0x00200000,
42 FOLDINGLIST_MULTIPLESELECT = 0x00300000,
43 FOLDINGLIST_AUTOSELECT = 0x00400000,
44 FOLDINGLIST_SHOWS_LINES = 0x00800000,
45 FOLDINGLIST_SHOWS_BOXES = 0x01000000,
46 FOLDINGLIST_ROOT_BOXES = 0x02000000,
47 FOLDINGLIST_NORMAL = FOLDINGLIST_EXTENDEDSELECT
72 FXFoldingItem():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 FXFoldingList* list,
FXDC& dc,FXint x,FXint y,FXint w,FXint h)
const;
74 virtual FXint hitItem(
const FXFoldingList* list,FXint x,FXint y)
const;
90 FXFoldingItem(
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);
189 virtual FXString getTipText()
const;
198 virtual void create();
201 virtual void detach();
204 virtual void destroy();
207 virtual void save(
FXStream& store)
const;
219 typedef FXint (*FXFoldingListSortFunc)(
const FXFoldingItem*,
const FXFoldingItem*);
260 FXFoldingListSortFunc sortfunc;
262 FXColor selbackColor;
263 FXColor seltextColor;
279 virtual void moveContents(FXint x,FXint y);
281 static FXint compareSection(
const FXchar *p,
const FXchar* q,FXint s);
282 static FXint compareSectionCase(
const FXchar *p,
const FXchar* q,FXint s);
287 long onPaint(
FXObject*,FXSelector,
void*);
288 long onEnter(
FXObject*,FXSelector,
void*);
289 long onLeave(
FXObject*,FXSelector,
void*);
290 long onUngrabbed(
FXObject*,FXSelector,
void*);
291 long onMotion(
FXObject*,FXSelector,
void*);
292 long onKeyPress(
FXObject*,FXSelector,
void*);
293 long onKeyRelease(
FXObject*,FXSelector,
void*);
294 long onLeftBtnPress(
FXObject*,FXSelector,
void*);
295 long onLeftBtnRelease(
FXObject*,FXSelector,
void*);
296 long onRightBtnPress(
FXObject*,FXSelector,
void*);
297 long onRightBtnRelease(
FXObject*,FXSelector,
void*);
298 long onChgHeader(
FXObject*,FXSelector,
void*);
299 long onQueryTip(
FXObject*,FXSelector,
void*);
300 long onQueryHelp(
FXObject*,FXSelector,
void*);
301 long onTipTimer(
FXObject*,FXSelector,
void*);
302 long onFocusIn(
FXObject*,FXSelector,
void*);
303 long onFocusOut(
FXObject*,FXSelector,
void*);
304 long onAutoScroll(
FXObject*,FXSelector,
void*);
305 long onClicked(
FXObject*,FXSelector,
void*);
306 long onDoubleClicked(
FXObject*,FXSelector,
void*);
307 long onTripleClicked(
FXObject*,FXSelector,
void*);
308 long onCommand(
FXObject*,FXSelector,
void*);
309 long onLookupTimer(
FXObject*,FXSelector,
void*);
317 ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
327 virtual void create();
330 virtual void detach();
333 virtual void layout();
336 virtual FXint getDefaultWidth();
339 virtual FXint getDefaultHeight();
342 virtual FXint getVisibleY()
const;
345 virtual FXint getVisibleHeight()
const;
348 virtual FXint getContentWidth();
351 virtual FXint getContentHeight();
354 virtual void recalc();
357 virtual FXbool canFocus()
const;
360 virtual void setFocus();
363 virtual void killFocus();
369 void setHeaders(
const FXchar *
const *strings,FXint size=1);
372 void setHeaders(
const FXString* strings,FXint size=1);
375 void setHeaders(
const FXString& strings,FXint size=1);
378 void appendHeader(
const FXString& text,
FXIcon *icon=
nullptr,FXint size=1);
381 void removeHeader(FXint index);
384 void setHeaderText(FXint index,
const FXString& text);
387 FXString getHeaderText(FXint index)
const;
390 void setHeaderIcon(FXint index,
FXIcon *icon);
393 FXIcon* getHeaderIcon(FXint index)
const;
396 void setHeaderSize(FXint index,FXint size);
399 FXint getHeaderSize(FXint index)
const;
402 FXint getNumHeaders()
const;
405 FXint getNumItems()
const;
411 void setNumVisible(FXint nvis);
420 FXint fillItems(
FXFoldingItem* father,
const FXchar *
const *strings,
FXIcon* oi=
nullptr,
FXIcon* ci=
nullptr,FXptr ptr=
nullptr,FXbool notify=
false);
462 void clearItems(FXbool notify=
false);
474 FXint hitItem(
const FXFoldingItem* item,FXint x,FXint y)
const;
555 virtual FXbool selectItem(
FXFoldingItem* item,FXbool notify=
false);
558 virtual FXbool deselectItem(
FXFoldingItem* item,FXbool notify=
false);
561 virtual FXbool toggleItem(
FXFoldingItem* item,FXbool notify=
false);
564 virtual FXbool extendSelection(
FXFoldingItem* item,FXbool notify=
false);
567 virtual FXbool selectAll(FXbool notify=
false);
570 virtual FXbool killSelection(FXbool notify=
false);
573 virtual FXbool openItem(
FXFoldingItem* item,FXbool notify=
false);
576 virtual FXbool closeItem(
FXFoldingItem* item,FXbool notify=
false);
579 virtual FXbool collapseTree(
FXFoldingItem* tree,FXbool notify=
false);
582 virtual FXbool expandTree(
FXFoldingItem* tree,FXbool notify=
false);
585 virtual void setCurrentItem(
FXFoldingItem* item,FXbool notify=
false);
600 void sortRootItems();
612 void setFont(
FXFont* fnt);
618 void setIndent(FXint in);
627 void setTextColor(FXColor clr);
633 void setSelBackColor(FXColor clr);
639 void setSelTextColor(FXColor clr);
645 void setLineColor(FXColor clr);
648 FXuint getListStyle()
const;
651 void setListStyle(FXuint style);
654 void setHelpText(
const FXString& text);
660 virtual void save(
FXStream& store)
const;
FXbool isDraggable() const
Return true if this item is draggable.
Definition: FXFoldingList.h:174
FXint getItemWidth(const FXFoldingItem *item) const
Return item width.
Definition: FXFoldingList.h:465
const FXString & getHelpText() const
Get the status line help text for this list.
Definition: FXFoldingList.h:657
FXbool isSelected() const
Return true if this item is selected.
Definition: FXFoldingList.h:150
void setSortFunc(FXFoldingListSortFunc func)
Change sort function.
Definition: FXFoldingList.h:609
FXFoldingItem * getLastItem() const
Return last root item.
Definition: FXFoldingList.h:417
FXFoldingItem * getCurrentItem() const
Return current item, if any.
Definition: FXFoldingList.h:588
FXint getIndent() const
Return parent-child indent amount.
Definition: FXFoldingList.h:621
FXbool hasItems() const
Return true if subitems, real or imagined.
Definition: FXFoldingList.h:177
A Folding List Widget resembles a Tree list except that it supports a header control to provide each ...
Definition: FXFoldingList.h:249
FXColor getLineColor() const
Return line color.
Definition: FXFoldingList.h:642
Base composite.
Definition: FXComposite.h:32
Tree list Item.
Definition: FXFoldingList.h:52
FXbool isOpened() const
Return true if this item is open.
Definition: FXFoldingList.h:156
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
void setData(FXptr ptr)
Change item user data.
Definition: FXFoldingList.h:135
Abstract Device Context.
Definition: FXDC.h:153
FXColor getSelBackColor() const
Return selected text background.
Definition: FXFoldingList.h:630
FXptr getData() const
Get item user data.
Definition: FXFoldingList.h:138
FXFoldingItem * getFirstItem() const
Return first root item.
Definition: FXFoldingList.h:414
Definition: FX4Splitter.h:28
FXFoldingItem * getFirst() const
Get first child item.
Definition: FXFoldingList.h:102
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
FXHeader * getHeader() const
Return header control.
Definition: FXFoldingList.h:366
FXColor getSelTextColor() const
Return selected text color.
Definition: FXFoldingList.h:636
virtual FXint getHeight(const FXFoldingList *list) const
Return height of item as drawn in list.
FXIcon * getOpenIcon() const
Get open icon.
Definition: FXFoldingList.h:126
FXFoldingItem * getAnchorItem() const
Return anchor item, if any.
Definition: FXFoldingList.h:594
FXFoldingListSortFunc getSortFunc() const
Return sort function.
Definition: FXFoldingList.h:606
FXIcon * getClosedIcon() const
Get closed icon.
Definition: FXFoldingList.h:132
FXFoldingItem * getPrev() const
Get previous sibling item.
Definition: FXFoldingList.h:99
FXFoldingItem * getNext() const
Get next sibling item.
Definition: FXFoldingList.h:96
FXint getNumVisible() const
Return number of visible items.
Definition: FXFoldingList.h:408
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
const FXString & getText() const
Get item label.
Definition: FXFoldingList.h:120
FXbool isEnabled() const
Return true if this item is enabled.
Definition: FXFoldingList.h:168
FXFoldingItem * getParent() const
Get parent item.
Definition: FXFoldingList.h:93
A Directory List widget provides a tree-structured view of the file system.
Definition: FXDirList.h:124
FXFoldingItem(const FXString &text, FXIcon *oi=nullptr, FXIcon *ci=nullptr, FXptr ptr=nullptr)
Constructor.
Definition: FXFoldingList.h:90
FXFont * getFont() const
Return text font.
Definition: FXFoldingList.h:615
FXint getItemHeight(const FXFoldingItem *item) const
Return item height.
Definition: FXFoldingList.h:468
FXColor getTextColor() const
Return normal text color.
Definition: FXFoldingList.h:624
FXbool isExpanded() const
Return true if this item is expanded into sub items.
Definition: FXFoldingList.h:162
Font class.
Definition: FXFont.h:137
FXFoldingItem * getLast() const
Get las child item.
Definition: FXFoldingList.h:105
FXbool hasFocus() const
Return true if item has focus.
Definition: FXFoldingList.h:144
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42
virtual FXint getWidth(const FXFoldingList *list) const
Return width of item as drawn in list.