searchcontainer.cpp

来自「一个比较完整的有关移动开发的例子 vc++6.0下编译通过」· C++ 代码 · 共 117 行

CPP
117
字号
/*
* ============================================================================
*  Name     : CSearchContainer from CCoeControl, MCoeControlObserver
*  Part of  : Search
*  Copyright (c) 2003 Nokia. All rights reserved.
* ============================================================================
*/

// INCLUDE FILES
#include <FairyLand.rsg>
#include "FairyLand.hrh"
#include "SearchContainer.h"


// ================= MEMBER FUNCTIONS =======================

// C++ default constructor can NOT contain any code, that
// might leave.
//
CSearchContainer::CSearchContainer()
    {
    }

// EPOC default constructor can leave.
void CSearchContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    ActivateL();
    }

// Destructor
CSearchContainer::~CSearchContainer()
    {
    }

// ---------------------------------------------------------
// CSearchContainer::FocusTo(TInt aCommand)
// Change foccused control.
// (other items were commented in a header).
// ---------------------------------------------------------
//

void CSearchContainer::FocusTo(TInt aCommand)
    {
    }

// ---------------------------------------------------------
// CSearchContainer::SizeChanged()
// Called by framework when the view size is changed
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CSearchContainer::SizeChanged()
    {
    }

// ---------------------------------------------------------
// CSearchContainer::CountComponentControls() const
// (other items were commented in a header).
// ---------------------------------------------------------
//
TInt CSearchContainer::CountComponentControls() const
    {
    return 0; // return nbr of controls inside this container
    }

// ---------------------------------------------------------
// CSearchContainer::ComponentControl(TInt aIndex) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
CCoeControl* CSearchContainer::ComponentControl(TInt aIndex) const
    {
		return NULL;
    }

// ---------------------------------------------------------
// CSearchContainer::Draw(const TRect& aRect) const
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CSearchContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle(CGraphicsContext::ENullPen);
    gc.SetBrushColor(KRgbRed);
    gc.SetBrushStyle(CGraphicsContext::ESolidBrush);
    gc.DrawRect(aRect);
    }

// ---------------------------------------------------------
// CSearchContainer::OfferKeyEventL(...)
// Notify key events to editors.
// (other items were commented in a header).
// ---------------------------------------------------------
//
TKeyResponse CSearchContainer::OfferKeyEventL(
    const TKeyEvent& aKeyEvent, TEventCode aType)
    {
    return EKeyWasNotConsumed;
    }


// ---------------------------------------------------------
// CSearchContainer::HandleControlEventL(
//     CCoeControl* aControl,TCoeEvent aEventType)
// (other items were commented in a header).
// ---------------------------------------------------------
//
void CSearchContainer::HandleControlEventL(
    CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
    {
    }

// End of File  

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?