一个s60界面设计的例子
源代码在线查看: myviews.h
#ifndef MYVIEWS_H
#define MYVIEWS_H
#include "coecntrl.h"
#include "coeview.h"
#include "aknview.h"
const TUid KUidMyApp = { 0x101F60FE };
const TUid KUidMyAppViewOne = {0x01};
const TUid KUidMyAppViewTwo = {0x02};
class CEikLabel;
class CContainerOne : public CCoeControl
{
public:
static CContainerOne* NewL(const TRect& aRect);
static CContainerOne* NewLC(const TRect& aRect);
virtual ~CContainerOne();
void SizeChanged();
private:
void ConstructL(const TRect& aRect);
/**
* From CoeControl,CountComponentControls.
*/
TInt CountComponentControls() const;
/**
* From CCoeControl,ComponentControl.
*/
CCoeControl* ComponentControl(TInt aIndex) const;
void Draw(const TRect& aRect) const;
protected:
CEikLabel* iLabel; // example label
};
class CContainerTwo : public CContainerOne
{
public:
static CContainerTwo* NewL(const TRect& aRect);
static CContainerTwo* NewLC(const TRect& aRect);
private:
void ConstructL(const TRect& aRect);
};
class CMyViewOne : public CAknView
{
public:
~CMyViewOne();
static CMyViewOne* NewL();
static CMyViewOne* NewLC();
private:
void ConstructL();
// from CAknView
public:
virtual TUid Id () const;
virtual void HandleCommandL(TInt aCommand);
protected:
virtual void DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage);
virtual void DoDeactivate();
private: //data
CContainerOne* iContainer;
};
class CMyViewTwo : public CAknView
{
public:
static CMyViewTwo* NewL();
static CMyViewTwo* NewLC();
~CMyViewTwo();
private:
void ConstructL();
// from CAknView
public:
virtual TUid Id () const;
virtual void HandleCommandL(TInt aCommand);
protected:
virtual void DoActivateL (const TVwsViewId &aPrevViewId, TUid aCustomMessageId, const TDesC8 &aCustomMessage);
virtual void DoDeactivate();
private: //data
CContainerTwo* iContainer; // example label
};
#endif