|
|
User login
Feeds |
How to add a button to View?
|
|||||
| Sun, 2004-06-20 21:00 | |
Forum posts: 7
Forum posts: 13
- In .rss:
RESOURCE CMBUT r_ex_button
{
version=0;
behavior=2;
layout=1;
extension=0;
txt="";
bmpfile="*";
bmpid=EMbmExicon;
bmpmask=EMbmExiconm;
}
- In class appview:
TResourceReader reader;
iCoeEnv->CreateResourceReaderLC(reader, R_EX_BUTTON);
CEikCommandButton* button = new CEikCommandButton();
button->ConstructFromResourceL(reader);
CleanupStack::PopAndDestroy();
button->SetContainerWindowL(*this);
button->SetObserver(this);
button->SetExtent(TPoint(0,0),TSize(20,20));
But it show and I only can see menu and exit emulator. I wrong? Please help me. Thanks.
Forum posts: 24
/dev/gmaker
Forum posts: 16
For make Button on view you must:
1)Write in CExampleAppView class *.h-file
3)In *.cpp-file of CExampleAppView class in ConstructL
CleanupStack::PushL(iBtnTest);
iBtnTest->SetTextL(_L("Test"));
iBtnTest->SetObserver(this);
iBtnTest->SetContainerWindowL(*this);
TSize size = iBtnTest->MinimumSize();
iBtnTest->SetExtent( TPoint(aRect.Width() - (size.iWidth + 5),
aRect.Height() - (size.iHeight + 36)),
size);
CleanupStack::Pop();
if (iBtnTest)Â Â counter++;
return counter;
5)... in ComponentControl
{
                 ................
case 4:
return iBtnTest;
                 ................
default:
return NULL;
}
{
         ........................
}
delete iBtnTest;
//для русских =)
//пишите в личку, отвечу на вопросы
Per aspera ad astra