1 /********************************************************************************
2 *                                                                               *
3 *                       T r e e  L i s t  B o x  O b j e c t                    *
4 *                                                                               *
5 *********************************************************************************
6 * Copyright (C) 1999,2005 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: FXTreeListBox.cpp,v 1.52 2005/02/06 17:20:00 fox Exp $                   *
23 ********************************************************************************/
24 #include "xincs.h"
25 #include "fxver.h"
26 #include "fxdefs.h"
27 #include "fxkeys.h"
28 #include "FXHash.h"
29 #include "FXThread.h"
30 #include "FXStream.h"
31 #include "FXString.h"
32 #include "FXSize.h"
33 #include "FXPoint.h"
34 #include "FXRectangle.h"
35 #include "FXRegistry.h"
36 #include "FXAccelTable.h"
37 #include "FXApp.h"
38 #include "FXFont.h"
39 #include "FXWindow.h"
40 #include "FXFrame.h"
41 #include "FXLabel.h"
42 #include "FXTextField.h"
43 #include "FXButton.h"
44 #include "FXMenuButton.h"
45 #include "FXPopup.h"
46 #include "FXScrollBar.h"
47 #include "FXTreeList.h"
48 #include "FXTreeListBox.h"
49 
50 
51 /*
52   Notes:
53   - Handling typed text:
54     a) Pass string to target only.
55     b) Pass string to target & add to list [begin, after/before current, or end].
56     c) Pass string to target & replace current item's label.
57   - In most other respects, it behaves like a FXTextField.
58   - Need to catch up/down arrow keys.
59   - Need to have mode to pass item* instead of char*.
60   - TreeListBox turns OFF GUI Updating while being manipulated.
61   - Fix this one [and FXComboBox also] the height is the height as determined
62     by the TreeList's item height...
63   - Perhaps may add some access API's to FXTreeItem?
64   - The default height of the treelist box is not good yet.
65   - Perhaps use TWO tree lists, one in the pane, and one in the box;
66     we can then rest assured that the metrics are always computed properly.
67   - Still need some code to make sure always one item shows in box.
68   - No reaction to up and down arrow while disabled.
69 */
70 
71 #define TREELISTBOX_MASK       (0)
72 
73 using namespace FX;
74 
75 
76 /*******************************************************************************/
77 
78 namespace FX {
79 
80 // Map
81 FXDEFMAP(FXTreeListBox) FXTreeListBoxMap[]={
82   FXMAPFUNC(SEL_FOCUS_UP,0,FXTreeListBox::onFocusUp),
83   FXMAPFUNC(SEL_FOCUS_DOWN,0,FXTreeListBox::onFocusDown),
84   FXMAPFUNC(SEL_FOCUS_SELF,0,FXTreeListBox::onFocusSelf),
85   FXMAPFUNC(SEL_UPDATE,FXTreeListBox::ID_TREE,FXTreeListBox::onTreeUpdate),
86   FXMAPFUNC(SEL_CHANGED,FXTreeListBox::ID_TREE,FXTreeListBox::onTreeChanged),
87   FXMAPFUNC(SEL_CLICKED,FXTreeListBox::ID_TREE,FXTreeListBox::onTreeClicked),
88   FXMAPFUNC(SEL_LEFTBUTTONPRESS,FXTreeListBox::ID_FIELD,FXTreeListBox::onFieldButton),
89   };
90 
91 
92 // Object implementation
FXIMPLEMENT(FXTreeListBox,FXPacker,FXTreeListBoxMap,ARRAYNUMBER (FXTreeListBoxMap))93 FXIMPLEMENT(FXTreeListBox,FXPacker,FXTreeListBoxMap,ARRAYNUMBER(FXTreeListBoxMap))
94 
95 
96 // List box
97 FXTreeListBox::FXTreeListBox(FXComposite *p,FXObject* tgt,FXSelector sel,FXuint opts,FXint x,FXint y,FXint w,FXint h,FXint pl,FXint pr,FXint pt,FXint pb):
98   FXPacker(p,opts,x,y,w,h, 0,0,0,0, 0,0){
99   flags|=FLAG_ENABLED;
100   target=tgt;
101   message=sel;
102   field=new FXButton(this," ",NULL,this,FXTreeListBox::ID_FIELD,ICON_BEFORE_TEXT|JUSTIFY_LEFT, 0,0,0,0, pl,pr,pt,pb);
103   field->setBackColor(getApp()->getBackColor());
104   pane=new FXPopup(this,FRAME_LINE);
105   tree=new FXTreeList(pane,this,FXTreeListBox::ID_TREE,TREELIST_BROWSESELECT|TREELIST_AUTOSELECT|LAYOUT_FILL_X|LAYOUT_FILL_Y|SCROLLERS_TRACK|HSCROLLING_OFF);
106   tree->setIndent(0);
107   button=new FXMenuButton(this,NULL,NULL,pane,FRAME_RAISED|FRAME_THICK|MENUBUTTON_DOWN|MENUBUTTON_ATTACH_RIGHT, 0,0,0,0, 0,0,0,0);
108   button->setXOffset(border);
109   button->setYOffset(border);
110   flags&=~FLAG_UPDATE;  // Never GUI update
111   }
112 
113 
114 // Create window
create()115 void FXTreeListBox::create(){
116   FXPacker::create();
117   pane->create();
118   }
119 
120 // Detach window
detach()121 void FXTreeListBox::detach(){
122   pane->detach();
123   FXPacker::detach();
124   }
125 
126 
127 // Destroy window
destroy()128 void FXTreeListBox::destroy(){
129   pane->destroy();
130   FXPacker::destroy();
131   }
132 
133 
134 // Enable the window
enable()135 void FXTreeListBox::enable(){
136   if(!isEnabled()){
137     FXPacker::enable();
138     field->setBackColor(getApp()->getBackColor());
139     field->enable();
140     button->enable();
141     }
142   }
143 
144 
145 // Disable the window
disable()146 void FXTreeListBox::disable(){
147   if(isEnabled()){
148     FXPacker::disable();
149     field->setBackColor(getApp()->getBaseColor());
150     field->disable();
151     button->disable();
152     }
153   }
154 
155 
156 // Get default width
getDefaultWidth()157 FXint FXTreeListBox::getDefaultWidth(){
158   FXint ww,pw;
159   ww=field->getDefaultWidth()+button->getDefaultWidth()+(border<<1);
160   pw=pane->getDefaultWidth();
161   return FXMAX(ww,pw);
162   }
163 
164 
165 // Get default height
getDefaultHeight()166 FXint FXTreeListBox::getDefaultHeight(){
167   FXint th,bh;
168   th=field->getDefaultHeight();
169   bh=button->getDefaultHeight();
170   return FXMAX(th,bh)+(border<<1);
171   }
172 
173 
174 // Recalculate layout
layout()175 void FXTreeListBox::layout(){
176   FXint buttonWidth,fieldWidth,itemHeight;
177   itemHeight=height-(border<<1);
178   buttonWidth=button->getDefaultWidth();
179   fieldWidth=width-buttonWidth-(border<<1);
180   field->position(border,border,fieldWidth,itemHeight);
181   button->position(border+fieldWidth,border,buttonWidth,itemHeight);
182   pane->resize(width,pane->getDefaultHeight());
183   flags&=~FLAG_DIRTY;
184   }
185 
186 
187 // Forward clicked message from list to target
onTreeClicked(FXObject *,FXSelector,void * ptr)188 long FXTreeListBox::onTreeClicked(FXObject*,FXSelector,void* ptr){
189   button->handle(this,FXSEL(SEL_COMMAND,ID_UNPOST),NULL);    // Unpost the list
190   if(ptr){
191     field->setText(tree->getItemText((FXTreeItem*)ptr));
192     field->setIcon(tree->getItemClosedIcon((FXTreeItem*)ptr));
193     if(target) target->tryHandle(this,FXSEL(SEL_COMMAND,message),ptr);
194     }
195   return 1;
196   }
197 
198 
199 // Forward changed message from list to target
onTreeChanged(FXObject *,FXSelector,void * ptr)200 long FXTreeListBox::onTreeChanged(FXObject*,FXSelector,void* ptr){
201   return target && target->tryHandle(this,FXSEL(SEL_CHANGED,message),ptr);
202   }
203 
204 
205 // Forward GUI update of tree to target; but only if pane is not popped
onTreeUpdate(FXObject *,FXSelector,void *)206 long FXTreeListBox::onTreeUpdate(FXObject*,FXSelector,void*){
207   return target && !isPaneShown() && target->tryHandle(this,FXSEL(SEL_UPDATE,message),NULL);
208   }
209 
210 
211 // Pressed left button in text field
onFieldButton(FXObject *,FXSelector,void *)212 long FXTreeListBox::onFieldButton(FXObject*,FXSelector,void*){
213   button->handle(this,FXSEL(SEL_COMMAND,ID_POST),NULL);      // Post the list
214   return 1;
215   }
216 
217 
218 // Bounce focus to the field
onFocusSelf(FXObject * sender,FXSelector,void * ptr)219 long FXTreeListBox::onFocusSelf(FXObject* sender,FXSelector,void* ptr){
220   return field->handle(sender,FXSEL(SEL_FOCUS_SELF,0),ptr);
221   }
222 
223 
224 // Select upper item
onFocusUp(FXObject *,FXSelector,void *)225 long FXTreeListBox::onFocusUp(FXObject*,FXSelector,void*){
226   if(isEnabled()){
227     FXTreeItem *item=getCurrentItem();
228     if(!item){
229       for(item=getLastItem(); item->getLast(); item=item->getLast());
230       }
231     else if(item->getAbove()){
232       item=item->getAbove();
233       }
234     if(item){
235       setCurrentItem(item);
236       if(target) target->tryHandle(this,FXSEL(SEL_COMMAND,message),(void*)item);
237       }
238     return 1;
239     }
240   return 0;
241   }
242 
243 
244 // Select lower item
onFocusDown(FXObject *,FXSelector,void *)245 long FXTreeListBox::onFocusDown(FXObject*,FXSelector,void*){
246   if(isEnabled()){
247     FXTreeItem *item=getCurrentItem();
248     if(!item){
249       item=getFirstItem();
250       }
251     else if(item->getBelow()){
252       item=item->getBelow();
253       }
254     if(item){
255       setCurrentItem(item);
256       if(target) target->tryHandle(this,FXSEL(SEL_COMMAND,message),(void*)item);
257       }
258     return 1;
259     }
260   return 0;
261   }
262 
263 
264 
265 // Is the pane shown
isPaneShown() const266 FXbool FXTreeListBox::isPaneShown() const {
267   return pane->shown();
268   }
269 
270 
271 // Set font
setFont(FXFont * fnt)272 void FXTreeListBox::setFont(FXFont* fnt){
273   if(!fnt){ fxerror("%s::setFont: NULL font specified.\n",getClassName()); }
274   field->setFont(fnt);
275   tree->setFont(fnt);
276   recalc();
277   }
278 
279 
280 // Obtain font
getFont() const281 FXFont* FXTreeListBox::getFont() const {
282   return field->getFont();
283   }
284 
285 
286 // Get number of items
getNumItems() const287 FXint FXTreeListBox::getNumItems() const {
288   return tree->getNumItems();
289   }
290 
291 
292 // Get number of visible items
getNumVisible() const293 FXint FXTreeListBox::getNumVisible() const {
294   return tree->getNumVisible();
295   }
296 
297 
298 // Set number of visible items
setNumVisible(FXint nvis)299 void FXTreeListBox::setNumVisible(FXint nvis){
300   tree->setNumVisible(nvis);
301   }
302 
303 
304 // Get first item
getFirstItem() const305 FXTreeItem* FXTreeListBox::getFirstItem() const {
306   return tree->getFirstItem();
307   }
308 
309 
310 // Get last item
getLastItem() const311 FXTreeItem* FXTreeListBox::getLastItem() const {
312   return tree->getLastItem();
313   }
314 
315 
316 // Fill tree list box by appending items from array of strings
fillItems(FXTreeItem * father,const FXchar ** strings,FXIcon * oi,FXIcon * ci,void * ptr)317 FXint FXTreeListBox::fillItems(FXTreeItem* father,const FXchar** strings,FXIcon* oi,FXIcon* ci,void* ptr){
318   register FXTreeItem* currentitem=tree->getCurrentItem();
319   register FXint n=tree->fillItems(father,strings,oi,ci,ptr);
320   if(currentitem!=tree->getCurrentItem()){
321     field->setIcon(tree->getItemClosedIcon(tree->getCurrentItem()));
322     field->setText(tree->getItemText(tree->getCurrentItem()));
323     }
324   recalc();
325   return n;
326   }
327 
328 
329 // Fill tree list box by appending items from newline separated strings
fillItems(FXTreeItem * father,const FXString & strings,FXIcon * oi,FXIcon * ci,void * ptr)330 FXint FXTreeListBox::fillItems(FXTreeItem* father,const FXString& strings,FXIcon* oi,FXIcon* ci,void* ptr){
331   register FXTreeItem* currentitem=tree->getCurrentItem();
332   register FXint n=tree->fillItems(father,strings,oi,ci,ptr);
333   if(currentitem!=tree->getCurrentItem()){
334     field->setIcon(tree->getItemClosedIcon(tree->getCurrentItem()));
335     field->setText(tree->getItemText(tree->getCurrentItem()));
336     }
337   recalc();
338   return n;
339   }
340 
341 
342 // Insert item under father before other item
insertItem(FXTreeItem * other,FXTreeItem * father,FXTreeItem * item)343 FXTreeItem* FXTreeListBox::insertItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item){
344   register FXTreeItem *newitem=tree->insertItem(other,father,item);
345   if(tree->getCurrentItem()==newitem){
346     field->setIcon(tree->getItemClosedIcon(newitem));
347     field->setText(tree->getItemText(newitem));
348     }
349   recalc();
350   return newitem;
351   }
352 
353 
354 // Insert item with given text and optional icons, and user-data pointer under father before other item
insertItem(FXTreeItem * other,FXTreeItem * father,const FXString & text,FXIcon * oi,FXIcon * ci,void * ptr)355 FXTreeItem* FXTreeListBox::insertItem(FXTreeItem* other,FXTreeItem* father,const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr){
356   register FXTreeItem *newitem=tree->insertItem(other,father,text,oi,ci,ptr);
357   if(tree->getCurrentItem()==newitem){
358     field->setIcon(tree->getItemClosedIcon(newitem));
359     field->setText(tree->getItemText(newitem));
360     }
361   recalc();
362   return newitem;
363   }
364 
365 
366 // Append item as last child of father
appendItem(FXTreeItem * father,FXTreeItem * item)367 FXTreeItem* FXTreeListBox::appendItem(FXTreeItem* father,FXTreeItem* item){
368   register FXTreeItem *newitem=tree->appendItem(father,item);
369   if(tree->getCurrentItem()==newitem){
370     field->setIcon(tree->getItemClosedIcon(newitem));
371     field->setText(tree->getItemText(newitem));
372     }
373   recalc();
374   return newitem;
375   }
376 
377 
378 // Append item with given text and optional icons, and user-data pointer as last child of father
appendItem(FXTreeItem * father,const FXString & text,FXIcon * oi,FXIcon * ci,void * ptr)379 FXTreeItem* FXTreeListBox::appendItem(FXTreeItem* father,const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr){
380   register FXTreeItem *newitem=tree->appendItem(father,text,oi,ci,ptr);
381   if(tree->getCurrentItem()==newitem){
382     field->setIcon(tree->getItemClosedIcon(newitem));
383     field->setText(tree->getItemText(newitem));
384     }
385   recalc();
386   return newitem;
387   }
388 
389 
390 // Prepend item as first child of father
prependItem(FXTreeItem * father,FXTreeItem * item)391 FXTreeItem* FXTreeListBox::prependItem(FXTreeItem* father,FXTreeItem* item){
392   register FXTreeItem *newitem=tree->prependItem(father,item);
393   if(tree->getCurrentItem()==newitem){
394     field->setIcon(tree->getItemClosedIcon(newitem));
395     field->setText(tree->getItemText(newitem));
396     }
397   recalc();
398   return newitem;
399   }
400 
401 
402 // Prepend item with given text and optional icons, and user-data pointer as first child of father
prependItem(FXTreeItem * father,const FXString & text,FXIcon * oi,FXIcon * ci,void * ptr)403 FXTreeItem* FXTreeListBox::prependItem(FXTreeItem* father,const FXString& text,FXIcon* oi,FXIcon* ci,void* ptr){
404   register FXTreeItem *newitem=tree->prependItem(father,text,oi,ci,ptr);
405   if(tree->getCurrentItem()==newitem){
406     field->setIcon(tree->getItemClosedIcon(newitem));
407     field->setText(tree->getItemText(newitem));
408     }
409   recalc();
410   return newitem;
411   }
412 
413 
414 // Move item under father before other item
moveItem(FXTreeItem * other,FXTreeItem * father,FXTreeItem * item)415 FXTreeItem *FXTreeListBox::moveItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item){
416   register FXTreeItem *newitem=tree->moveItem(other,father,item);
417   recalc();
418   return newitem;
419   }
420 
421 
422 // Remove given item
removeItem(FXTreeItem * item)423 void FXTreeListBox::removeItem(FXTreeItem* item){
424   register FXTreeItem *currentitem=tree->getCurrentItem();
425   tree->removeItem(item);
426   if(item==currentitem){
427     currentitem=tree->getCurrentItem();
428     if(currentitem){
429       field->setIcon(tree->getItemClosedIcon(currentitem));
430       field->setText(tree->getItemText(currentitem));
431       }
432     else{
433       field->setIcon(NULL);
434       field->setText(" ");
435       }
436     }
437   recalc();
438   }
439 
440 
441 // Remove sequence of items
removeItems(FXTreeItem * fm,FXTreeItem * to)442 void FXTreeListBox::removeItems(FXTreeItem* fm,FXTreeItem* to){
443   tree->removeItems(fm,to);
444   recalc();
445   }
446 
447 
448 // Remove all items
clearItems()449 void FXTreeListBox::clearItems(){
450   tree->clearItems();
451   recalc();
452   }
453 
454 
455 // Get item by name
findItem(const FXString & text,FXTreeItem * start,FXuint flgs) const456 FXTreeItem* FXTreeListBox::findItem(const FXString& text,FXTreeItem* start,FXuint flgs) const {
457   return tree->findItem(text,start,flgs);
458   }
459 
460 
461 // Get item by data
findItemByData(const void * ptr,FXTreeItem * start,FXuint flgs) const462 FXTreeItem* FXTreeListBox::findItemByData(const void *ptr,FXTreeItem* start,FXuint flgs) const {
463   return tree->findItemByData(ptr,start,flgs);
464   }
465 
466 
467 // Is item current
isItemCurrent(const FXTreeItem * item) const468 FXbool FXTreeListBox::isItemCurrent(const FXTreeItem* item) const {
469   return tree->isItemCurrent(item);
470   }
471 
472 
473 // Is item a leaf
isItemLeaf(const FXTreeItem * item) const474 FXbool FXTreeListBox::isItemLeaf(const FXTreeItem* item) const {
475   return tree->isItemLeaf(item);
476   }
477 
478 
479 // Sort all items recursively
sortItems()480 void FXTreeListBox::sortItems(){
481   tree->sortItems();
482   }
483 
484 
485 // Sort item child list
sortChildItems(FXTreeItem * item)486 void FXTreeListBox::sortChildItems(FXTreeItem* item){
487   tree->sortChildItems(item);
488   }
489 
490 
491 // Sort item list
sortRootItems()492 void FXTreeListBox::sortRootItems(){
493   tree->sortRootItems();
494   }
495 
496 
497 // Change current item
setCurrentItem(FXTreeItem * item,FXbool notify)498 void FXTreeListBox::setCurrentItem(FXTreeItem* item,FXbool notify){
499   tree->setCurrentItem(item,notify);
500   tree->makeItemVisible(item);
501   if(item){
502     field->setIcon(tree->getItemClosedIcon(item));
503     field->setText(tree->getItemText(item));
504     }
505   else{
506     field->setIcon(NULL);
507     field->setText(NULL);
508     }
509   }
510 
511 
512 // Get current item
getCurrentItem() const513 FXTreeItem* FXTreeListBox::getCurrentItem() const {
514   return tree->getCurrentItem();
515   }
516 
517 
518 // Set item text
setItemText(FXTreeItem * item,const FXString & text)519 void FXTreeListBox::setItemText(FXTreeItem* item,const FXString& text){
520   if(item==NULL){ fxerror("%s::setItemText: item is NULL\n",getClassName()); }
521   if(isItemCurrent(item)) field->setText(text);
522   tree->setItemText(item,text);
523   recalc();
524   }
525 
526 
527 // Get item text
getItemText(const FXTreeItem * item) const528 FXString FXTreeListBox::getItemText(const FXTreeItem* item) const {
529   if(item==NULL){ fxerror("%s::getItemText: item is NULL\n",getClassName()); }
530   return tree->getItemText(item);
531   }
532 
533 
534 // Change open icon
setItemOpenIcon(FXTreeItem * item,FXIcon * icon,FXbool owned)535 void FXTreeListBox::setItemOpenIcon(FXTreeItem* item,FXIcon* icon,FXbool owned){
536   tree->setItemOpenIcon(item,icon,owned);
537   }
538 
539 
540 // Get open icon
getItemOpenIcon(const FXTreeItem * item) const541 FXIcon* FXTreeListBox::getItemOpenIcon(const FXTreeItem* item) const {
542   return tree->getItemOpenIcon(item);
543   }
544 
545 
546 // Set closed icon
setItemClosedIcon(FXTreeItem * item,FXIcon * icon,FXbool owned)547 void FXTreeListBox::setItemClosedIcon(FXTreeItem* item,FXIcon* icon,FXbool owned){
548   tree->setItemClosedIcon(item,icon,owned);
549   }
550 
551 
552 // Get closed icon
getItemClosedIcon(const FXTreeItem * item) const553 FXIcon* FXTreeListBox::getItemClosedIcon(const FXTreeItem* item) const{
554   return tree->getItemClosedIcon(item);
555   }
556 
557 
558 // Set item data
setItemData(FXTreeItem * item,void * ptr) const559 void FXTreeListBox::setItemData(FXTreeItem* item,void* ptr) const {
560   if(item==NULL){ fxerror("%s::setItemData: item is NULL\n",getClassName()); }
561   tree->setItemData(item,ptr);
562   }
563 
564 
565 // Get item data
getItemData(const FXTreeItem * item) const566 void* FXTreeListBox::getItemData(const FXTreeItem* item) const {
567   if(item==NULL){ fxerror("%s::getItemData: item is NULL\n",getClassName()); }
568   return tree->getItemData(item);
569   }
570 
571 
572 // Get sort function
getSortFunc() const573 FXTreeListSortFunc FXTreeListBox::getSortFunc() const {
574   return tree->getSortFunc();
575   }
576 
577 
578 // Change sort function
setSortFunc(FXTreeListSortFunc func)579 void FXTreeListBox::setSortFunc(FXTreeListSortFunc func){
580   tree->setSortFunc(func);
581   }
582 
583 
584 // Change list style
setListStyle(FXuint mode)585 void FXTreeListBox::setListStyle(FXuint mode){
586   FXuint opts=(options&~TREELISTBOX_MASK)|(mode&TREELISTBOX_MASK);
587   if(opts!=options){
588     options=opts;
589     recalc();
590     }
591   }
592 
593 
594 // Get list style
getListStyle() const595 FXuint FXTreeListBox::getListStyle() const {
596   return (options&TREELISTBOX_MASK);
597   }
598 
599 
600 // Set help text
setHelpText(const FXString & txt)601 void FXTreeListBox::setHelpText(const FXString& txt){
602   field->setHelpText(txt);
603   }
604 
605 
606 // Get help text
getHelpText() const607 const FXString& FXTreeListBox::getHelpText() const {
608   return field->getHelpText();
609   }
610 
611 
612 // Set tip text
setTipText(const FXString & txt)613 void FXTreeListBox::setTipText(const FXString& txt){
614   field->setTipText(txt);
615   }
616 
617 
618 // Get tip text
getTipText() const619 const FXString& FXTreeListBox::getTipText() const {
620   return field->getTipText();
621   }
622 
623 
624 // Save object to stream
save(FXStream & store) const625 void FXTreeListBox::save(FXStream& store) const {
626   FXPacker::save(store);
627   store << field;
628   store << button;
629   store << tree;
630   store << pane;
631   }
632 
633 
634 // Load object from stream
load(FXStream & store)635 void FXTreeListBox::load(FXStream& store){
636   FXPacker::load(store);
637   store >> field;
638   store >> button;
639   store >> tree;
640   store >> pane;
641   }
642 
643 
644 // Delete it
~FXTreeListBox()645 FXTreeListBox::~FXTreeListBox(){
646   delete pane;
647   pane=(FXPopup*)-1L;
648   field=(FXButton*)-1L;
649   button=(FXMenuButton*)-1L;
650   tree=(FXTreeList*)-1L;
651   }
652 
653 }
654