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

FXDriveBox.h

Go to the documentation of this file.
00001 /********************************************************************************
00002 *                                                                               *
00003 *                        D r i v e   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: FXDriveBox.h,v 1.17 2006/01/22 17:58:01 fox Exp $                        *
00023 ********************************************************************************/
00024 #ifndef FXDRIVEBOX_H
00025 #define FXDRIVEBOX_H
00026 
00027 #ifndef FXLISTBOX_H
00028 #include "FXListBox.h"
00029 #endif
00030 
00031 namespace FX {
00032 
00033 
00034 class FXIcon;
00035 class FXFileDict;
00036 
00037 /// Drive Box options
00038 enum {
00039   DRIVEBOX_NO_OWN_ASSOC = 0x00020000    /// Do not create associations for files
00040   };
00041 
00042 
00043 /// Directory Box
00044 class FXAPI FXDriveBox : public FXListBox {
00045   FXDECLARE(FXDriveBox)
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   FXDriveBox(){}
00057   void listDrives();
00058 private:
00059   FXDriveBox(const FXDriveBox&);
00060   FXDriveBox &operator=(const FXDriveBox&);
00061 public:
00062   long onListChanged(FXObject*,FXSelector,void*);
00063   long onListClicked(FXObject*,FXSelector,void*);
00064   long onCmdSetValue(FXObject*,FXSelector,void*);
00065   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00066   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00067 public:
00068 
00069   /// Constructor
00070   FXDriveBox(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|LISTBOX_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);
00071 
00072   /// Create server-side resources
00073   virtual void create();
00074 
00075   /// Detach server-side resources
00076   virtual void detach();
00077 
00078   /// Destroy server-side resources
00079   virtual void destroy();
00080 
00081   /// Save to stream
00082   virtual void save(FXStream& store) const;
00083 
00084   /// Load from stream
00085   virtual void load(FXStream& store);
00086 
00087   /// Set current drive
00088   FXbool setDrive(const FXString& drive);
00089 
00090   /// Return current drive
00091   FXString getDrive() const;
00092 
00093   /// Change file associations
00094   void setAssociations(FXFileDict* assoc);
00095 
00096   /// Return file associations
00097   FXFileDict* getAssociations() const { return associations; }
00098 
00099   /// Destructor
00100   virtual ~FXDriveBox();
00101   };
00102 
00103 }
00104 
00105 #endif

Copyright © 1997-2005 Jeroen van der Zijp