62 void setButtonText (
const String& newText);
73 bool isDown() const noexcept;
79 bool isOver() const noexcept;
94 void setToggleable (
bool shouldBeToggleable);
100 bool isToggleable() const noexcept {
return canBeToggled || clickTogglesState; }
147 void setClickingTogglesState (
bool shouldAutoToggleOnClick)
noexcept;
175 void setRadioGroupId (
int newGroupId,
NotificationType notification = sendNotification);
205 void addListener (Listener* newListener);
210 void removeListener (Listener* listener);
227 virtual void triggerClick();
246 bool generateTooltip);
266 void clearShortcuts();
271 bool isRegisteredForShortcut (
const KeyPress&)
const;
287 void setRepeatSpeed (
int initialDelayInMillisecs,
288 int repeatDelayInMillisecs,
289 int minimumDelayInMillisecs = -1) noexcept;
300 void setTriggeredOnMouseDown (
bool isTriggeredOnMouseDown) noexcept;
305 bool getTriggeredOnMouseDown() const noexcept;
310 uint32 getMillisecondsSinceButtonDown() const noexcept;
316 void setTooltip (const
String& newTooltip) override;
323 ConnectedOnRight = 2,
325 ConnectedOnBottom = 8
339 void setConnectedEdges (
int connectedEdgeFlags);
357 bool isConnectedOnTop() const noexcept {
return (connectedEdgeFlags & ConnectedOnTop) != 0; }
382 void setState (ButtonState newState);
396 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) = 0;
398 virtual Font getTextButtonFont (
TextButton&,
int buttonHeight) = 0;
399 virtual int getTextButtonWidthToFitText (
TextButton&,
int buttonHeight) = 0;
403 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) = 0;
407 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) = 0;
409 virtual void changeToggleButtonWidthToFitText (
ToggleButton&) = 0;
411 virtual void drawTickBox (
Graphics&,
Component&,
float x,
float y,
float w,
float h,
412 bool ticked,
bool isEnabled,
413 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) = 0;
416 bool shouldDrawButtonAsHighlighted,
bool shouldDrawButtonAsDown) = 0;
421 [[deprecated (
"This method's parameters have changed.")]]
422 void setToggleState (
bool,
bool);
434 virtual void clicked();
455 bool shouldDrawButtonAsHighlighted,
456 bool shouldDrawButtonAsDown) = 0;
465 virtual void buttonStateChanged();
469 virtual void internalClickCallback (
const ModifierKeys&);
471 void handleCommandMessage (
int commandId)
override;
483 bool keyPressed (
const KeyPress&)
override;
485 using Component::keyStateChanged;
489 void parentHierarchyChanged()
override;
491 void visibilityChanged()
override;
497 void enablementChanged()
override;
510 uint32 buttonPressTime = 0, lastRepeatTime = 0;
512 int autoRepeatDelay = -1, autoRepeatSpeed = 0, autoRepeatMinimumDelay = -1;
513 int radioGroupId = 0, connectedEdgeFlags = 0;
515 ButtonState buttonState = buttonNormal, lastStatePainted = buttonNormal;
518 bool canBeToggled =
false;
519 bool lastToggleState =
false;
520 bool clickTogglesState =
false;
521 bool needsToRelease =
false;
522 bool needsRepainting =
false;
523 bool isKeyDown =
false;
524 bool triggerOnMouseDown =
false;
525 bool generateTooltip =
false;
527 void checkToggleableState (
bool wasToggleable);
529 void repeatTimerCallback();
530 bool keyStateChangedCallback();
531 void applicationCommandListChangeCallback();
534 ButtonState updateState();
535 ButtonState updateState (
bool isOver,
bool isDown);
536 bool isShortcutPressed()
const;
539 void flashButtonState();
541 void sendStateMessage();
One of these objects holds a list of all the commands your app can perform, and despatches these comm...
Holds a resizable array of primitive or copy-by-value objects.
Represents a colour, also including a transparency value.
The base class for all JUCE user-interface objects.
FocusChangeType
Enumeration used by the focusGained() and focusLost() methods.
Represents a particular font, including its size, style, etc.
A graphics context, used for drawing a component or image.
Represents a key press, including any modifier keys that are needed.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
Represents the state of the mouse buttons and modifier keys.
Contains position and status information about a mouse event.
A button that uses the standard lozenge-shaped background with a line of text on it.
Represents a shared variant value.
This class acts as a pointer which will automatically become null if the object to which it points is...
NotificationType
These enums are used in various classes to indicate whether a notification event should be sent out.
unsigned int uint32
A platform-independent 32-bit unsigned integer type.
int CommandID
A type used to hold the unique ID for an application command.
Holds information describing an application command.