Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odd combobox behaviour.... #86

Open
SamSandq opened this issue Jan 11, 2024 · 5 comments
Open

Odd combobox behaviour.... #86

SamSandq opened this issue Jan 11, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@SamSandq
Copy link

I create a Combo like this:

Combo *filter = combo_create();
layout_combo(filtLayout, filter, 3, 0);
combo_add_elem(filter, "1+ stars", NULL);
combo_add_elem(filter, "2+ stars", NULL);
combo_add_elem(filter, "3+ stars", NULL);
combo_add_elem(filter, "4+ stars ", NULL);
combo_add_elem(filter, "5 stars", NULL);
combo_add_elem(filter, "(no filter)", NULL);
combo_add_elem(filter, "(unrated)", NULL);

That works perfectly, and shows:

Screenshot 2024-01-11 at 21 36 42

But what I really want is this:

combo_add_elem(filter, "★%", NULL);
combo_add_elem(filter, "★★%", NULL);
combo_add_elem(filter, "★★★%", NULL);
combo_add_elem(filter, "★★★★%", NULL);
combo_add_elem(filter, "★★★★★", NULL);
combo_add_elem(filter, "(no filter)", NULL);
combo_add_elem(filter, "(unrated)", NULL);

which does not show correctly, as some elements are discarded:

Screenshot 2024-01-11 at 21 37 25

What could be wrong?

@frang75
Copy link
Owner

frang75 commented Jan 12, 2024

Hi @SamSandq! I add this new case to the ComboBox review.

Related to: #81 #68

@frang75 frang75 self-assigned this Jan 12, 2024
@frang75 frang75 added the bug Something isn't working label Jan 12, 2024
@SamSandq
Copy link
Author

FYI, the popup control works perfectly, and in my case is also better, since I do not wish to be able to edit the values.

However, I noticed that there is no way to access the text of the selected popup choice, only the index. Perhaps a

char_t *txt = popup_text(myPopup);

or

char_t *txt = popup_text(myPopup, index);

could be considered.

@frang75
Copy link
Owner

frang75 commented Jan 15, 2024

Thanks for update. Therefore, I leave this issue open. Full review of ComboBox is mandatory.

You can get the text of selected Item in OnSelect event as part of EvButton event parameters. But also is a good idea to add const char_t *popup_get_text(const PopUp *popup, const uint32_t index) to public interface.
popup_text

@SamSandq
Copy link
Author

SamSandq commented Jan 15, 2024 via email

@frang75
Copy link
Owner

frang75 commented Jan 16, 2024

Added popup_get_text() 8177e95.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants