141 {
142
144 if (self) {
145
148
150
152 assert(self->colorView);
153
156
158 assert(self->redSlider);
159
160 self->redSlider->delegate.self = self;
162 self->redSlider->max = 255.0;
164
166 assert(self->redInput);
167
169 $(self->redInput->label->text,
setText,
"R");
170
172
174 assert(self->greenSlider);
175
176 self->greenSlider->delegate.self = self;
178 self->greenSlider->max = 255.0;
180
182 assert(self->greenInput);
183
185 $(self->greenInput->label->text,
setText,
"G");
186
188
190 assert(self->blueSlider);
191
192 self->blueSlider->delegate.self = self;
194 self->blueSlider->max = 255.0;
196
198 assert(self->blueInput);
199
201 $(self->blueInput->label->text,
setText,
"B");
202
204
206 assert(self->alphaSlider);
207
208 self->alphaSlider->delegate.self = self;
210 self->alphaSlider->max = 255.0;
212
214 assert(self->alphaInput);
215
217 $(self->alphaInput->label->text,
setText,
"A");
218
220
222 }
223
224 return self;
225}
static void didSetComponent(Slider *slider, double value)
SliderDelegate callback for color component modification.
#define MakeRect(x, y, w, h)
Creates an SDL_Rect with the given origin and size.
Controls are Views which capture events and dispatch Actions.
void setLabelFormat(ProgressBar *self, const char *labelFormat)
Changes this ProgressBar's label format and calls appropriate update functions.
StackView * stackView
The StackView.
A Control allowing users to drag a handle to select a numeric value.
StackViews are containers that manage the arrangement of their subviews.
void setText(Text *self, const char *text)
Sets this Text's text.
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
void addClassName(View *self, const char *className)
Adds the given class name to this View.