Closed VedantParanjape closed 4 years ago
hey, @ArthurSonzogni des mises à jour à ce sujet?
Hi, thanks for opening this! We can add on_enter() in the toggle component. This will match RadioBox and CheckBox. Do you prefer to do the change? Or I can do it.
Do you think we need to add a "Button" component? I can do it too.
Hi, thanks for opening this! We can add on_enter() in the toggle component. This will match RadioBox and CheckBox. Do you prefer to do the change? Or I can do it.
I will make the change, and can we have a identical API for all component, like in RadioBox on_change() actually checks if user pressed enter, and not if the selection changed.
Do you think we need to add a "Button" component? I can do it too.
With toggle component having a on_enter method, it can emulate a button.
Hey @ArthurSonzogni, Can we have a identical API for on_change, on_enter for all the components, if yes. I'd like to contribute
Like radio box's on_change is actually on_enter, and some component lack the on_change thing.
Regards, Vedant
We currently have:
Component | on_change() | on_enter() |
---|---|---|
Toggle | X | |
Menu | X | X |
RadioBox | X | |
Input | X | X |
CheckBox | X |
on_change() means the data's have changed. The selected data can change by navigating (menu, Toggle), pressing a button like space or enter (RadioBox, CheckBox) or by directly typing something (Input)
on_enter() was added for Menu and Input. This means "The user has validated the selected data".
I think I left on_enter() in Toggle, because this was copy-pasted from Menu.
I don't think we can make enter to trigger on_enter() instead of on_change() for RadioBox and CheckBox, this would prevent us from using the current behavior.
I don't think we can make enter to trigger on_enter() instead of on_change() for RadioBox and CheckBox, this would prevent us from using the current behavior.
Current behaviour as in ? sorry, i didn't understand your point.
I think I don't want to add on_enter to CheckBox, RadioBox. The "enter" key are already assigned to select an element.
However, the CheckBox/RadioBox implementation do not have any privilege, you can freely build your own. You can even derive from them and just override the OnEvent method like this:
bool MyCheckbox::OnEvent(Event event) {
if (event == Event::Enter) {
on_enter();
return true;
}
return CheckBox::OnEvent(event);
}
Oh great, just what i wanted.
Better docs might have helped, why don't you setup detailed docs using mkdocs on readthedocs.com ?
I have started a "doxygen" branch here: https://github.com/ArthurSonzogni/FTXUI/tree/doxygen
I need to finish it and then we will have a documentation page.
I just uploaded: https://arthursonzogni.com/FTXUI/doc
Not that I still haven't completed the documentation yet.
Oh this is really good. You could use mkdocs or sphinx for a more material, modern looking docs.
I haven't used sphinx. This might be good option.
I improved the CSS and many more things: https://arthursonzogni.com/FTXUI/doc/
You might have to refresh several times (ctrl + maj + R) 2 times to get it, because this page is running through a ServiceWorker.
Looks great, but i need to refresh twice, I have extensively used github pages, let me know if you need any help with that.
Regards, Vedant
Hey, is it possible to add on_enter() for toggle component? Since, this framework doesn't have buttons. Toggle is a pretty good way to emulate buttons.
I am more than happy to contribute for this feature.