00001 #ifndef _REQUESTER_H_
00002 #define _REQUESTER_H_
00003
00004 #include "amigawindow.h"
00005 #include "scrollinglistbox.h"
00006 #include "listdata.h"
00007
00008 namespace WoopsiUI {
00009
00010 class Button;
00011
00020 class Requester : public AmigaWindow {
00021 public:
00031 Requester(s16 x, s16 y, u16 width, u16 height, const char* title, FontBase* font = NULL);
00032
00037 virtual void handleReleaseEvent(const GadgetEventArgs& e);
00038
00043 virtual void handleDoubleClickEvent(const GadgetEventArgs& e);
00044
00050 virtual inline void addOption(const char* text, const u32 value) {
00051 _listbox->addOption(text, value);
00052 };
00053
00063 virtual inline void addOption(const char* text, const u32 value, const u16 normalTextColour, const u16 normalBackColour, const u16 selectedTextColour, const u16 selectedBackColour) {
00064 _listbox->addOption(text, value, normalTextColour, normalBackColour, selectedTextColour, selectedBackColour);
00065 };
00066
00071 virtual inline void removeOption(const s32 index) {
00072 _listbox->removeOption(index);
00073 };
00074
00078 virtual inline void removeAllOptions() {
00079 _listbox->removeAllOptions();
00080 };
00081
00087 virtual const s32 getSelectedIndex() const {
00088 return _listbox->getSelectedIndex();
00089 };
00090
00095 virtual inline const ListData::ListDataItem* getSelectedOption() const {
00096 return _listbox->getSelectedOption();
00097 };
00098
00104 virtual inline void setAllowMultipleSelections(const bool allowMultipleSelections) {
00105 _listbox->setAllowMultipleSelections(allowMultipleSelections);
00106 };
00107
00112 virtual inline const ListData::ListDataItem* getOption(const s32 index) const {
00113 return _listbox->getOption(index);
00114 };
00115
00119 virtual inline void sort() {
00120 _listbox->sort();
00121 };
00122
00127 virtual inline const s32 getOptionCount() const {
00128 return _listbox->getOptionCount();
00129 };
00130
00137 virtual bool resize(u16 width, u16 height);
00138
00139 protected:
00140 Button* _okButton;
00141 Button* _cancelButton;
00142 ScrollingListBox* _listbox;
00147 virtual inline ~Requester() { };
00148
00152 inline Requester(const Requester& requester) : AmigaWindow(requester) { };
00153 };
00154 }
00155
00156 #endif