29 #ifndef _CEGUIColourPickerControls_h_
30 #define _CEGUIColourPickerControls_h_
32 #include "CEGUI/CommonDialogs/Module.h"
33 #include "CEGUI/Window.h"
34 #include "CEGUI/CommonDialogs/ColourPicker/Types.h"
37 # pragma warning(push)
38 # pragma warning(disable : 4251)
53 SliderMode_Lab_A = 1 << 1,
54 SliderMode_Lab_B = 1 << 2,
55 SliderMode_HSV_H = 1 << 3,
56 SliderMode_HSV_S = 1 << 4,
57 SliderMode_HSV_V = 1 << 5
67 static const String EventNamespace;
76 static const String EventClosed;
88 void setColours(
const Colour& newColour);
90 void setPreviousColour(
const Colour& previousColour);
92 void refreshAllElements();
101 void setCallingColourPicker(
ColourPicker* colourPicker);
104 void initialiseComponents();
115 static const String TitleBarName;
116 static const String ColourPickerStaticImageName;
117 static const String ColourPickerImageSliderName;
118 static const String ColourPickerAlphaSliderName;
119 static const String NewColourDescriptionName;
120 static const String OldColourDescriptionName;
121 static const String NewColourRectName;
122 static const String OldColourRectName;
123 static const String ColourEditBoxRDescriptionName;
124 static const String ColourEditBoxGDescriptionName;
125 static const String ColourEditBoxBDescriptionName;
126 static const String ColourEditBoxRName;
127 static const String ColourEditBoxGName;
128 static const String ColourEditBoxBName;
129 static const String HSVRadioButtonHName;
130 static const String HSVRadioButtonSName;
131 static const String HSVRadioButtonVName;
132 static const String HSVEditBoxHName;
133 static const String HSVEditBoxSName;
134 static const String HSVEditBoxVName;
135 static const String LabRadioButtonLName;
136 static const String LabRadioButtonAName;
137 static const String LabRadioButtonBName;
138 static const String LabEditBoxLName;
139 static const String LabEditBoxAName;
140 static const String LabEditBoxBName;
141 static const String AlphaEditBoxName;
142 static const String ColourPickerCursorName;
152 static const float LAB_L_MIN;
153 static const float LAB_L_MAX;
154 static const float LAB_L_DIFF;
155 static const float LAB_A_MIN;
156 static const float LAB_A_MAX;
157 static const float LAB_A_DIFF;
158 static const float LAB_B_MIN;
159 static const float LAB_B_MAX;
160 static const float LAB_B_DIFF;
162 void initColourPickerControlsImageSet();
163 void deinitColourPickerControlsTexture();
164 void refreshColourPickerControlsTextures();
166 void refreshColourSliderImage();
167 void refreshColourPickingImage();
168 void refreshAlphaSliderImage();
170 void reloadColourPickerControlsTexture();
172 Lab_Colour getColourSliderPositionColourLAB(
float value);
173 Lab_Colour getColourPickingPositionColourLAB(
float xAbs,
float yAbs);
175 HSV_Colour getColourSliderPositionColourHSV(
float value);
176 HSV_Colour getColourPickingPositionColourHSV(
float xAbs,
float yAbs);
178 RGB_Colour getAlphaSliderPositionColour(
int x,
int y);
180 Vector2f getColourPickingColourPosition();
181 void getColourPickingColourPositionHSV(
float& x,
float& y);
184 bool handleCancelButtonClicked(
const EventArgs& e);
185 bool handleAcceptButtonClicked(
const EventArgs& e);
186 bool handleEditboxDeactivated(
const EventArgs& args);
187 bool handleRadioButtonModeSelection(
const EventArgs& args);
189 bool handleHexadecimalEditboxTextChanged(
const EventArgs& args);
190 bool handleRGBEditboxTextChanged(
const EventArgs& args);
191 bool handleLABEditboxTextChanged(
const EventArgs& args);
192 bool handleHSVEditboxTextChanged(
const EventArgs& args);
194 bool handleAlphaEditboxTextChanged(
const EventArgs& args);
196 bool handleColourPickerStaticImageMouseLeaves(
const EventArgs& args);
197 bool handleColourPickerStaticImageMouseButtonUp(
const EventArgs& args);
198 bool handleColourPickerStaticImageMouseButtonDown(
const EventArgs& args);
199 bool handleColourPickerStaticImageMouseMove(
const EventArgs& args);
204 void onColourCursorPositionChanged();
205 void onColourSliderChanged();
207 void refreshColourPickerCursorPosition(
const MouseEventArgs& mouseEventArgs);
210 void refreshOnlyColourSliderImage();
211 bool handleColourPickerSliderValueChanged(
const EventArgs& args);
212 bool handleAlphaSliderValueChanged(
const EventArgs& args);
214 void refreshEditboxesAndColourRects();
216 void refreshColourRects();
217 void positionColourPickerCursorAbsolute(
float x,
float y);
218 void positionColourPickerCursorRelative(
float x,
float y);
219 void setColours(
const Lab_Colour& newColourLAB);
220 void setColours(
const RGB_Colour& newColourRGB);
221 void setColours(
const HSV_Colour& newColourHSV);
223 void setColourAlpha(
float alphaValue);
225 void refreshColourPickerCursorPosition();
226 void refreshColourSliderPosition();
228 void initColourPicker();
231 Window* getHexadecimalDescription();
232 Editbox* getHexadecimalEditbox();
234 Slider* getColourPickerImageSlider();
235 Slider* getColourPickerAlphaSlider();
236 Window* getColourPickerStaticImage();
237 Window* getNewColourDescription();
238 Window* getOldColourDescription();
239 Window* getNewColourRect();
240 Window* getOldColourRect();
241 Window* getColourEditBoxRDescription();
242 Window* getColourEditBoxGDescription();
243 Window* getColourEditBoxBDescription();
260 Window* getColourPickerCursorStaticImage();
263 Window* d_colourPickerCursor;
265 SliderMode d_sliderMode;
287 int d_colourPickerImageOffset;
288 int d_colourPickerPickingImageHeight;
289 int d_colourPickerPickingImageWidth;
290 int d_colourPickerColourSliderImageWidth;
291 int d_colourPickerColourSliderImageHeight;
292 int d_colourPickerAlphaSliderImageWidth;
293 int d_colourPickerAlphaSliderImageHeight;
295 int d_colourPickerControlsTextureSize;
297 bool d_draggingColourPickerCursor;
307 #if defined(_MSC_VER)
308 # pragma warning(pop)
Base class for the ColourPicker widget.
Definition: ColourPicker.h:46
static const String AcceptButtonName
Widget name for the accept button component.
Definition: Controls.h:110
static const String EventColourAccepted
Definition: Controls.h:75
Main namespace for Crazy Eddie's GUI Library.
Definition: arch_overview.dox:1
Class representing an RGB colour using unsigned chars.
Definition: Types.h:63
Base class used as the argument to all subscribers Event object.
Definition: EventArgs.h:49
static const String CancelButtonName
Widget name for the cancel button component.
Definition: Controls.h:108
Specialisation of RenderTarget interface that should be used as the base class for RenderTargets that...
Definition: TextureTarget.h:40
Interface for Regex matching support classes.
Definition: RegexMatcher.h:39
RGB_Colour d_selectedColourRGB
Definition: Controls.h:272
static const String ColourPickerControlsPickingTextureImageName
Name of the Picking Texture Image in the ImageSet.
Definition: Controls.h:144
Class representing an HSV (hue, saturation and value) colour using floats.
Definition: Types.h:111
Class representing a Colour according to the L*a*b* standard.
Definition: Types.h:88
static const String ColourPickerControlsColourSliderTextureImageName
Name of the Slider Texture Image in the ImageSet.
Definition: Controls.h:146
static const String ColourRectPropertyName
Name of the colour defining ColourRectProperty of ColourRect windows.
Definition: Controls.h:150
Base class for Slider widgets.
Definition: widgets/Slider.h:98
Class representing the title bar for Frame Windows.
Definition: widgets/Titlebar.h:50
Colour d_selectedColour
selected colour of the ColourPickerControls as CEGUI colour
Definition: Controls.h:268
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: Window.h:149
HSV_Colour d_selectedColourHSV
Definition: Controls.h:280
Base class for an Editbox widget.
Definition: widgets/Editbox.h:69
Lab_Colour d_selectedColourLAB
Definition: Controls.h:276
static const String WidgetTypeName
Window type name.
Definition: Controls.h:69
Class representing colour values within the system.
Definition: Colour.h:44
Base class for the ColourPickerControls widget.
Definition: Controls.h:47
EventArgs based class that is used for objects passed to handlers triggered for events concerning som...
Definition: InputEvent.h:251
EventArgs based class that is used for objects passed to input event handlers concerning mouse input...
Definition: InputEvent.h:280
static const String ColourPickerControlsAlphaSliderTextureImageName
Name of the Slider Texture Image in the ImageSet.
Definition: Controls.h:148
static const String HexaDecimalEditBoxName
Widget name for the colour value EditBox.
Definition: Controls.h:114
static const String HexaDecimalDescriptionName
Widget name for the static text label of the hexadecimal colour value EditBox.
Definition: Controls.h:112
Colour d_previouslySelectedColour
Previously selected colour of the ColourPickerControls.
Definition: Controls.h:283
String class used within the GUI system.
Definition: String.h:62