FXDirBox.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                    D i r e c t o r y   B o x   W i d g e t                    *
00004 *                                                                               *
00005 *********************************************************************************
00006 * Copyright (C) 1999,2006 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: FXDirBox.h,v 1.25 2006/01/22 17:58:00 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FX_DISABLEFILEDIRDIALOGS
00025 
00026 #ifndef FXDIRBOX_H
00027 #define FXDIRBOX_H
00028 
00029 #ifndef FXTREELISTBOX_H
00030 #include "FXTreeListBox.h"
00031 #endif
00032 
00033 namespace FX {
00034 
00035 
00036 class FXIcon;
00037 class FXFileDict;
00038 
00040 enum {
00041   DIRBOX_NO_OWN_ASSOC = 0x00020000      
00042   };
00043 
00044 
00054 class FXAPI FXDirBox : public FXTreeListBox {
00055   FXDECLARE(FXDirBox)
00056 protected:
00057   FXFileDict *associations;     // Association table
00058   FXIcon     *foldericon;       // Folder icons
00059   FXIcon     *cdromicon;        // CDROM icon
00060   FXIcon     *harddiskicon;     // Hard disk icon
00061   FXIcon     *netdriveicon;     // Networked drive icon
00062   FXIcon     *floppyicon;       // Floppy icon
00063   FXIcon     *nethoodicon;      // Network neighborhood icon
00064   FXIcon     *zipdiskicon;      // Zip drive icon
00065 protected:
00066   FXDirBox(){}
00067   FXString getItemPathname(FXTreeItem *item) const;
00068   FXTreeItem* getPathnameItem(const FXString& path);
00069 private:
00070   FXDirBox(const FXDirBox&);
00071   FXDirBox &operator=(const FXDirBox&);
00072 public:
00073   long onTreeChanged(FXObject*,FXSelector,void*);
00074   long onTreeClicked(FXObject*,FXSelector,void*);
00075   long onCmdSetValue(FXObject*,FXSelector,void*);
00076   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00077   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00078 public:
00079 
00081   FXDirBox(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);
00082 
00084   virtual void create();
00085 
00087   virtual void detach();
00088 
00090   virtual void destroy();
00091 
00093   virtual void save(FXStream& store) const;
00094 
00096   virtual void load(FXStream& store);
00097 
00099   void setDirectory(const FXString& pathname);
00100 
00102   FXString getDirectory() const;
00103 
00105   void setAssociations(FXFileDict* assoc);
00106 
00108   FXFileDict* getAssociations() const { return associations; }
00109 
00111   virtual ~FXDirBox();
00112   };
00113 
00114 }
00115 
00116 #endif
00117 #endif

(C) 2002-2009 Niall Douglas. Some parts (C) to assorted authors.
Generated on Fri Nov 20 18:31:20 2009 for TnFOX by doxygen v1.4.7