|
||
The QMessage Event |
|
|||||||
Synopsis |
The QMessage event is raised whenever SilverSharp wishes to display a quick-message, or qmessage (a status message in Windows application parlance). A qmessage is displayed in response to the SilverScreen API routine qmessage, and during most prompting.
|
|
||||||
Delegate |
The QMessage delegate is declared as follows:
A delegate is similar to a C/C++ function pointer, but delegates are type-safe and can only refer to a method that matches the signature of the delegate. The QMessage delegate declares a function signature that must be used when installing an event handler for the QMessage event.
|
|
||||||
Event |
The QMessage event is declared within Events as follows:
QMessage allows your application to subscribe to or unsubscribe from the QMessage event.
|
|
||||||
Raise method |
The method to raise the QMessage event is declared within Events as follows:
The SilverSharp assembly will automatically raise the QMessage event when a message is to be written into the status area. It would not be typical for a SilverSharp application to raise the event itself.
|
|
||||||
Remarks |
It is not necessary for a SilverSharp application to establish a handler for the QMessage event, but you must do so if you wish to call SilverScreen API routines that write into the message area, or if you wish to use SilverScreen prompting and wish status messages to appear.
|
|
||||||
See Also |
|
|||||||
Example |
The following code shows a sample QMessage event handler. The implementation of WriteToStatusArea is not shown. Note that the method declaration must match the delegate for this event in parameters and return type:
The following example shows how to subscribe to the QMessage event, assigning the above handler:
The following example shows how to unsubscribe from the QMessage event, removing the above handler:
|
|