#ifndef _widget_h_ #define _widget_h_ #includeusing namespace std; enum WidgetType { WT_BTN,}; enum InAreaType { IAT_OUT, IAT_IN_NONE_CLIENT, IAT_IN_CLIENT,}; class flEvent { }; class flPoint { public: int x,y;}; class flRect { public: int x,y,w,h;}; #define VISABLE_FLAG 1 // visable #define INVISABLE_FLAG (VISABLE_FLAG<<1) // in-visable #define DISABLE_FLAG (VISABLE_FLAG<<2) // disable but visable class Widget { public: Widget() { mParent = 0; } virtual ~Widget() { } Widget*getParent(){ return mParent;} virtual bool handleEvent(flEvent&event) = 0; virtual WidgetType getType()= 0; virtual void update() = 0; virtual void render() = 0; bool isVisable(){mStatusFlag == VISABLE_FLAG; } bool isDisable(){mStatusFlag == DISABLE_FLAG;} void set private: Widget* mParent; flRect mAreaInParent; // flRect mAreaInClient; flPoint mPosInScreen; int mStatusFlag; int mOrder; // private: vector mWidgetList;}; #endif