00001 /********************************************************************** 00002 00003 Copyright (c) 2005, TomTom B.V. 00004 00005 All rights reserved 00006 00007 00008 ***********************************************************************/ 00009 00010 #ifndef __CUIBUTTON_H__ 00011 #define __CUIBUTTON_H__ 00012 00013 #include "MUIWidget.h" 00014 #include "CDesktop.h" 00015 00021 class CUIButton: public MUIWidget 00022 { 00023 public: 00030 CUIButton( const CUIRect& aRectangle, 00031 const char* aTitle, 00032 MUIWidgetEvents* aObserver ); 00033 00034 virtual void Draw(); 00035 virtual bool HandlePenEvent( MInputReader::TTouchEventData& aData ); 00036 virtual bool HandleKeyEvent( MInputReader::TKeyEventData& aData ); 00037 00038 private: 00039 CUIButton(); 00040 CUIButton( const CUIButton& ); 00041 CUIButton& operator=( const CUIButton& ); 00042 00043 protected: 00045 CDesktop::TColor GetColor() { return 00046 ( iActive ) ? GetColorScheme()->ActiveFontColor(): 00047 ( iEnabled ? 00048 GetColorScheme()->ButtonFontColor(): 00049 GetColorScheme()->DisabledFontColor() 00050 ); 00051 } 00052 00053 bool iPressed; 00058 private: 00059 void Draw( CDesktop::TColor aFontColor, CDesktop::TColor aBackColor ); 00060 void BlinkDraw(); 00061 }; 00062 00063 #endif // __CUIBUTTON_H__ 00064