添加控件的方法

zg351229063 2007-08-15 06:33:48
请问各位高手,如何在CodeWarrier中添加控件?
有没有什么简单的方法?
不能像在VC下那样拖控件吗?
注:(最好能有源码,小弟刚学不久)
...全文
167 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
dyw 2007-08-16
  • 打赏
  • 举报
回复
没有用过CW,手工添加代码也很快,也很简单。
如果使用Carbide.c++,可以写自己的代码生成模板。
anel 2007-08-16
  • 打赏
  • 举报
回复
已经简到不能再简了,比这麻烦n*n倍的事情在后面,你能坚下来已经是一个奇迹
anel 2007-08-16
  • 打赏
  • 举报
回复
抄来?这是i的一个程序整理出来的,symbian常用程序结构都一样,
anel 2007-08-15
  • 打赏
  • 举报
回复
class CxxxContainer : public CCoeControl
{
public: // Constructors and destructor
void ConstructL(const TRect& aRect);
~CxxxContainer();
private: // Functions from base classes
void SizeChanged();
TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;
void Draw(const TRect& aRect) const;
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
public:
CEikEdwin *iEditor;
};

void CxxxContainer::ConstructL(const TRect& aRect)
{
CreateWindowL();
iEditor = new (ELeave) CEikEdwin;//添加
iEditor->ConstructL(...); //添加

ActivateL();
}

CxxxContainer::~CxxxContainer()
{
delete iEditor; //添加
}

void CxxxContainer::SizeChanged()
{
iEditor->SetRect(Rect());//添加
}

TInt CxxxContainer::CountComponentControls() const
{
return 1; //添加
}

CCoeControl* CxxxContainer::ComponentControl(TInt aIndex) const
{
switch ( aIndex )
{
case 0:
return iEditor;//添加
default:
return NULL;
}
}


void CxxxContainer::Draw(const TRect& aRect) const
{
...
}

TKeyResponse CxxxContainer::OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ){
return iEditor->OfferKeyEventL( aKeyEvent, aType );//添加

}
zg351229063 2007-08-15
  • 打赏
  • 举报
回复
太麻烦了!
而且,看着眼熟,好像是从什么地方抄的。

3,120

社区成员

发帖
与我相关
我的任务
社区描述
塞班系统(Symbian系统)是塞班公司为手机而设计的操作系统,它的前身是英国宝意昂公司的 EP ( Electronic Piece of cheese)操作系统。
社区管理员
  • Symbian社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧