Woopsi 1.0
GUI Framework for Nintendo DS Homebrew
|
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 00055 FileRequester(s16 x, s16 y, u16 width, u16 height, const WoopsiString& title, const WoopsiString& path, u32 flags, GadgetStyle* style = NULL); 00056 00061 virtual void handleReleaseEvent(const GadgetEventArgs& e); 00062 00067 virtual void handleActionEvent(const GadgetEventArgs& e); 00068 00073 virtual void handleValueChangeEvent(const GadgetEventArgs& e); 00074 00081 virtual inline void addOption(const char* text, const u32 value) { 00082 _listbox->addOption(text, value); 00083 }; 00084 00097 virtual inline void addOption(const char* text, const u32 value, const u16 normalTextColour, const u16 normalBackColour, const u16 selectedTextColour, const u16 selectedBackColour) { 00098 _listbox->addOption(text, value, normalTextColour, normalBackColour, selectedTextColour, selectedBackColour); 00099 }; 00100 00106 virtual inline void removeOption(const s32 index) { 00107 _listbox->removeOption(index); 00108 }; 00109 00113 virtual inline void removeAllOptions() { 00114 _listbox->removeAllOptions(); 00115 }; 00116 00123 virtual inline const s32 getSelectedIndex() const { 00124 return _listbox->getSelectedIndex(); 00125 }; 00126 00131 virtual inline const FileListBoxDataItem* getSelectedOption() const { 00132 return _listbox->getSelectedOption(); 00133 }; 00134 00140 virtual inline void setAllowMultipleSelections(const bool allowMultipleSelections) { 00141 _listbox->setAllowMultipleSelections(allowMultipleSelections); 00142 }; 00143 00148 virtual inline const FileListBoxDataItem* getOption(const s32 index) const { 00149 return _listbox->getOption(index); 00150 }; 00151 00155 virtual inline void sort() { 00156 _listbox->sort(); 00157 }; 00158 00163 virtual inline const s32 getOptionCount() const { 00164 return _listbox->getOptionCount(); 00165 }; 00166 00171 virtual void setPath(const char* path); 00172 00177 virtual void appendPath(const char* path); 00178 00182 virtual const FilePath* getPath() const; 00183 00187 virtual const WoopsiString& getTextBoxFileName() const; 00188 00189 protected: 00190 Button* _okButton; 00191 Button* _cancelButton; 00192 FileListBox* _listbox; 00193 TextBox* _fileNameTextBox; 00200 virtual void onResize(u16 width, u16 height); 00201 00205 virtual ~FileRequester() { }; 00206 00210 inline FileRequester(const FileRequester& fileRequester) : AmigaWindow(fileRequester) { }; 00211 }; 00212 } 00213 00214 #endif