1 /******************************************************************************** 2 * * 3 * F o l d i n g L i s t W i d g e t * 4 * * 5 ********************************************************************************* 6 * Copyright (C) 1997,2006 by Jeroen van der Zijp. All Rights Reserved. * 7 ********************************************************************************* 8 * This library is free software; you can redistribute it and/or * 9 * modify it under the terms of the GNU Lesser General Public * 10 * License as published by the Free Software Foundation; either * 11 * version 2.1 of the License, or (at your option) any later version. * 12 * * 13 * This library is distributed in the hope that it will be useful, * 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 16 * Lesser General Public License for more details. * 17 * * 18 * You should have received a copy of the GNU Lesser General Public * 19 * License along with this library; if not, write to the Free Software * 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 21 ********************************************************************************* 22 * $Id: FXFoldingList.h 3297 2015-12-14 20:30:04Z arthurcnorman $ * 23 ********************************************************************************/ 24 #ifndef FXFOLDINGLIST_H 25 #define FXFOLDINGLIST_H 26 27 #ifndef FXSCROLLAREA_H 28 #include "FXScrollArea.h" 29 #endif 30 31 namespace FX { 32 33 34 class FXIcon; 35 class FXFont; 36 class FXHeader; 37 class FXFoldingList; 38 39 40 /// Folding list styles 41 enum { 42 FOLDINGLIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items 43 FOLDINGLIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected 44 FOLDINGLIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times 45 FOLDINGLIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items 46 FOLDINGLIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor 47 FOLDINGLIST_SHOWS_LINES = 0x00800000, /// Lines shown 48 FOLDINGLIST_SHOWS_BOXES = 0x01000000, /// Boxes to expand shown 49 FOLDINGLIST_ROOT_BOXES = 0x02000000, /// Display root boxes also 50 FOLDINGLIST_NORMAL = FOLDINGLIST_EXTENDEDSELECT 51 }; 52 53 54 /// Tree list Item 55 class FXAPI FXFoldingItem : public FXObject { 56 FXDECLARE(FXFoldingItem) 57 friend class FXFoldingList; 58 friend class FXDirList; 59 protected: 60 FXFoldingItem *parent; 61 FXFoldingItem *prev; 62 FXFoldingItem *next; 63 FXFoldingItem *first; 64 FXFoldingItem *last; 65 FXString label; 66 FXIcon *openIcon; 67 FXIcon *closedIcon; 68 void *data; 69 FXuint state; 70 FXint x,y; 71 private: 72 FXFoldingItem(const FXFoldingItem&); 73 FXFoldingItem& operator=(const FXFoldingItem&); 74 protected: FXFoldingItem()75 FXFoldingItem():parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),openIcon(NULL),closedIcon(NULL),data(NULL),state(0),x(0),y(0){} 76 virtual void draw(const FXFoldingList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const; 77 virtual FXint hitItem(const FXFoldingList* list,FXint x,FXint y) const; 78 public: 79 enum{ 80 SELECTED = 1, /// Selected 81 FOCUS = 2, /// Focus 82 DISABLED = 4, /// Disabled 83 OPENED = 8, /// Opened 84 EXPANDED = 16, /// Expanded 85 HASITEMS = 32, /// Has virtual subitems 86 DRAGGABLE = 64, /// Draggable 87 OPENICONOWNED = 128, /// Open icon owned by item 88 CLOSEDICONOWNED = 256 /// Close icon owned by item 89 }; 90 public: 91 92 /// Constructor parent(NULL)93 FXFoldingItem(const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL):parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),label(text),openIcon(oi),closedIcon(ci),data(ptr),state(0),x(0),y(0){} 94 95 /// Get parent item getParent()96 FXFoldingItem* getParent() const { return parent; } 97 98 /// Get next sibling item getNext()99 FXFoldingItem* getNext() const { return next; } 100 101 /// Get previous sibling item getPrev()102 FXFoldingItem* getPrev() const { return prev; } 103 104 /// Get first child item getFirst()105 FXFoldingItem* getFirst() const { return first; } 106 107 /// Get las child item getLast()108 FXFoldingItem* getLast() const { return last; } 109 110 /// Get item below this one in list 111 FXFoldingItem* getBelow() const; 112 113 /// Get item above this one in list 114 FXFoldingItem* getAbove() const; 115 116 /// Get number of children of item 117 FXint getNumChildren() const; 118 119 /// Change item label 120 virtual void setText(const FXString& txt); 121 122 /// Get item label getText()123 const FXString& getText() const { return label; } 124 125 /// Change open icon, deleting old icon if it was owned 126 virtual void setOpenIcon(FXIcon* icn,FXbool owned=FALSE); 127 128 /// Get open icon getOpenIcon()129 FXIcon* getOpenIcon() const { return openIcon; } 130 131 /// Change closed icon, deleting old icon if it was owned 132 virtual void setClosedIcon(FXIcon* icn,FXbool owned=FALSE); 133 134 /// Get closed icon getClosedIcon()135 FXIcon* getClosedIcon() const { return closedIcon; } 136 137 /// Change item user data setData(void * ptr)138 void setData(void* ptr){ data=ptr; } 139 140 /// Get item user data getData()141 void* getData() const { return data; } 142 143 /// Make item draw as focused 144 virtual void setFocus(FXbool focus); 145 146 /// Return true if item has focus hasFocus()147 FXbool hasFocus() const { return (state&FOCUS)!=0; } 148 149 /// Select item 150 virtual void setSelected(FXbool selected); 151 152 /// Return true if this item is selected isSelected()153 FXbool isSelected() const { return (state&SELECTED)!=0; } 154 155 /// Make item show as open 156 virtual void setOpened(FXbool opened); 157 158 /// Return true if this item is open isOpened()159 FXbool isOpened() const { return (state&OPENED)!=0; } 160 161 /// Expand or collapse item 162 virtual void setExpanded(FXbool expanded); 163 164 /// Return true if this item is expanded into sub items isExpanded()165 FXbool isExpanded() const { return (state&EXPANDED)!=0; } 166 167 /// Enable or disable item 168 virtual void setEnabled(FXbool enabled); 169 170 /// Return true if this item is enabled isEnabled()171 FXbool isEnabled() const { return (state&DISABLED)==0; } 172 173 /// Make item draggable 174 virtual void setDraggable(FXbool draggable); 175 176 /// Return true if this item is draggable isDraggable()177 FXbool isDraggable() const { return (state&DRAGGABLE)!=0; } 178 179 /// Return TRUE if subitems, real or imagined hasItems()180 FXbool hasItems() const { return (state&HASITEMS)!=0; } 181 182 /// Change has items flag 183 void setHasItems(FXbool flag); 184 185 /// Return true if descendent of parent item 186 FXbool isChildOf(const FXFoldingItem* item) const; 187 188 /// Return true if ancestor of child item 189 FXbool isParentOf(const FXFoldingItem* item) const; 190 191 /// Return width of item as drawn in list 192 virtual FXint getWidth(const FXFoldingList* list) const; 193 194 /// Return height of item as drawn in list 195 virtual FXint getHeight(const FXFoldingList* list) const; 196 197 /// Create server-side resources 198 virtual void create(); 199 200 /// Detach server-side resources 201 virtual void detach(); 202 203 /// Destroy server-side resources 204 virtual void destroy(); 205 206 /// Save to stream 207 virtual void save(FXStream& store) const; 208 209 /// Load from stream 210 virtual void load(FXStream& store); 211 212 /// Destroy item and free icons if owned 213 virtual ~FXFoldingItem(); 214 }; 215 216 217 218 /// Folding item collate function 219 typedef FXint (*FXFoldingListSortFunc)(const FXFoldingItem*,const FXFoldingItem*); 220 221 222 223 /** 224 * A Folding List Widget resembles a Tree list except that it supports a 225 * header control to provide each item with multiple columns of text. 226 * Subtrees can be collapsed or expanded by double-clicking on an item 227 * or by clicking on the optional plus button in front of the item. 228 * Each item may have a text and optional open-icon as well as a closed-icon. 229 * The items may be connected by optional lines to show the hierarchical 230 * relationship. 231 * When an item's selected state changes, the folding list emits a SEL_SELECTED 232 * or SEL_DESELECTED message. If an item is opened or closed, a message 233 * of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an 234 * item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued. 235 * A change of the current item is signified by the SEL_CHANGED message. 236 * In addition, the folding list sends SEL_COMMAND messages when the user 237 * clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED 238 * when the user clicks once, twice, or thrice, respectively. 239 * When items are added or removed, the folding list sends messages of the 240 * type SEL_INSERTED or SEL_DELETED. 241 * In each of these cases, a pointer to the item, if any, is passed in the 242 * 3rd argument of the message. 243 */ 244 class FXAPI FXFoldingList : public FXScrollArea { 245 FXDECLARE(FXFoldingList) 246 protected: 247 FXHeader *header; // Tree header 248 FXFoldingItem *firstitem; // First root item 249 FXFoldingItem *lastitem; // Last root item 250 FXFoldingItem *anchoritem; // Selection anchor item 251 FXFoldingItem *currentitem; // Current item 252 FXFoldingItem *extentitem; // Selection extent 253 FXFoldingItem *cursoritem; // Item under cursor 254 FXFoldingItem *viewableitem; // Viewable item 255 FXFont *font; // Font 256 FXFoldingListSortFunc sortfunc; // Item sort function 257 FXColor textColor; // Text color 258 FXColor selbackColor; // Selected background color 259 FXColor seltextColor; // Selected text color 260 FXColor lineColor; // Line color 261 FXint treeWidth; // Tree width 262 FXint treeHeight; // Tree height 263 FXint visible; // Number of visible items 264 FXint indent; // Parent to child indentation 265 FXint grabx; // Grab point x 266 FXint graby; // Grab point y 267 FXString lookup; // Lookup string 268 FXString help; // Help string 269 FXbool state; // State of item 270 protected: 271 FXFoldingList(); 272 void recompute(); 273 void mergesort(FXFoldingItem*& list); 274 void sort(FXFoldingItem*& f1,FXFoldingItem*& t1,FXFoldingItem*& f2,FXFoldingItem*& t2,int n); 275 virtual void moveContents(FXint x,FXint y); 276 virtual FXFoldingItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr); 277 static FXint compareSection(const FXchar *p,const FXchar* q,FXint s); 278 static FXint compareSectionCase(const FXchar *p,const FXchar* q,FXint s); 279 private: 280 FXFoldingList(const FXFoldingList&); 281 FXFoldingList& operator=(const FXFoldingList&); 282 public: 283 long onPaint(FXObject*,FXSelector,void*); 284 long onEnter(FXObject*,FXSelector,void*); 285 long onLeave(FXObject*,FXSelector,void*); 286 long onUngrabbed(FXObject*,FXSelector,void*); 287 long onMotion(FXObject*,FXSelector,void*); 288 long onKeyPress(FXObject*,FXSelector,void*); 289 long onKeyRelease(FXObject*,FXSelector,void*); 290 long onLeftBtnPress(FXObject*,FXSelector,void*); 291 long onLeftBtnRelease(FXObject*,FXSelector,void*); 292 long onRightBtnPress(FXObject*,FXSelector,void*); 293 long onRightBtnRelease(FXObject*,FXSelector,void*); 294 long onHeaderChanged(FXObject*,FXSelector,void*); 295 long onQueryTip(FXObject*,FXSelector,void*); 296 long onQueryHelp(FXObject*,FXSelector,void*); 297 long onTipTimer(FXObject*,FXSelector,void*); 298 long onFocusIn(FXObject*,FXSelector,void*); 299 long onFocusOut(FXObject*,FXSelector,void*); 300 long onAutoScroll(FXObject*,FXSelector,void*); 301 long onClicked(FXObject*,FXSelector,void*); 302 long onDoubleClicked(FXObject*,FXSelector,void*); 303 long onTripleClicked(FXObject*,FXSelector,void*); 304 long onCommand(FXObject*,FXSelector,void*); 305 long onLookupTimer(FXObject*,FXSelector,void*); 306 public: 307 static FXint ascending(const FXFoldingItem*,const FXFoldingItem*); 308 static FXint descending(const FXFoldingItem*,const FXFoldingItem*); 309 static FXint ascendingCase(const FXFoldingItem*,const FXFoldingItem*); 310 static FXint descendingCase(const FXFoldingItem*,const FXFoldingItem*); 311 public: 312 enum { 313 ID_LOOKUPTIMER=FXScrollArea::ID_LAST, 314 ID_HEADER_CHANGE, 315 ID_LAST 316 }; 317 public: 318 319 /// Construct a folding list; the folding list is initially empty 320 FXFoldingList(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FOLDINGLIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 321 322 /// Create server-side resources 323 virtual void create(); 324 325 /// Detach server-side resources 326 virtual void detach(); 327 328 /// Perform layout 329 virtual void layout(); 330 331 /// Return default width 332 virtual FXint getDefaultWidth(); 333 334 /// Return default height 335 virtual FXint getDefaultHeight(); 336 337 /// Compute and return content width 338 virtual FXint getContentWidth(); 339 340 /// Return content height 341 virtual FXint getContentHeight(); 342 343 /// Recalculate layout 344 virtual void recalc(); 345 346 /// Tree list can receive focus 347 virtual bool canFocus() const; 348 349 /// Move the focus to this window 350 virtual void setFocus(); 351 352 /// Remove the focus from this window 353 virtual void killFocus(); 354 355 /// Return header control getHeader()356 FXHeader* getHeader() const { return header; } 357 358 /// Set headers from array of strings 359 void setHeaders(const FXchar** strings,FXint size=1); 360 361 /// Set headers from newline separated strings 362 void setHeaders(const FXString& strings,FXint size=1); 363 364 /// Append header with given text and optional icon 365 void appendHeader(const FXString& text,FXIcon *icon=NULL,FXint size=1); 366 367 /// Remove header at index 368 void removeHeader(FXint index); 369 370 /// Change text of header at index 371 void setHeaderText(FXint index,const FXString& text); 372 373 /// Return text of header at index 374 FXString getHeaderText(FXint index) const; 375 376 /// Change icon of header at index 377 void setHeaderIcon(FXint index,FXIcon *icon); 378 379 /// Return icon of header at index 380 FXIcon* getHeaderIcon(FXint index) const; 381 382 /// Change size of header at index 383 void setHeaderSize(FXint index,FXint size); 384 385 /// Return width of header at index 386 FXint getHeaderSize(FXint index) const; 387 388 /// Return number of headers 389 FXint getNumHeaders() const; 390 391 /// Return number of items 392 FXint getNumItems() const; 393 394 /// Return number of visible items getNumVisible()395 FXint getNumVisible() const { return visible; } 396 397 /// Change number of visible items 398 void setNumVisible(FXint nvis); 399 400 /// Return first root item getFirstItem()401 FXFoldingItem* getFirstItem() const { return firstitem; } 402 403 /// Return last root item getLastItem()404 FXFoldingItem* getLastItem() const { return lastitem; } 405 406 /// Fill list by appending items from array of strings 407 FXint fillItems(FXFoldingItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 408 409 /// Fill list by appending items from newline separated strings 410 FXint fillItems(FXFoldingItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 411 412 /// Insert [possibly subclassed] item under father before other item 413 FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 414 415 /// Insert item with given text and optional icons, and user-data pointer under father before other item 416 FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 417 418 /// Append [possibly subclassed] item as last child of father 419 FXFoldingItem* appendItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 420 421 /// Append item with given text and optional icons, and user-data pointer as last child of father 422 FXFoldingItem* appendItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 423 424 /// Prepend [possibly subclassed] item as first child of father 425 FXFoldingItem* prependItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 426 427 /// Prepend item with given text and optional icons, and user-data pointer as first child of father 428 FXFoldingItem* prependItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 429 430 /// Move item under father before other item 431 FXFoldingItem *moveItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item); 432 433 /// Extract item 434 FXFoldingItem* extractItem(FXFoldingItem* item,FXbool notify=FALSE); 435 436 /// Remove item 437 void removeItem(FXFoldingItem* item,FXbool notify=FALSE); 438 439 /// Remove items in range [fm, to] inclusively 440 void removeItems(FXFoldingItem* fm,FXFoldingItem* to,FXbool notify=FALSE); 441 442 /// Remove all items from list 443 void clearItems(FXbool notify=FALSE); 444 445 /// Return item width getItemWidth(const FXFoldingItem * item)446 FXint getItemWidth(const FXFoldingItem* item) const { return item->getWidth(this); } 447 448 /// Return item height getItemHeight(const FXFoldingItem * item)449 FXint getItemHeight(const FXFoldingItem* item) const { return item->getHeight(this); } 450 451 /// Get item at x,y, if any 452 virtual FXFoldingItem* getItemAt(FXint x,FXint y) const; 453 454 /** 455 * Search items by name, beginning from item start. If the start item 456 * is NULL the search will start at the first, top-most item in the list. 457 * Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search 458 * direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP 459 * to control whether the search wraps at the start or end of the list. 460 * The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, 461 * passing SEARCH_PREFIX causes searching for a prefix of the item name. 462 * Return NULL if no matching item is found. 463 */ 464 FXFoldingItem* findItem(const FXString& text,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const; 465 466 /** 467 * Search items by associated user data, beginning from item start. If the 468 * start item is NULL the search will start at the first, top-most item 469 * in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control 470 * the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP 471 * to control whether the search wraps at the start or end of the list. 472 */ 473 FXFoldingItem* findItemByData(const void *ptr,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const; 474 475 /// Scroll to make item visible 476 virtual void makeItemVisible(FXFoldingItem* item); 477 478 /// Change item's text 479 void setItemText(FXFoldingItem* item,const FXString& text); 480 481 /// Return item's text 482 FXString getItemText(const FXFoldingItem* item) const; 483 484 /// Change item's open icon, deleting old icon if it was owned 485 void setItemOpenIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE); 486 487 /// Return item's open icon 488 FXIcon* getItemOpenIcon(const FXFoldingItem* item) const; 489 490 /// Chance item's closed icon, deleting old icon if it was owned 491 void setItemClosedIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE); 492 493 /// Return item's closed icon 494 FXIcon* getItemClosedIcon(const FXFoldingItem* item) const; 495 496 /// Change item user-data pointer 497 void setItemData(FXFoldingItem* item,void* ptr) const; 498 499 /// Return item user-data pointer 500 void* getItemData(const FXFoldingItem* item) const; 501 502 /// Return TRUE if item is selected 503 FXbool isItemSelected(const FXFoldingItem* item) const; 504 505 /// Return TRUE if item is current 506 FXbool isItemCurrent(const FXFoldingItem* item) const; 507 508 /// Return TRUE if item is visible 509 FXbool isItemVisible(const FXFoldingItem* item) const; 510 511 /// Return TRUE if item opened 512 FXbool isItemOpened(const FXFoldingItem* item) const; 513 514 /// Return TRUE if item expanded 515 FXbool isItemExpanded(const FXFoldingItem* item) const; 516 517 /// Return TRUE if item is a leaf-item, i.e. has no children 518 FXbool isItemLeaf(const FXFoldingItem* item) const; 519 520 /// Return TRUE if item is enabled 521 FXbool isItemEnabled(const FXFoldingItem* item) const; 522 523 /// Return item hit code: 0 outside, 1 icon, 2 text, 3 box 524 FXint hitItem(const FXFoldingItem* item,FXint x,FXint y) const; 525 526 /// Repaint item 527 void updateItem(FXFoldingItem* item); 528 529 /// Enable item 530 virtual FXbool enableItem(FXFoldingItem* item); 531 532 /// Disable item 533 virtual FXbool disableItem(FXFoldingItem* item); 534 535 /// Select item 536 virtual FXbool selectItem(FXFoldingItem* item,FXbool notify=FALSE); 537 538 /// Deselect item 539 virtual FXbool deselectItem(FXFoldingItem* item,FXbool notify=FALSE); 540 541 /// Toggle item selection 542 virtual FXbool toggleItem(FXFoldingItem* item,FXbool notify=FALSE); 543 544 /// Extend selection from anchor item to item 545 virtual FXbool extendSelection(FXFoldingItem* item,FXbool notify=FALSE); 546 547 /// Deselect all items 548 virtual FXbool killSelection(FXbool notify=FALSE); 549 550 /// Open item 551 virtual FXbool openItem(FXFoldingItem* item,FXbool notify=FALSE); 552 553 /// Close item 554 virtual FXbool closeItem(FXFoldingItem* item,FXbool notify=FALSE); 555 556 /// Collapse tree 557 virtual FXbool collapseTree(FXFoldingItem* tree,FXbool notify=FALSE); 558 559 /// Expand tree 560 virtual FXbool expandTree(FXFoldingItem* tree,FXbool notify=FALSE); 561 562 /// Change current item 563 virtual void setCurrentItem(FXFoldingItem* item,FXbool notify=FALSE); 564 565 /// Return current item, if any getCurrentItem()566 FXFoldingItem* getCurrentItem() const { return currentitem; } 567 568 /// Change anchor item 569 void setAnchorItem(FXFoldingItem* item); 570 571 /// Return anchor item, if any getAnchorItem()572 FXFoldingItem* getAnchorItem() const { return anchoritem; } 573 574 /// Return item under cursor, if any getCursorItem()575 FXFoldingItem* getCursorItem() const { return cursoritem; } 576 577 /// Sort all items recursively 578 void sortItems(); 579 580 /// Sort root items 581 void sortRootItems(); 582 583 /// Sort children of item 584 void sortChildItems(FXFoldingItem* item); 585 586 /// Return sort function getSortFunc()587 FXFoldingListSortFunc getSortFunc() const { return sortfunc; } 588 589 /// Change sort function setSortFunc(FXFoldingListSortFunc func)590 void setSortFunc(FXFoldingListSortFunc func){ sortfunc=func; } 591 592 /// Change text font 593 void setFont(FXFont* fnt); 594 595 /// Return text font getFont()596 FXFont* getFont() const { return font; } 597 598 /// Change parent-child indent amount 599 void setIndent(FXint in); 600 601 /// Return parent-child indent amount getIndent()602 FXint getIndent() const { return indent; } 603 604 /// Return normal text color getTextColor()605 FXColor getTextColor() const { return textColor; } 606 607 /// Change normal text color 608 void setTextColor(FXColor clr); 609 610 /// Return selected text background getSelBackColor()611 FXColor getSelBackColor() const { return selbackColor; } 612 613 /// Change selected text background 614 void setSelBackColor(FXColor clr); 615 616 /// Return selected text color getSelTextColor()617 FXColor getSelTextColor() const { return seltextColor; } 618 619 /// Change selected text color 620 void setSelTextColor(FXColor clr); 621 622 /// Return line color getLineColor()623 FXColor getLineColor() const { return lineColor; } 624 625 /// Change line color 626 void setLineColor(FXColor clr); 627 628 /// Return list style 629 FXuint getListStyle() const; 630 631 /// Change list style 632 void setListStyle(FXuint style); 633 634 /// Set the status line help text for this list 635 void setHelpText(const FXString& text); 636 637 /// Get the status line help text for this list getHelpText()638 const FXString& getHelpText() const { return help; } 639 640 /// Save object to a stream 641 virtual void save(FXStream& store) const; 642 643 /// Load object from a stream 644 virtual void load(FXStream& store); 645 646 /// Destructor 647 virtual ~FXFoldingList(); 648 }; 649 650 } 651 652 653 #endif 654