00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TTextPopup_H_
00015 #define TTextPopup_H_
00016
00017 #include "TViewNoCompositingCompatible.h"
00018
00019
00020
00021 class TTextPopup:public TViewNoCompositingCompatible
00022 {
00023 AUGUIDefineControl(TTextPopup, TViewNoCompositingCompatible, "txtpop");
00024
00025 public:
00026
00027 virtual void SetProperty(OSType propID, double value);
00028 virtual void SetProperty(OSType propID, int32_t value);
00029 virtual void SetProperty(OSType propID, AUGUI::color_t &value);
00030 virtual void SetProperty(OSType propID, CFStringRef value);
00031 virtual void SetProperty(OSType propID, AUGUI::font_t & value);
00032
00033 virtual bool GetProperty(OSType propID, double &value);
00034 virtual bool GetProperty(OSType propID, int32_t &value);
00035 virtual bool GetProperty(OSType propID, AUGUI::color_t &value);
00036 virtual bool GetProperty(OSType propID, CFStringRef &value);
00037 virtual bool GetProperty(OSType propID, AUGUI::font_t &value);
00038
00039 protected:
00040
00041 TTextPopup(HIViewRef inControl);
00042 virtual ~TTextPopup();
00043
00044 virtual ControlKind GetKind();
00045
00046 virtual OSStatus Initialize(TCarbonEvent& inEvent);
00047
00048 virtual void DrawStaticBackground(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing);
00049 virtual void CompatibleDraw(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing);
00050
00051 virtual ControlPartCode HitTest(const HIPoint& inWhere);
00052 virtual OSStatus HiliteChanged(ControlPartCode inOriginalPart, ControlPartCode inCurrentPart, RgnHandle inInvalRgn);
00053 virtual OSStatus Track(TCarbonEvent& inEvent, ControlPartCode* outPart);
00054
00055 virtual void TitleChanged();
00056 virtual void ValueChanged();
00057
00058 virtual OSStatus SetData(OSType inTag, ControlPartCode inPart, Size inSize, const void* inPtr);
00059 virtual OSStatus GetData(OSType inTag, ControlPartCode inPart, Size inSize, Size* outSize, void* inPtr);
00060
00061 private:
00062
00063 CGImageRef mBackImage;
00064 MenuRef mPopupMenu;
00065 CFStringRef mSelectedItemText;
00066 CFStringRef mFilenameBase;
00067
00068 bool mDrawFrame;
00069
00070 float mXoffset, mYoffset, mFontSize, mRed, mGreen, mBlue, mAlpha;
00071 int mJustify;
00072 bool mSmoothFont;
00073 char mFontName[100];
00074 };
00075
00076 #endif
00077
00078
00079