From edd5fe68be2a2a9e23a87f65f6a89807c34b7c3f Mon Sep 17 00:00:00 2001 From: pixel Date: Fri, 2 Dec 2005 16:21:59 +0000 Subject: Added cascade stuff for buttons, and cleaned source a bit. --- include/widgets.h | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/widgets.h b/include/widgets.h index ae29cee..66a6191 100644 --- a/include/widgets.h +++ b/include/widgets.h @@ -17,7 +17,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -/* $Id: widgets.h,v 1.12 2005-12-01 13:48:12 pixel Exp $ */ +/* $Id: widgets.h,v 1.13 2005-12-02 16:21:59 pixel Exp $ */ #ifndef __WIDGETS_H__ #define __WIDGETS_H__ @@ -169,13 +169,16 @@ namespace mogltk { class Button : public widget { public: Button(action *, shape *, widget * father, int x, int y, int w, int h, const String & caption); + virtual ~Button(); + void simulate_press(); + action * cascade_action(); protected: virtual void draw(); virtual bool process_event(int, int, event_t); bool bevel; private: bool dragging; - action * a; + action * a, * cascade; }; /*! @@ -328,13 +331,19 @@ namespace mogltk { ContextMenu * subselected; }; + /*! + The InputText widget is used to do a simple input box on the screen. + */ class InputText : public widget { public: - InputText(shape *, widget * father, int x, int y); + InputText(action *, shape *, widget * father, int x, int y); virtual ~InputText(); virtual void draw(); const String & GetText() const; void SetText(const String &); + void activate(); + void SetCursorPos(int); + virtual bool process_event(int, int, event_t); private: class inputtext_keyevent : public mogltk::engine::keyevent { public: @@ -345,6 +354,10 @@ namespace mogltk { InputText * father; } * it_keyevent; String text; + action * a; + bool cursor_visible; + int cursor_pos; + }; /*! @@ -363,7 +376,6 @@ namespace mogltk { action * a; mogltk::font * InputDialog_font; }; - }; }; -- cgit v1.2.3