helpfulform.cpp

来自「barcode readers [ from Image]」· C++ 代码 · 共 83 行

CPP
83
字号
/*
	HelpfulForm. Help form for the ReadBarC application.
	This code is a derivative work of the HelpExample
	application distributed with the Symbian 6.0 SDK.
	Copyright (C) 2006  Jon A. Webb

	This program is free software; you can redistribute it and/or
	modify it under the terms of the GNU General Public License
	as published by the Free Software Foundation; either version 2
	of the License, or (at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.

*/

#include <AknAppUi.h>
#include <Avkon.rsg>
#include <eikmenup.h>

#include "HelpfulForm.h"
#include "ReadBarCApplication.h"
#include "ReadBarC.hrh"
#include "ReadBarC.hlp.hrh"

CHelpfulForm* CHelpfulForm::NewL(TInt aMenuResource)
    {
    CHelpfulForm* self = NewLC(aMenuResource);
    CleanupStack::Pop(self);
    return self;
    }

CHelpfulForm* CHelpfulForm::NewLC(TInt aMenuResource)
    {
    CHelpfulForm* self = new (ELeave) CHelpfulForm();
    CleanupStack::PushL(self);
    self->ConstructL(aMenuResource);
    return self;
    }

void CHelpfulForm::ConstructL(TInt aMenuResource)
    {
    // Ensure the base class construction is complete or some of the form's
    // features will not work
    CAknForm::ConstructL(aMenuResource);
    }

void CHelpfulForm::ProcessCommandL(TInt aCommandId)
    {
    switch(aCommandId)
        {
        case ELaunchHelpForContext :
            // Pass it back to the AppUi to deal with
            iAvkonAppUi->HandleCommandL(aCommandId);
            break;
        default :
            break;
        }

    // Need to do this in all cases or menu does not disappear after
    // a selection is made
    CAknForm::ProcessCommandL(aCommandId);
    }


void CHelpfulForm::DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane)
    {
    CAknForm::DynInitMenuPaneL(aResourceId, aMenuPane);
    if (aResourceId == R_AVKON_FORM_MENUPANE)
        {
        // Override the default form options. N/A in this case
        aMenuPane->SetItemDimmed(EAknFormCmdAdd, ETrue);
        aMenuPane->SetItemDimmed(EAknFormCmdSave, ETrue);
        aMenuPane->SetItemDimmed(EAknFormCmdLabel, ETrue);
        aMenuPane->SetItemDimmed(EAknFormCmdDelete, ETrue);
        }
    }

⌨️ 快捷键说明

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