Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Hi everyone,
I have created a button using AEECLSID_ButtonWidget and i have inserted the button into a root container.

But the problem is I can't set any text on the button. I have tried to set text using IWIDGET_SetText on the button.

So now how can I solve the problem?
Is anybody knows the solution please help me?

BR,
Shahid

Its a decorator widget.
// button widget is actually a static widget
ISHELL_CreateInstance(piShell, AEECLSID_StaticWidget, (void**)ppo) );
// setup button widget
IWidget_SetText(*ppo, pwszText, 0);
IWidget_SetFlags(*ppo, IDF_ALIGN_CENTER|IDF_ALIGN_MIDDLE);
IWidget_SetBorderWidth(*ppo, 2);
IWidget_SetFGColor(*ppo, RGB_DLGBUTTON_FG);
IWidget_SetSelectedFGColor(*ppo, RGB_DLGBUTTON_SELFG);
IWidget_GetPreferredExtent(*ppo, &we);
if (nWidth > 0) { we.width = nWidth; }
IWidget_SetExtent(*ppo, &we);
//create button widget
Button Widget is instantiated by passing AEECLSID_ButtonWidget into ISHELL_CreateInstance
//Call IDecorator_SetWidget to wrap button widget around static widget.

Its a decorator widget.
// button widget is actually a static widget
ISHELL_CreateInstance(piShell, AEECLSID_StaticWidget, (void**)ppo) );
// setup button widget
IWidget_SetText(*ppo, pwszText, 0);
IWidget_SetFlags(*ppo, IDF_ALIGN_CENTER|IDF_ALIGN_MIDDLE);
IWidget_SetBorderWidth(*ppo, 2);
IWidget_SetFGColor(*ppo, RGB_DLGBUTTON_FG);
IWidget_SetSelectedFGColor(*ppo, RGB_DLGBUTTON_SELFG);
IWidget_GetPreferredExtent(*ppo, &we);
if (nWidth > 0) { we.width = nWidth; }
IWidget_SetExtent(*ppo, &we);
//create button widget
Button Widget is instantiated by passing AEECLSID_ButtonWidget into ISHELL_CreateInstance
//Call IDecorator_SetWidget to wrap button widget around static widget.

Hi Atul,
Thanks for your reply.
Actually I have solved my problem from another help.
Your reply is also helpful.
If I face new problem later i will post and will for your answer.
Thanks.
BR,
Shahid

Hi Atul,
Thanks for your reply.
Actually I have solved my problem from another help.
Your reply is also helpful.
If I face new problem later i will post and will for your answer.
Thanks.
BR,
Shahid