Woopsi 1.3
Nintendo DS Gui Framework
libwoopsi/include/filerequester.h
00001 #ifndef _FILE_REQUESTER_H_
00002 #define _FILE_REQUESTER_H_
00003 
00004 #include "amigawindow.h"
00005 #include "listdata.h"
00006 #include "filelistboxdataitem.h"
00007 #include "filelistbox.h"
00008 #include "gadgetstyle.h"
00009 #include "textbox.h"
00010 
00011 namespace WoopsiUI {
00012 
00013     class Button;
00014     class FilePath;
00015 
00041     class FileRequester : public AmigaWindow {
00042     public:
00043 
00054         FileRequester(s16 x, s16 y, u16 width, u16 height, const WoopsiString& title, const WoopsiString& path, GadgetStyle* style = NULL);
00055 
00060         virtual void handleReleaseEvent(const GadgetEventArgs& e);
00061         
00066         virtual void handleActionEvent(const GadgetEventArgs& e);
00067     
00072         virtual void handleValueChangeEvent(const GadgetEventArgs& e);
00073 
00080         virtual inline void addOption(const char* text, const u32 value) {
00081             _listbox->addOption(text, value);
00082         };
00083 
00096         virtual inline void addOption(const char* text, const u32 value, const u16 normalTextColour, const u16 normalBackColour, const u16 selectedTextColour, const u16 selectedBackColour) {
00097             _listbox->addOption(text, value, normalTextColour, normalBackColour, selectedTextColour, selectedBackColour);
00098         };
00099 
00105         virtual inline void removeOption(const s32 index) {
00106             _listbox->removeOption(index);
00107         };
00108 
00112         virtual inline void removeAllOptions() {
00113             _listbox->removeAllOptions();
00114         };
00115 
00122         virtual inline const s32 getSelectedIndex() const {
00123             return _listbox->getSelectedIndex();
00124         };
00125 
00130         virtual inline const FileListBoxDataItem* getSelectedOption() const {
00131             return _listbox->getSelectedOption();
00132         };
00133 
00139         virtual inline void setAllowMultipleSelections(const bool allowMultipleSelections) {
00140             _listbox->setAllowMultipleSelections(allowMultipleSelections);
00141         };
00142 
00147         virtual inline const FileListBoxDataItem* getOption(const s32 index) const {
00148             return _listbox->getOption(index);
00149         };
00150 
00154         virtual inline void sort() {
00155             _listbox->sort();
00156         };
00157 
00162         virtual inline const s32 getOptionCount() const {
00163             return _listbox->getOptionCount();
00164         };
00165 
00170         virtual void setPath(const char* path);
00171 
00176         virtual void appendPath(const char* path);
00177 
00181         virtual const FilePath* getPath() const;
00182         
00186         virtual const WoopsiString& getTextBoxFileName() const;
00187 
00188     protected:
00189         Button* _okButton;                  
00190         Button* _cancelButton;              
00191         FileListBox* _listbox;              
00192         TextBox* _fileNameTextBox;          
00199         virtual void onResize(u16 width, u16 height);
00200         
00204         virtual ~FileRequester() { };
00205         
00209         inline FileRequester(const FileRequester& fileRequester) : AmigaWindow(fileRequester) { };
00210     };
00211 }
00212 
00213 #endif
 All Classes Functions Variables Enumerations Enumerator