diff -r fffcfc5e64e5 src/settings_gui.cpp --- a/src/settings_gui.cpp Sun Nov 16 15:43:45 2008 +0100 +++ b/src/settings_gui.cpp Sun Nov 16 16:57:46 2008 +0100 @@ -612,6 +612,8 @@ void Init(); PatchEntry *FindEntry(uint row, uint *cur_row); + byte Length() const; + uint Draw(GameSettings *patches_ptr, int x, int y, uint first_row, uint max_row, uint cur_row = 0); void SetButtons(uint16 new_value); @@ -672,6 +674,18 @@ } return NULL; } + +/** Return length of the entry in rows */ +byte PatchEntry::Length() const +{ + switch(flags & PEF_KIND_MASK) { + case PEF_SETTING_KIND: + return 1; + default: NOT_REACHED(); + } + return 0; // not used, but keeps the compilers happy +} + /** * Draw a row in the settings panel @@ -795,9 +809,13 @@ return pe; } +/** Return length of the page in rows */ byte PatchPage::Length() const { - return num; + byte length = 0; + for (uint fld = 0; fld < num; fld++) + length += entries[fld].Length(); + return length; } /**