00001
00002
00003
00004
00005
00006 #ifndef PUSH_BUTTON_H_1500475736
00007 #define PUSH_BUTTON_H_1500475736
00008 #include "base_control.h"
00009 #include "cursive.h"
00010 #include "events.h"
00011 #include <string>
00012
00013 namespace crs {
00014 class button_events: public window_events {
00015 public:
00016 virtual void onPush(){}
00017 };
00018
00019 class push_button: public focused_ctrl, public styled_ctrl {
00020 private:
00021 std::string mCaption;
00022 const std::string &getCaption();
00023 void setCaption( const std::string &Caption );
00024 public:
00025 push_button( base_control *Parent, button_events *Events, const std::string Caption,
00026 const unsigned int Left=0, const unsigned int Top=0, const unsigned int Width=3,
00027 style::styles Style = style::rect, const chtype clb='[', const chtype crb=']' );
00028 property< push_button, read_write, std::string > caption;
00029 virtual bool keyPress( const int key );
00030 virtual void draw();
00031 };
00032
00033
00034 }
00035
00036 #endif
00037