03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Class Description<br />

Figure 15.3<br />

contain another zoom factor object, multiplying the effect of<br />

the child zoom factor.<br />

The top-level zoom factor, however, uses a<br />

CGraphicsDevice (not another TZoomFactor).<br />

In the example, the zoom factor uses the screen device. This is set up as follows in the hello<br />

control constructor:<br />

iZoomFactor.SetGraphicsDeviceMap(iCoeEnv->ScreenDevice());<br />

iZoomFactor is used for getting the appropriate size and device- dependent font and size<br />

for drawing.<br />

The following section studies the device-independent drawing code in the<br />

CExampleHelloView class and the small amount of device- independent code for<br />

allocating a font in the CExampleHelloControl class. In the next section, we'll see how<br />

the drawing code is used by the CExampleHelloControl class.<br />

15.1.1 Device-independent Drawing<br />

Device-independent drawing is largely conducted by the CExample-HelloView class.<br />

Here is its declaration:<br />

class CExampleHelloView : public CBase<br />

{<br />

public:<br />

// Construct/destruct<br />

static CExampleHelloView* NewL();<br />

~CExampleHelloView();<br />

// Settings<br />

void SetTextL(const TDesC& aText);<br />

void SetFullRedraw(TBool aFullRedraw);<br />

// Draw

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!