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

📄 notelistdialog.cpp

📁 《基于Symbian OS的手机开发与应用实践》这本书的配套源码。
💻 CPP
字号:
/*
* ============================================================================
*  Name     : CNoteListDialog from SimpleDlgDialog.h
*  Part of  : NoteListDialog
*  Created  : 12.04.2005 by ToBeReplacedByAuthor
*  Implementation notes:
*     Initial content was generated by Series 60 Application Wizard.
*  Version  :
*  Copyright: ToBeReplacedByCopyright
* ============================================================================
*/

// INCLUDE FILES
#include    "NoteListDialog.h"

#include <eiklabel.h>  // for example label control
#include <avkon.hrh>
#include <aknappui.h>
#include <guictrls.rsg>
#include "guictrls.hrh"
#include <akntitle.h> // for title pane
#include <eikspane.h>
#include <aknlists.h> 
#include <aknnotewrappers.h> // for note
#include <AknStaticNoteDialog.h> // for static note
#include <AknProgressDialog.h> 

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


// Destructor
CNoteListDialog::~CNoteListDialog()
    {
    }

TInt CNoteListDialog::RunLD()
    {
    CNoteListDialog* dialog = new(ELeave) CNoteListDialog();
    CleanupStack::PushL(dialog);
    dialog->ConstructL(0);
    CleanupStack::Pop();
    return dialog->ExecuteLD(R_NOTELIST_DIALOG);
    }
    
TBool CNoteListDialog::OkToExitL(TInt aButtonId)
{
    if (aButtonId == EEikBidSelect|| aButtonId == EEikBidOk)
        {
        ShowNoteL();    
        return EFalse;
        }
    TBool ret = CAknDialog::OkToExitL(aButtonId);
    if (ret)
        {
        CEikStatusPane* sp = iEikonEnv->AppUiFactory()->StatusPane();
        CAknTitlePane* title = (CAknTitlePane*)sp->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) );
        title->SetTextToDefaultL();
        }
    return ret;
}

void CNoteListDialog::ShowNoteL()
    {
    CAknSingleStyleListBox*    listbox = static_cast<CAknSingleStyleListBox*> (Control(EDialogLine1));
    TInt index = listbox->CurrentItemIndex();
    switch (index)
        {
    case 0:
        {
        CAknConfirmationNote* note = new (ELeave) CAknConfirmationNote;
        note->ExecuteLD(_L("This is an confirmation note!"));
        //CAknNoteDialog* note = new(ELeave)CAknNoteDialog(CAknNoteDialog::EConfirmationTone, CAknNoteDialog::EShortTimeout);
        //note->ExecuteLD(R_MY_CONFIRMATION_NOTE);        
        break;
        }
    case 1:
        {
        CAknInformationNote* note = new(ELeave)CAknInformationNote;
        note->ExecuteLD(_L("Information Notes"));
        break;
        }
    case 2:
        {
        CAknWarningNote* note = new(ELeave)CAknWarningNote;
        note->ExecuteLD(_L("Warning Notes"));
        break;
        }
    case 3:
        {
        CAknErrorNote* note = new(ELeave)CAknErrorNote;
        note->ExecuteLD(_L("Error Notes"));
        break;
        }
    case 4:
        {
        CAknStaticNoteDialog* dlg = new(ELeave)CAknStaticNoteDialog;
        dlg->ExecuteLD(R_GUICTRLS_PERMANENT_NOTE);
        //dlg->PrepareLC(R_GUICTRLS_PERMANENT_NOTE);
        //dlg->SetNumberOfBorders(4);
        //dlg->RunLD();
        break;
        }
    case 5:
        {
        CAknProgressDialog* dlg = new ( ELeave ) CAknProgressDialog(200, 5, 20, NULL );
        dlg->ExecuteLD( R_GUICTRLS_PROGRESS_NOTE );
        break;
        }
    default:
        break;
        }
    }

void CNoteListDialog::PreLayoutDynInitL()
    {
    CAknSingleStyleListBox*    listbox = static_cast<CAknSingleStyleListBox*> (Control(EDialogLine1));
    listbox->ActivateL();
    listbox->CreateScrollBarFrameL(ETrue);
    listbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn);
    }

void CNoteListDialog::ProcessCommandL(TInt aCommandId)
    {
    CAknDialog::ProcessCommandL(aCommandId);
    if (aCommandId == EGuiCtrlsCmdAppTest)
        {
        iEikonEnv->InfoMsg(_L("Test in Simple Dialog"));
        }
    }

// End of File

⌨️ 快捷键说明

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