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

Developer

Forums

Hi 2 all!!!

I am able to display radio buttons but,
I want to know how to set text next to that radio button itself, if i give text it is displaying top or below it but not next to it,,,, :confused: plz help me,,,,,,,,

here is my following code:-

void CheckBoxExample(HareKrishna_t *pMe)
{

IPropContainer *pIPropContainer=NULL;

ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM , (void **)&pMe->pIRootForm);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM , (void **)&pMe->pIForm);

ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_PROPCONTAINER, (void **)&pMe->pIPropContainer);

ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_RADIOWIDGET,&pMe->pICheckBox1);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_RADIOWIDGET,&pMe->pICheckBox2);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_PROPCONTAINER,&pIPropContainer);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_FORM,&pMe->pIForm);
ISHELL_CreateInstance(pMe->a.m_pIShell,AEECLSID_ROOTFORM,&pMe->pIRootForm);

ISHELL_CreateInstance(pMe->a.m_pIShell, AEECLSID_STATICWIDGET,&pMe->piwCPrompt);

(void)IWIDGET_SetText(pMe->piwCPrompt, L"RadioButton1", TRUE);

pMe->wp.prop=10;
pMe->wp.bVisible=TRUE;
IPROPCONTAINER_Insert(pIPropContainer, pMe->piwCPrompt, WIDGET_ZNORMAL,(WidgetProp*)&pMe->wp);

pMe->wp.prop=10;
pMe->wp.bVisible=TRUE;

IPROPCONTAINER_Insert(pIPropContainer,pMe->pICheckBox1,WIDGET_ZNORMAL,(WidgetProp*)&pMe->wp);

pMe->wp.prop=30;
pMe->wp.bVisible=TRUE;

IPROPCONTAINER_Insert(pIPropContainer,pMe->pICheckBox2,WIDGET_ZNORMAL,(WidgetProp*)&pMe->wp);

IPROPCONTAINER_QueryInterface(pIPropContainer,AEEIID_WIDGET,&pMe->pICheckBoxContainer);

IWIDGET_SetProperty(pMe->pICheckBoxContainer, PROP_LAYOUTSTYLE, LAYOUT_VERT);

IFORM_SetWidget(pMe->pIForm,WID_FORM,pMe->pICheckBoxContainer);
IFORM_SetSoftkey(pMe->pIForm, FID_SOFTKEY1 ,L"Back");
IFORM_SetSoftkey(pMe->pIForm, FID_SOFTKEY2 ,L"View");

IROOTFORM_PushForm(pMe->pIRootForm,pMe->pIForm);

}

You will have to use the combination of static widget (for displaying the text) and radio widget ( for displaying the radio button). And then add these widgets into the container.

You will have to use the combination of static widget (for displaying the text) and radio widget ( for displaying the radio button). And then add these widgets into the container.

thanks for the reply,
I have done same thing, plz see my code above,

thanks for the reply,
I have done same thing, plz see my code above,

What I want to say is, you are using the correct widgets.
The only thing missing here is the layout arrangement.
You can use the proper container to add your widgets it should be like:
_____________________________
| Radio widget 1 | Static Widget 1 |
-----------------------------------------------
| Radio widget 2 | Static Widget 2 |
----------------------------------------------
| Radio widget 3 | Static Widget 3 |
-----------------------------------------------
Radio widgets will be the only focusable widgets, so that on key up/down the focus will change on the radio widgets only.
You can use IConstraintContainer/IXYContainer for obtaining this kind of arrangement.

What I want to say is, you are using the correct widgets.
The only thing missing here is the layout arrangement.
You can use the proper container to add your widgets it should be like:
_____________________________
| Radio widget 1 | Static Widget 1 |
-----------------------------------------------
| Radio widget 2 | Static Widget 2 |
----------------------------------------------
| Radio widget 3 | Static Widget 3 |
-----------------------------------------------
Radio widgets will be the only focusable widgets, so that on key up/down the focus will change on the radio widgets only.
You can use IConstraintContainer/IXYContainer for obtaining this kind of arrangement.

oh ok thanks :)

oh ok thanks :)

hai Lalit,
Thanks, i am able to put it in correct position but if i double click on it, radio button is not losing its focus, i mean inside black circle remains same instead of becoming white,,, :confused:

hai Lalit,
Thanks, i am able to put it in correct position but if i double click on it, radio button is not losing its focus, i mean inside black circle remains same instead of becoming white,,, :confused:

Hi All,
I am facing a problem in drawing a radio button form. The issue is I am getting only a check box instead of the radio button... Here is my sample code... Can some one help me???
boolean TestMode_RadioButtonForm(Application1 *pMe, uint16 eCode, uint16 wParam, uint32 dwParam)
{
int ret_val = AEE_SUCCESS, nStrLen, index;
IValueModel* pivm = NULL;
AECHAR szBuf[64] = {0};
IXYContainer *pXYContainer = NULL;
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_Form, (void **)&pMe->pIForm3);
nStrLen = ISHELL_LoadResString(pMe->pIShell, APPLICATION1_RES_FILE, IDS_STRING_1043, szBuf, sizeof(szBuf));
if(0 >= nStrLen)
{
return (FALSE);
}
else
{
ret_val = IForm_SetTitle(pMe->pIForm3, szBuf);
}
if(AEE_SUCCESS == ret_val)
{
nStrLen = ISHELL_LoadResString(pMe->pIShell, APPLICATION1_RES_FILE, IDS_STRING_1005, szBuf, sizeof(szBuf));
if(0 >= nStrLen)
{
return (FALSE);
}
else
{
ret_val = IForm_SetSoftkey(pMe->pIForm3, FID_SOFTKEY1 , szBuf);
}
}
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_XYContainer , (void**)&pXYContainer );
pMe->widgetPos.y = 10;
pMe->widgetPos.bVisible = TRUE;
pMe->widgetExt.height = 20;
for(index = 0; index < 5; index ++)
{
if(AEE_SUCCESS == ret_val)
{
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_RaioWidget, (void **)&pMe->pRadioWidget

);
}
if(AEE_SUCCESS == ret_val)
{
pMe->widgetPos.x = 10;
pMe->widgetExt.width = 20;
IWIDGET_SetExtent(pMe->pRadioWidget

, &pMe->widgetExt);
ret_val = IXYContainer_Insert(pXYContainer, pMe->pRadioWidget

, WIDGET_ZNORMAL, &pMe->widgetPos);
}
if(AEE_SUCCESS == ret_val)
{
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_StaticWidget, (void **)&pMe->pRadioStaticWidget

);
}
if(AEE_SUCCESS == ret_val)
{
pMe->widgetExt.width = 100;
IWIDGET_SetExtent(pMe->pRadioStaticWidget

, &pMe->widgetExt);
pMe->widgetPos.x = 40;
ret_val = IXYContainer_Insert(pXYContainer, pMe->pRadioStaticWidget

, WIDGET_ZNORMAL, &pMe->widgetPos);
}
pMe->widgetPos.y += 20;
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IXYContainer_QueryInterface(pXYContainer, AEEIID_WIDGET, (void**)&pMe->pContWidget);
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IForm_SetWidget(pMe->pIForm3, WID_FORM, pMe->pContWidget);
IXYContainer_Release(pXYContainer);
pXYContainer = NULL;
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IRootForm_PushForm(pMe->pIRootForm, pMe->pIForm3);
}
return TRUE;

Hi All,
I am facing a problem in drawing a radio button form. The issue is I am getting only a check box instead of the radio button... Here is my sample code... Can some one help me???
boolean TestMode_RadioButtonForm(Application1 *pMe, uint16 eCode, uint16 wParam, uint32 dwParam)
{
int ret_val = AEE_SUCCESS, nStrLen, index;
IValueModel* pivm = NULL;
AECHAR szBuf[64] = {0};
IXYContainer *pXYContainer = NULL;
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_Form, (void **)&pMe->pIForm3);
nStrLen = ISHELL_LoadResString(pMe->pIShell, APPLICATION1_RES_FILE, IDS_STRING_1043, szBuf, sizeof(szBuf));
if(0 >= nStrLen)
{
return (FALSE);
}
else
{
ret_val = IForm_SetTitle(pMe->pIForm3, szBuf);
}
if(AEE_SUCCESS == ret_val)
{
nStrLen = ISHELL_LoadResString(pMe->pIShell, APPLICATION1_RES_FILE, IDS_STRING_1005, szBuf, sizeof(szBuf));
if(0 >= nStrLen)
{
return (FALSE);
}
else
{
ret_val = IForm_SetSoftkey(pMe->pIForm3, FID_SOFTKEY1 , szBuf);
}
}
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_XYContainer , (void**)&pXYContainer );
pMe->widgetPos.y = 10;
pMe->widgetPos.bVisible = TRUE;
pMe->widgetExt.height = 20;
for(index = 0; index < 5; index ++)
{
if(AEE_SUCCESS == ret_val)
{
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_RaioWidget, (void **)&pMe->pRadioWidget

);
}
if(AEE_SUCCESS == ret_val)
{
pMe->widgetPos.x = 10;
pMe->widgetExt.width = 20;
IWIDGET_SetExtent(pMe->pRadioWidget

, &pMe->widgetExt);
ret_val = IXYContainer_Insert(pXYContainer, pMe->pRadioWidget

, WIDGET_ZNORMAL, &pMe->widgetPos);
}
if(AEE_SUCCESS == ret_val)
{
ret_val = ISHELL_CreateInstance(pMe->pIShell, AEECLSID_StaticWidget, (void **)&pMe->pRadioStaticWidget

);
}
if(AEE_SUCCESS == ret_val)
{
pMe->widgetExt.width = 100;
IWIDGET_SetExtent(pMe->pRadioStaticWidget

, &pMe->widgetExt);
pMe->widgetPos.x = 40;
ret_val = IXYContainer_Insert(pXYContainer, pMe->pRadioStaticWidget

, WIDGET_ZNORMAL, &pMe->widgetPos);
}
pMe->widgetPos.y += 20;
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IXYContainer_QueryInterface(pXYContainer, AEEIID_WIDGET, (void**)&pMe->pContWidget);
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IForm_SetWidget(pMe->pIForm3, WID_FORM, pMe->pContWidget);
IXYContainer_Release(pXYContainer);
pXYContainer = NULL;
}
if(AEE_SUCCESS == ret_val)
{
ret_val = IRootForm_PushForm(pMe->pIRootForm, pMe->pIForm3);
}
return TRUE;

Manju46,
You might have to register the event handler for the radio widget[or group] and on the required event have to change the model of the radio widget. like setting unsetting of the radio buttons.

Manju46,
You might have to register the event handler for the radio widget[or group] and on the required event have to change the model of the radio widget. like setting unsetting of the radio buttons.

hai Lalit thanks for the reply,
i have already set an event handler for it, but hw to give setting and not setting for radio button?

hai Lalit thanks for the reply,
i have already set an event handler for it, but hw to give setting and not setting for radio button?