brctlsampleappquerydialog.cpp

来自「基于SYMBIAN手机智能操作系统,通过插件」· C++ 代码 · 共 77 行

CPP
77
字号
/*
* ============================================================================
*  Name        : BrCtlSampleAppQueryDialog.cpp
*  基于SYMBIAN,通过插件方式,实现浏览器
* ============================================================================
*/

// INCLUDE FILES

#include <avkon.hrh>

#include "BrCtlSampleAppQueryDialog.h"

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

// C++ default constructor can NOT contain any code, that
// might leave.
//
CBrCtlSampleAppQueryDialog::CBrCtlSampleAppQueryDialog( TDes& aDefInput, HBufC*& aRetBuf )
    : CAknTextQueryDialog( aDefInput )
    , iRetBuf( aRetBuf )
	{
	}

// ---------------------------------------------------------
// CBrCtlSampleAppQueryDialog::PreLayoutDynInitL
// ---------------------------------------------------------
//
void  CBrCtlSampleAppQueryDialog::PreLayoutDynInitL()
	{
    CAknTextQueryDialog::PreLayoutDynInitL();

    MakeLeftSoftkeyVisible( ETrue );
    } 

// ---------------------------------------------------------
// CBrCtlSampleAppQueryDialog::OkToExitL
// ---------------------------------------------------------
//
TBool CBrCtlSampleAppQueryDialog::OkToExitL( TInt aKeycode )
	{
	switch ( aKeycode )
		{
		case EAknSoftkeyOk:
			{
            CAknQueryControl* control = QueryControl();

            __ASSERT_DEBUG( control, User::Panic( KNullDesC, KErrGeneral ) );
            
            iRetBuf = HBufC::NewL( control->GetTextLength() + 1);
            TPtr temp( iRetBuf->Des() );
			control->GetText( temp );
            temp.ZeroTerminate();
			}
			// no break !!! same return value
		case EAknSoftkeyCancel:
			return ETrue;
		default:
			return EFalse;
		}
    }

// ---------------------------------------------------------
// CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL
//
// This code is base on AknQueryDialog.cpp
// ---------------------------------------------------------
//
TBool CBrCtlSampleAppQueryDialog::HandleQueryEditorStateEventL(CAknQueryControl* /*aQueryControl*/, 
	TQueryControlEvent /*aEventType*/, TQueryValidationStatus /*aStatus*/)
    {
    return EFalse;
    }

//  End of File

⌨️ 快捷键说明

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