00001 /* 00002 * TMultiButton.h 00003 * Automat 00004 * 00005 * Created by Stefan Kirch on 12.04.05. 00006 * Copyright 2005 Stefan Kirch. All rights reserved. 00007 * 00008 */ 00009 00010 // ----------------------------------------------------------------------------- 00011 00012 #ifndef TMULTIBUTTON_H_ 00013 #define TMULTIBUTTON_H_ 00014 00015 #include "TViewNoCompositingCompatible.h" 00016 00017 // ----------------------------------------------------------------------------- 00018 00019 class TMultiButton:public TViewNoCompositingCompatible 00020 { 00021 AUGUIDefineControl(TMultiButton, TViewNoCompositingCompatible, "multibutton"); 00022 00023 protected: 00024 00025 TMultiButton(HIViewRef inControl); 00026 virtual ~TMultiButton(); 00027 00028 virtual ControlKind GetKind(); 00029 00030 virtual bool UseNonblockingTracking(){return true;} 00031 00032 virtual OSStatus Initialize(TCarbonEvent& inEvent); 00033 00034 virtual void ValueChanged(); 00035 virtual void TitleChanged(); 00036 00037 virtual void DrawStaticBackground(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing); 00038 virtual void CompatibleDraw(RgnHandle inLimitRgn, CGContextRef inContext, bool inCompositing); 00039 00040 virtual OSStatus StartTracking(TCarbonEvent&inEvent, HIPoint& from); 00041 virtual OSStatus StopTracking(TCarbonEvent&inEvent, HIPoint& from); 00042 00043 private: 00044 00045 CGImageRef mBackImage; 00046 CGImageRef mThumbImage; 00047 CGImageRef mTopImage; 00048 00049 int mXposition; 00050 int mYposition; 00051 int mValue; 00052 00053 bool mDown; 00054 }; 00055 00056 #endif 00057 00058 // -----------------------------------------------------------------------------