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

📄 studyview.cpp

📁 symbian下自制按钮实现
💻 CPP
字号:
// StudyView.cpp: implementation of the CStudyView class.
//
//////////////////////////////////////////////////////////////////////
#include "mysymstd.h"
#include "StudyView.h"
#include "Studyviewcontainer.h"

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CStudyView::CStudyView()
{
	ipStudyViewContainer =NULL ;

}

CStudyView::~CStudyView()
{
  delete ipStudyViewContainer ;
}

CStudyView * CStudyView::NewL(  ) 
{
	CStudyView * self = CStudyView::NewLC( ) ;
	CleanupStack::Pop(self ) ;
	return self ;
}


CStudyView * CStudyView::NewLC(  ) 
{
   CStudyView * self = new(ELeave)CStudyView( ) ;
   CleanupStack::PushL(self) ;
   self->constructL( ) ;
   return self ;
}

void CStudyView::constructL(  ) 
{
	BaseConstructL( R_STUSYM_STUDYVIEW ) ;
}

TUid CStudyView::Id() const
{
   	return TUid::Uid( EStuSymStudyView );

}

void CStudyView::HandleCommandL( TInt aCommand )
{
    switch(aCommand)
    {
		case EStuSymDlgCmd :
		{
	
		    TRect ret= this->ClientRect(   ) ;
			CMyDialog::RunAaaLD( ret ) ;
		  	break ; 
		}
		case EStuSymQuanCmd :
		{ 
			TUid viewID ;
            viewID.iUid = EStuSymBtnViewId ; 
            AppUi( )->ActivateLocalViewL( viewID ) ;
            break ;	
		}
		case EEikCmdExit :
		case EAknSoftkeyExit :
			AppUi( )->HandleCommandL( EEikCmdExit );
			break ;
		default:
            break;
	}
}

void CStudyView::DoActivateL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage)
{

    CEikButtonGroupContainer *cba = AppUi()->Cba();
	if ( cba ) 
	{
		cba->MakeVisible( EFalse );
	}

	
	if ( !ipStudyViewContainer )
	{
		ipStudyViewContainer = CStudyViewContainer::NewL( ClientRect(), NULL );
		ipStudyViewContainer->SetMopParent( this );
		AppUi()->AddToStackL( *this, ipStudyViewContainer );
	} 
}

void CStudyView::DoDeactivate( )
{
   CEikButtonGroupContainer *cba = AppUi()->Cba( );
	if ( cba ) 
	{
		cba->MakeVisible( ETrue );
		cba->DrawDeferred();
	}
	
	if (ipStudyViewContainer)
	{
		AppUi()->RemoveFromViewStack( *this, ipStudyViewContainer );
		delete ipStudyViewContainer;
		ipStudyViewContainer = NULL;
	}

}

⌨️ 快捷键说明

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