You Are Here:

Community: Wiki

This page was last modified on 6 September 2009, at 12:21.

How to get ReDraw event in exe from window server?

From Forum Nokia Wiki

Reviewer Approved   

Why it is required?
When you draw something in exe (without CONE environment), you will not get redraw event automatically. It is required because when some part of your rect gets invalid than you have to validate it again. Possible cases when your rect might get invalid are opening other aap, receive call, receive SMS etc.

How to implement it?
We have to request redraw events from the window server, we can do this by the RedrawReady method of window server. We also need to create an active object for redraw events.

CMyReDraw::CMyReDraw(RWsSession& aWsSession): CActive(CActive::EPriorityStandard), iWsSession(aWsSession)
{
CActiveScheduler::Add(this);
 
iStatus = KRequestPending;
//iWsSession is your window server session and assuming u have created it.
iWsSession.RedrawReady(&iStatus);
SetActive();
}
 
CMyReDraw::~CMyReDraw()
{
Cancel();
}
 
void CMyReDraw::RunL()
{
TWsRedrawEvent e;
//GetRedraw will give you redraw event
iWsSession.GetRedraw(e);
 
//you can call your drawing function here.
 
iStatus = KRequestPending;
//you should not call RedrawReady again until you've either called GetRedraw() or RedrawReadyCancel().
iWsSession.RedrawReady(&iStatus);
SetActive();
}
 
void CMyReDraw::DoCancel()
{
iWsSession.RedrawReadyCancel();
}


Related Links:

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fHostsE5ffileE5fonE5fS60E5f3E2eE78E5fE44evicesX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZseriesE5f60Q qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qfnZuserE5ftagQSxs60X qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ