📄 guielements_appui.cpp
字号:
/*****************************************************************************
Description: GuiElements_AppUi.cpp
COPYRIGHT All rights reserved Sony Ericsson Mobile Communications AB 2005.
The software is the copyrighted work of Sony Ericsson Mobile Communications AB.
The use of the software is subject to the terms of the end-user license
agreement which accompanies or is included with the software. The software is
provided "as is" and Sony Ericsson specifically disclaim any warranty or
condition whatsoever regarding merchantability or fitness for a specific
purpose, title or non-infringement. No warranty of any kind is made in
relation to the condition, suitability, availability, accuracy, reliability,
merchantability and/or non-infringement of the software provided herein.
*****************************************************************************/
#include "GuiElements.h"
#include "eiktime.h"
#include "qikzoomdlg.h"
#include "cntdef.h"
#include "cntuifinddlg.h"
#include "cntdb.h"
#include "HLPMODEL.h"
void CGuiElementsAppUi::ConstructL()
{
BaseConstructL();
iAppViewGuiElements = CGuiElementsAppView::NewL(ClientRect());
iAppView= iAppViewGuiElements;
AddToStackL(iAppView);
}
CGuiElementsAppUi::~CGuiElementsAppUi()
{
if (iAppView)
{
RemoveFromStack(iAppView);
}
delete iAppViewGuiElements;
}
void CGuiElementsAppUi::DynInitMenuPaneL(TInt /*aMenuId*/ ,CEikMenuPane* /*aMenuPane*/)
{
}
void CGuiElementsAppUi::HandleCommandL(TInt aCommand)
{
switch (aCommand)
{
case EGuiElementsCmdControls1:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_CONTROLS1_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EGuiElementsCmdControls2:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_CONTROLS2_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EGuiElementsCmdControls3:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_CONTROLS3_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EGuiElementsCmdEditors:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_EDITORS_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EGuiElementsCmdEditors2:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_EDITORS2_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EGuiElementsCmdSetTime:
{
TTime currentDateAndTime;
if(CEikTimeDialogSetTime::RunDlgLD(currentDateAndTime))
{
}
}
break;
case EGuiElementsCmdSetLocation:
{
TWorldId location;
RWorldServer worldServer;
User::LeaveIfError(worldServer.Connect());
User::LeaveIfError(worldServer.Home(location));
TCityName city=location.City();
TCountryName country=location.Country();
if(CEikTimeDialogSetCity::RunDlgLD(city,country,R_EXAMPLE_SETCITY_DIALOG_TITLE,R_EXAMPLE_SETCITY_DIALOG_DESCRIPTION))
{
}
worldServer.Close();
}
break;
case EGuiElementsCmdFindContact:
{
TContactItemId itemId = KNullContactId;
if (CContactUiFindDialog::RunDlgLD(itemId))
{
}
}
break;
case EGuiElementsCmdWorkWeek:
{
TLocale locale;
TUint workdays=locale.WorkDays();
TDay startOfWeek=locale.StartOfWeek();
if (CEikTimeDialogOptionWorkday::RunDlgLD(workdays,startOfWeek))
{
locale.SetWorkDays(workdays);
locale.SetStartOfWeek(startOfWeek);
locale.Set();
}
}
break;
case EGuiElementsCmdDaylightSavings:
{
TLocale locale;
TUint dstZone = locale.DaylightSaving();
TDaylightSavingZone homeZone = locale.HomeDaylightSavingZone();
if (CEikTimeDialogSetDst::RunDlgLD(dstZone, homeZone))
{
locale.SetDaylightSaving(dstZone);
locale.Set();
}
}
break;
case EGuiElementsCmdTimeOptions:
{
TLocale locale;
TEikTimeOptions myTimeOptions;
myTimeOptions.iDate=locale.DateFormat();
myTimeOptions.iTime=locale.TimeFormat();
myTimeOptions.iDateSeparator=locale.DateSeparator(1);
myTimeOptions.iTimeSeparator=locale.TimeSeparator(1);
CEikTimeDialogOptionFormat::RunDlgLD(myTimeOptions);
locale.SetDateFormat(myTimeOptions.iDate);
locale.SetTimeFormat(myTimeOptions.iTime);
locale.SetDateSeparator(0,0);
locale.SetDateSeparator(myTimeOptions.iDateSeparator,1);
locale.SetDateSeparator(myTimeOptions.iDateSeparator,2);
locale.SetDateSeparator(0,3);
locale.SetTimeSeparator(0,0);
locale.SetTimeSeparator(myTimeOptions.iTimeSeparator,1);
locale.SetTimeSeparator(myTimeOptions.iTimeSeparator,2);
locale.SetTimeSeparator(0,3);
locale.Set();
}
break;
case EGuiElementsCmdAlert:
{
_LIT(KAlertMessage1,"1st message line.");
_LIT(KAlertMessage2,"2nd message line.");
iEikonEnv->AlertWin(KAlertMessage1, KAlertMessage2);
}
break;
case EGuiElementsCmdInformation:
{
_LIT(KDialogTitle,"Title");
_LIT(KDialogMessage,"Message line.");
iEikonEnv->InfoWinL(KDialogTitle, KDialogMessage);
}
break;
case EGuiElementsCmdQuery:
{
_LIT(KDialogTitle,"Title");
_LIT(KDialogMessage,"Message line.");
iEikonEnv->QueryWinL(KDialogTitle, KDialogMessage);
}
break;
case EGuiElementsCmdAbout:
{
CEikDialog* dialog = new (ELeave) CUserDialog();
if (dialog->ExecuteLD(R_ABOUT_DIALOG))
{
iAppView->DrawNow();
}
}
break;
case EEikCmdExit:
Exit();
break;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -