libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
GuiOptionBrowser.h
1/****************************************************************************
2 * libgui
3 *
4 * Daryl Borth 2009-2026
5 * GuiOptionBrowser.h
6 ***************************************************************************/
7#pragma once
8
9#define MAX_OPTIONS 150
10#define OPTION_PAGESIZE 8
11
14typedef struct _optionlist {
15 int length;
16 char name[MAX_OPTIONS][50];
17 char value[MAX_OPTIONS][50];
18} OptionList;
19
23{
24 public:
28 GuiOptionBrowser(int w, int h, OptionList * l);
31 void setCol1Position(int x);
33 void setCol2Position(int x);
39 int findMenuItem(int currentItem, int direction);
41 int getClickedOption();
42 void resetState();
43 void setFocus(int f);
44 void draw() override;
46 void triggerUpdate();
47 void resetText();
48 void update(InputController * c);
51 GuiText * optionVal[OPTION_PAGESIZE];
52 protected:
54 int optionIndex[OPTION_PAGESIZE];
55 GuiButton * optionBtn[OPTION_PAGESIZE];
56 GuiText * optionTxt[OPTION_PAGESIZE];
57 GuiImage * optionBg[OPTION_PAGESIZE];
58
59 int selectedItem;
60 int listOffset;
61 OptionList * options;
62
63 GuiButton * arrowUpBtn;
64 GuiButton * arrowDownBtn;
65
66 GuiImage * bgOptionsImg;
67 GuiImage * scrollbarImg;
68 GuiImage * arrowDownImg;
69 GuiImage * arrowDownOverImg;
70 GuiImage * arrowUpImg;
71 GuiImage * arrowUpOverImg;
72
73 GuiImageData * bgOptions;
74 GuiImageData * bgOptionsEntry;
75 GuiImageData * scrollbar;
76 GuiImageData * arrowDown;
77 GuiImageData * arrowDownOver;
78 GuiImageData * arrowUp;
79 GuiImageData * arrowUpOver;
80
81 GuiSound * btnSoundOver;
82 GuiSound * btnSoundClick;
83 GuiTrigger * trigA;
84
85 bool listChanged;
87};
Display, manage, and manipulate buttons in the GUI.
Definition GuiButton.h:13
GuiElement()
Constructor.
Definition GuiElement.cpp:9
Decodes compressed image data (PNG) into a platform-native texture created from it.
Display, manage, and manipulate images in the GUI.
Definition GuiImage.h:18
int findMenuItem(int currentItem, int direction)
Finds the next non-blank option index from currentItem, skipping blank-named entries used as separato...
void resetState()
Resets the element's state to STATE::DEFAULT.
GuiOptionBrowser(int w, int h, OptionList *l)
void setCol1Position(int x)
Sets the x offset of the name column.
void draw() override
Draw the button on screen.
void resetText()
Called when the language has changed, to obtain new text values for all text elements.
void setFocus(int f)
Sets the element's focus.
void update(InputController *c)
Called constantly to allow the element to respond to the current input data.
GuiText * optionVal[OPTION_PAGESIZE]
One value label per visible row of the current page.
void setCol2Position(int x)
Sets the x offset of the value column.
void triggerUpdate()
Forces the visible page to refresh from the underlying options list.
Sound conversion and playback.
Definition GuiSound.h:27
Display, manage, and manipulate text in the GUI.
Definition GuiText.h:10
Input-condition matcher attached to a GuiElement (via setSimpleTrigger() etc.) and evaluated against ...
Definition GuiTrigger.h:34
Logical controller for one input channel.
Fixed-size name/value pair list backing a GuiOptionBrowser.
int length
Number of valid entries in name[]/value[].
char name[MAX_OPTIONS][50]
Option names; a blank name is a separator.
char value[MAX_OPTIONS][50]
Option values, shown right-aligned next to each name.