From: http://dev.chinamobile.com/cmdn/bbs/viewthread.php? Tid = 2177 & pid = 10870 & page = 1 & extra = Page % 3d1 # pid1_70
Activatel is a good thing. Many people want to know its internal implementation, but it is a pity that there is no source code. Now I am posting the reverse code to make everyone feel better. Errors are inevitable.
Rdrawablewindow * iwin;
Ccoecontrol: ownswindow () tests if the control is window-owning...
Ccoecontrol: capturespointer () tests whether pointer capture is set for the control. This returns true if setpointercapture () has been called with acapture = etrue.
Ccoecontrol: isreadytodraw () tests if the control is ready for drawing. This returns true if the control has been activated and is visible
Rwssession: purgepointerevents () removes all pointer events waiting to be delivered to this session. the events are removed from the event queue without being processed. this might occur, for example, at application startup.
Ccoecontrol: isbackedup () tests if the window owned by the control is a backed-up window.
========================================================== ========================================================== =
Void ccoecontrol: activatel (void)
{
If (iflags & 0x80000)
{
User: leavenomemory ();
}
If (efalse = isactivated)
{
Iflags | = 0x10; // set to active
If (ownswindow () // tests if the control is window-owning...
{
Iwin-> activate ();
If (capturespointer ())
{
If (isreadytodraw ())
{
// Removes all pointer events waiting to be delivered to this session.
// The events are removed from the event queue without being processed.
// This might occur, for example, at application startup.
Icoeenv-> wssession ()-> purgepointerevents ();
}
}
If (isbackedup ())
{
Drawnow ();
}
}
// Some codes here ....
// Rcoedynamicdatastorage related operations. This class does not have any information,
// We have no idea about the operations related to this class.
}
Tint ctrlcounts = countcomponentcontrols ();
Tint Index = 0;
While (index <ctrlcounts)
{
Ccoecontrol * subctrlptr = componentcontrol (INDEX );
Subctrlptr-> activatel ();
Index ++;
}
}