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

FXDirSelector.h

00001 /******************************************************************************** 00002 * * 00003 * D i r e c t o r y S e l e c t i o n W i d g e t * 00004 * * 00005 ********************************************************************************* 00006 * Copyright (C) 2000,2005 by Jeroen van der Zijp. All Rights Reserved. * 00007 ********************************************************************************* 00008 * This library is free software; you can redistribute it and/or * 00009 * modify it under the terms of the GNU Lesser General Public * 00010 * License as published by the Free Software Foundation; either * 00011 * version 2.1 of the License, or (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 GNU * 00016 * Lesser General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU Lesser General Public * 00019 * License along with this library; if not, write to the Free Software * 00020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. * 00021 ********************************************************************************* 00022 * $Id: FXDirSelector.h,v 1.20 2005/01/16 16:06:06 fox Exp $ * 00023 ********************************************************************************/ 00024 #ifndef FXDIRSELECTOR_H 00025 #define FXDIRSELECTOR_H 00026 00027 #ifndef FXPACKER_H 00028 #include "FXPacker.h" 00029 #endif 00030 00031 namespace FX { 00032 00033 00034 class FXDirList; 00035 class FXTextField; 00036 class FXButton; 00037 00038 00039 /** 00040 * The Directory Selector widget is the reusable mega-widget component which 00041 * is the core of the Directory Dialog. The function of the directory selector widget 00042 * is very similar to the file selector widget, except that the directory selector widget 00043 * displays a tree-structured view of the file system, and thereby makes up and down 00044 * navigation through the file system significantly easier. 00045 */ 00046 class FXAPI FXDirSelector : public FXPacker { 00047 FXDECLARE(FXDirSelector) 00048 protected: 00049 FXDirList *dirbox; // Directory list widget 00050 FXTextField *dirname; // Directory name entry field 00051 FXButton *accept; // Accept button 00052 FXButton *cancel; // Cancel button 00053 FXIcon *updiricon; // Up directory icon 00054 FXIcon *homeicon; // Go home icon 00055 FXIcon *workicon; // Go home icon 00056 FXIcon *markicon; // Book mark icon 00057 FXIcon *clearicon; // Book clear icon 00058 FXIcon *newicon; // New directory icon 00059 FXIcon *deleteicon; // Delete file icon 00060 FXIcon *moveicon; // Rename file icon 00061 FXIcon *copyicon; // Copy file icon 00062 FXIcon *linkicon; // Link file icon 00063 FXRecentFiles mrufiles; // Recently visited places 00064 protected: 00065 FXDirSelector(){} 00066 private: 00067 FXDirSelector(const FXDirSelector&); 00068 FXDirSelector &operator=(const FXDirSelector&); 00069 public: 00070 long onCmdName(FXObject*,FXSelector,void*); 00071 long onCmdOpened(FXObject*,FXSelector,void*); 00072 long onCmdHome(FXObject*,FXSelector,void*); 00073 long onCmdWork(FXObject*,FXSelector,void*); 00074 long onCmdDirectoryUp(FXObject*,FXSelector,void*); 00075 long onPopupMenu(FXObject*,FXSelector,void*); 00076 long onCmdBookmark(FXObject*,FXSelector,void*); 00077 long onCmdVisit(FXObject*,FXSelector,void*); 00078 long onCmdNew(FXObject*,FXSelector,void*); 00079 long onUpdNew(FXObject*,FXSelector,void*); 00080 long onCmdMove(FXObject*,FXSelector,void*); 00081 long onCmdCopy(FXObject*,FXSelector,void*); 00082 long onCmdLink(FXObject*,FXSelector,void*); 00083 long onCmdDelete(FXObject*,FXSelector,void*); 00084 long onUpdSelected(FXObject*,FXSelector,void*); 00085 public: 00086 enum { 00087 ID_DIRNAME=FXPacker::ID_LAST, 00088 ID_DIRLIST, 00089 ID_HOME, 00090 ID_WORK, 00091 ID_DIRECTORY_UP, 00092 ID_BOOKMARK, 00093 ID_VISIT, 00094 ID_NEW, 00095 ID_DELETE, 00096 ID_MOVE, 00097 ID_COPY, 00098 ID_LINK, 00099 ID_LAST 00100 }; 00101 public: 00102 00103 /// Constructor 00104 FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00105 00106 /// Return a pointer to the "Accept" button 00107 FXButton *acceptButton() const { return accept; } 00108 00109 /// Return a pointer to the "Cancel" button 00110 FXButton *cancelButton() const { return cancel; } 00111 00112 /// Change directory 00113 void setDirectory(const FXString& path); 00114 00115 /// Return directory 00116 FXString getDirectory() const; 00117 00118 /// Return TRUE if showing files as well as directories 00119 FXbool showFiles() const; 00120 00121 /// Show or hide normal files 00122 void showFiles(FXbool showing); 00123 00124 /// Return TRUE if showing hidden directories 00125 FXbool showHiddenFiles() const; 00126 00127 /// Show or hide hidden directories 00128 void showHiddenFiles(FXbool showing); 00129 00130 /// Return wildcard matching mode 00131 FXuint getMatchMode() const; 00132 00133 /// Change wildcard matching mode 00134 void setMatchMode(FXuint mode); 00135 00136 /// Change Directory List style 00137 void setDirBoxStyle(FXuint style); 00138 00139 /// Return Directory List style 00140 FXuint getDirBoxStyle() const; 00141 00142 /// Save to stream 00143 virtual void save(FXStream& store) const; 00144 00145 /// Load from stream 00146 virtual void load(FXStream& store); 00147 00148 /// Destructor 00149 virtual ~FXDirSelector(); 00150 }; 00151 00152 } 00153 00154 #endif

Copyright © 1997-2005 Jeroen van der Zijp