📄 audiorecordercontainer.cpp
字号:
/*
* ============================================================================
* Name : CAudioRecorderContainer from AudioRecorderContainer.h
* Part of : AudioRecorder
* Created : 31.01.2006 by ToBeReplacedByAuthor
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version :
* Copyright: ToBeReplacedByCopyRight
* ============================================================================
*/
// INCLUDE FILES
#include <coemain.h>
#include <eiklabel.h>
#include "AudioRecorderContainer.h"
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CAudioRecorderContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CAudioRecorderContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
iLabel = new (ELeave) CEikLabel;
iLabel->SetContainerWindowL( *this );
SetRect(aRect);
ActivateL();
}
// Destructor
CAudioRecorderContainer::~CAudioRecorderContainer()
{
delete iLabel;
}
void CAudioRecorderContainer::SetTextL(const TDesC& aText)
{
iLabel->SetTextL(aText);
SizeChanged();
DrawDeferred();
}
// ---------------------------------------------------------
// CAudioRecorderConainer::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CAudioRecorderContainer::SizeChanged()
{
if(iLabel->Text()!=NULL)
{
iLabel->SetExtent( TPoint(10,10), iLabel->MinimumSize() );
}
}
// ---------------------------------------------------------
// CAudioRecorderConainer::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CAudioRecorderContainer::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CAudioRecorderConainer::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CAudioRecorderContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iLabel;
default:
return NULL;
}
}
// ---------------------------------------------------------
// CAudioRecorderContainer::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CAudioRecorderContainer::Draw(const TRect& aRect) const
{
CWindowGc& gc = SystemGc();
// TODO: Add your drawing code here
// example code...
gc.SetPenStyle( CGraphicsContext::ENullPen );
gc.SetBrushColor( KRgbGray );
gc.SetBrushStyle( CGraphicsContext::ESolidBrush );
gc.DrawRect( aRect );
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -