Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 550 lines (450 sloc) 19.964 kB
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
1 /***********************************************************************
2 * FXRuby -- the Ruby language bindings for the FOX GUI toolkit.
b8219ec @lylejohnson Updated copyright notice for all SWIG interface files
lylejohnson authored
3 * Copyright (c) 2001-2009 by Lyle Johnson. All Rights Reserved.
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 *
19 * For further information please contact the author by e-mail
a934547 @lylejohnson Replaced e-mail address "lyle@users.sourceforge.net" with
lylejohnson authored
20 * at "lyle@lylejohnson.name".
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
21 ***********************************************************************/
22
23 /// Tree list styles
24 enum {
25 TREELIST_EXTENDEDSELECT = 0, /// Extended selection mode allows for drag-selection of ranges of items
26 TREELIST_SINGLESELECT = 0x00100000, /// Single selection mode allows up to one item to be selected
27 TREELIST_BROWSESELECT = 0x00200000, /// Browse selection mode enforces one single item to be selected at all times
28 TREELIST_MULTIPLESELECT = 0x00300000, /// Multiple selection mode is used for selection of individual items
29 TREELIST_AUTOSELECT = 0x00400000, /// Automatically select under cursor
30 TREELIST_SHOWS_LINES = 0x00800000, /// Lines shown
31 TREELIST_SHOWS_BOXES = 0x01000000, /// Boxes to expand shown
32 TREELIST_ROOT_BOXES = 0x02000000, /// Display root boxes also
33 TREELIST_NORMAL = TREELIST_EXTENDEDLIST
34 };
35
36
37 class FXIcon;
38 class FXFont;
39 class FXTreeList;
40
41 %rename("hasItems?") FXTreeItem::hasItems() const;
42 %rename("hasItems=") FXTreeItem::setHasItems(FXbool);
43
44 class FXTreeItem : public FXObject {
45 protected:
46 FXTreeItem *parent; // Parent item
47 FXTreeItem *prev; // Previous item
48 FXTreeItem *next; // Next item
49 FXTreeItem *first; // First child item
50 FXTreeItem *last; // Last child item
51 FXString label; // Text of item
52 FXIcon *openIcon; // Icon of item
53 FXIcon *closedIcon; // Icon of item
54 void *data; // Item user data pointer
55 FXuint state; // Item state flags
56 FXint x,y;
57 protected:
58 FXTreeItem();
59 virtual void draw(const FXTreeList* list,FXDC& dc,FXint x,FXint y,FXint w,FXint h) const;
60 virtual FXint hitItem(const FXTreeList* list,FXint x,FXint y) const;
61 public:
62 enum{
63 SELECTED = 1, /// Selected
64 FOCUS = 2, /// Focus
65 DISABLED = 4, /// Disabled
66 OPENED = 8, /// Opened
67 EXPANDED = 16, /// Expanded
68 HASITEMS = 32, /// Has virtual subitems
69 DRAGGABLE = 64, /// Draggable
70 OPENICONOWNED = 128, /// Open icon owned by item
71 CLOSEDICONOWNED = 256 /// Close icon owned by item
72 };
73 public:
74 %extend {
75 FXTreeItem(const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ITEMDATA=NULL){
76 return new FXRbTreeItem(text,oi,ci,ITEMDATA);
77 }
78 }
79
80 /// Get item label
81 const FXString& getText() const;
82
83 /// Get open icon
84 FXIcon* getOpenIcon() const;
85
86 /// Get closed icon
87 FXIcon* getClosedIcon() const;
88
89 FXTreeItem* getParent() const;
90 FXTreeItem* getNext() const;
91 FXTreeItem* getPrev() const;
92 FXTreeItem* getFirst() const;
93 FXTreeItem* getLast() const;
94 FXTreeItem* getBelow() const;
95 FXTreeItem* getAbove() const;
96 FXint getNumChildren() const;
97
98 %extend {
99 void setData(VALUE ptr){
100 self->setData((void*) ptr);
101 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
102
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
103 VALUE getData() const {
104 return self->getData() ? (VALUE) self->getData() : Qnil;
105 }
106 }
107
108 FXbool hasFocus() const;
109 FXbool isSelected() const;
110 FXbool isOpened() const;
111 FXbool isExpanded() const;
112 FXbool isEnabled() const;
113 FXbool isDraggable() const;
114
115 /// Return TRUE if subitems, real or imagined
116 FXbool hasItems() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
117
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
118 /// Change has items flag
119 void setHasItems(FXbool flag);
bea4cad @larskanis Strip all whitespaces on line endings
authored
120
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
121 /// Return true if descendent of parent item
122 FXbool isChildOf(const FXTreeItem* item) const;
123
124 /// Return true if ancestor of child item
125 FXbool isParentOf(const FXTreeItem* item) const;
126
127 virtual ~FXTreeItem(){}
128 };
129
130
131 DECLARE_FXOBJECT_VIRTUALS(FXTreeItem)
132 DECLARE_FXTREEITEM_VIRTUALS(FXTreeItem)
133
134 %{
135 static swig_type_info *FXTreeItem_dynamic_cast(void **ptr) {
136 FXTreeItem **ppTreeItem = reinterpret_cast<FXTreeItem **>(ptr);
137 FXDirItem *pDirItem=dynamic_cast<FXDirItem*>(*ppTreeItem);
138 if(pDirItem){
139 *ptr=reinterpret_cast<void*>(pDirItem);
140 return SWIG_TypeQuery("FXDirItem *");
141 }
142 return 0;
143 }
144 %}
145
146 DYNAMIC_CAST(SWIGTYPE_p_FXTreeItem, FXTreeItem_dynamic_cast);
147
148 %ignore FXTreeList::getSortFunc() const;
149 %ignore FXTreeList::setSortFunc(FXTreeListSortFunc);
150
151 /**
152 * A Tree List Widget organizes items in a hierarchical, tree-like fashion.
153 * Subtrees can be collapsed or expanded by double-clicking on an item
154 * or by clicking on the optional plus button in front of the item.
155 * Each item may have a text and optional open-icon as well as a closed-icon.
156 * The items may be connected by optional lines to show the hierarchical
157 * relationship.
158 * When an item's selected state changes, the treelist emits a SEL_SELECTED
159 * or SEL_DESELECTED message. If an item is opened or closed, a message
160 * of type SEL_OPENED or SEL_CLOSED is sent. When the subtree under an
161 * item is expanded, a SEL_EXPANDED or SEL_COLLAPSED message is issued.
162 * A change of the current item is signified by the SEL_CHANGED message.
163 * In addition, the tree list sends SEL_COMMAND messages when the user
164 * clicks on an item, and SEL_CLICKED, SEL_DOUBLECLICKED, and SEL_TRIPLECLICKED
165 * when the user clicks once, twice, or thrice, respectively.
166 * When items are added or removed, the tree list sends messages of the
167 * type SEL_INSERTED or SEL_DELETED.
168 * In each of these cases, a pointer to the item, if any, is passed in the
169 * 3rd argument of the message.
170 */
171 class FXTreeList : public FXScrollArea {
172 protected:
173 FXTreeItem *firstitem; // First root item
174 FXTreeItem *lastitem; // Last root item
175 FXTreeItem *anchoritem; // Selection anchor item
176 FXTreeItem *currentitem; // Current item
177 FXTreeItem *extentitem; // Selection extent
178 FXTreeItem *cursoritem; // Item under cursor
179 FXTreeItem *viewableitem; // Visible item
180 FXFont *font; // Font
181 FXColor textColor; // Text color
182 FXColor selbackColor; // Selected background color
183 FXColor seltextColor; // Selected text color
184 FXColor lineColor; // Line color
185 FXint treeWidth; // Tree width
186 FXint treeHeight; // Tree height
187 FXint visible; // Number of visible items
188 FXint indent; // Parent to child indentation
189 FXint grabx; // Grab point x
190 FXint graby; // Grab point y
191 FXString lookup; // Lookup string
192 FXString help; // Help string
193 FXbool state; // State of item
194 protected:
195 FXTreeList();
196 virtual FXTreeItem* createItem(const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr);
197 // void sort(FXTreeItem*& f1,FXTreeItem*& t1,FXTreeItem*& f2,FXTreeItem*& t2,int n); FIXME
198 void recompute();
199 public:
200 long onPaint(FXObject*,FXSelector,void* PTR_EVENT);
201 long onEnter(FXObject*,FXSelector,void* PTR_EVENT);
202 long onLeave(FXObject*,FXSelector,void* PTR_EVENT);
203 long onUngrabbed(FXObject*,FXSelector,void* PTR_EVENT);
204 long onMotion(FXObject*,FXSelector,void* PTR_EVENT);
205 long onKeyPress(FXObject*,FXSelector,void* PTR_EVENT);
206 long onKeyRelease(FXObject*,FXSelector,void* PTR_EVENT);
207 long onLeftBtnPress(FXObject*,FXSelector,void* PTR_EVENT);
208 long onLeftBtnRelease(FXObject*,FXSelector,void* PTR_EVENT);
209 long onRightBtnPress(FXObject*,FXSelector,void* PTR_EVENT);
210 long onRightBtnRelease(FXObject*,FXSelector,void* PTR_EVENT);
211 long onQueryTip(FXObject*,FXSelector,void* PTR_IGNORE);
212 long onQueryHelp(FXObject*,FXSelector,void* PTR_IGNORE);
213 long onTipTimer(FXObject*,FXSelector,void* PTR_IGNORE);
214 long onFocusIn(FXObject*,FXSelector,void* PTR_EVENT);
215 long onFocusOut(FXObject*,FXSelector,void* PTR_EVENT);
216 long onAutoScroll(FXObject*,FXSelector,void* PTR_EVENT);
217 long onClicked(FXObject*,FXSelector,void* PTR_TREEITEM);
218 long onDoubleClicked(FXObject*,FXSelector,void* PTR_TREEITEM);
219 long onTripleClicked(FXObject*,FXSelector,void* PTR_TREEITEM);
220 long onCommand(FXObject*,FXSelector,void* PTR_TREEITEM);
221 long onLookupTimer(FXObject*,FXSelector,void* PTR_IGNORE);
222 public:
223 static FXint ascending(const FXTreeItem* a,const FXTreeItem* b);
224 static FXint descending(const FXTreeItem* a,const FXTreeItem* b);
225 static FXint ascendingCase(const FXTreeItem* a,const FXTreeItem* b);
226 static FXint descendingCase(const FXTreeItem* pa,const FXTreeItem* pb);
227 public:
228 enum {
229 ID_LOOKUPTIMER=FXScrollArea::ID_LAST,
230 ID_LAST
231 };
232 public:
233
234 /// Construct a new, initially empty tree list
235 %extend {
236 FXTreeList(FXComposite* p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=TREELIST_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0){
237 return new FXRbTreeList(p,tgt,sel,opts,x,y,w,h);
238 }
239 }
240
241 /// Return number of items
242 FXint getNumItems() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
243
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
244 /// Return number of visible items
245 FXint getNumVisible() const;
246
247 /// Change number of visible items
248 void setNumVisible(FXint nvis);
bea4cad @larskanis Strip all whitespaces on line endings
authored
249
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
250 /// Return first root item
251 FXTreeItem* getFirstItem() const;
252
253 /// Return last root item
254 FXTreeItem* getLastItem() const;
255
256 /// Fill tree list by appending items from array of strings
257 FXint fillItems(FXTreeItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ITEMDATA=NULL,FXbool notify=FALSE);
258
259 %extend {
260 /// Insert [possibly subclassed] item under father before other item
261 FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE){
262 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
263 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
264 }
265 return self->insertItem(other,father,item,notify);
266 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
267
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
268 /// Insert item with given text and optional icons, and user-data pointer under father before other item
269 FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ITEMDATA=NULL,FXbool notify=FALSE){
270 FXTreeItem* item=self->insertItem(other,father,text,oi,ci,ITEMDATA,notify);
271 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
272 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
273 }
274 return item;
275 }
276
bea4cad @larskanis Strip all whitespaces on line endings
authored
277 /// Append [possibly subclassed] item as last child of father
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
278 FXTreeItem* appendItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE){
279 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
280 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
281 }
282 return self->appendItem(father,item,notify);
283 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
284
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
285 /// Append item with given text and optional icons, and user-data pointer as last child of father
286 FXTreeItem* appendItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ITEMDATA=NULL,FXbool notify=FALSE){
287 FXTreeItem* item=self->appendItem(father,text,oi,ci,ITEMDATA,notify);
288 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
289 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
290 }
291 return item;
292 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
293
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
294 /// Prepend [possibly subclassed] item as first child of father
295 FXTreeItem* prependItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=FALSE){
296 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
297 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
298 }
299 return self->prependItem(father,item,notify);
300 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
301
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
302 /// Prepend item with given text and optional icons, and user-data pointer as first child of father
303 FXTreeItem* prependItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ITEMDATA=NULL,FXbool notify=FALSE){
304 FXTreeItem* item=self->prependItem(father,text,oi,ci,ITEMDATA,notify);
305 if(item->isMemberOf(FXMETACLASS(FXRbTreeItem))){
306 dynamic_cast<FXRbTreeItem*>(item)->owner=self;
307 }
308 return item;
309 }
310 }
311
312 /// Move item under father before other item
313 FXTreeItem *moveItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item);
314
315 /// Extract item
316 FXTreeItem* extractItem(FXTreeItem* item,FXbool notify=FALSE);
317
318 %extend {
319 /// Remove item
320 void removeItem(FXTreeItem* item,FXbool notify=FALSE){
321 // Save pointer(s) to the soon-to-be-destroyed items
322 FXObjectListOf<FXTreeItem> items;
323 FXRbTreeList::enumerateItem(item,items);
bea4cad @larskanis Strip all whitespaces on line endings
authored
324
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
325 // Do the deed
326 self->removeItem(item,notify);
bea4cad @larskanis Strip all whitespaces on line endings
authored
327
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
328 // Now zero-out pointers held by still-alive Ruby objects
329 for(FXint i=0;i<items.no();i++){
330 FXRbUnregisterRubyObj(items[i]);
331 }
332 }
333
334 /// Remove items in range [fm, to] inclusively
335 void removeItems(FXTreeItem* fm,FXTreeItem* to,FXbool notify=FALSE){
336 // Save pointer(s) to the soon-to-be-destroyed items
337 FXObjectListOf<FXTreeItem> items;
338 FXRbTreeList::enumerateItems(fm,to,items);
339
340 // Do the deed
341 self->removeItems(fm,to,notify);
342
343 // Now zero-out pointers held by still-alive Ruby objects
344 for(FXint i=0;i<items.no();i++){
345 FXRbUnregisterRubyObj(items[i]);
346 }
347 }
348
349 /// Remove all items from list
350 void clearItems(FXbool notify=FALSE){
351 // Save pointer(s) to the soon-to-be-destroyed items
352 FXObjectListOf<FXTreeItem> items;
353 FXRbTreeList::enumerateItems(self->getFirstItem(),self->getLastItem(),items);
354
355 // Do the deed
356 self->clearItems(notify);
357
358 // Now zero-out pointers held by still-alive Ruby objects
359 for(FXint i=0;i<items.no();i++){
360 FXRbUnregisterRubyObj(items[i]);
361 }
362 }
363 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
364
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
365 /// Return item width
366 FXint getItemWidth(const FXTreeItem* item) const;
367
368 /// Return item height
369 FXint getItemHeight(const FXTreeItem* item) const;
370
371 /**
372 * Search items by name, beginning from item start. If the start item
373 * is NULL the search will start at the first, top-most item in the list.
374 * Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control the search
375 * direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
376 * to control whether the search wraps at the start or end of the list.
377 * The option SEARCH_IGNORECASE causes a case-insensitive match. Finally,
378 * passing SEARCH_PREFIX causes searching for a prefix of the item name.
379 * Return NULL if no matching item is found.
380 */
381 FXTreeItem* findItem(const FXString& name,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
382
383 /**
384 * Search items by associated user data, beginning from item start. If the
385 * start item is NULL the search will start at the first, top-most item
386 * in the list. Flags may be SEARCH_FORWARD or SEARCH_BACKWARD to control
387 * the search direction; this can be combined with SEARCH_NOWRAP or SEARCH_WRAP
388 * to control whether the search wraps at the start or end of the list.
389 */
390 FXTreeItem* findItemByData(const void *ITEMDATA,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
391
392 /// Change item's text
393 void setItemText(FXTreeItem* item,const FXString& text);
bea4cad @larskanis Strip all whitespaces on line endings
authored
394
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
395 /// Return item's text
396 FXString getItemText(const FXTreeItem* item) const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
397
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
398 /// Change item's open icon, deleting the old icon if it was owned
399 void setItemOpenIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
bea4cad @larskanis Strip all whitespaces on line endings
authored
400
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
401 /// Return item's open icon
402 FXIcon* getItemOpenIcon(const FXTreeItem* item) const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
403
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
404 /// Chance item's closed icon, deleting the old icon if it was owned
405 void setItemClosedIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=FALSE);
bea4cad @larskanis Strip all whitespaces on line endings
authored
406
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
407 /// Return item's closed icon
408 FXIcon* getItemClosedIcon(const FXTreeItem* item) const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
409
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
410 %extend {
411 /// Change item user-data pointer
412 void setItemData(FXTreeItem* item,VALUE ptr){
413 self->setItemData(item,(void*) ptr);
414 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
415
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
416 /// Return item user-data pointer
417 VALUE getItemData(const FXTreeItem* item) const {
418 return self->getItemData(item) ? (VALUE) self->getItemData(item) : Qnil;
419 }
420 }
bea4cad @larskanis Strip all whitespaces on line endings
authored
421
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
422 /// Return TRUE if item is selected
423 FXbool isItemSelected(const FXTreeItem* item) const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
424
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
425 /// Return TRUE if item is current
426 FXbool isItemCurrent(const FXTreeItem* item) const;
427
428 /// Return TRUE if item is visible
429 FXbool isItemVisible(const FXTreeItem* item) const;
430
431 /// Return TRUE if item opened
432 FXbool isItemOpened(const FXTreeItem* item) const;
433
434 /// Return TRUE if item expanded
435 FXbool isItemExpanded(const FXTreeItem* item) const;
436
437 /// Return TRUE if item is a leaf-item, i.e. has no children
438 FXbool isItemLeaf(const FXTreeItem* item) const;
439
440 /// Return TRUE if item is enabled
441 FXbool isItemEnabled(const FXTreeItem* item) const;
442
443 /// Return item hit code: 0 outside, 1 icon, 2 text, 3 box
444 FXint hitItem(const FXTreeItem* item,FXint x,FXint y) const;
445
446 /// Repaint item
447 void updateItem(FXTreeItem* item) const;
448
449 /// Return current item, if any
450 FXTreeItem* getCurrentItem() const;
451
452 /// Change anchor item
453 void setAnchorItem(FXTreeItem* item);
454
455 /// Return anchor item, if any
456 FXTreeItem* getAnchorItem() const;
457
458 /// Return item under cursor, if any
459 FXTreeItem* getCursorItem() const;
460
461 /// Sort root items
462 void sortRootItems();
bea4cad @larskanis Strip all whitespaces on line endings
authored
463
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
464 /// Sort all items recursively
465 void sortItems();
466
467 /// Sort children of item
468 void sortChildItems(FXTreeItem* item);
bea4cad @larskanis Strip all whitespaces on line endings
authored
469
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
470 /// Return sort function
471 FXTreeListSortFunc getSortFunc() const;
472
473 /// Change sort function
474 void setSortFunc(FXTreeListSortFunc func);
475
476 /// Change text font
477 void setFont(FXFont* fnt);
478
479 /// Return text font
480 FXFont* getFont() const;
481
482 /// Change parent-child indent amount
483 void setIndent(FXint in);
484
485 /// Return parent-child indent amount
486 FXint getIndent() const;
487
488 /// Return normal text color
489 FXColor getTextColor() const;
490
491 /// Change normal text color
492 void setTextColor(FXColor clr);
493
494 /// Return selected text background
495 FXColor getSelBackColor() const;
496
497 /// Change selected text background
498 void setSelBackColor(FXColor clr);
499
500 /// Return selected text color
501 FXColor getSelTextColor() const;
502
503 /// Change selected text color
504 void setSelTextColor(FXColor clr);
bea4cad @larskanis Strip all whitespaces on line endings
authored
505
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
506 /// Return line color
507 FXColor getLineColor() const;
508
509 /// Change line color
510 void setLineColor(FXColor clr);
511
512 /// Return list style
513 FXuint getListStyle() const;
bea4cad @larskanis Strip all whitespaces on line endings
authored
514
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
515 /// Change list style
516 void setListStyle(FXuint style);
bea4cad @larskanis Strip all whitespaces on line endings
authored
517
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
518 /// Set the status line help text for this list
519 void setHelpText(const FXString& text);
bea4cad @larskanis Strip all whitespaces on line endings
authored
520
45cf7d8 @lylejohnson initial checkin of r2610 from trunk
lylejohnson authored
521 /// Get the status line help text for this list
522 const FXString& getHelpText() const;
523
524 /// Destructor
525 virtual ~FXTreeList();
526 };
527
528
529 DECLARE_FXOBJECT_VIRTUALS(FXTreeList)
530 DECLARE_FXID_VIRTUALS(FXTreeList)
531 DECLARE_FXDRAWABLE_VIRTUALS(FXTreeList)
532 DECLARE_FXWINDOW_VIRTUALS(FXTreeList)
533 DECLARE_FXSCROLLAREA_VIRTUALS(FXTreeList)
534 DECLARE_FXTREELIST_VIRTUALS(FXTreeList)
535
536 %{
537 static swig_type_info *FXTreeList_dynamic_cast(void **ptr) {
538 FXTreeList **ppTreeList = reinterpret_cast<FXTreeList **>(ptr);
539 FXDirList *pDirList=dynamic_cast<FXDirList*>(*ppTreeList);
540 if(pDirList){
541 *ptr=reinterpret_cast<void*>(pDirList);
542 return SWIG_TypeQuery("FXDirList *");
543 }
544 return 0;
545 }
546 %}
547
548 DYNAMIC_CAST(SWIGTYPE_p_FXTreeList, FXTreeList_dynamic_cast);
549
Something went wrong with that request. Please try again.