Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members

FXFoldingList.h

00001 /******************************************************************************** 00002 * * 00003 * F o l d i n g L i s t W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1997,2005 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (at your option) any later version. * 00012 * * 00013 * This library is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXFoldingList.h,v 1.27 2005/02/06 17:20:00 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXFOLDINGLIST_H 00025 #define FXFOLDINGLIST_H 00026 00027 #ifndef FXSCROLLAREA_H 00028 #include "FXScrollArea.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 class FXIcon; 00035 class FXFont; 00036 class FXHeader; 00037 class FXFoldingList; 00038 00039 00040 /// Folding list styles 00041 enum { 00042 FOLDINGLIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items 00043 FOLDINGLIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected 00044 FOLDINGLIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times 00045 FOLDINGLIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items 00046 FOLDINGLIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor 00047 FOLDINGLIST_SHOWS_LINES = 0x00800000, /// Lines shown 00048 FOLDINGLIST_SHOWS_BOXES = 0x01000000, /// Boxes to expand shown 00049 FOLDINGLIST_ROOT_BOXES = 0x02000000, /// Display root boxes also 00050 FOLDINGLIST_NORMAL = FOLDINGLIST_EXTENDEDSELECT 00051 }; 00052 00053 00054 /// Tree list Item 00055 class FXAPI FXFoldingItem : public FXObject { 00056 FXDECLARE(FXFoldingItem) 00057 friend class FXFoldingList; 00058 friend class FXDirList; 00059 protected: 00060 FXFoldingItem *parent; 00061 FXFoldingItem *prev; 00062 FXFoldingItem *next; 00063 FXFoldingItem *first; 00064 FXFoldingItem *last; 00065 FXString label; 00066 FXIcon *openIcon; 00067 FXIcon *closedIcon; 00068 void *data; 00069 FXuint state; 00070 FXint x,y; 00071 protected: 00072 FXFoldingItem():parent(NULL),prev(NULL),next(NULL),first(NULL),last(NULL),openIcon(NULL),closedIcon(NULL),data(NULL),state(0),x(0),y(0){} 00073 virtual void draw(const FXFoldingList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const; 00074 virtual FXint hitItem(const FXFoldingList* list,FXint x,FXint y) const; 00075 public: 00076 enum{ 00077 SELECTED = 1, /// Selected 00078 FOCUS = 2, /// Focus 00079 DISABLED = 4, /// Disabled 00080 OPENED = 8, /// Opened 00081 EXPANDED = 16, /// Expanded 00082 HASITEMS = 32, /// Has virtual subitems 00083 DRAGGABLE = 64, /// Draggable 00084 OPENICONOWNED = 128, /// Open icon owned by item 00085 CLOSEDICONOWNED = 256 /// Close icon owned by item 00086 }; 00087 public: 00088 00089 /// Constructor 00090 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){} 00091 00092 /// Get parent item 00093 FXFoldingItem* getParent() const { return parent; } 00094 00095 /// Get next sibling item 00096 FXFoldingItem* getNext() const { return next; } 00097 00098 /// Get previous sibling item 00099 FXFoldingItem* getPrev() const { return prev; } 00100 00101 /// Get first child item 00102 FXFoldingItem* getFirst() const { return first; } 00103 00104 /// Get las child item 00105 FXFoldingItem* getLast() const { return last; } 00106 00107 /// Get item below this one in list 00108 FXFoldingItem* getBelow() const; 00109 00110 /// Get item above this one in list 00111 FXFoldingItem* getAbove() const; 00112 00113 /// Get number of children of item 00114 FXint getNumChildren() const; 00115 00116 /// Change item label 00117 virtual void setText(const FXString& txt); 00118 00119 /// Get item label 00120 const FXString& getText() const { return label; } 00121 00122 /// Change open icon, deleting old icon if it was owned 00123 virtual void setOpenIcon(FXIcon* icn,FXbool owned=FALSE); 00124 00125 /// Get open icon 00126 FXIcon* getOpenIcon() const { return openIcon; } 00127 00128 /// Change closed icon, deleting old icon if it was owned 00129 virtual void setClosedIcon(FXIcon* icn,FXbool owned=FALSE); 00130 00131 /// Get closed icon 00132 FXIcon* getClosedIcon() const { return closedIcon; } 00133 00134 /// Change item user data 00135 void setData(void* ptr){ data=ptr; } 00136 00137 /// Get item user data 00138 void* getData() const { return data; } 00139 00140 /// Make item draw as focused 00141 virtual void setFocus(FXbool focus); 00142 00143 /// Return true if item has focus 00144 FXbool hasFocus() const { return (state&FOCUS)!=0; } 00145 00146 /// Select item 00147 virtual void setSelected(FXbool selected); 00148 00149 /// Return true if this item is selected 00150 FXbool isSelected() const { return (state&SELECTED)!=0; } 00151 00152 /// Make item show as open 00153 virtual void setOpened(FXbool opened); 00154 00155 /// Return true if this item is open 00156 FXbool isOpened() const { return (state&OPENED)!=0; } 00157 00158 /// Expand or collapse item 00159 virtual void setExpanded(FXbool expanded); 00160 00161 /// Return true if this item is expanded into sub items 00162 FXbool isExpanded() const { return (state&EXPANDED)!=0; } 00163 00164 /// Enable or disable item 00165 virtual void setEnabled(FXbool enabled); 00166 00167 /// Return true if this item is enabled 00168 FXbool isEnabled() const { return (state&DISABLED)==0; } 00169 00170 /// Make item draggable 00171 virtual void setDraggable(FXbool draggable); 00172 00173 /// Return true if this item is draggable 00174 FXbool isDraggable() const { return (state&DRAGGABLE)!=0; } 00175 00176 /// Return TRUE if subitems, real or imagined 00177 FXbool hasItems() const { return (state&HASITEMS)!=0; } 00178 00179 /// Change has items flag 00180 void setHasItems(FXbool flag); 00181 00182 /// Return true if descendent of parent item 00183 FXbool isChildOf(const FXFoldingItem* item) const; 00184 00185 /// Return true if ancestor of child item 00186 FXbool isParentOf(const FXFoldingItem* item) const; 00187 00188 /// Return width of item as drawn in list 00189 virtual FXint getWidth(const FXFoldingList* list) const; 00190 00191 /// Return height of item as drawn in list 00192 virtual FXint getHeight(const FXFoldingList* list) const; 00193 00194 /// Create server-side resources 00195 virtual void create(); 00196 00197 /// Detach server-side resources 00198 virtual void detach(); 00199 00200 /// Destroy server-side resources 00201 virtual void destroy(); 00202 00203 /// Save to stream 00204 virtual void save(FXStream& store) const; 00205 00206 /// Load from stream 00207 virtual void load(FXStream& store); 00208 00209 /// Destroy item and free icons if owned 00210 virtual ~FXFoldingItem(); 00211 }; 00212 00213 00214 00215 /// Folding item collate function 00216 typedef FXint (*FXFoldingListSortFunc)(const FXFoldingItem*,const FXFoldingItem*); 00217 00218 00219 00220 /** 00221 * A Folding List Widget resembles a Tree list except that it supports a 00222 * header control to provide each item with multiple columns of text. 00223 * Subtrees can be collapsed or expanded by double-clicking on an item 00224 * or by clicking on the optional plus button in front of the item. 00225 * Each item may have a text and optional open-icon as well as a closed-icon. 00226 * The items may be connected by optional lines to show the hierarchical 00227 * relationship. 00228 * When an item's selected state changes, the folding list emits a SEL_SELECTED 00229 * or SEL_DESELECTED message. If an item is opened or closed, a message 00230 * of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an 00231 * item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued. 00232 * A change of the current item is signified by the SEL_CHANGED message. 00233 * In addition, the folding list sends SEL_COMMAND messages when the user 00234 * clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED 00235 * when the user clicks once, twice, or thrice, respectively. 00236 * When items are added or removed, the folding list sends messages of the 00237 * type SEL_INSERTED or SEL_DELETED. 00238 * In each of these cases, a pointer to the item, if any, is passed in the 00239 * 3rd argument of the message. 00240 */ 00241 class FXAPI FXFoldingList : public FXScrollArea { 00242 FXDECLARE(FXFoldingList) 00243 protected: 00244 FXHeader *header; // Tree header 00245 FXFoldingItem *firstitem; // First root item 00246 FXFoldingItem *lastitem; // Last root item 00247 FXFoldingItem *anchoritem; // Selection anchor item 00248 FXFoldingItem *currentitem; // Current item 00249 FXFoldingItem *extentitem; // Selection extent 00250 FXFoldingItem *cursoritem; // Item under cursor 00251 FXFont *font; // Font 00252 FXFoldingListSortFunc sortfunc; // Item sort function 00253 FXColor textColor; // Text color 00254 FXColor selbackColor; // Selected background color 00255 FXColor seltextColor; // Selected text color 00256 FXColor lineColor; // Line color 00257 FXint treeWidth; // Tree width 00258 FXint treeHeight; // Tree height 00259 FXint visible; // Number of visible items 00260 FXint indent; // Parent to child indentation 00261 FXint grabx; // Grab point x 00262 FXint graby; // Grab point y 00263 FXString lookup; // Lookup string 00264 FXString help; // Help string 00265 FXbool state; // State of item 00266 protected: 00267 FXFoldingList(); 00268 virtual FXFoldingItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr); 00269 virtual void moveContents(FXint x,FXint y); 00270 void sort(FXFoldingItem*& f1,FXFoldingItem*& t1,FXFoldingItem*& f2,FXFoldingItem*& t2,int n); 00271 void mergesort(FXFoldingItem*& list); 00272 void recompute(); 00273 private: 00274 FXFoldingList(const FXFoldingList&); 00275 FXFoldingList& operator=(const FXFoldingList&); 00276 public: 00277 long onPaint(FXObject*,FXSelector,void*); 00278 long onEnter(FXObject*,FXSelector,void*); 00279 long onLeave(FXObject*,FXSelector,void*); 00280 long onUngrabbed(FXObject*,FXSelector,void*); 00281 long onMotion(FXObject*,FXSelector,void*); 00282 long onKeyPress(FXObject*,FXSelector,void*); 00283 long onKeyRelease(FXObject*,FXSelector,void*); 00284 long onLeftBtnPress(FXObject*,FXSelector,void*); 00285 long onLeftBtnRelease(FXObject*,FXSelector,void*); 00286 long onRightBtnPress(FXObject*,FXSelector,void*); 00287 long onRightBtnRelease(FXObject*,FXSelector,void*); 00288 long onHeaderChanged(FXObject*,FXSelector,void*); 00289 long onQueryTip(FXObject*,FXSelector,void*); 00290 long onQueryHelp(FXObject*,FXSelector,void*); 00291 long onTipTimer(FXObject*,FXSelector,void*); 00292 long onFocusIn(FXObject*,FXSelector,void*); 00293 long onFocusOut(FXObject*,FXSelector,void*); 00294 long onAutoScroll(FXObject*,FXSelector,void*); 00295 long onClicked(FXObject*,FXSelector,void*); 00296 long onDoubleClicked(FXObject*,FXSelector,void*); 00297 long onTripleClicked(FXObject*,FXSelector,void*); 00298 long onCommand(FXObject*,FXSelector,void*); 00299 long onLookupTimer(FXObject*,FXSelector,void*); 00300 public: 00301 static FXint ascending(const FXFoldingItem*,const FXFoldingItem*); 00302 static FXint descending(const FXFoldingItem*,const FXFoldingItem*); 00303 static FXint ascendingCase(const FXFoldingItem*,const FXFoldingItem*); 00304 static FXint descendingCase(const FXFoldingItem*,const FXFoldingItem*); 00305 public: 00306 enum { 00307 ID_LOOKUPTIMER=FXScrollArea::ID_LAST, 00308 ID_HEADER_CHANGE, 00309 ID_LAST 00310 }; 00311 public: 00312 00313 /// Construct a folding list; the folding list is initially empty 00314 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); 00315 00316 /// Create server-side resources 00317 virtual void create(); 00318 00319 /// Detach server-side resources 00320 virtual void detach(); 00321 00322 /// Perform layout 00323 virtual void layout(); 00324 00325 /// Return default width 00326 virtual FXint getDefaultWidth(); 00327 00328 /// Return default height 00329 virtual FXint getDefaultHeight(); 00330 00331 /// Compute and return content width 00332 virtual FXint getContentWidth(); 00333 00334 /// Return content height 00335 virtual FXint getContentHeight(); 00336 00337 /// Recalculate layout 00338 virtual void recalc(); 00339 00340 /// Tree list can receive focus 00341 virtual FXbool canFocus() const; 00342 00343 /// Move the focus to this window 00344 virtual void setFocus(); 00345 00346 /// Remove the focus from this window 00347 virtual void killFocus(); 00348 00349 /// Return header control 00350 FXHeader* getHeader() const { return header; } 00351 00352 /// Set headers from array of strings 00353 void setHeaders(const FXchar** strings,FXint size=1); 00354 00355 /// Set headers from newline separated strings 00356 void setHeaders(const FXString& strings,FXint size=1); 00357 00358 /// Append header with given text and optional icon 00359 void appendHeader(const FXString& text,FXIcon *icon=NULL,FXint size=1); 00360 00361 /// Remove header at index 00362 void removeHeader(FXint index); 00363 00364 /// Change text of header at index 00365 void setHeaderText(FXint index,const FXString& text); 00366 00367 /// Return text of header at index 00368 FXString getHeaderText(FXint index) const; 00369 00370 /// Change icon of header at index 00371 void setHeaderIcon(FXint index,FXIcon *icon); 00372 00373 /// Return icon of header at index 00374 FXIcon* getHeaderIcon(FXint index) const; 00375 00376 /// Change size of header at index 00377 void setHeaderSize(FXint index,FXint size); 00378 00379 /// Return width of header at index 00380 FXint getHeaderSize(FXint index) const; 00381 00382 /// Return number of headers 00383 FXint getNumHeaders() const; 00384 00385 /// Return number of items 00386 FXint getNumItems() const; 00387 00388 /// Return number of visible items 00389 FXint getNumVisible() const { return visible; } 00390 00391 /// Change number of visible items 00392 void setNumVisible(FXint nvis); 00393 00394 /// Return first root item 00395 FXFoldingItem* getFirstItem() const { return firstitem; } 00396 00397 /// Return last root item 00398 FXFoldingItem* getLastItem() const { return lastitem; } 00399 00400 /// Fill list by appending items from array of strings 00401 FXint fillItems(FXFoldingItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 00402 00403 /// Fill list by appending items from newline separated strings 00404 FXint fillItems(FXFoldingItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 00405 00406 /// Insert [possibly subclassed] item under father before other item 00407 FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 00408 00409 /// Insert item with given text and optional icons, and user-data pointer under father before other item 00410 FXFoldingItem* insertItem(FXFoldingItem* other,FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 00411 00412 /// Append [possibly subclassed] item as last child of father 00413 FXFoldingItem* appendItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 00414 00415 /// Append item with given text and optional icons, and user-data pointer as last child of father 00416 FXFoldingItem* appendItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 00417 00418 /// Prepend [possibly subclassed] item as first child of father 00419 FXFoldingItem* prependItem(FXFoldingItem* father,FXFoldingItem* item,FXbool notify=FALSE); 00420 00421 /// Prepend item with given text and optional icons, and user-data pointer as first child of father 00422 FXFoldingItem* prependItem(FXFoldingItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=FALSE); 00423 00424 /// Move item under father before other item 00425 FXFoldingItem *moveItem(FXFoldingItem* other,FXFoldingItem* father,FXFoldingItem* item); 00426 00427 /// Remove item 00428 void removeItem(FXFoldingItem* item,FXbool notify=FALSE); 00429 00430 /// Remove items in range [fm, to] inclusively 00431 void removeItems(FXFoldingItem* fm,FXFoldingItem* to,FXbool notify=FALSE); 00432 00433 /// Remove all items from list 00434 void clearItems(FXbool notify=FALSE); 00435 00436 /// Return item width 00437 FXint getItemWidth(const FXFoldingItem* item) const { return item->getWidth(this); } 00438 00439 /// Return item height 00440 FXint getItemHeight(const FXFoldingItem* item) const { return item->getHeight(this); } 00441 00442 /// Get item at x,y, if any 00443 virtual FXFoldingItem* getItemAt(FXint x,FXint y) const; 00444 00445 /** 00446 * Search items by name, beginning from item start. If the start item 00447 * is NULL the search will start at the first, top-most item in the list. 00448 * Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search 00449 * direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP 00450 * to control whether the search wraps at the start or end of the list. 00451 * The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, 00452 * passing SEARCH_PREFIX causes searching for a prefix of the item name. 00453 * Return NULL if no matching item is found. 00454 */ 00455 FXFoldingItem* findItem(const FXString& text,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const; 00456 00457 /** 00458 * Search items by associated user data, beginning from item start. If the 00459 * start item is NULL the search will start at the first, top-most item 00460 * in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control 00461 * the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP 00462 * to control whether the search wraps at the start or end of the list. 00463 * The option SEARCH_IGNORECASE causes a case-insensitive match. Finally, 00464 * passing SEARCH_PREFIX causes searching for a prefix of the item name. 00465 * Return NULL if no matching item is found. 00466 */ 00467 FXFoldingItem* findItemByData(const void *ptr,FXFoldingItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const; 00468 00469 /// Scroll to make item visible 00470 virtual void makeItemVisible(FXFoldingItem* item); 00471 00472 /// Change item's text 00473 void setItemText(FXFoldingItem* item,const FXString& text); 00474 00475 /// Return item's text 00476 FXString getItemText(const FXFoldingItem* item) const; 00477 00478 /// Change item's open icon, deleting old icon if it was owned 00479 void setItemOpenIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE); 00480 00481 /// Return item's open icon 00482 FXIcon* getItemOpenIcon(const FXFoldingItem* item) const; 00483 00484 /// Chance item's closed icon, deleting old icon if it was owned 00485 void setItemClosedIcon(FXFoldingItem* item,FXIcon* icon,FXbool owned=FALSE); 00486 00487 /// Return item's closed icon 00488 FXIcon* getItemClosedIcon(const FXFoldingItem* item) const; 00489 00490 /// Change item user-data pointer 00491 void setItemData(FXFoldingItem* item,void* ptr) const; 00492 00493 /// Return item user-data pointer 00494 void* getItemData(const FXFoldingItem* item) const; 00495 00496 /// Return TRUE if item is selected 00497 FXbool isItemSelected(const FXFoldingItem* item) const; 00498 00499 /// Return TRUE if item is current 00500 FXbool isItemCurrent(const FXFoldingItem* item) const; 00501 00502 /// Return TRUE if item is visible 00503 FXbool isItemVisible(const FXFoldingItem* item) const; 00504 00505 /// Return TRUE if item opened 00506 FXbool isItemOpened(const FXFoldingItem* item) const; 00507 00508 /// Return TRUE if item expanded 00509 FXbool isItemExpanded(const FXFoldingItem* item) const; 00510 00511 /// Return TRUE if item is a leaf-item, i.e. has no children 00512 FXbool isItemLeaf(const FXFoldingItem* item) const; 00513 00514 /// Return TRUE if item is enabled 00515 FXbool isItemEnabled(const FXFoldingItem* item) const; 00516 00517 /// Return item hit code: 0 outside, 1 icon, 2 text, 3 box 00518 FXint hitItem(const FXFoldingItem* item,FXint x,FXint y) const; 00519 00520 /// Repaint item 00521 void updateItem(FXFoldingItem* item); 00522 00523 /// Enable item 00524 virtual FXbool enableItem(FXFoldingItem* item); 00525 00526 /// Disable item 00527 virtual FXbool disableItem(FXFoldingItem* item); 00528 00529 /// Select item 00530 virtual FXbool selectItem(FXFoldingItem* item,FXbool notify=FALSE); 00531 00532 /// Deselect item 00533 virtual FXbool deselectItem(FXFoldingItem* item,FXbool notify=FALSE); 00534 00535 /// Toggle item selection 00536 virtual FXbool toggleItem(FXFoldingItem* item,FXbool notify=FALSE); 00537 00538 /// Extend selection from anchor item to item 00539 virtual FXbool extendSelection(FXFoldingItem* item,FXbool notify=FALSE); 00540 00541 /// Deselect all items 00542 virtual FXbool killSelection(FXbool notify=FALSE); 00543 00544 /// Open item 00545 virtual FXbool openItem(FXFoldingItem* item,FXbool notify=FALSE); 00546 00547 /// Close item 00548 virtual FXbool closeItem(FXFoldingItem* item,FXbool notify=FALSE); 00549 00550 /// Collapse tree 00551 virtual FXbool collapseTree(FXFoldingItem* tree,FXbool notify=FALSE); 00552 00553 /// Expand tree 00554 virtual FXbool expandTree(FXFoldingItem* tree,FXbool notify=FALSE); 00555 00556 /// Change current item 00557 virtual void setCurrentItem(FXFoldingItem* item,FXbool notify=FALSE); 00558 00559 /// Return current item, if any 00560 FXFoldingItem* getCurrentItem() const { return currentitem; } 00561 00562 /// Change anchor item 00563 void setAnchorItem(FXFoldingItem* item); 00564 00565 /// Return anchor item, if any 00566 FXFoldingItem* getAnchorItem() const { return anchoritem; } 00567 00568 /// Return item under cursor, if any 00569 FXFoldingItem* getCursorItem() const { return cursoritem; } 00570 00571 /// Sort all items recursively 00572 void sortItems(); 00573 00574 /// Sort root items 00575 void sortRootItems(); 00576 00577 /// Sort children of item 00578 void sortChildItems(FXFoldingItem* item); 00579 00580 /// Return sort function 00581 FXFoldingListSortFunc getSortFunc() const { return sortfunc; } 00582 00583 /// Change sort function 00584 void setSortFunc(FXFoldingListSortFunc func){ sortfunc=func; } 00585 00586 /// Change text font 00587 void setFont(FXFont* fnt); 00588 00589 /// Return text font 00590 FXFont* getFont() const { return font; } 00591 00592 /// Change parent-child indent amount 00593 void setIndent(FXint in); 00594 00595 /// Return parent-child indent amount 00596 FXint getIndent() const { return indent; } 00597 00598 /// Return normal text color 00599 FXColor getTextColor() const { return textColor; } 00600 00601 /// Change normal text color 00602 void setTextColor(FXColor clr); 00603 00604 /// Return selected text background 00605 FXColor getSelBackColor() const { return selbackColor; } 00606 00607 /// Change selected text background 00608 void setSelBackColor(FXColor clr); 00609 00610 /// Return selected text color 00611 FXColor getSelTextColor() const { return seltextColor; } 00612 00613 /// Change selected text color 00614 void setSelTextColor(FXColor clr); 00615 00616 /// Return line color 00617 FXColor getLineColor() const { return lineColor; } 00618 00619 /// Change line color 00620 void setLineColor(FXColor clr); 00621 00622 /// Return list style 00623 FXuint getListStyle() const; 00624 00625 /// Change list style 00626 void setListStyle(FXuint style); 00627 00628 /// Set the status line help text for this list 00629 void setHelpText(const FXString& text); 00630 00631 /// Get the status line help text for this list 00632 const FXString& getHelpText() const { return help; } 00633 00634 /// Save object to a stream 00635 virtual void save(FXStream& store) const; 00636 00637 /// Load object from a stream 00638 virtual void load(FXStream& store); 00639 00640 /// Destructor 00641 virtual ~FXFoldingList(); 00642 }; 00643 00644 } 00645 00646 00647 #endif

Copyright © 1997-2005 Jeroen van der Zijp