Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » MessageCtrl: A passive notifications ctrl and manager. (A a usefule CtrlLib add-on.)
Re: MessageCtrl: A passive notifications ctrl and manager. [message #49603 is a reply to message #49602] Sun, 11 March 2018 12:32 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 534
Registered: August 2007
Location: Turkey
Contributor
Hello Luigi,

The thing is, MessageCtrl is simply a manager, there is no real reason to add it to a "layout".
IT is not a Ctrl derived class.
Messages will resize automatically depending on the size of it's parent.

You instantiate it in your, say, TopWindow, and then set a target (a Ctrl) for it to attach:


class MyWindow : public TopWindow {
 MessageCtrl messages;
 DocEdit     editor;
 RichEdit    richeditor; 

 void DisplayEditorErrorMessage() { 
      messages.Error(editor, "This is an error message.");
 }

 void DisplayRichEditorSuccessMessage() {
      messages.Success(richeditor, "This is a success message.");
 }

 // Other members, constructors, etc...
};




Think of it like a Prompt. You do not use them with layout. Nor MessageCtrl. (Of course you can also attach messages to layouted ctrls)

Example code provided with the MessageCtrl demonstrates that. (It adds top message boxes to the window itself, and the bottom meassage box to the editor widget.)

I've written a new example to clarify the behaviour. Please find the attached example. Smile
Best regards,
Oblivion

[Updated on: Sun, 11 March 2018 18:04]

Report message to a moderator

Re: MessageCtrl: A passive notifications ctrl and manager. [message #49604 is a reply to message #49603] Mon, 12 March 2018 08:24 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1031
Registered: March 2006
Location: Italy
Experienced Contributor
Oblivion wrote on Sun, 11 March 2018 12:32

I've written a new example to clarify the behaviour. Please find the attached example. Smile


Hello Oblivion,

now everything is clear.
Thanks!
Luigi
Re: MessageCtrl: A passive notifications ctrl and manager. [message #49606 is a reply to message #49603] Mon, 12 March 2018 09:58 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1031
Registered: March 2006
Location: Italy
Experienced Contributor
Oblivion wrote on Sun, 11 March 2018 12:32

I've written a new example to clarify the behaviour. Please find the attached example. Smile


One more question, please.
How can I clear the message present, let's say, in editor ctrl? I tried

messages.Clear(editor.GetCaptureCtrl());
messages.Clear(editor);

with no success. Perhaps I must use several MessageCtrl and bind each of them to a different ctrl.
Thanks,
Luigi
Re: MessageCtrl: A passive notifications ctrl and manager. [message #49607 is a reply to message #49606] Mon, 12 March 2018 11:34 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 534
Registered: August 2007
Location: Turkey
Contributor
Hello Luigi,



with no success. Perhaps I must use several MessageCtrl and bind each of them to a different ctrl.


This is possible (and in some rare cases, might be useful) but not necessary. A single instance of MessageCtrl is usually sufficient.


All you need to do is pass a pointer to your ctrl:

messages.Clear(&editor)


(One shortcoming of the MessageCtrl is that currenty you cannot target a single message box automatically. Will be available soon though.)

Best regards,
Oblivion

[Updated on: Mon, 12 March 2018 13:54]

Report message to a moderator

Re: MessageCtrl: A passive notifications ctrl and manager. [message #49700 is a reply to message #49494] Fri, 06 April 2018 23:10 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 534
Registered: August 2007
Location: Turkey
Contributor
Hello,

MessageCtrl updated.

From now on informative message boxes (information, warning, success, error) use crosses instead of OK button.


You can find the updated package in the first message of this topic, or grab it from:
https://github.com/ismail-yilmaz/upp-components/tree/master/ CtrlLib/MessageCtrl

Screenshot:

index.php?t=getfile&id=5546&private=0

Best regards,
Oblivion
Previous Topic: OpenCV and openCV_Demo copiling error
Next Topic: ANSI Escape and control sequence parser for U++
Goto Forum:
  


Current Time: Sun Feb 17 10:28:05 CET 2019

Total time taken to generate the page: 0.00789 seconds