00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
#ifndef FXFILESELECTOR_H
00025
#define FXFILESELECTOR_H
00026
00027
#ifndef FXPACKER_H
00028
#include "FXPacker.h"
00029
#endif
00030
00031
namespace FX {
00032
00033
class FXFileList;
00034
class FXTextField;
00035
class FXComboBox;
00036
class FXDirBox;
00037
class FXButton;
00038
class FXIcon;
00039
class FXMenuPane;
00040
class FXCheckButton;
00041
class FXMatrix;
00042
class FXHorizontalFrame;
00043
00044
00045
00046
enum {
00047
SELECTFILE_ANY,
00048
SELECTFILE_EXISTING,
00049
SELECTFILE_MULTIPLE,
00050
SELECTFILE_MULTIPLE_ALL,
00051
SELECTFILE_DIRECTORY
00052 };
00053
00054
00055
00056
class FXAPI FXFileSelector :
public FXPacker {
00057 FXDECLARE(FXFileSelector)
00058 protected:
00059 FXFileList *filebox;
00060 FXTextField *filename;
00061 FXComboBox *filefilter;
00062 FXMenuPane *bookmarks;
00063 FXHorizontalFrame *navbuttons;
00064 FXHorizontalFrame *fileboxframe;
00065
FXMatrix *entryblock;
00066
FXCheckButton *readonly;
00067
FXDirBox *dirbox;
00068
FXButton *accept;
00069
FXButton *cancel;
00070
FXIcon *updiricon;
00071
FXIcon *newdiricon;
00072
FXIcon *listicon;
00073
FXIcon *detailicon;
00074
FXIcon *iconsicon;
00075
FXIcon *homeicon;
00076
FXIcon *workicon;
00077
FXIcon *shownicon;
00078
FXIcon *hiddenicon;
00079
FXIcon *markicon;
00080
FXIcon *clearicon;
00081
FXIcon *deleteicon;
00082
FXIcon *moveicon;
00083
FXIcon *copyicon;
00084
FXIcon *linkicon;
00085
FXRecentFiles mrufiles;
00086 FXuint selectmode;
00087 protected:
00088 FXFileSelector(){}
00089
private:
00090 FXFileSelector(
const FXFileSelector&);
00091 FXFileSelector &operator=(
const FXFileSelector&);
00092
public:
00093
long onCmdAccept(
FXObject*,FXSelector,
void*);
00094 long onCmdFilter(
FXObject*,FXSelector,
void*);
00095
long onCmdItemDblClicked(
FXObject*,FXSelector,
void*);
00096
long onCmdItemSelected(
FXObject*,FXSelector,
void*);
00097 long onCmdItemDeselected(
FXObject*,FXSelector,
void*);
00098
long onCmdDirectoryUp(
FXObject*,FXSelector,
void*);
00099
long onUpdDirectoryUp(
FXObject*,FXSelector,
void*);
00100
long onCmdDirTree(
FXObject*,FXSelector,
void*);
00101
long onCmdHome(
FXObject*,FXSelector,
void*);
00102
long onCmdWork(
FXObject*,FXSelector,
void*);
00103
long onCmdBookmark(
FXObject*,FXSelector,
void*);
00104
long onCmdVisit(
FXObject*,FXSelector,
void*);
00105
long onCmdNew(
FXObject*,FXSelector,
void*);
00106
long onUpdNew(
FXObject*,FXSelector,
void*);
00107
long onCmdMove(
FXObject*,FXSelector,
void*);
00108
long onCmdCopy(
FXObject*,FXSelector,
void*);
00109
long onCmdLink(
FXObject*,FXSelector,
void*);
00110
long onCmdDelete(
FXObject*,FXSelector,
void*);
00111
long onUpdSelected(
FXObject*,FXSelector,
void*);
00112
long onPopupMenu(
FXObject*,FXSelector,
void*);
00113
public:
00114
enum {
00115 ID_FILEFILTER=FXPacker::ID_LAST,
00116 ID_ACCEPT,
00117 ID_FILELIST,
00118 ID_DIRECTORY_UP,
00119 ID_DIRTREE,
00120 ID_HOME,
00121 ID_WORK,
00122 ID_BOOKMARK,
00123 ID_VISIT,
00124 ID_NEW,
00125 ID_DELETE,
00126 ID_MOVE,
00127 ID_COPY,
00128 ID_LINK,
00129 ID_LAST
00130 };
00131
public:
00132
00133
00134 FXFileSelector(
FXComposite *p,
FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0);
00135
00136
00137
FXButton *acceptButton()
const {
return accept; }
00138
00139
00140 FXButton *cancelButton()
const {
return cancel; }
00141
00142
00143
void setFilename(
const FXString& path);
00144
00145
00146 FXString getFilename() const;
00147
00148
00149
00150
00151
00152
00153 FXString* getFilenames() const;
00154
00155
00156
void setPattern(const FXString& ptrn);
00157
00158
00159 FXString getPattern() const;
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
void setPatternList(const FXString& patterns);
00176
00177
00178 FXString getPatternList() const;
00179
00180
00181
00182
00183
00184
void setCurrentPattern(FXint n);
00185
00186
00187 FXint getCurrentPattern() const;
00188
00189
00190
FXString getPatternText(FXint patno) const;
00191
00192
00193
void setPatternText(FXint patno,const
FXString& text);
00194
00195
00196
00197
00198
00199
00200
00201 static
FXString patternFromText(const
FXString& pattern);
00202
00203
00204
00205
00206
00207
00208 static
FXString extensionFromPattern(const
FXString& pattern);
00209
00210
00211
void setDirectory(const
FXString& path);
00212
00213
00214
FXString getDirectory() const;
00215
00216
00217
void setItemSpace(FXint s);
00218
00219
00220 FXint getItemSpace() const;
00221
00222
00223
void setFileBoxStyle(FXuint style);
00224
00225
00226 FXuint getFileBoxStyle() const;
00227
00228
00229
void setSelectMode(FXuint mode);
00230
00231
00232 FXuint getSelectMode()
const {
return selectmode; }
00233
00234
00235
void setMatchMode(FXuint mode);
00236
00237
00238 FXuint getMatchMode() const;
00239
00240
00241
void showReadOnly(FXbool show);
00242
00243
00244 FXbool shownReadOnly() const;
00245
00246
00247
void setReadOnly(FXbool state);
00248
00249
00250 FXbool getReadOnly() const;
00251
00252
00253 virtual
void save(
FXStream& store) const;
00254
00255
00256 virtual
void load(
FXStream& store);
00257
00258
00259 virtual ~FXFileSelector();
00260 };
00261
00262 }
00263
00264 #endif