The typical Call Sequence of a view in receiving events
1. doactivatel ()
2. handleforegroundeventl (etrue)
3. handleforegroundeventl (efalse)
4. dodeactivate ()
[View architecture]
View applications Program Only one active view is allowed at a time. When the other view is activated, the current view will be released. When a view is released
Then, the menus, dialog boxes, and applications will be closed.
Each view is treated as an application UI. It must provide an ID () function to be identified by the system. It also needs to overload doactivatel (),
Dodeactivate (), handleforegroundeventl (), handlcommandl () and handlestatuspanesizechange () functions to handle various tasks
.
See the following one by one
Doactivatel ()
When the client requires that your view be activated, it will be called. The client may send message parameters to your view. If your view is already activated,
It is called only when the client explicitly requires re-activation, so your doactivatel () implementation has to cope with this situation, ie has activated view.
If you do not want to display the view or your view does not want to process any messages, simply check and return.
Dodeactive ()
This function is called when your view is deregistered. When the view is deregistered, there are two common scenarios: one is that your application is about to exit, and the other is in the same program.
A view is to be activated. This function is very important, so we can't forget it :)
Handleforegroundeventl ()
This function is called when your view is activated (that is, between doactivatel () and dodeactivate ). When your view is on the frontend
It will be hanleforegroundevent (etrue), when your view is removed from the foreground, it will be handleforegroundevent (efalse), only
This function is called only when the current station status does change.
Handlecommandl ()
When the View menu generates a command, this function will be called.
Handlestatuspanesizechange ()
When the client size changes due to Status Pane, this function is called.