|
|
Home » Developing U++ » UppHub » MessageCtrl: A passive notifications ctrl and manager. (A a usefule CtrlLib add-on.)
Re: MessageCtrl: A passive notifications ctrl and manager. [message #51504 is a reply to message #51503] |
Fri, 05 April 2019 14:50 |
Oblivion
Messages: 1091 Registered: August 2007
|
Senior Contributor |
|
|
Hello Mahanthesh, and welcome to the U++ forums!
MessageCtrl is using Qtf. And it can be formatted using Qtf syntax. You can even put images or tables in it (if you really need such options...)
See here for more details on the format: https://www.ultimatepp.org/srcdoc$RichText$QTF_en-us.html
As for your question. Here is a modified version of the reference code:
#include <CtrlLib/CtrlLib.h>
#include <MessageCtrl/MessageCtrl.h>
using namespace Upp;
class Messages : public TopWindow {
MessageCtrl msg;
DocEdit editor;
Button button1, button2;
public:
Messages()
{
Title("U++ Message Boxes (Passive Notifications)");
SetRect(0,0, 640, 480);
Sizeable().Zoomable().CenterScreen();
SetMinSize({100, 100});
auto action = [=](int id) {
switch(id) {
case IDYES: PromptOK("You've chosen 'yes'"); break;
case IDNO: PromptOK("You've chosen 'no'"); break;
}
};
Add(editor.HSizePosZ().VSizePos(0, 24));
Add(button1.SetLabel("Test").RightPos(4).BottomPos(4));
Add(button2.SetLabel("Clear").LeftPos(4).BottomPos(4));
button2 << [=] { msg.Clear(this); }; // Selective clearing.
button1 << [=] {
msg.Animation()
.Top()
.Information(*this, "This is a time-constrained information message. It will disappear in 5 seconds.", Null, 5)
.Success(*this, "This is a success message.")
.Warning(*this, "This is a warning message.")
.Error(*this, "This is an error message.")
.Information(*this, "[C [4 This information message is using 16 pt courier font...]") // <-- Different font face and font size...
.Bottom()
.AskYesNo(editor, "This is a question box 'in' the text editor with "
"[^https:www`.ultimatepp`.org^ l`i`n`k]"
" support. Would you like to continue?",
action,
callback(LaunchWebBrowser)
);
};
}
};
GUI_APP_MAIN
{
Messages().Run();
}
Result should be (this is on Linux):
If you have more questions about the MesasgeCtrl, I'll try to answer them.
Best regards,
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Fri, 05 April 2019 14:51] Report message to a moderator
|
|
|
|
|
MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sun, 18 February 2018 19:21
|
|
|
Re: Notification: A passive notifications ctrl and manager.
By: Klugier on Sun, 18 February 2018 20:58
|
|
|
Re: Notification: A passive notifications ctrl and manager.
By: Klugier on Sun, 18 February 2018 21:28
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Mon, 19 February 2018 01:10
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Mon, 19 February 2018 15:01
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Klugier on Mon, 19 February 2018 22:12
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Mon, 19 February 2018 22:35
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Tue, 20 February 2018 17:46
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Klugier on Wed, 21 February 2018 00:02
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Wed, 21 February 2018 00:25
|
|
|
Re: Message: A passive notifications ctrl and manager.
By: Oblivion on Wed, 21 February 2018 20:18
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Fri, 02 March 2018 01:45
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 04 March 2018 08:33
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sun, 04 March 2018 10:40
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 04 March 2018 12:35
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sun, 04 March 2018 13:10
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 04 March 2018 16:56
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sun, 04 March 2018 21:05
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 04 March 2018 23:38
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 11 March 2018 12:03
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sun, 11 March 2018 12:32
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Mon, 12 March 2018 08:24
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Mon, 12 March 2018 09:58
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Mon, 12 March 2018 11:34
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Fri, 06 April 2018 23:10
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Fri, 05 April 2019 14:50
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Sun, 25 August 2019 23:03
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Mon, 26 August 2019 01:30
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: forlano on Mon, 26 August 2019 08:56
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Tue, 02 February 2021 22:07
|
|
|
Re: MessageCtrl: A passive notifications ctrl and manager.
By: Oblivion on Sat, 21 January 2023 09:19
|
Goto Forum:
Current Time: Fri Mar 29 16:04:20 CET 2024
Total time taken to generate the page: 0.01685 seconds
|
|
|