⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readandwriteappview.cpp

📁 在symbian下读和写文件源代码
💻 CPP
字号:
/*
============================================================================
 Name        : ReadAndWriteView.cpp
 Author      : 
 Version     :
 Copyright   : Your copyright notice
 Description : Application view
============================================================================
*/

// INCLUDE FILES
#include <coemain.h>
#include "ReadAndWriteAppView.h"

#include "ReadAndWrite.hrh"
#include "ReadAndWrite.rsg"


// ============================ MEMBER FUNCTIONS ===============================

// -----------------------------------------------------------------------------
// CReadAndWriteAppView::NewL()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CReadAndWriteAppView* CReadAndWriteAppView::NewL( const TRect& aRect )
    {
    CReadAndWriteAppView* self = CReadAndWriteAppView::NewLC( aRect );
    CleanupStack::Pop( self );
    return self;
    }

// -----------------------------------------------------------------------------
// CReadAndWriteAppView::NewLC()
// Two-phased constructor.
// -----------------------------------------------------------------------------
//
CReadAndWriteAppView* CReadAndWriteAppView::NewLC( const TRect& aRect )
    {
    CReadAndWriteAppView* self = new ( ELeave ) CReadAndWriteAppView;
    CleanupStack::PushL( self );
    self->ConstructL( aRect );
    return self;
    }

// -----------------------------------------------------------------------------
// CReadAndWriteAppView::ConstructL()
// Symbian 2nd phase constructor can leave.
// -----------------------------------------------------------------------------
//
void CReadAndWriteAppView::ConstructL( const TRect& aRect )
    {
    // Create a window for this application view
    CreateWindowL();

    // Set the windows size
    SetRect( aRect );

    // Activate the window, which makes it ready to be drawn
    ActivateL();
    }

// -----------------------------------------------------------------------------
// CReadAndWriteAppView::CReadAndWriteAppView()
// C++ default constructor can NOT contain any code, that might leave.
// -----------------------------------------------------------------------------
//
CReadAndWriteAppView::CReadAndWriteAppView()
    {
    // No implementation required
    }


// -----------------------------------------------------------------------------
// CReadAndWriteAppView::~CReadAndWriteAppView()
// Destructor.
// -----------------------------------------------------------------------------
//
CReadAndWriteAppView::~CReadAndWriteAppView()
    {
    // No implementation required
    }


// -----------------------------------------------------------------------------
// CReadAndWriteAppView::Draw()
// Draws the display.
// -----------------------------------------------------------------------------
//
void CReadAndWriteAppView::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 );
    
  	}

// -----------------------------------------------------------------------------
// CReadAndWriteAppView::SizeChanged()
// Called by framework when the view size is changed.
// -----------------------------------------------------------------------------
//
void CReadAndWriteAppView::SizeChanged()
    {  
    DrawNow();
    }

void CReadAndWriteAppView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
	{
		if(aResourceId == R_READANDWRITE_MENUBAR)
		{
			TBuf8<20> buf8Text;
			TBuf<20>  bufText;

			_LIT8(K8Read,"读取");
			_LIT8(K8Write,"写入");
			
			buf8Text.Copy(K8Read);
			iCReadAndWriteAppUi->ConvertToUnicode(bufText,buf8Text);
			aMenuPane->SetItemTextL(EReadCommand,bufText);

			buf8Text.Copy(K8Write);
			iCReadAndWriteAppUi->ConvertToUnicode(bufText,buf8Text);
			aMenuPane->SetItemTextL(EWriteCommand,bufText);
		}

	}
// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -