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

/home/jeroen/FOX/fox/fox-1.7.33/include/FXDirBox.h
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,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 FXDIRBOX_H
00022 #define FXDIRBOX_H
00023 
00024 #ifndef FXTREELISTBOX_H
00025 #include "FXTreeListBox.h"
00026 #endif
00027 
00028 namespace FX {
00029 
00030 
00031 class FXIcon;
00032 class FXFileDict;
00033 
00035 enum {
00036   DIRBOX_NO_OWN_ASSOC = 0x00020000      
00037   };
00038 
00039 
00049 class FXAPI FXDirBox : public FXTreeListBox {
00050   FXDECLARE(FXDirBox)
00051 protected:
00052   FXFileDict *associations;     // Association table
00053   FXIcon     *foldericon;       // Folder icons
00054   FXIcon     *cdromicon;        // CDROM icon
00055   FXIcon     *harddiskicon;     // Hard disk icon
00056   FXIcon     *netdriveicon;     // Networked drive icon
00057   FXIcon     *floppyicon;       // Floppy icon
00058   FXIcon     *nethoodicon;      // Network neighborhood icon
00059   FXIcon     *zipdiskicon;      // Zip drive icon
00060 protected:
00061   FXDirBox(){}
00062   FXString getItemPathname(FXTreeItem *item) const;
00063   FXTreeItem* getPathnameItem(const FXString& path);
00064 private:
00065   FXDirBox(const FXDirBox&);
00066   FXDirBox &operator=(const FXDirBox&);
00067 public:
00068   long onTreeChanged(FXObject*,FXSelector,void*);
00069   long onTreeCommand(FXObject*,FXSelector,void*);
00070   long onCmdSetValue(FXObject*,FXSelector,void*);
00071   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00072   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00073 public:
00074 
00076   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);
00077 
00079   virtual void create();
00080 
00082   virtual void detach();
00083 
00085   virtual void destroy();
00086 
00088   virtual void save(FXStream& store) const;
00089 
00091   virtual void load(FXStream& store);
00092 
00094   void setDirectory(const FXString& pathname);
00095 
00097   FXString getDirectory() const;
00098 
00100   void setAssociations(FXFileDict* assoc,FXbool owned=false);
00101 
00103   FXFileDict* getAssociations() const { return associations; }
00104 
00106   virtual ~FXDirBox();
00107   };
00108 
00109 }
00110 
00111 #endif

Copyright © 1997-2011 Jeroen van der Zijp