Skip to content

[ENHANCEMENT] xtd.forms - message_notifier #180

@gammasoft71

Description

@gammasoft71

xtd.forms - xtd::forms::message_notifier

Library

xtd.forms

Enhancement

xtd::forms::message_notifier

Description

message_notifier is a small, nonblocking notification pop-up. A message_notifier is shown to users with readable message content at the bottom or top of the screen or at a specific target and disappears automatically after a few seconds (time-out). The control has various built-in options for customizing visual elements, durations, and dismissing toasts.

  • xtd::forms::message_notifier component

First draft

Unfortunately, the different OS don't manage the notifications in the same way.
So, we should have as for the dialog box xtd::forms::about_dialog manage the two styles of dialog:

  • xtd::forms::dialog_style::standard (notification managed by xtd)
  • xtd::forms::dialog_style::system (notification system).

Notification system :

Use wxNotificationMessage whenever possible. But typically, on macOS it doesn't work (Maybe for a user right ?).
And if the wxWidgets component doesn't match maybe call the native version for each OS (as I did for xtd::forms::message_box which was not implemented correctly in macOS and Windows).

Standard notification :

Implement our own xtd::forms::form (no border, no title and no controls). Add an image, a message and the possibility of 1, 2 or more buttons.
Add an xtd::forms::timer for automatic closing.

Common

  • Add asynchronous button events (like xtd::forms::show_sheet) which allows to know which button has been clicked.
  • Add a close event.
  • add properties for the message_notifier

API

Globally the API will be close to xtd::forms::message_dialog and xtd::forms::message_box with the possibility to have custom buttons and a timer to close the notification automatically.

Metadata

Metadata

Assignees

Projects

Status

In Progress

Relationships

None yet

Development

No branches or pull requests

Issue actions