summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic Letz <dominic@diode.io>2021-01-13 19:01:42 +0100
committerDominic Letz <dominic@diode.io>2021-01-22 12:23:27 +0100
commit4e66a2fe996c91c93612a6d2ffd1b0a3564def04 (patch)
tree2b9bc6373519d3ac3804dfdc1fa386119d6b498a
parent1a99d780d5e3d8de060cd5aba38abac35b4cf669 (diff)
downloaderlang-4e66a2fe996c91c93612a6d2ffd1b0a3564def04.tar.gz
wxNotificationMessage support
This enables native os notification events on the platform. For implementing messaging and background apps this is especially important. E.g. imagine an app wanting to announce 'Update available' or 'New Mail Received' or 'Download Completed'. For MacOS even which discourages applications raising themself to focus, using the native OS notifications is the only correct way to get the users attention to an app. Note that the underlying wxWidgets implementation in 3.0.x is very basic and has been completely reworked in 3.1.x for best experience use wxWidgets 3.1
-rwxr-xr-xlib/wx/api_gen/interface/wx/notifmsg.h8
-rw-r--r--lib/wx/api_gen/wx_gen_cpp.erl1
-rw-r--r--lib/wx/api_gen/wx_gen_nif.erl1
-rw-r--r--lib/wx/api_gen/wxapi.conf11
-rw-r--r--lib/wx/c_src/gen/wxe_derived_dest.h8
-rw-r--r--lib/wx/c_src/gen/wxe_events.cpp11
-rw-r--r--lib/wx/c_src/gen/wxe_func_table.cpp35
-rw-r--r--lib/wx/c_src/gen/wxe_init.cpp5
-rw-r--r--lib/wx/c_src/gen/wxe_macros.h3
-rw-r--r--lib/wx/c_src/gen/wxe_wrapper_8.cpp199
-rw-r--r--lib/wx/doc/src/wxNotificationMessage.xml152
-rw-r--r--lib/wx/examples/demo/Makefile1
-rw-r--r--lib/wx/examples/demo/ex_notificationMessage.erl144
-rw-r--r--lib/wx/include/wx.hrl5
-rw-r--r--lib/wx/src/gen/wxCommandEvent.erl4
-rw-r--r--lib/wx/src/gen/wxNotificationMessage.erl174
-rw-r--r--lib/wx/src/gen/wxe_funcs.hrl13
17 files changed, 760 insertions, 15 deletions
diff --git a/lib/wx/api_gen/interface/wx/notifmsg.h b/lib/wx/api_gen/interface/wx/notifmsg.h
index b355393e24..ebc85d24d9 100755
--- a/lib/wx/api_gen/interface/wx/notifmsg.h
+++ b/lib/wx/api_gen/interface/wx/notifmsg.h
@@ -39,13 +39,13 @@
@beginEventEmissionTable{wxCommandEvent}
- @event{wxEVT_NOTIFICATION_MESSAGE_CLICK(id, func)}
+ @event{EVT_NOTIFICATION_MESSAGE_CLICK(id, func)}
Process a @c wxEVT_NOTIFICATION_MESSAGE_CLICK event, when a notification
is clicked.
- @event{wxEVT_NOTIFICATION_MESSAGE_DISMISSED(id, func)}
+ @event{EVT_NOTIFICATION_MESSAGE_DISMISSED(id, func)}
Process a @c wxEVT_NOTIFICATION_MESSAGE_DISMISSED event, when a notification
is dismissed by the user or times out.
- @event{wxEVT_NOTIFICATION_MESSAGE_ACTION(id, func)}
+ @event{EVT_NOTIFICATION_MESSAGE_ACTION(id, func)}
Process a @c wxEVT_NOTIFICATION_MESSAGE_ACTION event, when the user
selects on of the actions added by AddAction()
@endEventTable
@@ -167,7 +167,7 @@ public:
@return @false if an error occurred.
*/
- bool Show(int timeout = Timeout_Auto);
+ bool Show(int timeout = wxNotificationMessage::Timeout_Auto);
/**
If the application already uses a wxTaskBarIcon, it should be connected
diff --git a/lib/wx/api_gen/wx_gen_cpp.erl b/lib/wx/api_gen/wx_gen_cpp.erl
index 399bbdbb77..356ebfe127 100644
--- a/lib/wx/api_gen/wx_gen_cpp.erl
+++ b/lib/wx/api_gen/wx_gen_cpp.erl
@@ -1224,6 +1224,7 @@ gen_macros() ->
w("#include <wx/filename.h>~n"),
w("#include <wx/sysopt.h>~n"),
w("#include <wx/overlay.h>~n"),
+ w("#include <wx/notifmsg.h>~n"),
w("~n~n", []),
w("#ifndef wxICON_DEFAULT_BITMAP_TYPE~n",[]),
diff --git a/lib/wx/api_gen/wx_gen_nif.erl b/lib/wx/api_gen/wx_gen_nif.erl
index 3afa6fddb2..752713ac44 100644
--- a/lib/wx/api_gen/wx_gen_nif.erl
+++ b/lib/wx/api_gen/wx_gen_nif.erl
@@ -1426,6 +1426,7 @@ gen_macros() ->
w("#include <wx/filename.h>~n"),
w("#include <wx/sysopt.h>~n"),
w("#include <wx/overlay.h>~n"),
+ w("#include <wx/notifmsg.h>~n"),
w("~n~n", []),
w("#ifndef wxICON_DEFAULT_BITMAP_TYPE~n",[]),
diff --git a/lib/wx/api_gen/wxapi.conf b/lib/wx/api_gen/wxapi.conf
index b1f99e315a..ed3da97c44 100644
--- a/lib/wx/api_gen/wxapi.conf
+++ b/lib/wx/api_gen/wxapi.conf
@@ -1614,7 +1614,10 @@
wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxEVT_COMMAND_LEFT_CLICK,wxEVT_COMMAND_LEFT_DCLICK,wxEVT_COMMAND_RIGHT_CLICK,
wxEVT_COMMAND_SET_FOCUS, wxEVT_COMMAND_KILL_FOCUS,
- wxEVT_COMMAND_ENTER
+ wxEVT_COMMAND_ENTER,
+ {wxEVT_NOTIFICATION_MESSAGE_CLICK, {test_if, "wxCHECK_VERSION(3,1,0)"}},
+ {wxEVT_NOTIFICATION_MESSAGE_DISMISSED, {test_if, "wxCHECK_VERSION(3,1,0)"}},
+ {wxEVT_NOTIFICATION_MESSAGE_ACTION, {test_if, "wxCHECK_VERSION(3,1,0)"}}
]}],
[{'GetClientObject',[{erl_func, "getClientData"}]},
'GetExtraLong','GetInt','GetSelection','GetString','IsChecked',
@@ -2310,3 +2313,9 @@
{class, wxGCDC, wxDC, [{ifdef, wxUSE_GRAPHICS_CONTEXT}],
['wxGCDC', '~wxGCDC', 'GetGraphicsContext', 'SetGraphicsContext'
]}.
+
+{class, wxNotificationMessage, wxEvtHandler, [],
+ ['wxNotificationMessage','~wxNotificationMessage',
+ {'AddAction', [{test_if, "wxCHECK_VERSION(3,1,0)"}]},'Close',
+ 'SetFlags',{'SetIcon', [{test_if, "wxCHECK_VERSION(3,1,0)"}]},
+ 'SetMessage','SetParent','SetTitle','Show']}.
diff --git a/lib/wx/c_src/gen/wxe_derived_dest.h b/lib/wx/c_src/gen/wxe_derived_dest.h
index 861d8ca4b7..33b988eb18 100644
--- a/lib/wx/c_src/gen/wxe_derived_dest.h
+++ b/lib/wx/c_src/gen/wxe_derived_dest.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -861,3 +861,9 @@ class EwxGCDC : public wxGCDC {
};
#endif // wxUSE_GRAPHICS_CONTEXT
+class EwxNotificationMessage : public wxNotificationMessage {
+ public: ~EwxNotificationMessage() {((WxeApp *)wxTheApp)->clearPtr(this);};
+ EwxNotificationMessage(const wxString& title,const wxString& message,wxWindow * parent,int flags) : wxNotificationMessage(title,message,parent,flags) {};
+ EwxNotificationMessage() : wxNotificationMessage() {};
+};
+
diff --git a/lib/wx/c_src/gen/wxe_events.cpp b/lib/wx/c_src/gen/wxe_events.cpp
index 97a5fac4ff..cc5647e615 100644
--- a/lib/wx/c_src/gen/wxe_events.cpp
+++ b/lib/wx/c_src/gen/wxe_events.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -80,6 +80,15 @@ void initEventTable()
{wxEVT_COMMAND_SET_FOCUS, 168, "command_set_focus", "wxCommandEvent", "wxCommand"},
{wxEVT_COMMAND_KILL_FOCUS, 168, "command_kill_focus", "wxCommandEvent", "wxCommand"},
{wxEVT_COMMAND_ENTER, 168, "command_enter", "wxCommandEvent", "wxCommand"},
+#if wxCHECK_VERSION(3,1,0)
+ {wxEVT_NOTIFICATION_MESSAGE_CLICK, 168, "notification_message_click", "wxCommandEvent", "wxCommand"},
+#endif
+#if wxCHECK_VERSION(3,1,0)
+ {wxEVT_NOTIFICATION_MESSAGE_DISMISSED, 168, "notification_message_dismissed", "wxCommandEvent", "wxCommand"},
+#endif
+#if wxCHECK_VERSION(3,1,0)
+ {wxEVT_NOTIFICATION_MESSAGE_ACTION, 168, "notification_message_action", "wxCommandEvent", "wxCommand"},
+#endif
{wxEVT_SCROLL_TOP, 169, "scroll_top", "wxScrollEvent", "wxScroll"},
{wxEVT_SCROLL_BOTTOM, 169, "scroll_bottom", "wxScrollEvent", "wxScroll"},
{wxEVT_SCROLL_LINEUP, 169, "scroll_lineup", "wxScrollEvent", "wxScroll"},
diff --git a/lib/wx/c_src/gen/wxe_func_table.cpp b/lib/wx/c_src/gen/wxe_func_table.cpp
index ee83db17ba..32f7f45446 100644
--- a/lib/wx/c_src/gen/wxe_func_table.cpp
+++ b/lib/wx/c_src/gen/wxe_func_table.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -3281,6 +3281,20 @@ extern void wxGCDC_new_1(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
extern void wxGCDC_new_0(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
extern void wxGCDC_GetGraphicsContext(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
extern void wxGCDC_SetGraphicsContext(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_new_0(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_new_2(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+#if wxCHECK_VERSION(3,1,0)
+extern void wxNotificationMessage_AddAction(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+#endif
+extern void wxNotificationMessage_Close(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_SetFlags(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+#if wxCHECK_VERSION(3,1,0)
+extern void wxNotificationMessage_SetIcon(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+#endif
+extern void wxNotificationMessage_SetMessage(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_SetParent(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_SetTitle(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
+extern void wxNotificationMessage_Show(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd);
wxe_fns_t wxe_fns[] =
{
@@ -6904,4 +6918,23 @@ wxe_fns_t wxe_fns[] =
{NULL, "wxGCDC", "destroy", 1}, // 3541 obj destructor wxGCDC_destruct
{wxGCDC_GetGraphicsContext, "wxGCDC", "getGraphicsContext", 1}, // 3542
{wxGCDC_SetGraphicsContext, "wxGCDC", "setGraphicsContext", 2}, // 3543
+ {wxNotificationMessage_new_0, "wxNotificationMessage", "new", 0}, // 3544
+ {wxNotificationMessage_new_2, "wxNotificationMessage", "new", 2}, // 3545
+ {NULL, "wxNotificationMessage", "destroy", 1}, // 3546 obj destructor wxNotificationMessage_destruct
+#if wxCHECK_VERSION(3,1,0)
+ {wxNotificationMessage_AddAction, "wxNotificationMessage", "addAction", 3}, // 3547
+#else
+ {NULL, "wxNotificationMessage", "addAction", 0}, // 3547
+#endif
+ {wxNotificationMessage_Close, "wxNotificationMessage", "close", 1}, // 3548
+ {wxNotificationMessage_SetFlags, "wxNotificationMessage", "setFlags", 2}, // 3549
+#if wxCHECK_VERSION(3,1,0)
+ {wxNotificationMessage_SetIcon, "wxNotificationMessage", "setIcon", 2}, // 3550
+#else
+ {NULL, "wxNotificationMessage", "setIcon", 0}, // 3550
+#endif
+ {wxNotificationMessage_SetMessage, "wxNotificationMessage", "setMessage", 2}, // 3551
+ {wxNotificationMessage_SetParent, "wxNotificationMessage", "setParent", 2}, // 3552
+ {wxNotificationMessage_SetTitle, "wxNotificationMessage", "setTitle", 2}, // 3553
+ {wxNotificationMessage_Show, "wxNotificationMessage", "show", 2}, // 3554
};
diff --git a/lib/wx/c_src/gen/wxe_init.cpp b/lib/wx/c_src/gen/wxe_init.cpp
index 956cfa2e96..892111bbd9 100644
--- a/lib/wx/c_src/gen/wxe_init.cpp
+++ b/lib/wx/c_src/gen/wxe_init.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -4751,6 +4751,9 @@ void WxeApp::init_consts(wxeMetaCommand& event) {
{ enif_make_atom(rt.env,"wxNotebook"), "wxNotebook_NO_IMAGE", rt.make_int(wxNotebook::NO_IMAGE) },
// From class wxNotebook
{ enif_make_atom(rt.env,"wxNotebook"), "wxNotebook_NO_IMAGE", rt.make_int(wxNotebook::NO_IMAGE) },
+// From class wxNotificationMessage
+ { enif_make_atom(rt.env,"wxNotificationMessage"), "wxNotificationMessage_Timeout_Auto", rt.make_int(wxNotificationMessage::Timeout_Auto) },
+ { enif_make_atom(rt.env,"wxNotificationMessage"), "wxNotificationMessage_Timeout_Never", rt.make_int(wxNotificationMessage::Timeout_Never) },
// From class wxStaticBitmap::ScaleMode
#if wxCHECK_VERSION(3,1,0)
{ enif_make_atom(rt.env,"ScaleMode"), "wxStaticBitmap_Scale_None", rt.make_int(wxStaticBitmap::Scale_None) },
diff --git a/lib/wx/c_src/gen/wxe_macros.h b/lib/wx/c_src/gen/wxe_macros.h
index cfdfaa6a1c..d1d36ec571 100644
--- a/lib/wx/c_src/gen/wxe_macros.h
+++ b/lib/wx/c_src/gen/wxe_macros.h
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -67,6 +67,7 @@
#include <wx/filename.h>
#include <wx/sysopt.h>
#include <wx/overlay.h>
+#include <wx/notifmsg.h>
#ifndef wxICON_DEFAULT_BITMAP_TYPE
diff --git a/lib/wx/c_src/gen/wxe_wrapper_8.cpp b/lib/wx/c_src/gen/wxe_wrapper_8.cpp
index 8802c1d303..d211e00fd4 100644
--- a/lib/wx/c_src/gen/wxe_wrapper_8.cpp
+++ b/lib/wx/c_src/gen/wxe_wrapper_8.cpp
@@ -1,7 +1,7 @@
/*
* %CopyrightBegin%
*
- * Copyright Ericsson AB 2008-2020. All Rights Reserved.
+ * Copyright Ericsson AB 2008-2021. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -3025,3 +3025,200 @@ void wxGCDC_SetGraphicsContext(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
}
#endif // wxUSE_GRAPHICS_CONTEXT
+// wxNotificationMessage::wxNotificationMessage
+void wxNotificationMessage_new_0(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ wxNotificationMessage * Result = new EwxNotificationMessage();
+ app->newPtr((void *) Result, 1, memenv);
+ wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
+ rt.send( rt.make_ref(app->getRef((void *)Result,memenv), "wxNotificationMessage"));
+
+}
+
+// wxNotificationMessage::wxNotificationMessage
+void wxNotificationMessage_new_2(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ wxString message= wxEmptyString;
+ wxWindow * parent=NULL;
+ int flags=wxICON_INFORMATION;
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ ErlNifBinary title_bin;
+ wxString title;
+ if(!enif_inspect_binary(env, argv[0], &title_bin)) Badarg("title");
+ title = wxString(title_bin.data, wxConvUTF8, title_bin.size);
+ ERL_NIF_TERM lstHead, lstTail;
+ lstTail = argv[1];
+ if(!enif_is_list(env, lstTail)) Badarg("Options");
+ const ERL_NIF_TERM *tpl;
+ int tpl_sz;
+ while(!enif_is_empty_list(env, lstTail)) {
+ if(!enif_get_list_cell(env, lstTail, &lstHead, &lstTail)) Badarg("Options");
+ if(!enif_get_tuple(env, lstHead, &tpl_sz, &tpl) || tpl_sz != 2) Badarg("Options");
+ if(enif_is_identical(tpl[0], enif_make_atom(env, "message"))) {
+ ErlNifBinary message_bin;
+ if(!enif_inspect_binary(env, tpl[1], &message_bin)) Badarg("message");
+ message = wxString(message_bin.data, wxConvUTF8, message_bin.size);
+ } else if(enif_is_identical(tpl[0], enif_make_atom(env, "parent"))) {
+ parent = (wxWindow *) memenv->getPtr(env, tpl[1], "parent");
+ } else if(enif_is_identical(tpl[0], enif_make_atom(env, "flags"))) {
+ if(!enif_get_int(env, tpl[1], &flags)) Badarg("flags"); // int
+ } else Badarg("Options");
+ };
+ wxNotificationMessage * Result = new EwxNotificationMessage(title,message,parent,flags);
+ app->newPtr((void *) Result, 1, memenv);
+ wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
+ rt.send( rt.make_ref(app->getRef((void *)Result,memenv), "wxNotificationMessage"));
+
+}
+
+#if wxCHECK_VERSION(3,1,0)
+// wxNotificationMessage::AddAction
+void wxNotificationMessage_AddAction(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ wxString label= wxString();
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ int actionid;
+ if(!enif_get_int(env, argv[1], &actionid)) Badarg("actionid"); // wxWindowID
+ ERL_NIF_TERM lstHead, lstTail;
+ lstTail = argv[2];
+ if(!enif_is_list(env, lstTail)) Badarg("Options");
+ const ERL_NIF_TERM *tpl;
+ int tpl_sz;
+ while(!enif_is_empty_list(env, lstTail)) {
+ if(!enif_get_list_cell(env, lstTail, &lstHead, &lstTail)) Badarg("Options");
+ if(!enif_get_tuple(env, lstHead, &tpl_sz, &tpl) || tpl_sz != 2) Badarg("Options");
+ if(enif_is_identical(tpl[0], enif_make_atom(env, "label"))) {
+ ErlNifBinary label_bin;
+ if(!enif_inspect_binary(env, tpl[1], &label_bin)) Badarg("label");
+ label = wxString(label_bin.data, wxConvUTF8, label_bin.size);
+ } else Badarg("Options");
+ };
+ if(!This) throw wxe_badarg("This");
+ bool Result = This->AddAction(actionid,label);
+ wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
+ rt.send( rt.make_bool(Result));
+
+}
+
+#endif
+// wxNotificationMessage::Close
+void wxNotificationMessage_Close(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ if(!This) throw wxe_badarg("This");
+ bool Result = This->Close();
+ wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
+ rt.send( rt.make_bool(Result));
+
+}
+
+// wxNotificationMessage::SetFlags
+void wxNotificationMessage_SetFlags(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ int flags;
+ if(!enif_get_int(env, argv[1], &flags)) Badarg("flags"); // int
+ if(!This) throw wxe_badarg("This");
+ This->SetFlags(flags);
+
+}
+
+#if wxCHECK_VERSION(3,1,0)
+// wxNotificationMessage::SetIcon
+void wxNotificationMessage_SetIcon(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ wxIcon *icon;
+ icon = (wxIcon *) memenv->getPtr(env, argv[1], "icon");
+ if(!This) throw wxe_badarg("This");
+ This->SetIcon(*icon);
+
+}
+
+#endif
+// wxNotificationMessage::SetMessage
+void wxNotificationMessage_SetMessage(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ ErlNifBinary message_bin;
+ wxString message;
+ if(!enif_inspect_binary(env, argv[1], &message_bin)) Badarg("message");
+ message = wxString(message_bin.data, wxConvUTF8, message_bin.size);
+ if(!This) throw wxe_badarg("This");
+ This->SetMessage(message);
+
+}
+
+// wxNotificationMessage::SetParent
+void wxNotificationMessage_SetParent(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ wxWindow *parent;
+ parent = (wxWindow *) memenv->getPtr(env, argv[1], "parent");
+ if(!This) throw wxe_badarg("This");
+ This->SetParent(parent);
+
+}
+
+// wxNotificationMessage::SetTitle
+void wxNotificationMessage_SetTitle(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ ErlNifBinary title_bin;
+ wxString title;
+ if(!enif_inspect_binary(env, argv[1], &title_bin)) Badarg("title");
+ title = wxString(title_bin.data, wxConvUTF8, title_bin.size);
+ if(!This) throw wxe_badarg("This");
+ This->SetTitle(title);
+
+}
+
+// wxNotificationMessage::Show
+void wxNotificationMessage_Show(WxeApp *app, wxeMemEnv *memenv, wxeCommand& Ecmd)
+{
+ int timeout=wxNotificationMessage::Timeout_Auto;
+ ErlNifEnv *env = Ecmd.env;
+ ERL_NIF_TERM * argv = Ecmd.args;
+ wxNotificationMessage *This;
+ This = (wxNotificationMessage *) memenv->getPtr(env, argv[0], "This");
+ ERL_NIF_TERM lstHead, lstTail;
+ lstTail = argv[1];
+ if(!enif_is_list(env, lstTail)) Badarg("Options");
+ const ERL_NIF_TERM *tpl;
+ int tpl_sz;
+ while(!enif_is_empty_list(env, lstTail)) {
+ if(!enif_get_list_cell(env, lstTail, &lstHead, &lstTail)) Badarg("Options");
+ if(!enif_get_tuple(env, lstHead, &tpl_sz, &tpl) || tpl_sz != 2) Badarg("Options");
+ if(enif_is_identical(tpl[0], enif_make_atom(env, "timeout"))) {
+ if(!enif_get_int(env, tpl[1], &timeout)) Badarg("timeout"); // int
+ } else Badarg("Options");
+ };
+ if(!This) throw wxe_badarg("This");
+ bool Result = This->Show(timeout);
+ wxeReturn rt = wxeReturn(memenv, Ecmd.caller, true);
+ rt.send( rt.make_bool(Result));
+
+}
+
diff --git a/lib/wx/doc/src/wxNotificationMessage.xml b/lib/wx/doc/src/wxNotificationMessage.xml
new file mode 100644
index 0000000000..71ad363592
--- /dev/null
+++ b/lib/wx/doc/src/wxNotificationMessage.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE erlref SYSTEM "erlref.dtd">
+
+<!-- THIS FILE IS GENERATED DO NOT EDIT -->
+
+
+<erlref>
+<header>
+ <copyright>
+ <year>2020</year>
+ <holder>Ericsson AB. All Rights Reserved.</holder></copyright>
+ <legalnotice>
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ </legalnotice>
+ <title>wxNotificationMessage</title>
+</header>
+<module>wxNotificationMessage</module>
+<modulesummary>Functions for wxNotificationMessage class</modulesummary>
+<description><p>This class allows showing the user a message non intrusively.
+ </p><p>Currently it is implemented natively for Windows, macOS, GTK and uses generic toast notifications under the other platforms. It's not recommended but <c>wxGenericNotificationMessage</c> can be used instead of the native ones. This might make sense if your application requires features not available in the native implementation.
+ </p><p>Notice that this class is not a window and so doesn't derive from <seeerl marker="wxWindow"><c>wxWindow</c></seeerl>.
+ </p><p>Platform Notes</p> <p>Par: Up to Windows 8 balloon notifications are displayed from an icon in the notification area of the taskbar. If your application uses a <seeerl marker="wxTaskBarIcon"><c>wxTaskBarIcon</c></seeerl> you should call <c>UseTaskBarIcon()</c> (not implemented in wx) to ensure that only one icon is shown in the notification area. Windows 10 displays all notifications as popup toasts. To suppress the additional icon in the notification area on Windows 10 and for toast notification support on Windows 8 it is recommended to call <c>MSWUseToasts()</c> (not implemented in wx) before showing the first notification message.
+ </p><p>Par: The macOS implementation uses Notification Center to display native notifications. In order to use actions your notifications must use the alert style. This can be enabled by the user in system settings or by setting the <c>NSUserNotificationAlertStyle</c> value in Info.plist to <c>alert</c>. Please note that the user always has the option to change the notification style.
+ </p><p>Since: 2.9.0
+ </p>
+ <p>This class is derived (and can use functions) from:
+ <seeerl marker="wxEvtHandler"><c>wxEvtHandler</c></seeerl></p>
+
+ <p>wxWidgets docs: <url href="https://docs.wxwidgets.org/3.1/classwx_notification_message.html">wxNotificationMessage</url></p>
+ </description><section><title>Events</title><p>Event types emitted from this class: <seeerl marker="wxCommandEvent"><c>notification_message_click</c></seeerl>, <seeerl marker="wxCommandEvent"><c>notification_message_dismissed</c></seeerl>, <seeerl marker="wxCommandEvent"><c>notification_message_action</c></seeerl></p></section>
+<datatypes><datatype><name name="wxNotificationMessage"/></datatype></datatypes>
+
+<funcs>
+ <func>
+ <name name="new" arity="0" clause_i="1" since=""/>
+ <fsummary>Default constructor, use <c>setParent/2</c>, <c>setTitle/2</c> and <c>setMessage/2</c> to initialize the object before showing it. </fsummary>
+ <desc><p>Default constructor, use <seemfa marker="#setParent/2"><c>setParent/2</c></seemfa>, <seemfa marker="#setTitle/2"><c>setTitle/2</c></seemfa> and <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa> to initialize the object before showing it.
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="new" arity="1" clause_i="1" since=""/>
+ <fsummary>See: <c>new/2</c></fsummary>
+ </func>
+
+ <func>
+ <name name="new" arity="2" clause_i="1" since=""/>
+ <fsummary>Create a notification object with the given attributes. </fsummary>
+ <desc><p>Create a notification object with the given attributes.
+ </p><p>See <seemfa marker="#setTitle/2"><c>setTitle/2</c></seemfa>, <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa>, <seemfa marker="#setParent/2"><c>setParent/2</c></seemfa> and <seemfa marker="#setFlags/2"><c>setFlags/2</c></seemfa> for the description of the corresponding parameters.
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="destroy" arity="1" clause_i="1" since=""/>
+ <fsummary>Destructor does not hide the notification. </fsummary>
+ <desc><p>Destructor does not hide the notification.
+ </p><p>The notification can continue to be shown even after the C++ object was destroyed, call <seemfa marker="#close/1"><c>close/1</c></seemfa> explicitly if it needs to be hidden.
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="addAction" arity="2" clause_i="1" since=""/>
+ <fsummary>See: <c>addAction/3</c></fsummary>
+ </func>
+
+ <func>
+ <name name="addAction" arity="3" clause_i="1" since=""/>
+ <fsummary>Add an action to the notification. </fsummary>
+ <desc><p>Add an action to the notification.
+ </p><p>If supported by the implementation this are usually buttons in the notification selectable by the user.
+ </p><p>Return: false if the current implementation or OS version does not support actions in notifications.
+ </p><p>Since: 3.1.0
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="close" arity="1" clause_i="1" since=""/>
+ <fsummary>Hides the notification. </fsummary>
+ <desc><p>Hides the notification.
+ </p><p>Returns true if it was hidden or false if it couldn't be done (e.g. on some systems automatically hidden notifications can't be hidden manually).
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="setFlags" arity="2" clause_i="1" since=""/>
+ <fsummary>This parameter can be currently used to specify the icon to show in the notification. </fsummary>
+ <desc><p>This parameter can be currently used to specify the icon to show in the notification.
+ </p><p>Valid values are <c>wxICON_INFORMATION</c>, <c>wxICON_WARNING</c> and <c>wxICON_ERROR</c> (notice that <c>wxICON_QUESTION</c> is not allowed here). Some implementations of this class may not support the icons.
+ </p><p>See: <seemfa marker="#setIcon/2"><c>setIcon/2</c></seemfa>
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="setIcon" arity="2" clause_i="1" since=""/>
+ <fsummary>Specify a custom icon to be displayed in the notification. </fsummary>
+ <desc><p>Specify a custom icon to be displayed in the notification.
+ </p><p>Some implementations of this class may not support custom icons.
+ </p><p>See: <seemfa marker="#setFlags/2"><c>setFlags/2</c></seemfa>
+ </p><p>Since: 3.1.0
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="setMessage" arity="2" clause_i="1" since=""/>
+ <fsummary>Set the main text of the notification. </fsummary>
+ <desc><p>Set the main text of the notification.
+ </p><p>This should be a more detailed description than the title but still limited to reasonable length (not more than 256 characters).
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="setParent" arity="2" clause_i="1" since=""/>
+ <fsummary>Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default. </fsummary>
+ <desc><p>Set the parent for this notification: the notification will be associated with the top level parent of this window or, if this method is not called, with the main application window by default.
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="setTitle" arity="2" clause_i="1" since=""/>
+ <fsummary>Set the title, it must be a concise string (not more than 64 characters), use <c>setMessage/2</c> to give the user more details. </fsummary>
+ <desc><p>Set the title, it must be a concise string (not more than 64 characters), use <seemfa marker="#setMessage/2"><c>setMessage/2</c></seemfa> to give the user more details.
+ </p></desc>
+ </func>
+
+ <func>
+ <name name="show" arity="1" clause_i="1" since=""/>
+ <fsummary>See: <c>show/2</c></fsummary>
+ </func>
+
+ <func>
+ <name name="show" arity="2" clause_i="1" since=""/>
+ <fsummary>Show the notification to the user and hides it after <c>timeout</c> seconds are elapsed. </fsummary>
+ <desc><p>Show the notification to the user and hides it after <c>timeout</c> seconds are elapsed.
+ </p><p>Special values <c>Timeout_Auto</c> and <c>Timeout_Never</c> can be used here, notice that you shouldn't rely on <c>timeout</c> being exactly respected because the current platform may only support default timeout value and also because the user may be able to close the notification.
+ </p><p>Note: When using native notifications in wxGTK, the timeout is ignored for the notifications with <c>wxICON_WARNING</c> or <c>wxICON_ERROR</c> flags, they always remain shown unless they're explicitly hidden by the user, i.e. behave as if Timeout_Auto were given.
+ </p><p>Return: false if an error occurred.
+ </p></desc>
+ </func>
+ </funcs>
+</erlref>
diff --git a/lib/wx/examples/demo/Makefile b/lib/wx/examples/demo/Makefile
index 7b5de2253b..fdb443eb4a 100644
--- a/lib/wx/examples/demo/Makefile
+++ b/lib/wx/examples/demo/Makefile
@@ -43,6 +43,7 @@ TESTMODS = \
ex_htmlWindow \
ex_listCtrl \
ex_notebook \
+ ex_notificationMessage \
ex_pickers \
ex_popupMenu \
ex_radioBox \
diff --git a/lib/wx/examples/demo/ex_notificationMessage.erl b/lib/wx/examples/demo/ex_notificationMessage.erl
new file mode 100644
index 0000000000..f63f633af0
--- /dev/null
+++ b/lib/wx/examples/demo/ex_notificationMessage.erl
@@ -0,0 +1,144 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2009-2021. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+
+%% This is example of the widgets and usage of wxErlang
+%% Hopefully it will contain all implemented widgets, it's event handling
+%% and some tutorials of how to use sizers and other stuff.
+
+-module(ex_notificationMessage).
+
+-include_lib("wx/include/wx.hrl").
+
+-behaviour(wx_object).
+-export([start/1, init/1,
+ terminate/2, code_change/3,
+ handle_info/2, handle_call/3, handle_cast/2, handle_event/2]).
+
+-record(state, {buttons, close, notifications, config, parent}).
+
+start(Config) ->
+ wx_object:start_link(?MODULE, Config, []).
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+init(Config) ->
+ wx:batch(fun() -> do_init(Config) end).
+
+do_init(Config) ->
+ Parent = proplists:get_value(parent, Config),
+ Panel = wxScrolledWindow:new(Parent),
+ Sz = wxBoxSizer:new(?wxVERTICAL),
+ wxWindow:setSizer(Panel, Sz),
+ Version = {?wxMAJOR_VERSION, ?wxMINOR_VERSION, ?wxRELEASE_NUMBER},
+ EventsEnabled = case Version of
+ {Major, Minor, _} when Major >= 3, Minor >= 1 -> true;
+ _ -> false
+ end,
+ EventsEnabled orelse demo:format(Config,"wxNotificationMessage events are not supported in ~p~n",[Version]),
+
+ ButtBox = wxStaticBox:new(Panel, -1, "wxNotificationMessage"),
+ wxStaticBox:setSizer(ButtBox, wxFlexGridSizer:new(3)),
+ wxSizer:add(Sz, ButtBox, [{flag, ?wxALL bor ?wxEXPAND}, {proportion, 1}]),
+
+ Configs = [
+ {"Info", ?wxICON_INFORMATION},
+ {"Warning", ?wxICON_WARNING},
+ {"Error", ?wxICON_ERROR}
+ ],
+ {Buttons, Notifications} = create_buttons(ButtBox, Configs, EventsEnabled),
+
+ CloseEmAll = wxButton:new(ButtBox, -1, [{label, "Close Em All"}]),
+ wxSizer:add(wxStaticBox:getSizer(ButtBox), CloseEmAll),
+ CloseId = wxButton:getId(CloseEmAll),
+
+ wxWindow:connect(Panel, command_button_clicked),
+ wxSizer:layout(Sz),
+ wxWindow:refresh(Panel),
+ wxScrolledWindow:setScrollRate(Panel, 5, 5),
+ {Panel, #state{
+ buttons=Buttons,
+ notifications=Notifications,
+ close=CloseId,
+ config=Config,
+ parent=Panel}}.
+
+create_buttons(Parent, Configs, false) ->
+ lists:unzip(lists:map(fun ({Label, Icon}) ->
+ Button = wxButton:new(Parent, -1, [{label, Label}]),
+ wxSizer:add(wxWindow:getSizer(Parent), Button),
+ ButtonId = wxButton:getId(Button),
+ Notify = wxNotificationMessage:new(Label, [{message, "Example " ++ Label ++ " message"}, {flags, Icon}]),
+ {ButtonId, Notify}
+ end, Configs));
+
+create_buttons(Parent, Configs, true) ->
+ {Buttons0, Notifications0} = create_buttons(Parent, Configs, false),
+ Events = [notification_message_click, notification_message_dismissed, notification_message_action],
+ [wxWindow:connect(Notify, E) || Notify <- Notifications0, E <- Events],
+ {Buttons1, Notifications1} = lists:unzip(lists:map(fun ({Label, Icon}) ->
+ Button = wxButton:new(Parent, -1, [{label, Label ++ " action"}]),
+ wxSizer:add(wxWindow:getSizer(Parent), Button),
+ ButtonId = wxButton:getId(Button),
+ Notify = wxNotificationMessage:new(Label, [{message, "Example " ++ Label ++ " message"}, {flags, Icon}]),
+ [wxWindow:connect(Notify, E) || E <- Events],
+ wxNotificationMessage:addAction(Notify, -1, [{label, "An added action"}]),
+ wxNotificationMessage:addAction(Notify, -1, [{label, "Another added action"}]),
+ {ButtonId, Notify}
+ end, Configs)),
+ {Buttons0 ++ Buttons1, Notifications0 ++ Notifications1}.
+
+%%%%%%%%%%%%
+%% Async Events are handled in handle_event as in handle_info
+handle_event(#wx{id=CloseId, event=#wxCommand{type=command_button_clicked}},
+ State = #state{close=CloseId, notifications=Ns}) ->
+ [wxNotificationMessage:close(N) || N <- Ns],
+ {noreply, State};
+
+handle_event(#wx{id=Id, event=#wxCommand{type=command_button_clicked}},
+ State = #state{buttons=Bs, notifications=Ns}) ->
+ {_, N} = lists:keyfind(Id, 1, lists:zip(Bs, Ns)),
+ wxNotificationMessage:show(N),
+ {noreply, State};
+
+handle_event(Ev = #wx{}, State = #state{}) ->
+ demo:format(State#state.config,"Got Event ~p~n",[Ev]),
+ {noreply,State}.
+
+%% Callbacks handled as normal gen_server callbacks
+handle_info(Msg, State) ->
+ demo:format(State#state.config, "Got Info ~p~n",[Msg]),
+ {noreply,State}.
+
+handle_call(shutdown, _From, State=#state{parent=Panel}) ->
+ wxPanel:destroy(Panel),
+ {stop, normal, ok, State};
+
+handle_call(Msg, _From, State) ->
+ demo:format(State#state.config,"Got Call ~p~n",[Msg]),
+ {reply,ok,State}.
+
+handle_cast(Msg, State) ->
+ io:format("Got cast ~p~n",[Msg]),
+ {noreply,State}.
+
+code_change(_, _, State) ->
+ {stop, ignore, State}.
+
+terminate(_Reason, _) ->
+ ok.
+
diff --git a/lib/wx/include/wx.hrl b/lib/wx/include/wx.hrl
index 02669d24de..fc5dbcff9d 100644
--- a/lib/wx/include/wx.hrl
+++ b/lib/wx/include/wx.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2020. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2021. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -626,6 +626,9 @@
%%% From class wxNotebook
-define(wxNotebook_NO_IMAGE, -1).
%%% From class wxNotebook
+%%% From class wxNotificationMessage
+-define(wxNotificationMessage_Timeout_Auto, -1).
+-define(wxNotificationMessage_Timeout_Never, 0).
%%% From class wxStaticBitmap::ScaleMode
-define(wxStaticBitmap_Scale_None, 0).
-define(wxStaticBitmap_Scale_Fill, 1).
diff --git a/lib/wx/src/gen/wxCommandEvent.erl b/lib/wx/src/gen/wxCommandEvent.erl
index 2eba72e150..866872571e 100644
--- a/lib/wx/src/gen/wxCommandEvent.erl
+++ b/lib/wx/src/gen/wxCommandEvent.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2020. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2021. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -29,7 +29,7 @@
-type wxCommandEvent() :: wx:wx_object().
-include("wx.hrl").
--type wxCommandEventType() :: 'command_button_clicked' | 'command_checkbox_clicked' | 'command_choice_selected' | 'command_listbox_selected' | 'command_listbox_doubleclicked' | 'command_text_updated' | 'command_text_enter' | 'text_maxlen' | 'command_menu_selected' | 'command_slider_updated' | 'command_radiobox_selected' | 'command_radiobutton_selected' | 'command_scrollbar_updated' | 'command_vlbox_selected' | 'command_combobox_selected' | 'combobox_dropdown' | 'combobox_closeup' | 'command_tool_rclicked' | 'command_tool_enter' | 'tool_dropdown' | 'command_checklistbox_toggled' | 'command_togglebutton_clicked' | 'command_left_click' | 'command_left_dclick' | 'command_right_click' | 'command_set_focus' | 'command_kill_focus' | 'command_enter'.
+-type wxCommandEventType() :: 'command_button_clicked' | 'command_checkbox_clicked' | 'command_choice_selected' | 'command_listbox_selected' | 'command_listbox_doubleclicked' | 'command_text_updated' | 'command_text_enter' | 'text_maxlen' | 'command_menu_selected' | 'command_slider_updated' | 'command_radiobox_selected' | 'command_radiobutton_selected' | 'command_scrollbar_updated' | 'command_vlbox_selected' | 'command_combobox_selected' | 'combobox_dropdown' | 'combobox_closeup' | 'command_tool_rclicked' | 'command_tool_enter' | 'tool_dropdown' | 'command_checklistbox_toggled' | 'command_togglebutton_clicked' | 'command_left_click' | 'command_left_dclick' | 'command_right_click' | 'command_set_focus' | 'command_kill_focus' | 'command_enter' | 'notification_message_click' | 'notification_message_dismissed' | 'notification_message_action'.
-export_type([wxCommandEvent/0, wxCommand/0, wxCommandEventType/0]).
%% @hidden
parent_class(wxEvent) -> true;
diff --git a/lib/wx/src/gen/wxNotificationMessage.erl b/lib/wx/src/gen/wxNotificationMessage.erl
new file mode 100644
index 0000000000..5310b2b189
--- /dev/null
+++ b/lib/wx/src/gen/wxNotificationMessage.erl
@@ -0,0 +1,174 @@
+%%
+%% %CopyrightBegin%
+%%
+%% Copyright Ericsson AB 2008-2021. All Rights Reserved.
+%%
+%% Licensed under the Apache License, Version 2.0 (the "License");
+%% you may not use this file except in compliance with the License.
+%% You may obtain a copy of the License at
+%%
+%% http://www.apache.org/licenses/LICENSE-2.0
+%%
+%% Unless required by applicable law or agreed to in writing, software
+%% distributed under the License is distributed on an "AS IS" BASIS,
+%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+%% See the License for the specific language governing permissions and
+%% limitations under the License.
+%%
+%% %CopyrightEnd%
+%% This file is generated DO NOT EDIT
+
+-module(wxNotificationMessage).
+-include("wxe.hrl").
+-export([addAction/2,addAction/3,close/1,destroy/1,new/0,new/1,new/2,setFlags/2,
+ setIcon/2,setMessage/2,setParent/2,setTitle/2,show/1,show/2]).
+
+%% inherited exports
+-export([connect/2,connect/3,disconnect/1,disconnect/2,disconnect/3,parent_class/1]).
+
+-type wxNotificationMessage() :: wx:wx_object().
+-export_type([wxNotificationMessage/0]).
+%% @hidden
+parent_class(wxEvtHandler) -> true;
+parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagewxnotificationmessage">external documentation</a>.
+-spec new() -> wxNotificationMessage().
+new() ->
+ wxe_util:queue_cmd(?get_env(), ?wxNotificationMessage_new_0),
+ wxe_util:rec(?wxNotificationMessage_new_0).
+
+%% @equiv new(Title, [])
+-spec new(Title) -> wxNotificationMessage() when
+ Title::unicode:chardata().
+
+new(Title)
+ when ?is_chardata(Title) ->
+ new(Title, []).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagewxnotificationmessage">external documentation</a>.
+-spec new(Title, [Option]) -> wxNotificationMessage() when
+ Title::unicode:chardata(),
+ Option :: {'message', unicode:chardata()}
+ | {'parent', wxWindow:wxWindow()}
+ | {'flags', integer()}.
+new(Title, Options)
+ when ?is_chardata(Title),is_list(Options) ->
+ Title_UC = unicode:characters_to_binary(Title),
+ MOpts = fun({message, Message}) -> Message_UC = unicode:characters_to_binary(Message),{message,Message_UC};
+ ({parent, #wx_ref{type=ParentT}} = Arg) -> ?CLASS(ParentT,wxWindow),Arg;
+ ({flags, _flags} = Arg) -> Arg;
+ (BadOpt) -> erlang:error({badoption, BadOpt}) end,
+ Opts = lists:map(MOpts, Options),
+ wxe_util:queue_cmd(Title_UC, Opts,?get_env(),?wxNotificationMessage_new_2),
+ wxe_util:rec(?wxNotificationMessage_new_2).
+
+%% @equiv addAction(This,Actionid, [])
+-spec addAction(This, Actionid) -> boolean() when
+ This::wxNotificationMessage(), Actionid::integer().
+
+addAction(This,Actionid)
+ when is_record(This, wx_ref),is_integer(Actionid) ->
+ addAction(This,Actionid, []).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessageaddaction">external documentation</a>.
+-spec addAction(This, Actionid, [Option]) -> boolean() when
+ This::wxNotificationMessage(), Actionid::integer(),
+ Option :: {'label', unicode:chardata()}.
+addAction(#wx_ref{type=ThisT}=This,Actionid, Options)
+ when is_integer(Actionid),is_list(Options) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ MOpts = fun({label, Label}) -> Label_UC = unicode:characters_to_binary(Label),{label,Label_UC};
+ (BadOpt) -> erlang:error({badoption, BadOpt}) end,
+ Opts = lists:map(MOpts, Options),
+ wxe_util:queue_cmd(This,Actionid, Opts,?get_env(),?wxNotificationMessage_AddAction),
+ wxe_util:rec(?wxNotificationMessage_AddAction).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessageclose">external documentation</a>.
+-spec close(This) -> boolean() when
+ This::wxNotificationMessage().
+close(#wx_ref{type=ThisT}=This) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ wxe_util:queue_cmd(This,?get_env(),?wxNotificationMessage_Close),
+ wxe_util:rec(?wxNotificationMessage_Close).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagesetflags">external documentation</a>.
+-spec setFlags(This, Flags) -> 'ok' when
+ This::wxNotificationMessage(), Flags::integer().
+setFlags(#wx_ref{type=ThisT}=This,Flags)
+ when is_integer(Flags) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ wxe_util:queue_cmd(This,Flags,?get_env(),?wxNotificationMessage_SetFlags).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessageseticon">external documentation</a>.
+-spec setIcon(This, Icon) -> 'ok' when
+ This::wxNotificationMessage(), Icon::wxIcon:wxIcon().
+setIcon(#wx_ref{type=ThisT}=This,#wx_ref{type=IconT}=Icon) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ ?CLASS(IconT,wxIcon),
+ wxe_util:queue_cmd(This,Icon,?get_env(),?wxNotificationMessage_SetIcon).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagesetmessage">external documentation</a>.
+-spec setMessage(This, Message) -> 'ok' when
+ This::wxNotificationMessage(), Message::unicode:chardata().
+setMessage(#wx_ref{type=ThisT}=This,Message)
+ when ?is_chardata(Message) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ Message_UC = unicode:characters_to_binary(Message),
+ wxe_util:queue_cmd(This,Message_UC,?get_env(),?wxNotificationMessage_SetMessage).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagesetparent">external documentation</a>.
+-spec setParent(This, Parent) -> 'ok' when
+ This::wxNotificationMessage(), Parent::wxWindow:wxWindow().
+setParent(#wx_ref{type=ThisT}=This,#wx_ref{type=ParentT}=Parent) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ ?CLASS(ParentT,wxWindow),
+ wxe_util:queue_cmd(This,Parent,?get_env(),?wxNotificationMessage_SetParent).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessagesettitle">external documentation</a>.
+-spec setTitle(This, Title) -> 'ok' when
+ This::wxNotificationMessage(), Title::unicode:chardata().
+setTitle(#wx_ref{type=ThisT}=This,Title)
+ when ?is_chardata(Title) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ Title_UC = unicode:characters_to_binary(Title),
+ wxe_util:queue_cmd(This,Title_UC,?get_env(),?wxNotificationMessage_SetTitle).
+
+%% @equiv show(This, [])
+-spec show(This) -> boolean() when
+ This::wxNotificationMessage().
+
+show(This)
+ when is_record(This, wx_ref) ->
+ show(This, []).
+
+%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxnotificationmessage.html#wxnotificationmessageshow">external documentation</a>.
+-spec show(This, [Option]) -> boolean() when
+ This::wxNotificationMessage(),
+ Option :: {'timeout', integer()}.
+show(#wx_ref{type=ThisT}=This, Options)
+ when is_list(Options) ->
+ ?CLASS(ThisT,wxNotificationMessage),
+ MOpts = fun({timeout, _timeout} = Arg) -> Arg;
+ (BadOpt) -> erlang:error({badoption, BadOpt}) end,
+ Opts = lists:map(MOpts, Options),
+ wxe_util:queue_cmd(This, Opts,?get_env(),?wxNotificationMessage_Show),
+ wxe_util:rec(?wxNotificationMessage_Show).
+
+%% @doc Destroys this object, do not use object again
+-spec destroy(This::wxNotificationMessage()) -> 'ok'.
+destroy(Obj=#wx_ref{type=Type}) ->
+ ?CLASS(Type,wxNotificationMessage),
+ wxe_util:queue_cmd(Obj, ?get_env(), ?DESTROY_OBJECT),
+ ok.
+ %% From wxEvtHandler
+%% @hidden
+disconnect(This,EventType, Options) -> wxEvtHandler:disconnect(This,EventType, Options).
+%% @hidden
+disconnect(This,EventType) -> wxEvtHandler:disconnect(This,EventType).
+%% @hidden
+disconnect(This) -> wxEvtHandler:disconnect(This).
+%% @hidden
+connect(This,EventType, Options) -> wxEvtHandler:connect(This,EventType, Options).
+%% @hidden
+connect(This,EventType) -> wxEvtHandler:connect(This,EventType).
diff --git a/lib/wx/src/gen/wxe_funcs.hrl b/lib/wx/src/gen/wxe_funcs.hrl
index e1206a3cef..93dd6b1a6f 100644
--- a/lib/wx/src/gen/wxe_funcs.hrl
+++ b/lib/wx/src/gen/wxe_funcs.hrl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 2008-2020. All Rights Reserved.
+%% Copyright Ericsson AB 2008-2021. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -3367,3 +3367,14 @@
-define(wxGCDC_destruct, 3541).
-define(wxGCDC_GetGraphicsContext, 3542).
-define(wxGCDC_SetGraphicsContext, 3543).
+-define(wxNotificationMessage_new_0, 3544).
+-define(wxNotificationMessage_new_2, 3545).
+-define(wxNotificationMessage_destruct, 3546).
+-define(wxNotificationMessage_AddAction, 3547).
+-define(wxNotificationMessage_Close, 3548).
+-define(wxNotificationMessage_SetFlags, 3549).
+-define(wxNotificationMessage_SetIcon, 3550).
+-define(wxNotificationMessage_SetMessage, 3551).
+-define(wxNotificationMessage_SetParent, 3552).
+-define(wxNotificationMessage_SetTitle, 3553).
+-define(wxNotificationMessage_Show, 3554).