![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
00001 /******************************************************************************** 00002 * * 00003 * D r i v e B o x W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 1999,2009 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 * $Id: FXDriveBox.h,v 1.23 2009/01/06 13:07:23 fox Exp $ * 00022 ********************************************************************************/ 00023 #ifndef FXDRIVEBOX_H 00024 #define FXDRIVEBOX_H 00025 00026 #ifndef FXLISTBOX_H 00027 #include "FXListBox.h" 00028 #endif 00029 00030 namespace FX { 00031 00032 00033 class FXIcon; 00034 class FXFileDict; 00035 00036 /// Drive Box options 00037 enum { 00038 DRIVEBOX_NO_OWN_ASSOC = 0x00020000 /// Do not create associations for files 00039 }; 00040 00041 00042 /// Directory Box 00043 class FXAPI FXDriveBox : public FXListBox { 00044 FXDECLARE(FXDriveBox) 00045 protected: 00046 FXFileDict *associations; // Association table 00047 FXIcon *foldericon; // Folder icons 00048 FXIcon *cdromicon; // CDROM icon 00049 FXIcon *harddiskicon; // Hard disk icon 00050 FXIcon *netdriveicon; // Networked drive icon 00051 FXIcon *floppyicon; // Floppy icon 00052 FXIcon *nethoodicon; // Network neighborhood icon 00053 FXIcon *zipdiskicon; // Zip drive icon 00054 protected: 00055 FXDriveBox(){} 00056 void listDrives(); 00057 private: 00058 FXDriveBox(const FXDriveBox&); 00059 FXDriveBox &operator=(const FXDriveBox&); 00060 public: 00061 long onListChanged(FXObject*,FXSelector,void*); 00062 long onListClicked(FXObject*,FXSelector,void*); 00063 long onCmdSetValue(FXObject*,FXSelector,void*); 00064 long onCmdSetStringValue(FXObject*,FXSelector,void*); 00065 long onCmdGetStringValue(FXObject*,FXSelector,void*); 00066 public: 00067 00068 /// Constructor 00069 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); 00070 00071 /// Create server-side resources 00072 virtual void create(); 00073 00074 /// Detach server-side resources 00075 virtual void detach(); 00076 00077 /// Destroy server-side resources 00078 virtual void destroy(); 00079 00080 /// Save to stream 00081 virtual void save(FXStream& store) const; 00082 00083 /// Load from stream 00084 virtual void load(FXStream& store); 00085 00086 /// Set current drive 00087 FXbool setDrive(const FXString& drive); 00088 00089 /// Return current drive 00090 FXString getDrive() const; 00091 00092 /// Change file associations 00093 void setAssociations(FXFileDict* assoc); 00094 00095 /// Return file associations 00096 FXFileDict* getAssociations() const { return associations; } 00097 00098 /// Destructor 00099 virtual ~FXDriveBox(); 00100 }; 00101 00102 } 00103 00104 #endif
![]() |