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

FXDriveBox.h
Go to the documentation of this file.
1 /********************************************************************************
2 * *
3 * D r i v e B o x W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2006 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or *
9 * modify it under the terms of the GNU Lesser General Public *
10 * License as published by the Free Software Foundation; either *
11 * version 2.1 of the License, or (at your option) any later version. *
12 * *
13 * This library is distributed in the hope that it will be useful, *
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
16 * Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public *
19 * License along with this library; if not, write to the Free Software *
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
21 *********************************************************************************
22 * $Id: FXDriveBox.h,v 1.17 2006/01/22 17:58:01 fox Exp $ *
23 ********************************************************************************/
24 #ifndef FXDRIVEBOX_H
25 #define FXDRIVEBOX_H
26 
27 #ifndef FXLISTBOX_H
28 #include "FXListBox.h"
29 #endif
30 
31 namespace FX {
32 
33 
34 class FXIcon;
35 class FXFileDict;
36 
37 /// Drive Box options
38 enum {
39  DRIVEBOX_NO_OWN_ASSOC = 0x00020000 /// Do not create associations for files
40  };
41 
42 
43 /// Directory Box
44 class FXAPI FXDriveBox : public FXListBox {
46 protected:
47  FXFileDict *associations; // Association table
48  FXIcon *foldericon; // Folder icons
49  FXIcon *cdromicon; // CDROM icon
50  FXIcon *harddiskicon; // Hard disk icon
51  FXIcon *netdriveicon; // Networked drive icon
52  FXIcon *floppyicon; // Floppy icon
53  FXIcon *nethoodicon; // Network neighborhood icon
54  FXIcon *zipdiskicon; // Zip drive icon
55 protected:
56  FXDriveBox(){}
57  void listDrives();
58 private:
59  FXDriveBox(const FXDriveBox&);
60  FXDriveBox &operator=(const FXDriveBox&);
61 public:
62  long onListChanged(FXObject*,FXSelector,void*);
63  long onListClicked(FXObject*,FXSelector,void*);
64  long onCmdSetValue(FXObject*,FXSelector,void*);
65  long onCmdSetStringValue(FXObject*,FXSelector,void*);
66  long onCmdGetStringValue(FXObject*,FXSelector,void*);
67 public:
68 
69  /// Constructor
71 
72  /// Create server-side resources
73  virtual void create();
74 
75  /// Detach server-side resources
76  virtual void detach();
77 
78  /// Destroy server-side resources
79  virtual void destroy();
80 
81  /// Save to stream
82  virtual void save(FXStream& store) const;
83 
84  /// Load from stream
85  virtual void load(FXStream& store);
86 
87  /// Set current drive
88  FXbool setDrive(const FXString& drive);
89 
90  /// Return current drive
91  FXString getDrive() const;
92 
93  /// Change file associations
94  void setAssociations(FXFileDict* assoc);
95 
96  /// Return file associations
97  FXFileDict* getAssociations() const { return associations; }
98 
99  /// Destructor
100  virtual ~FXDriveBox();
101  };
102 
103 }
104 
105 #endif
Do not create associations for files.
Definition: FXDriveBox.h:42
unsigned int FXuint
Definition: fxdefs.h:396
Definition: FXFrame.h:56
FXuint FXSelector
Association key.
Definition: FXObject.h:53
#define FXAPI
Definition: fxdefs.h:122
The List Box is a control to select one of a list of options.
Definition: FXListBox.h:62
FXuchar FXbool
Definition: fxdefs.h:393
Sunken border.
Definition: FXWindow.h:76
Base composite.
Definition: FXComposite.h:35
#define NULL
Definition: fxdefs.h:41
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:99
The File Association dictionary associates a file extension with a File Association record which cont...
Definition: FXFileDict.h:85
Definition: FX4Splitter.h:31
int FXint
Definition: fxdefs.h:397
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:45
Directory Box.
Definition: FXDriveBox.h:52
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:166
Thick border.
Definition: FXWindow.h:78
FXString drive(const FXString &file)
Return the drive letter prefixing this file name (if any).
Normal style.
Definition: FXListBox.h:39
#define FXDECLARE(classname)
Macro to set up class declaration.
Definition: FXObject.h:92
FXString provides essential string manipulation capabilities.
Definition: FXString.h:33

Copyright © 1997-2005 Jeroen van der Zijp