![]() |
Main Page Class Hierarchy Alphabetical List Compound List File List Compound Members
![]() |
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,2002 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.13 2002/03/12 07:11:30 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 class FXDriveBox; 00038 00039 00040 /// Directory selection widget 00041 class FXAPI FXDirSelector : public FXPacker { 00042 FXDECLARE(FXDirSelector) 00043 protected: 00044 FXDirList *dirbox; // Directory list widget 00045 FXDriveBox *drivebox; // Drive selection widget 00046 FXTextField *dirname; // Directory name entry field 00047 FXButton *accept; // Accept button 00048 FXButton *cancel; // Cancel button 00049 protected: 00050 FXDirSelector(){} 00051 private: 00052 FXDirSelector(const FXDirSelector&); 00053 FXDirSelector &operator=(const FXDirSelector&); 00054 public: 00055 long onCmdName(FXObject*,FXSelector,void*); 00056 long onCmdOpened(FXObject*,FXSelector,void*); 00057 long onCmdDriveChanged(FXObject*,FXSelector,void*); 00058 public: 00059 enum { 00060 ID_DIRNAME=FXPacker::ID_LAST, 00061 ID_DIRLIST, 00062 ID_DRIVEBOX, 00063 ID_LAST 00064 }; 00065 public: 00066 00067 /// Constructor 00068 FXDirSelector(FXComposite *p,FXObject* tgt=NULL,FXSelector sel=0,FXuint opts=0,FXint x=0,FXint y=0,FXint w=0,FXint h=0); 00069 00070 /// Return a pointer to the "Accept" button 00071 FXButton *acceptButton() const { return accept; } 00072 00073 /// Return a pointer to the "Cancel" button 00074 FXButton *cancelButton() const { return cancel; } 00075 00076 /// Change directory 00077 void setDirectory(const FXString& path); 00078 00079 /// Return directory 00080 FXString getDirectory() const; 00081 00082 /// Change Directory List style 00083 void setDirBoxStyle(FXuint style); 00084 00085 /// Return Directory List style 00086 FXuint getDirBoxStyle() const; 00087 00088 /// Save to stream 00089 virtual void save(FXStream& store) const; 00090 00091 /// Load from stream 00092 virtual void load(FXStream& store); 00093 00094 /// Destructor 00095 virtual ~FXDirSelector(); 00096 }; 00097 00098 } 00099 00100 #endif