📄 autostartappview.cpp
字号:
/*
============================================================================
Name : AutoStartView.cpp
Author :
Version :
Copyright : Your copyright notice
Description : Application view
============================================================================
*/
// INCLUDE FILES
#include <coemain.h>
#include <eiklabel.h>
#include "AutoStartAppView.h"
// ============================ MEMBER FUNCTIONS ===============================
// -----------------------------------------------------------------------------
// CAutoStartAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CAutoStartAppView* CAutoStartAppView::NewL( const TRect& aRect )
{
CAutoStartAppView* self = CAutoStartAppView::NewLC( aRect );
CleanupStack::Pop( self );
return self;
}
// -----------------------------------------------------------------------------
// CAutoStartAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CAutoStartAppView* CAutoStartAppView::NewLC( const TRect& aRect )
{
CAutoStartAppView* self = new ( ELeave ) CAutoStartAppView;
CleanupStack::PushL( self );
self->ConstructL( aRect );
return self;
}
// -----------------------------------------------------------------------------
// CAutoStartAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CAutoStartAppView::ConstructL( const TRect& aRect )
{
// Create a window for this application view
CreateWindowL();
iAutoStartLabel = new (ELeave) CEikLabel;
iAutoStartLabel->SetContainerWindowL( *this );
iAutoStartLabel->SetTextL( _L("Auto Start flag") );
SetRect( aRect );
ActivateL();
}
// -----------------------------------------------------------------------------
// CAutoStartAppView::CAutoStartAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CAutoStartAppView::CAutoStartAppView()
{
// No implementation required
}
// -----------------------------------------------------------------------------
// CAutoStartAppView::~CAutoStartAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CAutoStartAppView::~CAutoStartAppView()
{
delete iAutoStartLabel;
}
void CAutoStartAppView::SizeChanged()
{
// TODO: Add here control resize code etc
// iAutoStartLabel->SetExtent( TPoint(0,0), iAutoStartLabel->MinimumSize() );
iAutoStartLabel->SetRect( Rect() );
}
// ---------------------------------------------------------
// CMobileHelpContainer2::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CAutoStartAppView::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CMobileHelpContainer2::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CAutoStartAppView::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iAutoStartLabel;
default:
return NULL;
}
}
// -----------------------------------------------------------------------------
// CAutoStartAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CAutoStartAppView::Draw( const TRect& /*aRect*/ ) const
{
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect drawRect( Rect());
// Clears the screen
gc.Clear( drawRect );
}
void CAutoStartAppView::SetTextL( const TDesC& aText )
{
if ( iAutoStartLabel )
{
iAutoStartLabel->SetTextL( aText );
iAutoStartLabel->DrawNow();
}
}
// End of File
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -