📄 hellocontainer.cpp
字号:
/*
* ============================================================================
* Name : CHelloContainer from CCoeControl, MCoeControlObserver
* Part of : Hello
* Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/
// INCLUDE FILES
#include <MyHello.rsg>
#include "MyHello.hrh"
#include "HelloContainer.h"
// ================= MEMBER FUNCTIONS =======================
// C++ default constructor can NOT contain any code, that
// might leave.
//
CHelloContainer::CHelloContainer()
{
}
// EPOC default constructor can leave.
void CHelloContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
SetRect(aRect);
ActivateL();
}
// Destructor
CHelloContainer::~CHelloContainer()
{
}
// ---------------------------------------------------------
// CHelloContainer::FocusTo(TInt aCommand)
// Change foccused control.
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelloContainer::FocusTo(TInt aCommand)
{
}
// ---------------------------------------------------------
// CHelloContainer::SizeChanged()
// Called by framework when the view size is changed
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelloContainer::SizeChanged()
{
}
// ---------------------------------------------------------
// CHelloContainer::CountComponentControls() const
// (other items were commented in a header).
// ---------------------------------------------------------
//
TInt CHelloContainer::CountComponentControls() const
{
return 0; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CHelloContainer::ComponentControl(TInt aIndex) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
CCoeControl* CHelloContainer::ComponentControl(TInt aIndex) const
{
return NULL;
}
// ---------------------------------------------------------
// CHelloContainer::Draw(const TRect& aRect) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelloContainer::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
//gc.SetPenStyle(CGraphicsContext::ENullPen);
gc.SetBrushColor(KRgbBlue);
gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
gc.DrawRect(aRect);
gc.SetPenStyle(CGraphicsContext::ESolidPen);
gc.SetPenColor(KRgbRed);
gc.DrawLine(TPoint(50,50), TPoint(100,90));
}
// ---------------------------------------------------------
// CHelloContainer::OfferKeyEventL(...)
// Notify key events to editors.
// (other items were commented in a header).
// ---------------------------------------------------------
//
TKeyResponse CHelloContainer::OfferKeyEventL(
const TKeyEvent& aKeyEvent, TEventCode aType)
{
return EKeyWasNotConsumed;
}
// ---------------------------------------------------------
// CHelloContainer::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CHelloContainer::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -