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

FXDirBox.h
1 /********************************************************************************
2 * *
3 * D i r e c t o r y B o x W i d g e t *
4 * *
5 *********************************************************************************
6 * Copyright (C) 1999,2022 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 FXDIRBOX_H
22 #define FXDIRBOX_H
23 
24 #ifndef FXTREELISTBOX_H
25 #include "FXTreeListBox.h"
26 #endif
27 
28 namespace FX {
29 
30 
31 class FXIcon;
32 class FXFileAssociations;
33 
35 enum {
36  DIRBOX_NO_OWN_ASSOC = 0x00020000
37  };
38 
39 
49 class FXAPI FXDirBox : public FXTreeListBox {
50  FXDECLARE(FXDirBox)
51 protected:
52  FXFileAssociations *associations; // Association table
53  FXIcon *foldericon; // Folder icons
54  FXIcon *cdromicon; // CDROM icon
55  FXIcon *harddiskicon; // Hard disk icon
56  FXIcon *netdriveicon; // Networked drive icon
57  FXIcon *floppyicon; // Floppy icon
58  FXIcon *nethoodicon; // Network neighborhood icon
59  FXIcon *zipdiskicon; // Zip drive icon
60 protected:
61  FXDirBox(){}
62  FXString getItemPathname(FXTreeItem *item) const;
63  FXTreeItem* getPathnameItem(const FXString& path);
64 private:
65  FXDirBox(const FXDirBox&);
66  FXDirBox &operator=(const FXDirBox&);
67 public:
68  long onTreeChanged(FXObject*,FXSelector,void*);
69  long onTreeCommand(FXObject*,FXSelector,void*);
70  long onCmdSetValue(FXObject*,FXSelector,void*);
71  long onCmdSetStringValue(FXObject*,FXSelector,void*);
72  long onCmdGetStringValue(FXObject*,FXSelector,void*);
73 public:
74 
76  FXDirBox(FXComposite *p,FXObject* tgt=nullptr,FXSelector sel=0,FXuint opts=FRAME_SUNKEN|FRAME_THICK|TREELISTBOX_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);
77 
79  virtual void create();
80 
82  virtual void detach();
83 
85  virtual void destroy();
86 
88  virtual void save(FXStream& store) const;
89 
91  virtual void load(FXStream& store);
92 
94  void setDirectory(const FXString& pathname,FXbool notify=false);
95 
97  FXString getDirectory() const;
98 
100  void setAssociations(FXFileAssociations* assoc,FXbool owned=false,FXbool notify=false);
101 
103  FXFileAssociations* getAssociations() const { return associations; }
104 
106  virtual ~FXDirBox();
107  };
108 
109 }
110 
111 #endif
Tree list Item.
Definition: FXTreeList.h:52
FXFileAssociations * getAssociations() const
Return file associations.
Definition: FXDirBox.h:103
Base composite.
Definition: FXComposite.h:32
A stream is a way to serialize data and objects into a byte stream.
Definition: FXStream.h:81
The Tree List Box behaves very much like a List Box, except that it supports a hierarchical, tree structured display of the items.
Definition: FXTreeListBox.h:53
Definition: FX4Splitter.h:28
An Icon is an image with two additional server-side resources: a shape bitmap, which is used to mask ...
Definition: FXIcon.h:42
The FileAssociations object manages file associations between a file extension and a FileAssoc record...
Definition: FXFileAssociations.h:101
A Directory Box widget allows the user to select parts of a file path.
Definition: FXDirBox.h:49
Object is the base class for all objects in FOX; in order to receive messages from the user interface...
Definition: FXObject.h:134
FXString provides essential string manipulation capabilities in FOX.
Definition: FXString.h:42

Copyright © 1997-2022 Jeroen van der Zijp