2011-06-14 19:53:19 +02:00
|
|
|
#ifndef GUI_OPTIONBROWSER_H_
|
|
|
|
#define GUI_OPTIONBROWSER_H_
|
2010-11-13 23:34:53 +01:00
|
|
|
|
2009-10-01 01:10:58 +02:00
|
|
|
#include "gui.h"
|
2011-06-14 19:53:19 +02:00
|
|
|
#include "gui_scrollbar.hpp"
|
2010-11-13 23:34:53 +01:00
|
|
|
#include <vector>
|
2009-10-01 01:10:58 +02:00
|
|
|
|
|
|
|
//!Display a list of menu options
|
2011-06-14 19:53:19 +02:00
|
|
|
class GuiOptionBrowser: public GuiElement, public sigslot::has_slots<>
|
2010-02-09 11:59:55 +01:00
|
|
|
{
|
2011-07-26 00:28:22 +02:00
|
|
|
public:
|
|
|
|
GuiOptionBrowser(int w, int h, OptionList * l, const char * background);
|
|
|
|
virtual ~GuiOptionBrowser();
|
|
|
|
int GetClickedOption();
|
|
|
|
int GetSelectedOption();
|
|
|
|
void SetOffset(int optionnumber);
|
|
|
|
void ResetState();
|
|
|
|
void Draw();
|
|
|
|
void Update(GuiTrigger * t);
|
|
|
|
protected:
|
|
|
|
void onListChange(int SelItem, int SelInd);
|
|
|
|
void UpdateListEntries();
|
2011-09-24 01:49:18 +02:00
|
|
|
|
|
|
|
int oldSelectedItem;
|
2011-07-26 00:28:22 +02:00
|
|
|
int selectedItem;
|
|
|
|
int listOffset;
|
|
|
|
int coL2;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
OptionList * options;
|
2011-09-24 01:49:18 +02:00
|
|
|
std::vector<GuiButton *> optionBtn;
|
|
|
|
std::vector<GuiText *> optionTxt;
|
|
|
|
std::vector<GuiText *> optionVal;
|
|
|
|
std::vector<GuiImage *> optionBg;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
GuiImage * bgOptionsImg;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
GuiImageData * bgOptions;
|
|
|
|
GuiImageData * bgOptionsEntry;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
GuiTrigger * trigA;
|
|
|
|
GuiScrollbar scrollBar;
|
2009-10-01 01:10:58 +02:00
|
|
|
};
|
2010-11-13 23:34:53 +01:00
|
|
|
|
|
|
|
#endif
|