usbloadergx/source/libwiigui/gui_customoptionbrowser.h
dimok321 8bec876889 *Removed ramdisk
*Lot's of changes in image processing
*Added use of libgd and ImageData class from WiiXplorer. No more crashes with corrupted images and no more restriction to images sizes that are devidable by 4 :).
*Added a recource file manager for better access of all files/images for internal files and theme files. Some themes will have to adjust some filenames because we want to use the same filenames for themes and internal source files.
2010-09-26 08:33:43 +00:00

102 lines
2.8 KiB
C++

#include "gui.h"
class customOptionList
{
public:
customOptionList(int Size);
~customOptionList();
void SetLength(int Length);
void SetName(int i, const char *format, ...) __attribute__( ( format ( printf, 3, 4 ) ) );
const char *GetName(int i)
{
if (i >= 0 && i < length && name[i])
return name[i];
else return "";
}
void SetValue(int i, const char *format, ...) __attribute__( ( format ( printf, 3, 4 ) ) );
const char *GetValue(int i)
{
if (i >= 0 && i < length && value[i])
return value[i];
else return "";
}
void Clear(bool OnlyValue = false);
int GetLength()
{
return length;
}
bool IsChanged()
{
bool ret = changed;
changed = false;
return ret;
}
private:
void SetSize(int Size);
int size;
char ** name;
char ** value;
int length;
bool changed;
};
//!Display a list of menu options
class GuiCustomOptionBrowser: public GuiElement
{
public:
GuiCustomOptionBrowser(int w, int h, customOptionList * l, const char * background, int scrollbar, int col2);
~GuiCustomOptionBrowser();
int FindMenuItem(int c, int d);
int GetClickedOption();
int GetSelectedOption();
void SetClickable(bool enable);
void SetScrollbar(int enable);
void SetOffset(int optionnumber);
void ResetState();
void SetFocus(int f);
void Draw();
void Update(GuiTrigger * t);
protected:
void UpdateListEntries();
int selectedItem;
int listOffset;
int size;
int coL2;
int scrollbaron;
customOptionList * options;
int * optionIndex;
GuiButton ** optionBtn;
GuiText ** optionTxt;
GuiText ** optionVal;
GuiText ** optionValOver;
GuiImage ** optionBg;
GuiButton * arrowUpBtn;
GuiButton * arrowDownBtn;
GuiButton * scrollbarBoxBtn;
GuiImage * bgOptionsImg;
GuiImage * scrollbarImg;
GuiImage * arrowDownImg;
GuiImage * arrowDownOverImg;
GuiImage * arrowUpImg;
GuiImage * arrowUpOverImg;
GuiImage * scrollbarBoxImg;
GuiImage * scrollbarBoxOverImg;
GuiImageData * bgOptions;
GuiImageData * bgOptionsEntry;
GuiImageData * scrollbar;
GuiImageData * arrowDown;
GuiImageData * arrowDownOver;
GuiImageData * arrowUp;
GuiImageData * arrowUpOver;
GuiImageData * scrollbarBox;
GuiImageData * scrollbarBoxOver;
GuiSound * btnSoundClick;
GuiTrigger * trigA;
GuiTrigger * trigHeldA;
};