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

ufilebox.hpp

00001 /* ==================================================== ======== ======= *
00002  *
00003  *  ufilebox.hh
00004  *  Ubit Project  [Elc][2003]
00005  *
00006  *  Part of the Ubit Toolkit: A Brick Construction Game Model for Creating GUIs
00007  *
00008  *  (C) 1999-2003 Eric Lecolinet @ ENST Paris
00009  *  WWW: http://www.enst.fr/~elc/ubit   Email: elc@enst.fr (subject: ubit)
00010  *
00011  * ***********************************************************************
00012  * COPYRIGHT NOTICE : 
00013  * THIS PROGRAM IS DISTRIBUTED WITHOUT ANY WARRANTY AND WITHOUT EVEN THE 
00014  * IMPLIED WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 
00015  * YOU CAN REDISTRIBUTE IT AND/OR MODIFY IT UNDER THE TERMS OF THE GNU 
00016  * GENERAL PUBLIC LICENSE AS PUBLISHED BY THE FREE SOFTWARE FOUNDATION; 
00017  * EITHER VERSION 2 OF THE LICENSE, OR (AT YOUR OPTION) ANY LATER VERSION.
00018  * SEE FILES 'COPYRIGHT' AND 'COPYING' FOR MORE DETAILS.
00019  * ***********************************************************************
00020  *
00021  * ==================================================== [Elc:03] ======= *
00022  * ==================================================== ======== ======= */
00023 
00024 #ifndef _ufilebox_hh
00025 #define _ufilebox_hh
00026 #include <ubit/uchoice.hpp>
00027 //pragma ident  "@(#)ufilebox.hh        ubit:03.03.00"
00028 
00029 
00030 /* File chooser.
00031  * This object is a subclass of UBox.
00032  * You can include it into a UDialog or a UMenu to create a File Dialog Choser:
00033  * 
00034         * examples: 
00035         * <pre>
00036         *   UDialog& filedial = udialog(ufilebox())
00037         *   UMenu&   filemenu = umenu(ufilebox())
00038         * </pre>
00039  */
00040 class UFilebox : public UBox {
00041 public:
00042   UFilebox(const UArgs& a = UArgs::none);
00044 
00045   friend UFilebox& ufilebox(const UArgs& a = UArgs::none);
00047 
00048   virtual ~UFilebox();
00049 
00050   virtual void showHiddenFiles(bool);
00051                 virtual void showDirOnly(bool);
00052                 virtual void showList(bool);
00053 
00054   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00055 
00056   virtual const UStr& getDir() const;
00058 
00059   virtual const UStr& getName() const;
00061 
00062   virtual const UStr& getPath() const;
00064 
00065   virtual const UStr& getFilter() const;
00067 
00068   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00069 
00070   virtual void setDir(const UStr&);
00072 
00073   virtual void setName(const UStr&);
00074 
00075   virtual void setFilter(const UStr&);
00077 
00078   virtual void changeDir(UStr* dirpath);
00085   virtual void rescan();
00087 
00088   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00089 
00090   virtual void cancelBehavior(class UEvent&);
00091   virtual void okBehavior(class UEvent&, const UStr&);
00092   virtual void selectBehavior(class UEvent&, const UStr&);
00109   // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
00110                 // Impl.
00111 
00112 protected:
00113   UStr fname, fdir, ffilter;
00114   mutable UStr fdir2, fpath;
00115   class UScrollpane *scrollpane;
00116   class UBox *viewport;
00117   class UButton *show_list, *show_hidden_files, *show_dirs_only;
00118   URadioSelect new_sel;
00119 };
00120 
00121 /* ==================================================== [TheEnd] ======= */
00122 /* ==================================================== [Elc:03] ======= */
00123 #endif
00124 

Generated on Sun Jul 3 23:15:48 2005 for Ubit[Eric.Lecolinet@enst.fr] by  doxygen 1.4.3-20050530