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

FXDriveBox.h
1 /********************************************************************************
2 * *
3 * D r i v e B o x W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2017 by Jeroen van der Zijp. All Rights Reserved. *
7 *********************************************************************************
8 * This library is free software; you can redistribute it and/or modify *
9 * it under the terms of the GNU Lesser General Public License as published by *
10 * the Free Software Foundation; either version 3 of the License, or *
11 * (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 *
16 * GNU Lesser General Public License for more details. *
17 * *
18 * You should have received a copy of the GNU Lesser General Public License *
19 * along with this program. If not, see <http://www.gnu.org/licenses/> *
20 ********************************************************************************/
21 #ifndef FXDRIVEBOX_H
22 #define FXDRIVEBOX_H
23 
24 #ifndef FXLISTBOX_H
25 #include "FXListBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXFileAssociations;
32 
34 enum {
35  DRIVEBOX_NO_OWN_ASSOC = 0x00020000
36  };
37 
38 
40 class FXAPI FXDriveBox : public FXListBox {
41  FXDECLARE(FXDriveBox)
42 protected:
43  FXFileAssociations *associations; // Association table
44  FXIcon *foldericon; // Folder icons
45  FXIcon *cdromicon; // CDROM icon
46  FXIcon *harddiskicon; // Hard disk icon
47  FXIcon *netdriveicon; // Networked drive icon
48  FXIcon *floppyicon; // Floppy icon
49  FXIcon *nethoodicon; // Network neighborhood icon
50  FXIcon *zipdiskicon; // Zip drive icon
51 protected:
52  FXDriveBox(){}
53  void listDrives();
54 private:
55  FXDriveBox(const FXDriveBox&);
56  FXDriveBox &operator=(const FXDriveBox&);
57 public:
58  long onListChanged(FXObject*,FXSelector,void*);
59  long onListClicked(FXObject*,FXSelector,void*);
60  long onCmdSetValue(FXObject*,FXSelector,void*);
61  long onCmdSetStringValue(FXObject*,FXSelector,void*);
62  long onCmdGetStringValue(FXObject*,FXSelector,void*);
63 public:
64 
66  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);
67 
69  virtual void create();
70 
72  virtual void detach();
73 
75  virtual void destroy();
76 
78  virtual void save(FXStream& store) const;
79 
81  virtual void load(FXStream& store);
82 
84  FXbool setDrive(const FXString& drive);
85 
87  FXString getDrive() const;
88 
90  void setAssociations(FXFileAssociations* assoc);
91 
93  FXFileAssociations* getAssociations() const { return associations; }
94 
96  virtual ~FXDriveBox();
97  };
98 
99 }
100 
101 #endif

Copyright © 1997-2016 Jeroen van der Zijp