📄 gpicontainer.cpp
字号:
/*
* ============================================================================
* Name : CGPIContainer from GPIContainer.h
* Part of : GPI
* Created : 2008-11-20 by
* Implementation notes:
* Initial content was generated by Series 60 AppWizard.
* Version :
* Copyright:
* ============================================================================
*/
// INCLUDE FILES
#include "GPIContainer.h"
#include <eiklabel.h> // for example label control
#include <AknsDrawUtils.h>// skin
#include <AknsBasicBackgroundControlContext.h> //skin
#include <barsread.h>
#include <GPI.mbg>
#include <stringloader.h>
#include <fbs.h>
#include <aknutils.h>
#include <GPI.rsg>
#include <bautils.h>
#include <utf.h>
#include <eikapp.h>
#include <charconv.h>
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CGPIContainer::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CGPIContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
key=0;
yemian=3;
shujugeshu=1;
bianhao=1;
fanye=1;
jishu=0;
qiuweizhi=40;
jishu1=0;
shujugeshu1=1;
izongyeshu1=0;
bianhao1=1;
begin1=0;
begin=0;
iBitmapA=new(ELeave)CFbsBitmap();
iBitmapB=new(ELeave)CFbsBitmap();
iBitmapC=new(ELeave)CFbsBitmap();
iBitmapD=new(ELeave)CFbsBitmap();
iBitmapE=new(ELeave)CFbsBitmap();
iBitmapF=new(ELeave)CFbsBitmap();
iBitmapG=new(ELeave)CFbsBitmap();
iBitmapH=new(ELeave)CFbsBitmap();
iBitmapI=new(ELeave)CFbsBitmap();
_LIT(KMBMFILEH,"\\system\\apps\\GPI\\GPI.mbm");
TFileName fileH(KMBMFILEH);
User::LeaveIfError(CompleteWithAppPath(fileH));
User::LeaveIfError(iBitmapH->Load(fileH,EMbmGpiH));
_LIT(KMBMFILEI,"\\system\\apps\\GPI\\GPI.mbm");
TFileName fileI(KMBMFILEI);
User::LeaveIfError(CompleteWithAppPath(fileI));
User::LeaveIfError(iBitmapI->Load(fileI,EMbmGpiI));
iEditor=new(ELeave)CEikEdwin;
iEditor1=new(ELeave)CEikEdwin;
_LIT(KPath,"c:\\Nokia\\location.txt");
TBuf<30>Name1(KPath);
yeshuxianshi=new (ELeave)CEikLabel;
yeshuxianshi->SetContainerWindowL(*this);
yeshuxianshi->SetTextL(_L(""));
xuanzhongxianshi1=new (ELeave)CEikLabel;
xuanzhongxianshi1->SetContainerWindowL(*this);
xuanzhongxianshi1->SetTextL(_L(""));
xuanzhongxianshi2=new (ELeave)CEikLabel;
xuanzhongxianshi2->SetContainerWindowL(*this);
xuanzhongxianshi2->SetTextL(_L(""));
nxuanzhongxianshi1=new (ELeave)CEikLabel;
nxuanzhongxianshi1->SetContainerWindowL(*this);
nxuanzhongxianshi1->SetTextL(_L(""));
nxuanzhongxianshi2=new (ELeave)CEikLabel;
nxuanzhongxianshi2->SetContainerWindowL(*this);
nxuanzhongxianshi2->SetTextL(_L(""));
xinxixianshi1=new (ELeave)CEikLabel;
xinxixianshi1->SetContainerWindowL(*this);
xinxixianshi1->SetTextL(_L(""));
xinxixianshi2=new (ELeave)CEikLabel;
xinxixianshi2->SetContainerWindowL(*this);
xinxixianshi2->SetTextL(_L(""));
xinxixianshi3=new (ELeave)CEikLabel;
xinxixianshi3->SetContainerWindowL(*this);
xinxixianshi3->SetTextL(_L(""));
xinxixianshi4=new (ELeave)CEikLabel;
xinxixianshi4->SetContainerWindowL(*this);
xinxixianshi4->SetTextL(_L(""));
xinxixianshi5=new (ELeave)CEikLabel;
xinxixianshi5->SetContainerWindowL(*this);
xinxixianshi5->SetTextL(_L(""));
xinxixianshi6=new (ELeave)CEikLabel;
xinxixianshi6->SetContainerWindowL(*this);
xinxixianshi6->SetTextL(_L(""));
xinxixianshi11=new (ELeave)CEikLabel;
xinxixianshi11->SetContainerWindowL(*this);
xinxixianshi11->SetTextL(_L(""));
xinxixianshi22=new (ELeave)CEikLabel;
xinxixianshi22->SetContainerWindowL(*this);
xinxixianshi22->SetTextL(_L(""));
xinxixianshi33=new (ELeave)CEikLabel;
xinxixianshi33->SetContainerWindowL(*this);
xinxixianshi33->SetTextL(_L(""));
xinxixianshi44=new (ELeave)CEikLabel;
xinxixianshi44->SetContainerWindowL(*this);
xinxixianshi44->SetTextL(_L(""));
xinxixianshi55=new (ELeave)CEikLabel;
xinxixianshi55->SetContainerWindowL(*this);
xinxixianshi55->SetTextL(_L(""));
xinxixianshi66=new (ELeave)CEikLabel;
xinxixianshi66->SetContainerWindowL(*this);
xinxixianshi66->SetTextL(_L(""));
nxinxixianshi1=new (ELeave)CEikLabel;
nxinxixianshi1->SetContainerWindowL(*this);
nxinxixianshi1->SetTextL(_L(""));
nxinxixianshi2=new (ELeave)CEikLabel;
nxinxixianshi2->SetContainerWindowL(*this);
nxinxixianshi2->SetTextL(_L(""));
nxinxixianshi3=new (ELeave)CEikLabel;
nxinxixianshi3->SetContainerWindowL(*this);
nxinxixianshi3->SetTextL(_L(""));
nxinxixianshi4=new (ELeave)CEikLabel;
nxinxixianshi4->SetContainerWindowL(*this);
nxinxixianshi4->SetTextL(_L(""));
nxinxixianshi5=new (ELeave)CEikLabel;
nxinxixianshi5->SetContainerWindowL(*this);
nxinxixianshi5->SetTextL(_L(""));
User::LeaveIfError(iFs.Connect());
_LIT(KPath0001,"c:\\Nokia\\t.txt");
TBuf<30>Name0001(KPath0001);
_LIT(KP0001,"c:\\Nokia\\t1.txt");
TBuf<30>Name0002(KP0001);
if(BaflUtils::FileExists(iFs,KPath0001))
{
RFileReadStream InStream;
User::LeaveIfError(InStream.Open(iFs,Name0001,EFileRead));
User::LeaveIfError(OutStream.Replace(iFs,Name0002,EFileWrite));
OutStream.PushL();
OutStream.WriteL(InStream);
OutStream.CommitL();
OutStream.Pop();
InStream.Release();
OutStream.Release();
User::LeaveIfError(InStream.Open(iFs,Name0002,EFileRead));
User::LeaveIfError(OutStream.Open(iFs,Name0001,EFileWrite));
OutStream.PushL();
OutStream.WriteL(InStream);
OutStream.CommitL();
OutStream.Pop();
InStream.Release();
User::LeaveIfError(OutStream1.Replace(iFs,Name0002,EFileWrite));
OutStream1.Release();
}
else
{
User::LeaveIfError(OutStream.Replace(iFs,Name0001,EFileWrite));
}
if(BaflUtils::FileExists(iFs,KPath))
{
RFileReadStream InStream;
User::LeaveIfError(InStream.Open(iFs,Name1,EFileRead));
InStream.PushL();
TBuf<1> text;
_LIT(h,"\n");
TBuf<2> huanhang(h);
_LIT(douhao,".");
TBuf<1>jiange(douhao);
_LIT(juhao,";");
TBuf<1>jieshu(juhao);
_LIT(douhao1,",");
TBuf<1>b(douhao1);
for(;;)
{
InStream.ReadL(text);
if((text.CompareC(jieshu))==0){
break;
}else if((text.CompareC(jiange))!=0){
if(begin==0)
{
InStream.ReadL(text);
begin=1;
}
switch(shujugeshu){
case 1:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi1.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi1.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi1.operator+=(huanhang);
}
}
break;
case 2:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi2.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi2.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi2.operator+=(huanhang);
}
}
break;
case 3:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi3.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi3.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi3.operator+=(huanhang);
}
}
break;
case 4:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi4.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi4.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi4.operator+=(huanhang);
}
}
break;
case 5:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi5.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi5.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi5.operator+=(huanhang);
}
}
break;
case 6:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi6.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi6.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi6.operator+=(huanhang);
}
}
break;
case 7:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi7.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi7.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi7.operator+=(huanhang);
}
}
break;
case 8:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi8.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi8.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi8.operator+=(huanhang);
}
}
break;
case 9:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi9.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi9.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi9.operator+=(huanhang);
}
}
break;
case 10:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi10.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi10.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi10.operator+=(huanhang);
}
}
break;
case 11:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi11.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi11.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi11.operator+=(huanhang);
}
}
break;
case 12:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi12.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi12.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi12.operator+=(huanhang);
}
}
break;
case 13:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi13.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi13.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi13.operator+=(huanhang);
}
}
break;
case 14:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi14.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi14.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi14.operator+=(huanhang);
}
}
break;
case 15:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi15.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi15.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi15.operator+=(huanhang);
}
}
break;
case 16:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi16.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi16.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi16.operator+=(huanhang);
}
}
break;
case 17:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi17.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi17.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi17.operator+=(huanhang);
}
}
break;
case 18:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi18.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi18.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi18.operator+=(huanhang);
}
}
break;
case 19:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi19.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi19.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi19.operator+=(huanhang);
}
}
break;
case 20:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi20.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi20.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi20.operator+=(huanhang);
}
}
break;
case 21:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi21.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi21.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi21.operator+=(huanhang);
}
}
break;
case 22:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi22.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi22.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi22.operator+=(huanhang);
}
}
break;
case 23:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi23.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi23.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi23.operator+=(huanhang);
}
}
break;
case 24:
if(bianhao==1)
{
if((text.CompareC(b))!=0)
{
nxinxi24.operator+=(text);
}
else
{
bianhao=0;
}
}
else
{
xinxi24.operator+=(text);
jishu++;
if(jishu==14)
{
xinxi24.operator+=(huanhang);
}
}
break;
case 25:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -