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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXTreeListBox.h
00001 /********************************************************************************
00002 *                                                                               *
00003 *                      T r e e   L i s t   B o x   W i d g e t                  *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2012 by Jeroen van der Zijp.   All Rights Reserved.        *
00007 *********************************************************************************
00008 * This library is free software; you can redistribute it and/or modify          *
00009 * it under the terms of the GNU Lesser General Public License as published by   *
00010 * the Free Software Foundation; either version 3 of the License, or             *
00011 * (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                 *
00016 * GNU Lesser General Public License for more details.                           *
00017 *                                                                               *
00018 * You should have received a copy of the GNU Lesser General Public License      *
00019 * along with this program.  If not, see <http://www.gnu.org/licenses/>          *
00020 ********************************************************************************/
00021 #ifndef FXTREELISTBOX_H
00022 #define FXTREELISTBOX_H
00023 
00024 #ifndef FXPACKER_H
00025 #include "FXPacker.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00032 enum {
00033   TREELISTBOX_NORMAL         = 0          
00034   };
00035 
00036 
00037 class FXButton;
00038 class FXMenuButton;
00039 class FXTreeList;
00040 class FXPopup;
00041 
00042 
00053 class FXAPI FXTreeListBox : public FXPacker {
00054   FXDECLARE(FXTreeListBox)
00055 protected:
00056   FXButton      *field;
00057   FXMenuButton  *button;
00058   FXTreeList    *tree;
00059   FXPopup       *pane;
00060 protected:
00061   FXTreeListBox(){}
00062 private:
00063   FXTreeListBox(const FXTreeListBox&);
00064   FXTreeListBox& operator=(const FXTreeListBox&);
00065 public:
00066   long onFocusUp(FXObject*,FXSelector,void*);
00067   long onFocusDown(FXObject*,FXSelector,void*);
00068   long onFocusSelf(FXObject*,FXSelector,void*);
00069   long onMouseWheel(FXObject*,FXSelector,void*);
00070   long onFieldButton(FXObject*,FXSelector,void*);
00071   long onTreeUpdate(FXObject*,FXSelector,void*);
00072   long onTreeForward(FXObject*,FXSelector,void*);
00073   long onTreeClicked(FXObject*,FXSelector,void*);
00074   long onTreeCommand(FXObject*,FXSelector,void*);
00075 public:
00076   enum{
00077     ID_TREE=FXPacker::ID_LAST,
00078     ID_FIELD,
00079     ID_LAST
00080     };
00081 public:
00082 
00084   FXTreeListBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_NORMAL,FXint x=0,FXint y=0,FXint w=0,FXint h=0,FXint pl=DEFAULT_PAD,FXint pr=DEFAULT_PAD,FXint pt=DEFAULT_PAD,FXint pb=DEFAULT_PAD);
00085 
00087   virtual void create();
00088 
00090   virtual void detach();
00091 
00093   virtual void destroy();
00094 
00096   virtual void layout();
00097 
00099   virtual void enable();
00100 
00102   virtual void disable();
00103 
00105   virtual FXint getDefaultWidth();
00106 
00108   virtual FXint getDefaultHeight();
00109 
00111   FXint getNumItems() const;
00112 
00114   FXint getNumVisible() const;
00115 
00117   void setNumVisible(FXint nvis);
00118 
00120   FXTreeItem* getFirstItem() const;
00121 
00123   FXTreeItem* getLastItem() const;
00124 
00126   FXbool isItemCurrent(const FXTreeItem* item) const;
00127 
00129   virtual void setCurrentItem(FXTreeItem* item,FXbool notify=false);
00130 
00132   FXTreeItem* getCurrentItem() const;
00133 
00135   FXint fillItems(FXTreeItem* father,const FXchar** strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=false);
00136 
00138   FXint fillItems(FXTreeItem* father,const FXString& strings,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=false);
00139 
00141   FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item,FXbool notify=false);
00142 
00144   FXTreeItem* insertItem(FXTreeItem* other,FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=false);
00145 
00147   FXTreeItem* appendItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=false);
00148 
00150   FXTreeItem* appendItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=false);
00151 
00153   FXTreeItem* prependItem(FXTreeItem* father,FXTreeItem* item,FXbool notify=false);
00154 
00156   FXTreeItem* prependItem(FXTreeItem* father,const FXString& text,FXIcon* oi=NULL,FXIcon* ci=NULL,void* ptr=NULL,FXbool notify=false);
00157 
00159   FXTreeItem *moveItem(FXTreeItem* other,FXTreeItem* father,FXTreeItem* item);
00160 
00162   FXTreeItem* extractItem(FXTreeItem* item,FXbool notify=false);
00163 
00165   void removeItem(FXTreeItem* item,FXbool notify=false);
00166 
00168   void removeItems(FXTreeItem* fm,FXTreeItem* to,FXbool notify=false);
00169 
00171   void clearItems(FXbool notify=false);
00172 
00183   FXTreeItem* findItem(const FXString& text,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
00184 
00192   FXTreeItem* findItemByData(const void *ptr,FXTreeItem* start=NULL,FXuint flags=SEARCH_FORWARD|SEARCH_WRAP) const;
00193 
00195   FXbool isItemLeaf(const FXTreeItem* item) const;
00196 
00198   void sortRootItems();
00199 
00201   void sortItems();
00202 
00204   void sortChildItems(FXTreeItem* item);
00205 
00207   void setItemText(FXTreeItem* item,const FXString& text);
00208 
00210   FXString getItemText(const FXTreeItem* item) const;
00211 
00213   void setItemOpenIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=false);
00214 
00216   FXIcon* getItemOpenIcon(const FXTreeItem* item) const;
00217 
00219   void setItemClosedIcon(FXTreeItem* item,FXIcon* icon,FXbool owned=false);
00220 
00222   FXIcon* getItemClosedIcon(const FXTreeItem* item) const;
00223 
00225   void setItemData(FXTreeItem* item,void* ptr) const;
00226 
00228   void* getItemData(const FXTreeItem* item) const;
00229 
00231   FXTreeListSortFunc getSortFunc() const;
00232 
00234   void setSortFunc(FXTreeListSortFunc func);
00235 
00237   void showMenu(FXbool shw);
00238 
00240   FXbool isMenuShown() const;
00241 
00243   void setFont(FXFont* fnt);
00244 
00246   FXFont* getFont() const;
00247 
00249   void setListStyle(FXuint style);
00250 
00252   FXuint getListStyle() const;
00253 
00255   void setShrinkWrap(FXbool flag);
00256 
00258   FXbool getShrinkWrap() const;
00259 
00261   void setHelpText(const FXString& txt);
00262 
00264   const FXString& getHelpText() const;
00265 
00267   void setTipText(const FXString& txt);
00268 
00270   const FXString& getTipText() const;
00271 
00273   virtual void save(FXStream& store) const;
00274 
00276   virtual void load(FXStream& store);
00277 
00279   virtual ~FXTreeListBox();
00280   };
00281 
00282 }
00283 
00284 #endif

Copyright © 1997-2011 Jeroen van der Zijp