00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef __JUCE_DRAWABLEBUTTON_JUCEHEADER__
00033 #define __JUCE_DRAWABLEBUTTON_JUCEHEADER__
00034
00035 #include "juce_Button.h"
00036 #include "../../graphics/drawables/juce_Drawable.h"
00037
00038
00039
00048 class JUCE_API DrawableButton : public Button
00049 {
00050 public:
00051
00052 enum ButtonStyle
00053 {
00054 ImageFitted,
00055 ImageRaw,
00057 ImageAboveTextLabel,
00058 ImageOnButtonBackground
00059 };
00060
00061
00071 DrawableButton (const String& buttonName,
00072 const ButtonStyle buttonStyle);
00073
00075 ~DrawableButton();
00076
00077
00106 void setImages (const Drawable* normalImage,
00107 const Drawable* overImage = 0,
00108 const Drawable* downImage = 0,
00109 const Drawable* disabledImage = 0,
00110 const Drawable* normalImageOn = 0,
00111 const Drawable* overImageOn = 0,
00112 const Drawable* downImageOn = 0,
00113 const Drawable* disabledImageOn = 0);
00114
00115
00116
00121 void setButtonStyle (const ButtonStyle newStyle);
00122
00123
00136 void setBackgroundColours (const Colour& toggledOffColour,
00137 const Colour& toggledOnColour);
00138
00143 const Colour& getBackgroundColour() const throw();
00144
00153 void setEdgeIndent (const int numPixelsIndent);
00154
00155
00157 const Drawable* getCurrentImage() const throw();
00158 const Drawable* getNormalImage() const throw();
00159 const Drawable* getOverImage() const throw();
00160 const Drawable* getDownImage() const throw();
00161
00162
00163 juce_UseDebuggingNewOperator
00164
00165 protected:
00167 void paintButton (Graphics& g,
00168 bool isMouseOverButton,
00169 bool isButtonDown);
00170
00171 private:
00172
00173 ButtonStyle style;
00174 Drawable* normalImage;
00175 Drawable* overImage;
00176 Drawable* downImage;
00177 Drawable* disabledImage;
00178 Drawable* normalImageOn;
00179 Drawable* overImageOn;
00180 Drawable* downImageOn;
00181 Drawable* disabledImageOn;
00182 Colour backgroundOff, backgroundOn;
00183 int edgeIndent;
00184
00185 void deleteImages();
00186 DrawableButton (const DrawableButton&);
00187 const DrawableButton& operator= (const DrawableButton&);
00188 };
00189
00190
00191 #endif // __JUCE_DRAWABLEBUTTON_JUCEHEADER__