Display notification messages at the bottom-left of the play area. They have a translucent black background, and do not capture mouse events (i.e. mouse events pass through the notification display and are received by the play area).
There are two types of notifications:
Those that disappear automatically after 5 seconds
Those that are removed explicitly
Messages should be displayable in colour, just like the button bar description.
The notification display should support having multiple messages on display at the same time, and perhaps have simple animation like fade-out when the message needs to disappear.
(Type 1) Those that disappear automatically after 5 seconds include:
"Saved to default clipboard" / "Saved to clipboard X"
"Simulation reset"
Error messages, e.g. "Can't redo" / "File already saved"
(Type 2) Those that are removed explicitly include:
"Default view active"
"Hold 'Shift' to add to selection; hold 'Alt' to subtract from selection"
"Hold 'Shift' to draw a polyline"
Notification mode
We might want certain notifications to be only displayed in beginner mode. Two possible designs:
The callers (e.g. SelectionAction) need to check if beginner mode in enabled, and thus decide whether to submit the notification
The callers submit notifications with a 'notification mode' parameter, and the notification manager decides whether to display the notification, based on the notification mode and whether beginner mode is enabled
Type 2 notifications with RAII
It is useful for callers to use RAII to manage Type 2 notifications. Callers should construct a notification object to display the notification and destruct it to remove the notification. In this way, callers can never forget to remove a notification.
Notification display system
Display notification messages at the bottom-left of the play area. They have a translucent black background, and do not capture mouse events (i.e. mouse events pass through the notification display and are received by the play area).
There are two types of notifications:
Messages should be displayable in colour, just like the button bar description.
The notification display should support having multiple messages on display at the same time, and perhaps have simple animation like fade-out when the message needs to disappear.
(Type 1) Those that disappear automatically after 5 seconds include:
(Type 2) Those that are removed explicitly include:
Notification mode
We might want certain notifications to be only displayed in beginner mode. Two possible designs:
Type 2 notifications with RAII
It is useful for callers to use RAII to manage Type 2 notifications. Callers should construct a notification object to display the notification and destruct it to remove the notification. In this way, callers can never forget to remove a notification.