Public Member Functions | |
void | Init (byte level=0) |
Initialization of an entire setting page. | |
void | FoldAll () |
Recursively close all folds of sub-pages. | |
uint | Length () const |
Return number of rows needed to display the whole page. | |
SettingEntry * | FindEntry (uint row, uint *cur_row) const |
Find the setting entry at row number row_num. | |
uint | Draw (GameSettings *settings_ptr, int base_x, int base_y, int max_x, uint first_row, uint max_row, uint cur_row=0, uint parent_last=0) const |
Draw a selected part of the settings page. | |
Data Fields | |
SettingEntry * | entries |
Array of setting entries of the page. | |
byte | num |
Number of entries on the page (statically filled). |
Definition at line 658 of file settings_gui.cpp.
void SettingsPage::Init | ( | byte | level = 0 |
) |
Initialization of an entire setting page.
level | Nesting level of this page (internal variable, do not provide a value for it when calling) |
Definition at line 929 of file settings_gui.cpp.
References entries, and SettingEntry::Init().
SettingEntry * SettingsPage::FindEntry | ( | uint | row_num, | |
uint * | cur_row | |||
) | const |
Find the setting entry at row number row_num.
row_num | Index of entry to return | |
cur_row | Variable used for keeping track of the current row number. Should point to memory initialized to 0 when first called. |
NULL
if it does not exist Definition at line 960 of file settings_gui.cpp.
References entries, and SettingEntry::FindEntry().
uint SettingsPage::Draw | ( | GameSettings * | settings_ptr, | |
int | base_x, | |||
int | base_y, | |||
int | max_x, | |||
uint | first_row, | |||
uint | max_row, | |||
uint | cur_row = 0 , |
|||
uint | parent_last = 0 | |||
) | const |
Draw a selected part of the settings page.
The scrollbar uses rows of the page, while the page data strucure is a tree of SettingsPage and SettingEntry objects. As a result, the drawing routing traverses the tree from top to bottom, counting rows in cur_row until it reaches first_row. Then it enables drawing rows while traversing until max_row is reached, at which point drawing is terminated.
settings_ptr | Pointer to current values of all settings | |
base_x | Left-most position in window/panel to start drawing of each setting row | |
base_y | Upper-most position in window/panel to start drawing of row number first_row | |
max_x | The maximum x position to draw strings add. | |
first_row | Number of first row to draw | |
max_row | Row-number to stop drawing (the row-number of the row below the last row to draw) | |
cur_row | Current row number (internal variable) | |
parent_last | Last-field booleans of parent page level (page level i sets bit i to 1 if it is its last field) |
Definition at line 990 of file settings_gui.cpp.
References SettingEntry::Draw(), and entries.