Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Button.h

00001 /*
00002   File: Button.h
00003 
00004   Copyright(C) C. Kotterink, Computed Graphics
00005 */
00006 #ifndef BUTTON_H
00007 #define BUTTON_H
00008 
00009 #include<Widget.h>
00010 #include<Color4.h>
00011 
00012 #include<string>
00013 
00026 class Button : public Widget
00027 {
00028     DYNAMIC_OBJECT;
00029 public:
00031     Button(const string t = "", int i = 0);
00032 
00034     void setBKColor(const Color4 c) {
00035         bkColor = c;
00036     }
00037 
00039     void setTextOffsetX(unsigned int offset) {
00040         textOffsetX = offset;
00041     }
00042 
00044     void setTextOffsetY(unsigned int offset) {
00045         textOffsetY = offset;
00046     }
00047 
00048     // Inherited from Region
00049     void refresh();
00050     bool handleEvent(Event &event); 
00051 
00052     // Inherited from DynamicObject
00053     void parseSymbol(Token &t, ObjectFile &file);
00054     void writeParams(ostream &stream);
00055 
00056 protected:
00061     typedef enum State {
00062         Idle,       
00063         Pressed,    
00064         Released    
00065     };
00066 
00067     // Inherited from DynamicObject
00068     void createSymbols();
00069 
00071     State state;
00072 
00074     unsigned short textOffsetX;
00075 
00077     unsigned short textOffsetY;
00078 
00080     bool retained;
00081 
00083     string text;
00084 
00086     Color4 bkColor;
00087 
00088 private:
00089     typedef Widget super;
00090 };
00091 #endif

This documentation was generated using doxygen. If you have any comments or additions please mail me.