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 FindMenuItem(int c, int d);
|
|
|
|
int GetClickedOption();
|
|
|
|
int GetSelectedOption();
|
|
|
|
void SetClickable(bool enable);
|
|
|
|
void SetOffset(int optionnumber);
|
|
|
|
void ResetState();
|
|
|
|
void SetFocus(int f);
|
|
|
|
void Draw();
|
|
|
|
void Update(GuiTrigger * t);
|
|
|
|
protected:
|
|
|
|
void onListChange(int SelItem, int SelInd);
|
|
|
|
void UpdateListEntries();
|
|
|
|
int selectedItem;
|
|
|
|
int listOffset;
|
|
|
|
int coL2;
|
|
|
|
bool scrollbaron;
|
|
|
|
bool listChanged;
|
2009-10-01 01:10:58 +02:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
OptionList * options;
|
|
|
|
int optionIndex[PAGESIZE];
|
|
|
|
GuiButton * optionBtn[PAGESIZE];
|
|
|
|
GuiText * optionTxt[PAGESIZE];
|
|
|
|
GuiText * optionVal[PAGESIZE];
|
|
|
|
GuiText * optionValOver[PAGESIZE];
|
|
|
|
GuiImage * optionBg[PAGESIZE];
|
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
|