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

📄 userlistboxappui.cpp

📁 symbian s60 2th 自定义ListBox
💻 CPP
字号:
/* Copyright (c) 2009, Nokia. All rights reserved */

#include <avkon.hrh>
#include <aknnotewrappers.h> 

#include "UserListbox.pan"
#include "UserListboxAppUi.h"
//#include "UserListboxAppView.h"
#include "UserListboxView.h"
#include "UserListbox.hrh"
#include "Userlistboxcontainer.h"

void CUserListboxAppUi::ConstructL()
    {
    BaseConstructL(EAknEnableSkin);

//    iAppView = CUserListboxAppView::NewL(ClientRect());    
//    AddToStackL(iAppView);
	ipUserLbView = CUserListboxView::NewL();
	AddViewL(ipUserLbView);
    }

CUserListboxAppUi::CUserListboxAppUi()                              
    {
    // add any construction that cannot leave here
    }

CUserListboxAppUi::~CUserListboxAppUi()
    {
    
    }

void CUserListboxAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
             Exit();
            break;

        case EUserListboxCommand1:
            {
			
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("1"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("2"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("3"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("4"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("5"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("6"));
				ipUserLbView->m_pAppContainer->AppendAnItem(_L("7"));
 				ipUserLbView->m_pAppContainer->AppendAnItem(_L("8"));

				ipUserLbView->m_pAppContainer->SetSelected(0);
				ipUserLbView->m_pAppContainer->SetSelected(1);
				ipUserLbView->m_pAppContainer->SetSelected(2);
				ipUserLbView->m_pAppContainer->SetSelected(3);
				ipUserLbView->m_pAppContainer->SetSelected(4);
				ipUserLbView->m_pAppContainer->SetSelected(5);

            }
            break;
		case EUserListboxCommand2:
			{
				for(TInt i=0; i<4; ++i)
				{
					ipUserLbView->m_pAppContainer->DeleteAnItem(0);
				}
			}
			break;
        default:
            Panic(EUserListboxBasicUi);
            break;
        }
    }



⌨️ 快捷键说明

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