JUCE-7.0.12-0-g4f43011b96 JUCE-7.0.12-0-g4f43011b96
JUCE — C++ application framework with suport for VST, VST3, LV2 audio plug-ins

« « « Anklang Documentation
Loading...
Searching...
No Matches
juce_LookAndFeel_V1.cpp
Go to the documentation of this file.
1 /*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
29LookAndFeel_V1::LookAndFeel_V1()
30{
31 setColour (TextButton::buttonColourId, Colour (0xffbbbbff));
33 setColour (ScrollBar::thumbColourId, Colour (0xffbbbbdd));
34 setColour (ScrollBar::backgroundColourId, Colours::transparentBlack);
35 setColour (Slider::thumbColourId, Colours::white);
36 setColour (Slider::trackColourId, Colour (0x7f000000));
38 setColour (ProgressBar::backgroundColourId, Colours::white.withAlpha (0.6f));
39 setColour (ProgressBar::foregroundColourId, Colours::green.withAlpha (0.7f));
40 setColour (PopupMenu::backgroundColourId, Colour (0xffeef5f8));
44
45 scrollbarShadow.setShadowProperties (DropShadow (Colours::black.withAlpha (0.5f), 2, Point<int>()));
46}
47
48LookAndFeel_V1::~LookAndFeel_V1()
49{
50}
51
52//==============================================================================
53void LookAndFeel_V1::drawButtonBackground (Graphics& g, Button& button, const Colour& backgroundColour,
55{
56 const int width = button.getWidth();
57 const int height = button.getHeight();
58
59 const float indent = 2.0f;
60 const int cornerSize = jmin (roundToInt ((float) width * 0.4f),
61 roundToInt ((float) height * 0.4f));
62
63 Path p;
64 p.addRoundedRectangle (indent, indent,
65 (float) width - indent * 2.0f,
66 (float) height - indent * 2.0f,
67 (float) cornerSize);
68
69 Colour bc (backgroundColour.withMultipliedSaturation (0.3f));
70
72 {
74 bc = bc.brighter();
75 else if (bc.getBrightness() > 0.5f)
76 bc = bc.darker (0.1f);
77 else
78 bc = bc.brighter (0.1f);
79 }
80
81 g.setColour (bc);
82 g.fillPath (p);
83
84 g.setColour (bc.contrasting().withAlpha ((shouldDrawButtonAsHighlighted) ? 0.6f : 0.4f));
85 g.strokePath (p, PathStrokeType ((shouldDrawButtonAsHighlighted) ? 2.0f : 1.4f));
86}
87
88void LookAndFeel_V1::drawTickBox (Graphics& g, Component& /*component*/,
89 float x, float y, float w, float h,
90 const bool ticked,
91 const bool isEnabled,
92 const bool /*shouldDrawButtonAsHighlighted*/,
93 const bool shouldDrawButtonAsDown)
94{
95 Path box;
96 box.addRoundedRectangle (0.0f, 2.0f, 6.0f, 6.0f, 1.0f);
97
98 g.setColour (isEnabled ? Colours::blue.withAlpha (shouldDrawButtonAsDown ? 0.3f : 0.1f)
99 : Colours::lightgrey.withAlpha (0.1f));
100
101 AffineTransform trans (AffineTransform::scale (w / 9.0f, h / 9.0f).translated (x, y));
102
103 g.fillPath (box, trans);
104
105 g.setColour (Colours::black.withAlpha (0.6f));
106 g.strokePath (box, PathStrokeType (0.9f), trans);
107
108 if (ticked)
109 {
110 Path tick;
111 tick.startNewSubPath (1.5f, 3.0f);
112 tick.lineTo (3.0f, 6.0f);
113 tick.lineTo (6.0f, 0.0f);
114
115 g.setColour (isEnabled ? Colours::black : Colours::grey);
116 g.strokePath (tick, PathStrokeType (2.5f), trans);
117 }
118}
119
121{
122 if (button.hasKeyboardFocus (true))
123 {
124 g.setColour (button.findColour (TextEditor::focusedOutlineColourId));
125 g.drawRect (0, 0, button.getWidth(), button.getHeight());
126 }
127
128 const int tickWidth = jmin (20, button.getHeight() - 4);
129
130 drawTickBox (g, button, 4.0f, (float) (button.getHeight() - tickWidth) * 0.5f,
131 (float) tickWidth, (float) tickWidth,
132 button.getToggleState(),
133 button.isEnabled(),
136
137 g.setColour (button.findColour (ToggleButton::textColourId));
138 g.setFont (jmin (15.0f, (float) button.getHeight() * 0.6f));
139
140 if (! button.isEnabled())
141 g.setOpacity (0.5f);
142
143 const int textX = tickWidth + 5;
144
145 g.drawFittedText (button.getButtonText(),
146 textX, 4,
147 button.getWidth() - textX - 2, button.getHeight() - 8,
149}
150
152 int width, int height,
153 double progress, const String& textToShow)
154{
156 {
157 LookAndFeel_V2::drawProgressBar (g, progressBar, width, height, progress, textToShow);
158 }
159 else
160 {
161 const Colour background (progressBar.findColour (ProgressBar::backgroundColourId));
162 const Colour foreground (progressBar.findColour (ProgressBar::foregroundColourId));
163
164 g.fillAll (background);
166
167 g.fillRect (1, 1,
168 jlimit (0, width - 2, roundToInt (progress * (width - 2))),
169 height - 2);
170
171 if (textToShow.isNotEmpty())
172 {
173 g.setColour (Colour::contrasting (background, foreground));
174 g.setFont ((float) height * 0.6f);
175
176 g.drawText (textToShow, 0, 0, width, height, Justification::centred, false);
177 }
178 }
179}
180
182 int width, int height, int buttonDirection,
186{
188 width -= 2;
189 else
190 height -= 2;
191
192 Path p;
193
194 const auto w = (float) width;
195 const auto h = (float) height;
196
197 if (buttonDirection == 0)
198 p.addTriangle (w * 0.5f, h * 0.2f,
199 w * 0.1f, h * 0.7f,
200 w * 0.9f, h * 0.7f);
201 else if (buttonDirection == 1)
202 p.addTriangle (w * 0.8f, h * 0.5f,
203 w * 0.3f, h * 0.1f,
204 w * 0.3f, h * 0.9f);
205 else if (buttonDirection == 2)
206 p.addTriangle (w * 0.5f, h * 0.8f,
207 w * 0.1f, h * 0.3f,
208 w * 0.9f, h * 0.3f);
209 else if (buttonDirection == 3)
210 p.addTriangle (w * 0.2f, h * 0.5f,
211 w * 0.7f, h * 0.1f,
212 w * 0.7f, h * 0.9f);
213
215 g.setColour (Colours::white);
217 g.setColour (Colours::white.withAlpha (0.7f));
218 else
219 g.setColour (bar.findColour (ScrollBar::thumbColourId).withAlpha (0.5f));
220
221 g.fillPath (p);
222
223 g.setColour (Colours::black.withAlpha (0.5f));
224 g.strokePath (p, PathStrokeType (0.5f));
225}
226
228 int x, int y, int width, int height,
229 bool isScrollbarVertical, int thumbStartPosition, int thumbSize,
230 bool isMouseOver, bool isMouseDown)
231{
233
235 .withAlpha ((isMouseOver || isMouseDown) ? 0.4f : 0.15f));
236
237 if ((float) thumbSize > 0.0f)
238 {
240
242 {
243 width -= 2;
244 g.fillRect (x + roundToInt ((float) width * 0.35f), y,
245 roundToInt ((float) width * 0.3f), height);
246
247 thumb.setBounds (x + 1, thumbStartPosition,
248 width - 2, thumbSize);
249 }
250 else
251 {
252 height -= 2;
253 g.fillRect (x, y + roundToInt ((float) height * 0.35f),
254 width, roundToInt ((float) height * 0.3f));
255
256 thumb.setBounds (thumbStartPosition, y + 1,
257 thumbSize, height - 2);
258 }
259
261 .withAlpha ((isMouseOver || isMouseDown) ? 0.95f : 0.7f));
262
263 g.fillRect (thumb);
264
265 g.setColour (Colours::black.withAlpha ((isMouseOver || isMouseDown) ? 0.4f : 0.25f));
266 g.drawRect (thumb.getX(), thumb.getY(), thumb.getWidth(), thumb.getHeight());
267
268 if (thumbSize > 16)
269 {
270 for (int i = 3; --i >= 0;)
271 {
272 const float linePos = (float) thumbStartPosition + (float) thumbSize * 0.5f + (float) (i - 1) * 4.0f;
273 g.setColour (Colours::black.withAlpha (0.15f));
274
276 {
277 g.drawLine ((float) x + (float) width * 0.2f, linePos, (float) width * 0.8f, linePos);
278 g.setColour (Colours::white.withAlpha (0.15f));
279 g.drawLine ((float) width * 0.2f, linePos - 1.0f, (float) width * 0.8f, linePos - 1.0f);
280 }
281 else
282 {
283 g.drawLine (linePos, (float) height * 0.2f, linePos, (float) height * 0.8f);
284 g.setColour (Colours::white.withAlpha (0.15f));
285 g.drawLine (linePos - 1.0f, (float) height * 0.2f, linePos - 1.0f, (float) height * 0.8f);
286 }
287 }
288 }
289 }
290}
291
293{
294 return &scrollbarShadow;
295}
296
297
298//==============================================================================
299void LookAndFeel_V1::drawPopupMenuBackground (Graphics& g, int width, int height)
300{
302
303 g.setColour (Colours::black.withAlpha (0.6f));
304 g.drawRect (0, 0, width, height);
305}
306
307void LookAndFeel_V1::drawMenuBarBackground (Graphics& g, int /*width*/, int /*height*/, bool, MenuBarComponent& menuBar)
308{
309 g.fillAll (menuBar.findColour (PopupMenu::backgroundColourId));
310}
311
312
313//==============================================================================
314void LookAndFeel_V1::drawTextEditorOutline (Graphics& g, int width, int height, TextEditor& textEditor)
315{
316 if (textEditor.isEnabled())
317 {
318 g.setColour (textEditor.findColour (TextEditor::outlineColourId));
319 g.drawRect (0, 0, width, height);
320 }
321}
322
323//==============================================================================
324void LookAndFeel_V1::drawComboBox (Graphics& g, int width, int height,
325 const bool isButtonDown,
326 int buttonX, int buttonY, int buttonW, int buttonH,
327 ComboBox& box)
328{
329 g.fillAll (box.findColour (ComboBox::backgroundColourId));
330
331 g.setColour (box.findColour ((isButtonDown) ? ComboBox::buttonColourId
332 : ComboBox::backgroundColourId));
333 g.fillRect (buttonX, buttonY, buttonW, buttonH);
334
335 g.setColour (box.findColour (ComboBox::outlineColourId));
336 g.drawRect (0, 0, width, height);
337
338 const float arrowX = 0.2f;
339 const float arrowH = 0.3f;
340
341 const auto x = (float) buttonX;
342 const auto y = (float) buttonY;
343 const auto w = (float) buttonW;
344 const auto h = (float) buttonH;
345
346 if (box.isEnabled())
347 {
348 Path p;
349 p.addTriangle (x + w * 0.5f, y + h * (0.45f - arrowH),
350 x + w * (1.0f - arrowX), y + h * 0.45f,
351 x + w * arrowX, y + h * 0.45f);
352
353 p.addTriangle (x + w * 0.5f, y + h * (0.55f + arrowH),
354 x + w * (1.0f - arrowX), y + h * 0.55f,
355 x + w * arrowX, y + h * 0.55f);
356
357 g.setColour (box.findColour ((isButtonDown) ? ComboBox::backgroundColourId
359 g.fillPath (p);
360 }
361}
362
363Font LookAndFeel_V1::getComboBoxFont (ComboBox& box)
364{
365 Font f (jmin (15.0f, (float) box.getHeight() * 0.85f));
366 f.setHorizontalScale (0.9f);
367 return f;
368}
369
370//==============================================================================
371static void drawTriangle (Graphics& g, float x1, float y1, float x2, float y2, float x3, float y3, Colour fill, Colour outline)
372{
373 Path p;
374 p.addTriangle (x1, y1, x2, y2, x3, y3);
375 g.setColour (fill);
376 g.fillPath (p);
377
378 g.setColour (outline);
379 g.strokePath (p, PathStrokeType (0.3f));
380}
381
382void LookAndFeel_V1::drawLinearSlider (Graphics& g,
383 int x, int y, int w, int h,
384 float sliderPos, float minSliderPos, float maxSliderPos,
385 const Slider::SliderStyle style,
386 Slider& slider)
387{
388 g.fillAll (slider.findColour (Slider::backgroundColourId));
389
390 if (style == Slider::LinearBar)
391 {
392 g.setColour (slider.findColour (Slider::thumbColourId));
393 g.fillRect (x, y, (int) sliderPos - x, h);
394
395 g.setColour (slider.findColour (Slider::textBoxTextColourId).withMultipliedAlpha (0.5f));
396 g.drawRect (x, y, (int) sliderPos - x, h);
397 }
398 else
399 {
400 g.setColour (slider.findColour (Slider::trackColourId)
401 .withMultipliedAlpha (slider.isEnabled() ? 1.0f : 0.3f));
402
403 if (slider.isHorizontal())
404 {
405 g.fillRect (x, y + roundToInt ((float) h * 0.6f),
406 w, roundToInt ((float) h * 0.2f));
407 }
408 else
409 {
410 g.fillRect (x + roundToInt ((float) w * 0.5f - jmin (3.0f, (float) w * 0.1f)), y,
411 jmin (4, roundToInt ((float) w * 0.2f)), h);
412 }
413
414 float alpha = 0.35f;
415
416 if (slider.isEnabled())
417 alpha = slider.isMouseOverOrDragging() ? 1.0f : 0.7f;
418
419 const Colour fill (slider.findColour (Slider::thumbColourId).withAlpha (alpha));
420 const Colour outline (Colours::black.withAlpha (slider.isEnabled() ? 0.7f : 0.35f));
421
423 {
424 drawTriangle (g,
425 (float) x + (float) w * 0.5f + jmin (4.0f, (float) w * 0.3f), minSliderPos,
426 (float) x + (float) w * 0.5f - jmin (8.0f, (float) w * 0.4f), minSliderPos - 7.0f,
427 (float) x + (float) w * 0.5f - jmin (8.0f, (float) w * 0.4f), minSliderPos,
428 fill, outline);
429
430 drawTriangle (g,
431 (float) x + (float) w * 0.5f + jmin (4.0f, (float) w * 0.3f), maxSliderPos,
432 (float) x + (float) w * 0.5f - jmin (8.0f, (float) w * 0.4f), maxSliderPos,
433 (float) x + (float) w * 0.5f - jmin (8.0f, (float) w * 0.4f), maxSliderPos + 7.0f,
434 fill, outline);
435 }
436 else if (style == Slider::TwoValueHorizontal || style == Slider::ThreeValueHorizontal)
437 {
438 drawTriangle (g,
439 minSliderPos, (float) y + (float) h * 0.6f - jmin (4.0f, (float) h * 0.3f),
440 minSliderPos - 7.0f, (float) y + (float) h * 0.9f,
441 minSliderPos, (float) y + (float) h * 0.9f,
442 fill, outline);
443
444 drawTriangle (g,
445 maxSliderPos, (float) y + (float) h * 0.6f - jmin (4.0f, (float) h * 0.3f),
446 maxSliderPos, (float) y + (float) h * 0.9f,
447 maxSliderPos + 7.0f, (float) y + (float) h * 0.9f,
448 fill, outline);
449 }
450
452 {
453 drawTriangle (g,
454 sliderPos, (float) y + (float) h * 0.9f,
455 sliderPos - 7.0f, (float) y + (float) h * 0.2f,
456 sliderPos + 7.0f, (float) y + (float) h * 0.2f,
457 fill, outline);
458 }
459 else if (style == Slider::LinearVertical || style == Slider::ThreeValueVertical)
460 {
461 drawTriangle (g,
462 (float) x + (float) w * 0.5f - jmin (4.0f, (float) w * 0.3f), sliderPos,
463 (float) x + (float) w * 0.5f + jmin (8.0f, (float) w * 0.4f), sliderPos - 7.0f,
464 (float) x + (float) w * 0.5f + jmin (8.0f, (float) w * 0.4f), sliderPos + 7.0f,
465 fill, outline);
466 }
467 }
468
469 if (slider.isBar())
470 drawLinearSliderOutline (g, x, y, w, h, style, slider);
471}
472
473Button* LookAndFeel_V1::createSliderButton (Slider&, const bool isIncrement)
474{
475 if (isIncrement)
476 return new ArrowButton ("u", 0.75f, Colours::white.withAlpha (0.8f));
477
478 return new ArrowButton ("d", 0.25f, Colours::white.withAlpha (0.8f));
479}
480
481ImageEffectFilter* LookAndFeel_V1::getSliderEffect (Slider&)
482{
483 return &scrollbarShadow;
484}
485
486int LookAndFeel_V1::getSliderThumbRadius (Slider&)
487{
488 return 8;
489}
490
491//==============================================================================
492void LookAndFeel_V1::drawCornerResizer (Graphics& g, int w, int h, bool isMouseOver, bool isMouseDragging)
493{
494 g.setColour ((isMouseOver || isMouseDragging) ? Colours::lightgrey
495 : Colours::darkgrey);
496
497 const float lineThickness = (float) jmin (w, h) * 0.1f;
498
499 for (float i = 0.0f; i < 1.0f; i += 0.3f)
500 {
501 g.drawLine ((float) w * i,
502 (float) h + 1.0f,
503 (float) w + 1.0f,
504 (float) h * i,
506 }
507}
508
509//==============================================================================
510Button* LookAndFeel_V1::createDocumentWindowButton (int buttonType)
511{
512 Path shape;
513
514 if (buttonType == DocumentWindow::closeButton)
515 {
516 shape.addLineSegment (Line<float> (0.0f, 0.0f, 1.0f, 1.0f), 0.35f);
517 shape.addLineSegment (Line<float> (1.0f, 0.0f, 0.0f, 1.0f), 0.35f);
518
519 ShapeButton* const b = new ShapeButton ("close",
520 Colour (0x7fff3333),
521 Colour (0xd7ff3333),
522 Colour (0xf7ff3333));
523
524 b->setShape (shape, true, true, true);
525 return b;
526 }
527 else if (buttonType == DocumentWindow::minimiseButton)
528 {
529 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), 0.25f);
530
531 DrawableButton* b = new DrawableButton ("minimise", DrawableButton::ImageFitted);
532 DrawablePath dp;
533 dp.setPath (shape);
534 dp.setFill (Colours::black.withAlpha (0.3f));
535 b->setImages (&dp);
536 return b;
537 }
538 else if (buttonType == DocumentWindow::maximiseButton)
539 {
540 shape.addLineSegment (Line<float> (0.5f, 0.0f, 0.5f, 1.0f), 0.25f);
541 shape.addLineSegment (Line<float> (0.0f, 0.5f, 1.0f, 0.5f), 0.25f);
542
543 DrawableButton* b = new DrawableButton ("maximise", DrawableButton::ImageFitted);
544 DrawablePath dp;
545 dp.setPath (shape);
546 dp.setFill (Colours::black.withAlpha (0.3f));
547 b->setImages (&dp);
548 return b;
549 }
550
552 return nullptr;
553}
554
555void LookAndFeel_V1::positionDocumentWindowButtons (DocumentWindow&,
556 int titleBarX, int titleBarY, int titleBarW, int titleBarH,
557 Button* minimiseButton,
558 Button* maximiseButton,
559 Button* closeButton,
560 bool positionTitleBarButtonsOnLeft)
561{
562 titleBarY += titleBarH / 8;
563 titleBarH -= titleBarH / 4;
564
565 const int buttonW = titleBarH;
566
567 int x = positionTitleBarButtonsOnLeft ? titleBarX + 4
568 : titleBarX + titleBarW - buttonW - 4;
569
570 if (closeButton != nullptr)
571 {
572 closeButton->setBounds (x, titleBarY, buttonW, titleBarH);
573 x += positionTitleBarButtonsOnLeft ? buttonW + buttonW / 5
574 : -(buttonW + buttonW / 5);
575 }
576
577 if (positionTitleBarButtonsOnLeft)
578 std::swap (minimiseButton, maximiseButton);
579
580 if (maximiseButton != nullptr)
581 {
582 maximiseButton->setBounds (x, titleBarY - 2, buttonW, titleBarH);
583 x += positionTitleBarButtonsOnLeft ? buttonW : -buttonW;
584 }
585
586 if (minimiseButton != nullptr)
587 minimiseButton->setBounds (x, titleBarY - 2, buttonW, titleBarH);
588}
589
590} // namespace juce
static AffineTransform scale(float factorX, float factorY) noexcept
Returns a new transform which is a re-scale about the origin.
Represents a colour, also including a transparency value.
Definition juce_Colour.h:38
Colour contrasting(float amount=1.0f) const noexcept
Returns a colour that will be clearly visible against this colour.
@ outlineColourId
The colour for an outline around the box.
@ buttonColourId
The base colour for the button (a LookAndFeel class will probably use variations on this).
@ backgroundColourId
The background colour to fill the box with.
@ ImageFitted
The button will just display the images, but will resize and centre them to fit inside it.
void setShadowProperties(const DropShadow &newShadow)
Sets up parameters affecting the shadow's appearance.
A graphics context, used for drawing a component or image.
void setOpacity(float newOpacity)
Changes the opacity to use with the current colour.
void drawText(const String &text, int x, int y, int width, int height, Justification justificationType, bool useEllipsesIfTooBig=true) const
Draws a line of text within a specified rectangle.
void drawFittedText(const String &text, int x, int y, int width, int height, Justification justificationFlags, int maximumNumberOfLines, float minimumHorizontalScale=0.0f) const
Tries to draw a text string inside a given space.
void setFont(const Font &newFont)
Changes the font to use for subsequent text-drawing functions.
void drawRect(int x, int y, int width, int height, int lineThickness=1) const
Draws a rectangular outline, using the current colour or brush.
void fillRect(Rectangle< int > rectangle) const
Fills a rectangle with the current colour or brush.
void fillPath(const Path &path) const
Fills a path using the currently selected colour or brush.
void setColour(Colour newColour)
Changes the current drawing colour.
void drawLine(float startX, float startY, float endX, float endY) const
Draws a line between two points.
void strokePath(const Path &path, const PathStrokeType &strokeType, const AffineTransform &transform={}) const
Draws a path's outline using the currently selected colour or brush.
void fillAll() const
Fills the context's entire clip region with the current colour or brush.
A graphical effect filter that can be applied to components.
@ centred
Indicates that the item should be centred vertically and horizontally.
@ centredLeft
Indicates that the item should be centred vertically but placed on the left hand side.
@ outlineColourId
An optional colour to use to draw a border around the list.
void drawPopupMenuBackground(Graphics &, int width, int height) override
Fills the background of a popup menu component.
void drawToggleButton(Graphics &, ToggleButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Draws the contents of a standard ToggleButton.
void drawScrollbarButton(Graphics &, ScrollBar &, int width, int height, int buttonDirection, bool isScrollbarVertical, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown) override
Draws one of the buttons on a scrollbar.
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow) override
Draws a progress bar.
void drawScrollbar(Graphics &, ScrollBar &, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown) override
Draws the thumb area of a scrollbar.
ImageEffectFilter * getScrollbarEffect() override
Returns the component effect to use for a scrollbar.
void drawProgressBar(Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow) override
Draws a progress bar.
void setColour(int colourId, Colour colour) noexcept
Registers a colour to be used for a particular purpose.
Colour findColour(int colourId) const noexcept
Looks for a colour that has been registered with the given colour ID number.
A menu bar component.
Describes a type of stroke used to render a solid outline along a path.
A path is a sequence of lines and curves that may either form a closed shape or be open-ended.
Definition juce_Path.h:65
void addTriangle(float x1, float y1, float x2, float y2, float x3, float y3)
Adds a triangle to the path.
@ highlightedTextColourId
The colour to use for the text of the currently highlighted item.
@ backgroundColourId
The colour to fill the menu's background with.
@ highlightedBackgroundColourId
The colour to fill the background of the currently highlighted menu item.
A progress bar component.
@ backgroundColourId
The background colour, behind the bar.
@ foregroundColourId
The colour to use to draw the bar itself.
Manages a rectangle and allows geometric operations to be performed on it.
A scrollbar component.
@ thumbColourId
A base colour to use for the thumb.
@ backgroundColourId
The background colour of the scrollbar.
SliderStyle
The types of slider available.
Definition juce_Slider.h:62
@ ThreeValueHorizontal
A horizontal slider that has three thumbs instead of one, so it can show a minimum and maximum value,...
Definition juce_Slider.h:82
@ TwoValueHorizontal
A horizontal slider that has two thumbs instead of one, so it can show a minimum and maximum value.
Definition juce_Slider.h:77
@ LinearBar
A horizontal bar slider with the text label drawn on top of it.
Definition juce_Slider.h:65
@ LinearHorizontal
A traditional horizontal slider.
Definition juce_Slider.h:63
@ LinearVertical
A traditional vertical slider.
Definition juce_Slider.h:64
@ ThreeValueVertical
A vertical slider that has three thumbs instead of one, so it can show a minimum and maximum value,...
Definition juce_Slider.h:85
@ TwoValueVertical
A vertical slider that has two thumbs instead of one, so it can show a minimum and maximum value.
Definition juce_Slider.h:79
@ textBoxTextColourId
The colour for the text in the text-editor box used for editing the value.
@ textBoxOutlineColourId
The colour to use for a border around the text-editor box.
@ trackColourId
The colour to draw the groove that the thumb moves along.
@ backgroundColourId
A colour to use to fill the slider's background.
@ thumbColourId
The colour to draw the thumb with.
The JUCE String class!
Definition juce_String.h:53
@ buttonColourId
The colour used to fill the button shape (when the button is toggled 'off').
@ outlineColourId
If this is non-transparent, it will be used to draw a box around the edge of the component.
@ focusedOutlineColourId
If this is non-transparent, it will be used to draw a box around the edge of the component when it ha...
A button that can be toggled on/off.
@ textColourId
The colour to use for the button's text.
T fill(T... args)
#define jassertfalse
This will always cause an assertion failure.
typedef float
JUCE Namespace.
constexpr Type jmin(Type a, Type b)
Returns the smaller of two values.
Type jlimit(Type lowerLimit, Type upperLimit, Type valueToConstrain) noexcept
Constrains a value to keep it within a given range.
Type unalignedPointerCast(void *ptr) noexcept
Casts a pointer to another type via void*, which suppresses the cast-align warning which sometimes ar...
Definition juce_Memory.h:88
int roundToInt(const FloatType value) noexcept
Fast floating-point-to-integer conversion.
T swap(T... args)