2022-11-20 09:17 PM
I create custom container and include one radio button in that container and then I want to create list of radio buttons. The problem is that when I touch one radio button other buttons does not deselected. How to include radio buttons in the same group? (in custom container)
2022-11-22 12:47 AM
Hello @heyo ,
Could you please attach screenshots of the issue you have ? That could help us a lot to better visualize the problem.
Thanks,
/Yoann
2022-11-24 12:26 AM
Do you check if all your radio button are on the same group ?
2022-11-24 03:28 AM
Ok. First of all I create one radio button in custom container:
Then I write this code in my custom container:
#include <gui/containers/example.hpp>
example::example()
{
}
void example::setupListElement(TEXTS iconTextID, int _index)
{
index = _index;
languagetxt.setTypedText(TypedText(iconTextID));
languagetxt.resizeToCurrentText();
invalidate();
}
int example::getIndex()
{
return index;
}
Then I put that container in my screen window: Screen1
My Screen1 code looks like that:
#include <gui/screen1_screen/Screen1View.hpp>
#include <texts/TextKeysAndLanguages.hpp>
Screen1View::Screen1View()
{
}
void Screen1View::setupScreen()
{
list.setHeight(0);
listElements[0].setupListElement(T_ENGLSIHID, 0);
listElements[1].setupListElement(T_POLSKIID,1);
listElements[2].setupListElement(T_DANSKID, 2);
listElements[3].setupListElement(T_SVENSKAID, 3);
for (uint8_t i = 0; i < numberOfListElements; ++i)
{
list.add(listElements[i]);
}
}
void Screen1View::tearDownScreen()
{
Screen1ViewBase::tearDownScreen();
}
void Screen1View::examplebuttoncalled()
{
if(examples.getState())
{
scrollableContainer1.setVisible(true);
scrollableContainer1.invalidate();
}
else
{
scrollableContainer1.setVisible(false);
scrollableContainer1.invalidate();
}
}
Start simulator and click on toggle button we see dropdown
If I click for example english and polski it selects both of them(as usually if all buttons are in one group then if I click one option deselects another and so on). So the question is this how to add all radio buttons in one group programmatically? In this project I use a lot of dropdowns and I need to create them dinammically because it allocate a lot of microprocessor memory.
2022-11-24 10:58 PM
2022-11-28 12:41 AM
Hello @heyo ,
What does your callback method look like ?
I mean the method which is called when you click on your radio buttons?
/Yoann