📄 slidlg.cpp
字号:
// This is generic code that would be generated by
// the wizard. It has all been moved into the single
// file so that it is easier to understand and reduces
// the number of files to understand.
//
#include "SLIDlg.h"
#include "SLIDlg.hrh"
#include "SettingsListSample.h"
const TUid KUidSLIDlg = {0x10204762B};
///////////////////////////////////////////////////////////////////////////////////////////
// Application UI class
void CSLIDlgAppUi::ConstructL()
{
BaseConstructL(EAknEnableSkin);
iAppView = CSLIDlgAppView::NewL(ClientRect());
AddToStackL(iAppView);
}
CSLIDlgAppUi::CSLIDlgAppUi()
{
// No implementation required
}
CSLIDlgAppUi::~CSLIDlgAppUi()
{
// If we have a view then
// remove it from the stack of views getting
// user input and then delete it.
if (iAppView)
{
iEikonEnv->RemoveFromStack(iAppView);
delete iAppView;
iAppView = NULL;
}
}
void CSLIDlgAppUi::HandleCommandL(TInt aCommand)
{
// We are only interested in handling one command.
// The command is the one to display a dialog with
// a settings list item embedded in the dialog.
// As with all Series 60 applications we also
// allow the user to exit the application
// in an orderly manner via the assigned exit key.
//
switch(aCommand)
{
case SettingsItemListCmd:
{
EditSettings();
}
break;
case EEikCmdExit:
case EAknSoftkeyExit:
Exit();
break;
}
}
///////////////////////////////////////////////////////////////////////////////////////////
// Application view class for the sample
CSLIDlgAppView* CSLIDlgAppView::NewL(const TRect& aRect)
{
CSLIDlgAppView* self = CSLIDlgAppView::NewLC(aRect);
CleanupStack::Pop(self);
return self;
}
CSLIDlgAppView* CSLIDlgAppView::NewLC(const TRect& aRect)
{
CSLIDlgAppView* self = new (ELeave) CSLIDlgAppView;
CleanupStack::PushL(self);
self->ConstructL(aRect);
return self;
}
void CSLIDlgAppView::ConstructL(const TRect& aRect)
{
// Create a real window for this application view
CreateWindowL();
// Set the windows size
SetRect(aRect);
// Activate the window, which makes it ready to be drawn
ActivateL();
}
CSLIDlgAppView::CSLIDlgAppView()
{
// No implementation required
}
CSLIDlgAppView::~CSLIDlgAppView()
{
// No implementation required
}
void CSLIDlgAppView::Draw(const TRect& /*aRect*/) const
{
// We do not bother with any items to be drawn as there
// is no need.
//
// Get the standard graphics context
CWindowGc& gc = SystemGc();
// Gets the control's extent
TRect rect = Rect();
// Clears the screen
gc.Clear(rect);
}
///////////////////////////////////////////////////////////////////////////////////////////
// Document class for the sample
CSLIDlgDocument* CSLIDlgDocument::NewL(CEikApplication& aApp)
{
CSLIDlgDocument* self = NewLC(aApp);
CleanupStack::Pop(self);
return self;
}
CSLIDlgDocument* CSLIDlgDocument::NewLC(CEikApplication& aApp)
{
CSLIDlgDocument* self = new (ELeave) CSLIDlgDocument(aApp);
CleanupStack::PushL(self);
self->ConstructL();
return self;
}
void CSLIDlgDocument::ConstructL()
{
// No implementation required
}
CSLIDlgDocument::CSLIDlgDocument(CEikApplication& aApp) : CAknDocument(aApp)
{
// No implementation required
}
CSLIDlgDocument::~CSLIDlgDocument()
{
// No implementation required
}
CEikAppUi* CSLIDlgDocument::CreateAppUiL()
{
// Create the application user interface, and return a pointer to it
return(static_cast<CEikAppUi*>(new (ELeave) CSLIDlgAppUi));
}
///////////////////////////////////////////////////////////////////////////////////////////
// UID for the application; this should correspond to the uid defined in the mmp file
CApaDocument* CSLIDlgApplication::CreateDocumentL()
{
// Create an HelloWorldPlus document, and return a pointer to it
return (static_cast<CApaDocument*>(CSLIDlgDocument::NewL(*this)));
}
TUid CSLIDlgApplication::AppDllUid() const
{
// Return the UID for the SLIDlgApp application
return KUidSLIDlg;
}
// Create an application, and return a pointer to it
EXPORT_C CApaApplication* NewApplication()
{
CApaApplication* app = new CSLIDlgApplication;
return app;
}
///////////////////////////////////////////////////////////////////////////////////////////
// DLL entry point, return that everything is ok
GLDEF_C TInt E32Dll(TDllReason /*aReason*/)
{
return KErrNone;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -