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

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,2004 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.21 2004/02/08 17:17:33 fox Exp $                          *
00023 ********************************************************************************/
00024 #ifndef FXDIRBOX_H
00025 #define FXDIRBOX_H
00026 
00027 #ifndef FXTREELISTBOX_H
00028 #include "FXTreeListBox.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXIcon;
00035 class FXFileDict;
00036 
00037 /// Directory Box options
00038 enum {
00039   DIRBOX_NO_OWN_ASSOC = 0x00020000      /// Do not create associations for files
00040   };
00041 
00042 
00043 /// Directory Box
00044 class FXAPI FXDirBox : public FXTreeListBox {
00045   FXDECLARE(FXDirBox)
00046 protected:
00047   FXFileDict *associations;     // Association table
00048   FXIcon     *foldericon;       // Folder icons
00049   FXIcon     *cdromicon;        // CDROM icon
00050   FXIcon     *harddiskicon;     // Hard disk icon
00051   FXIcon     *netdriveicon;     // Networked drive icon
00052   FXIcon     *floppyicon;       // Floppy icon
00053   FXIcon     *nethoodicon;      // Network neighborhood icon
00054   FXIcon     *zipdiskicon;      // Zip drive icon
00055 protected:
00056   FXDirBox(){}
00057   FXString getItemPathname(FXTreeItem *item) const;
00058   FXTreeItem* getPathnameItem(const FXString& path);
00059 private:
00060   FXDirBox(const FXDirBox&);
00061   FXDirBox &operator=(const FXDirBox&);
00062 public:
00063   long onChanged(FXObject*,FXSelector,void*);
00064   long onCommand(FXObject*,FXSelector,void*);
00065   long onCmdSetValue(FXObject*,FXSelector,void*);
00066   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00067   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00068 public:
00069 
00070   /// Constructor
00071   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);
00072 
00073   /// Create server-side resources
00074   virtual void create();
00075 
00076   /// Detach server-side resources
00077   virtual void detach();
00078 
00079   /// Destroy server-side resources
00080   virtual void destroy();
00081 
00082   /// Save to stream
00083   virtual void save(FXStream& store) const;
00084 
00085   /// Load from stream
00086   virtual void load(FXStream& store);
00087 
00088   /// Set current directory
00089   void setDirectory(const FXString& pathname);
00090 
00091   /// Return current directory
00092   FXString getDirectory() const;
00093 
00094   /// Change file associations
00095   void setAssociations(FXFileDict* assoc);
00096 
00097   /// Return file associations
00098   FXFileDict* getAssociations() const { return associations; }
00099 
00100   /// Destructor
00101   virtual ~FXDirBox();
00102   };
00103 
00104 }
00105 
00106 #endif

Copyright © 1997-2004 Jeroen van der Zijp