mynotepaper.cpp

来自「symbian下的重载控件防短信界面」· C++ 代码 · 共 56 行

CPP
56
字号
/*
* ============================================================================
*  Name     : CMyNotepaper from MyNotepaper.h
*  Part of  : 
*  Created  : 17.05.2006 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include "MyNotepaper.h"


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

// ---------------------------------------------------------
// CMyNotepaper::Draw(const TRect& aRect) const
// ---------------------------------------------------------
//
void CMyNotepaper::Draw(const TRect& aRect) const
    {
    CEikEdwin::Draw(aRect);
    CWindowGc& gc = SystemGc();
    gc.SetPenStyle( CGraphicsContext::ESolidPen );
    gc.SetPenColor( TRgb(0x6AB4ED) );
    TInt hChar;
    TInt ascent;
    iLayout->GetCharacterHeightAndAscentL(0, hChar, ascent);

    TRect lRect;
    iLayout->GetLineRect(0, lRect);
    TInt hLine = lRect.Height();
    TInt x1 = lRect.iTl.iX;
    //bianbian fix bug: TInt x2 = lRect.iBr.iX;
	TInt x2 = aRect.Width();

    TInt height = aRect.Height();
    TInt y = hChar + (hLine-hChar)/2;
    while(y<=height)
        {
        gc.DrawLine(TPoint(x1, y), TPoint(x2, y));
        y = y + hLine;
        }
    }

TKeyResponse CMyNotepaper::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
    {
    DrawDeferred();
    return CEikEdwin::OfferKeyEventL(aKeyEvent, aType);
    }

// End of File  

⌨️ 快捷键说明

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