📄 myxmlparsecontainer2.cpp
字号:
/*
* ============================================================================
* Name : CMyXMLParseContainer2 from MyXMLParseContainer2.cpp
* Part of : MyXMLParse
* Created : 19.05.2008 by
* Implementation notes:
* Initial content was generated by Series 60 Application Wizard.
* Version :
* Copyright:
* ============================================================================
*/
// INCLUDE FILES
#include "MyXMLParseContainer2.h"
#include <eiklabel.h> // for example label control
#include <barsread.h> // for resource reader
#include "MyXMLParse.rsg"
#include "w32std.h"////for CWsScreenDevice
#include "eikenv.h"///for CEikonEnv
#include "FileListEngine.h"
#include "MyXMLParse.hrh"
#include <AknQueryDialog.h> //弹出对话框
#include <f32file.h >//文件
#include <aknnotewrappers.h>//非阻塞对话框
// ================= MEMBER FUNCTIONS =======================
// ---------------------------------------------------------
// CMyXMLParseContainer2::ConstructL(const TRect& aRect)
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CMyXMLParseContainer2::ConstructL(TBuf<1024> buf,const TRect& aRect)
{
CreateWindowL();
/////////////create a editor
TResourceReader reader;
iCoeEnv->CreateResourceReaderLC( reader, R_OUTPUT_VIEW_RTEXTED );
iOutputWindow = new ( ELeave ) CEikRichTextEditor();
iOutputWindow->SetContainerWindowL( *this );
iOutputWindow->ConstructFromResourceL( reader );
iOutputWindow->SetTextL(&buf);//以buf初始化iOutputWindow
CleanupStack::PopAndDestroy(); // Resource reader
///////获取屏幕尺寸
CWsScreenDevice* ws = CEikonEnv::Static()->ScreenDevice();
TSize checkSize = ws->SizeInPixels();
iOutputWindow->SetExtent( TPoint( 0,0 ),checkSize);//将屏幕尺寸对编辑框初始化
iOutputWindow->SetFocus( ETrue );
SetRect(aRect);
ActivateL();
}
// Destructor
CMyXMLParseContainer2::~CMyXMLParseContainer2()
{
delete iOutputWindow;
}
// ---------------------------------------------------------
// CMyXMLParseContainer2::SizeChanged()
// Called by framework when the view size is changed
// ---------------------------------------------------------
//
void CMyXMLParseContainer2::SizeChanged()
{
// TODO: Add here control resize code etc.
}
// ---------------------------------------------------------
// CMyXMLParseContainer2::CountComponentControls() const
// ---------------------------------------------------------
//
TInt CMyXMLParseContainer2::CountComponentControls() const
{
return 1; // return nbr of controls inside this container
}
// ---------------------------------------------------------
// CMyXMLParseContainer2::ComponentControl(TInt aIndex) const
// ---------------------------------------------------------
//
CCoeControl* CMyXMLParseContainer2::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iOutputWindow;
default:
return NULL;
}
}
// ---------------------------------------------------------
// CMyXMLParseContainer2::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CMyXMLParseContainer2::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 );
}
// ---------------------------------------------------------
// CMyXMLParseContainer2::HandleControlEventL(
// CCoeControl* aControl,TCoeEvent aEventType)
// ---------------------------------------------------------
//
void CMyXMLParseContainer2::HandleControlEventL(
CCoeControl* /*aControl*/,TCoeEvent /*aEventType*/)
{
// TODO: Add your control event handler code here
}
// End of File
TKeyResponse CMyXMLParseContainer2::OfferKeyEventL(const TKeyEvent &aKeyEvent, TEventCode aType)
{
return iOutputWindow->OfferKeyEventL( aKeyEvent, aType );
}
//DEL TInt CMyXMLParseContainer2::ReturnPos()
//DEL {
//DEL
//DEL }
//DEL void CMyXMLParseContainer2::ConvGbk2Uni(TDesC8 &original, TDes &res)
//DEL {
//DEL
//DEL }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -