A speech-bubble component that displays a short message. More...
Inherits BubbleComponent, and Timer.
Public Member Functions | |
| BubbleMessageComponent (int fadeOutLengthMs=150) | |
| Creates a bubble component. | |
| ~BubbleMessageComponent () | |
| Destructor. | |
| void | showAt (int x, int y, const String &message, int numMillisecondsBeforeRemoving, bool removeWhenMouseClicked=true, bool deleteSelfAfterUse=false) |
| Shows a message bubble at a particular position. | |
| void | showAt (Component *component, const String &message, int numMillisecondsBeforeRemoving, bool removeWhenMouseClicked=true, bool deleteSelfAfterUse=false) |
| Shows a message bubble next to a particular component. | |
| void | getContentSize (int &w, int &h) |
| void | paintContent (Graphics &g, int w, int h) |
| void | timerCallback () |
A speech-bubble component that displays a short message.
This can be used to show a message with the tail of the speech bubble pointing to a particular component or location on the screen.
| BubbleMessageComponent::BubbleMessageComponent | ( | int | fadeOutLengthMs = 150 |
) |
Creates a bubble component.
After creating one a BubbleComponent, do the following:
| BubbleMessageComponent::~BubbleMessageComponent | ( | ) |
Destructor.
| void BubbleMessageComponent::showAt | ( | int | x, | |
| int | y, | |||
| const String & | message, | |||
| int | numMillisecondsBeforeRemoving, | |||
| bool | removeWhenMouseClicked = true, |
|||
| bool | deleteSelfAfterUse = false | |||
| ) |
Shows a message bubble at a particular position.
This shows the bubble with its stem pointing to the given location (co-ordinates being relative to its parent component).
For details about exactly how it decides where to position itself, see BubbleComponent::updatePosition().
| x | the x co-ordinate of end of the bubble's tail | |
| y | the y co-ordinate of end of the bubble's tail | |
| message | the text to display | |
| numMillisecondsBeforeRemoving | how long to leave it on the screen before removing itself from its parent compnent. If this is 0 or less, it will stay there until manually removed. | |
| removeWhenMouseClicked | if this is true, the bubble will disappear as soon as a mouse button is pressed (anywhere on the screen) | |
| deleteSelfAfterUse | if true, then the component will delete itself after it becomes invisible |
| void BubbleMessageComponent::showAt | ( | Component * | component, | |
| const String & | message, | |||
| int | numMillisecondsBeforeRemoving, | |||
| bool | removeWhenMouseClicked = true, |
|||
| bool | deleteSelfAfterUse = false | |||
| ) |
Shows a message bubble next to a particular component.
This shows the bubble with its stem pointing at the given component.
For details about exactly how it decides where to position itself, see BubbleComponent::updatePosition().
| component | the component that you want to point at | |
| message | the text to display | |
| numMillisecondsBeforeRemoving | how long to leave it on the screen before removing itself from its parent compnent. If this is 0 or less, it will stay there until manually removed. | |
| removeWhenMouseClicked | if this is true, the bubble will disappear as soon as a mouse button is pressed (anywhere on the screen) | |
| deleteSelfAfterUse | if true, then the component will delete itself after it becomes invisible |
| void BubbleMessageComponent::getContentSize | ( | int & | w, | |
| int & | h | |||
| ) | [virtual] |
For internal use only.
Implements BubbleComponent.
| void BubbleMessageComponent::paintContent | ( | Graphics & | g, | |
| int | w, | |||
| int | h | |||
| ) | [virtual] |
For internal use only.
Implements BubbleComponent.
| void BubbleMessageComponent::timerCallback | ( | ) | [virtual] |
For internal use only.
Implements Timer.
1.6.3