Namespaces
Variants
Actions

Drawing a standard border around a CEikEdwin

Jump to: navigation, search
Article Metadata

Tested with
Devices(s): Nokia E61i
Nokia E90 Communicator
Nokia N95 8GB
Nokia 6220 Classic

Compatibility
Platform(s): S60 3rd Edition and later

Article
Keywords: TGulBorder, CEikEdwin, TGulBorder::Draw(), TGulBorder::OuterRect(), CEikEdwin::SetBorder(), CEikEdwin::Border()
Created: tapiolaitinen (05 Mar 2008)
Last edited: hamishwillee (13 Sep 2012)

Contents

Overview

In this code snippet a standard border is drawn around a CEikEdwin. The same technique applies to all controls inherited from CEikBorderedControl.

MMP file

The following libraries are required:

LIBRARY egul.lib
LIBRARY eikcoctl.lib

Header file

CEikEdwin* iEditor;

Source file

void CAppView::ConstructL(const TRect& aRect)
{
// ...
 
// Set border type
iEditor->SetBorder(TGulBorder::ESingleDotted);
 
// ...
}
void CAppView::Draw(const TRect& aRect) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
 
// Clear the screen
gc.Clear(aRect);
 
// Get the border
TGulBorder border = iEditor->Border();
 
// Draw the border so that it surrounds iEditor
TRect editorRect = iEditor->Rect();
border.Draw(gc, border.OuterRect(editorRect));
}

Postconditions

A standard border is drawn around a CEikEdwin.

This page was last modified on 13 September 2012, at 09:48.
184 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved