From fc4809e41bc5694231046eb2fd4c324c4daba13f Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 18 Sep 2010 13:25:37 +0000 Subject: cosmetic updates in engine list functions, trade menu updates --- src/ui/scrollpane.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'src/ui/scrollpane.h') diff --git a/src/ui/scrollpane.h b/src/ui/scrollpane.h index 82c74c9..8fe8395 100644 --- a/src/ui/scrollpane.h +++ b/src/ui/scrollpane.h @@ -26,33 +26,45 @@ public: inline int scroll() const { return scrollpane_scroll; } + + /// current scroll offset + inline int offset() const { + return scrollpane_offset; + } /// text alignment inline unsigned int alignment() const { return scrollpane_alignment; } - /// set text alignment - void set_alignment(const unsigned int alignment); - /* -- mutators --------------------------------------------- */ /// set scroll - void set_scroll(int scroll); + void set_scroll(const int scroll); + + /// set scroll offset + void set_offset(const int offset); /// increase scroll - void inc_scroll(int scroll); + void inc_scroll(const int scroll); /// decrease scroll - void dec_scroll(int scroll); + void dec_scroll(const int scroll); + + /// set text alignment + void set_alignment(const unsigned int alignment); protected: /// draw the scroll pane virtual void draw(); + + /// key event handler provides mouse scrolling + virtual bool on_keypress(const int key, const unsigned int modifier); private: ui::Text &scrollpane_text; int scrollpane_scroll; + int scrollpane_offset; unsigned int scrollpane_alignment; }; -- cgit v1.2.3