summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/menu.h
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-25 11:13:18 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-25 11:13:18 +0000
commit137d900672cf15df2d5f3cf5988aff20d33620f7 (patch)
treeee5e26fe0d672f0cfa3c1faf5a4fda4d31ff5840 /crawl-ref/source/menu.h
parentc5ab08484a85c0f7f25bd8199d0e1c688e08eba3 (diff)
downloadcrawl-ref-137d900672cf15df2d5f3cf5988aff20d33620f7.tar.gz
crawl-ref-137d900672cf15df2d5f3cf5988aff20d33620f7.zip
[1801838] Use a menu to show mutation list so long lists don't scroll off the end of the terminal.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3331 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/menu.h')
-rw-r--r--crawl-ref/source/menu.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/menu.h b/crawl-ref/source/menu.h
index 86bdc4f246..88c1d00d0d 100644
--- a/crawl-ref/source/menu.h
+++ b/crawl-ref/source/menu.h
@@ -177,10 +177,26 @@ enum MenuFlag
// you pass in MUST be allocated with new, or Crawl will crash.
#define NUMBUFSIZ 10
+
+// FIXME: MenuEntry is a large object, and shouldn't be used for
+// showing text files.
+
class Menu
{
public:
Menu( int flags = MF_MULTISELECT, const std::string& tagname = "" );
+
+ // Initializes a Menu from a formatted_string as follows:
+ //
+ // 1) Splits the formatted_string on EOL (this is not necessarily \n).
+ // 2) Picks the most recently used non-whitespace colour as the colour
+ // for the next line (so it can't do multiple colours on one line).
+ // 3) Ignores all cursor movement ops in the formatted_string.
+ //
+ // These are limitations that should be fixed eventually.
+ //
+ Menu( const formatted_string &fs );
+
virtual ~Menu();
// Remove all items from the Menu, leave title intact.
@@ -257,6 +273,7 @@ protected:
int last_selected;
protected:
+ void check_add_formatted_line(int col, std::string &line, bool check_eol);
void do_menu();
virtual void draw_select_count(int count, bool force = false);
virtual void draw_item( int index ) const;