×
Namespaces

Variants
Actions
Revision as of 09:52, 19 July 2012 by hamishwillee (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A tip to debug Draw() function of a control class

From Nokia Developer Wiki
Jump to: navigation, search
Article Metadata
Article
Created: bharatuppal (11 Jul 2007)
Last edited: hamishwillee (19 Jul 2012)

A custom contral generally overrides the CCoeControl::Draw() method to implement its own drawing stuff. However, when stepping into the code with the debugger, the result of each command is not displayed immediatly on screen because of the cache mechanism implemented by the window server.

Happily enough, you can get rid of this behaviour, and have each drawing function being rendered immediatly on screen. Add the following code in your AppUi::ConstructL():

#ifdef _DEBUG
iEikonEnv->WsSession().SetAutoFlush(ETrue);
#endif

This force each Graphic Context draw commands to show up immediately, rather than when the window server client buffer is next flushed.

This means you can step through the draw code and see the effect each line is having. However, you must ensure this line does not make it into released software as it has efficiency implications.

This page was last modified on 19 July 2012, at 09:52.
51 page views in the last 30 days.