From 82992a9b16d64104dd28d42e97cc118a75fded86 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 8 Dec 2010 20:19:21 +0000 Subject: Added clock. --- src/client/infowidget.h | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src/client/infowidget.h') diff --git a/src/client/infowidget.h b/src/client/infowidget.h index 48d1c9a..e773ef4 100644 --- a/src/client/infowidget.h +++ b/src/client/infowidget.h @@ -52,12 +52,37 @@ private: class KeyInfoWidget : public ui::Widget { public: - // default constructor + /// default constructor KeyInfoWidget(ui::Widget *parent = 0); protected: - // draw keypress events + /// draw keypress events + virtual void draw(); +}; + +/// a widget to show keypress events +class ClockInfoWidget : public ui::Widget +{ +public: + /// clock mode + enum Mode {ClockOff=0, Clock24Hours=1, Clock12Hours=2}; + + /// default constructor + ClockInfoWidget(ui::Widget *parent = 0); + + inline void set_mode(const Mode mode) { + clock_mode = mode; + } + + inline const Mode mode() const { + return clock_mode; + } + +protected: + /// draw the current time virtual void draw(); + + Mode clock_mode; }; } -- cgit v1.2.3