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 FX_DISABLEFILEDIRDIALOGS
00025 
00026 #ifndef FXDRIVEBOX_H
00027 #define FXDRIVEBOX_H
00028 
00029 #ifndef FXLISTBOX_H
00030 #include "FXListBox.h"
00031 #endif
00032 
00033 namespace FX {
00034 
00035 
00036 class FXIcon;
00037 class FXFileDict;
00038 
00040 enum {
00041   DRIVEBOX_NO_OWN_ASSOC = 0x00020000    
00042   };
00043 
00044 
00046 class FXAPI FXDriveBox : public FXListBox {
00047   FXDECLARE(FXDriveBox)
00048 protected:
00049   FXFileDict *associations;     // Association table
00050   FXIcon     *foldericon;       // Folder icons
00051   FXIcon     *cdromicon;        // CDROM icon
00052   FXIcon     *harddiskicon;     // Hard disk icon
00053   FXIcon     *netdriveicon;     // Networked drive icon
00054   FXIcon     *floppyicon;       // Floppy icon
00055   FXIcon     *nethoodicon;      // Network neighborhood icon
00056   FXIcon     *zipdiskicon;      // Zip drive icon
00057 protected:
00058   FXDriveBox(){}
00059   void listDrives();
00060 private:
00061   FXDriveBox(const FXDriveBox&);
00062   FXDriveBox &operator=(const FXDriveBox&);
00063 public:
00064   long onListChanged(FXObject*,FXSelector,void*);
00065   long onListClicked(FXObject*,FXSelector,void*);
00066   long onCmdSetValue(FXObject*,FXSelector,void*);
00067   long onCmdSetStringValue(FXObject*,FXSelector,void*);
00068   long onCmdGetStringValue(FXObject*,FXSelector,void*);
00069 public:
00070 
00072   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);
00073 
00075   virtual void create();
00076 
00078   virtual void detach();
00079 
00081   virtual void destroy();
00082 
00084   virtual void save(FXStream& store) const;
00085 
00087   virtual void load(FXStream& store);
00088 
00090   FXbool setDrive(const FXString& drive);
00091 
00093   FXString getDrive() const;
00094 
00096   void setAssociations(FXFileDict* assoc);
00097 
00099   FXFileDict* getAssociations() const { return associations; }
00100 
00102   virtual ~FXDriveBox();
00103   };
00104 
00105 }
00106 
00107 #endif
00108 #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