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

Developer

Forums

I have never seen any Button Widget (I don't mean a radio button, but a simple button) in uiwidgets.

Have I missed something or what?

Thanks for your answers.

Use a static widget with a border.
-Erik

Use a static widget with a border.
-Erik

Thanks that's what I'm going to do then.

Thanks that's what I'm going to do then.

But status widget can't take the focus no?
So it's not possible to do such an easy thing:
IWIDGET_MoveFocus(pIMainContainerWidget, (IWidget*)WIDGET_FOCUS_NEXT);
Am I right? (sorry if not but I begin BREW and Widgets)
Is there a way to force a static widget to be focusable?

But status widget can't take the focus no?
So it's not possible to do such an easy thing:
IWIDGET_MoveFocus(pIMainContainerWidget, (IWidget*)WIDGET_FOCUS_NEXT);
Am I right? (sorry if not but I begin BREW and Widgets)
Is there a way to force a static widget to be focusable?

Try this,
IWIDGET_MoveFocus(pIMainContainerWidget, staticWidget);
IWIDGET_SetFocus(staticWidget, TRUE);
Michael

Try this,
IWIDGET_MoveFocus(pIMainContainerWidget, staticWidget);
IWIDGET_SetFocus(staticWidget, TRUE);
Michael

Yes, this works thanks.
By the way I do not really understand why
IWIDGET_MoveFocus(pIMainContainerWidget, staticWidget);
doesn't do the same thing as
IWIDGET_SetFocus(staticWidget, TRUE);
Now the problem is when I do:
IWidget * pIWidget;
IWIDGET_MoveFocus(pIMainContainerWidget, (IWidget*)WIDGET_FOCUS_PREV);
IWIDGET_GetFocus((IWidget *)pIMainContainer, &pIWidget);
if (pIWidget==NULL)
DBGPRINTF("pIWidget==NULL");
IWIDGET_SetFocus(pIWidget, TRUE); // This line segfault even if pIWidget is not NULL
Is there another way to call IWIDGET_SetFocus with the same widget as (IWidget*)WIDGET_FOCUS_PREV?
Thanks for your help
- Tigre-Bleu -
N.B.
I've tried IWIDGET_GetFocus(pIMainContainerWidget, &pIWidget); but it returns pIWidget=NULL

Yes, this works thanks.
By the way I do not really understand why
IWIDGET_MoveFocus(pIMainContainerWidget, staticWidget);
doesn't do the same thing as
IWIDGET_SetFocus(staticWidget, TRUE);
Now the problem is when I do:
IWidget * pIWidget;
IWIDGET_MoveFocus(pIMainContainerWidget, (IWidget*)WIDGET_FOCUS_PREV);
IWIDGET_GetFocus((IWidget *)pIMainContainer, &pIWidget);
if (pIWidget==NULL)
DBGPRINTF("pIWidget==NULL");
IWIDGET_SetFocus(pIWidget, TRUE); // This line segfault even if pIWidget is not NULL
Is there another way to call IWIDGET_SetFocus with the same widget as (IWidget*)WIDGET_FOCUS_PREV?
Thanks for your help
- Tigre-Bleu -
N.B.
I've tried IWIDGET_GetFocus(pIMainContainerWidget, &pIWidget); but it returns pIWidget=NULL

Add an event handler to the static widget that handles EVT_WDG_CANTAKEFOCUS and EVT_WDG_SETFOCUS.
switch ( evt )
{
case EVT_WDG_SETFOCUS:
return TRUE;
case EVT_WDG_CANTAKEFOCUS:
*((boolean *)dwParam) = TRUE;
return TRUE;
}
-Erik

Add an event handler to the static widget that handles EVT_WDG_CANTAKEFOCUS and EVT_WDG_SETFOCUS.
switch ( evt )
{
case EVT_WDG_SETFOCUS:
return TRUE;
case EVT_WDG_CANTAKEFOCUS:
*((boolean *)dwParam) = TRUE;
return TRUE;
}
-Erik

Thanks a lot, that works perfectly well
- Tigre-Bleu -

Thanks a lot, that works perfectly well
- Tigre-Bleu -

hi frds,
same solution is not working for me :(
scenario: 2 text boxes and button on the form
steps followed:
1. create prop container
2. insert the 2 textboxes in the prop
3. create button widget and static text widget (button being the decorator)
4. decorate button with static text, set the text on the static before that.
5. insert the button to the prop
6. herez the glitch
IWIDGET_SetText(fAddNetworkLbl, pwbuf, TRUE); //lbl is static
IWIDGET_SetBorderWidth(fAddNetworkLbl, 0);
IWIDGET_SetFontClass(fAddNetworkLbl, AEECLSID_FONTSYSBOLD);
IWIDGET_SetFlags(fAddNetworkLbl, IDF_ALIGN_CENTER|IDF_ALIGN_MIDDLE);
//this should set the selected bg color of the button ????
IWIDGET_SetSelectedBGColor(fAddNetworkButton, MAKE_RGB(255,0,0));
7. add widget handler as Erik suggested in the above post
IWIDGET_SetHandler(fAddNetworkButton, fAddNetworkBtnWidgetHandler);
8. in the handler do exactly the same thing mentioned by Erik
handle setfocus and cantakefocus
9. set tehy form handler
10. ISSUE is
when i press down once, it comes to forms handle event and i do iwidget_movefocus(widget, NEXT), focus comes to next text widget
11. once again i press down key, focus is actually ON THE BUTTON WIDGET (checked using IWIDGET_GetFocus), so the focus is there BUT CANT SEE THE FOCUS, NOT VISIBLE
any solutions ???

hi frds,
same solution is not working for me :(
scenario: 2 text boxes and button on the form
steps followed:
1. create prop container
2. insert the 2 textboxes in the prop
3. create button widget and static text widget (button being the decorator)
4. decorate button with static text, set the text on the static before that.
5. insert the button to the prop
6. herez the glitch
IWIDGET_SetText(fAddNetworkLbl, pwbuf, TRUE); //lbl is static
IWIDGET_SetBorderWidth(fAddNetworkLbl, 0);
IWIDGET_SetFontClass(fAddNetworkLbl, AEECLSID_FONTSYSBOLD);
IWIDGET_SetFlags(fAddNetworkLbl, IDF_ALIGN_CENTER|IDF_ALIGN_MIDDLE);
//this should set the selected bg color of the button ????
IWIDGET_SetSelectedBGColor(fAddNetworkButton, MAKE_RGB(255,0,0));
7. add widget handler as Erik suggested in the above post
IWIDGET_SetHandler(fAddNetworkButton, fAddNetworkBtnWidgetHandler);
8. in the handler do exactly the same thing mentioned by Erik
handle setfocus and cantakefocus
9. set tehy form handler
10. ISSUE is
when i press down once, it comes to forms handle event and i do iwidget_movefocus(widget, NEXT), focus comes to next text widget
11. once again i press down key, focus is actually ON THE BUTTON WIDGET (checked using IWIDGET_GetFocus), so the focus is there BUT CANT SEE THE FOCUS, NOT VISIBLE
any solutions ???

any help guys ????
currently the handler is on the button, i dont understand how the handler can be on static widget (although i tried that as well)

any help guys ????
currently the handler is on the button, i dont understand how the handler can be on static widget (although i tried that as well)