Page 1 of 2
Combo box limitation ?
Posted: Wed Oct 26, 2022 3:05 pm
by CAsba
Hi,
I am using a combo box and button setup to navigate between cards. However, the combo box does not allow me to enter more than 13 card names even though I have set the number of lines to 30. Is this usual ? Could there be anything preventing the combo box from manipulating more than 13 lines ?
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 3:12 pm
by Klaus
Hi CAsba,
looks like this is a limitation of a combo box control!?
Not documented however...
"the number of lines" only manages how many lines will be displayed WITHOUT a scrollbar in the menu.
Best
Klaus
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 3:42 pm
by CAsba
OK, many thanks Klaus
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 3:49 pm
by richmond62

- SShot 2022-10-26 at 17.49.00.png (24.91 KiB) Viewed 4651 times
-
Err ?
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 4:30 pm
by Klaus
Code: Select all
set the visible of the_amount_of_scrolled_pixel of btn "CM" to TRUE
Really?

Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 5:55 pm
by dunbarx
Richmond.
What Klaus means is:
"You want to set the visible of an integer??"
Craig
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 5:57 pm
by richmond62
Aha,
be displayed WITHOUT a scrollbar in the menu
And how would one go about setting up a vertical scrollbar in a combo thing?
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 6:46 pm
by dunbarx
Richmond.
Combo boxes do not have a limit to the number of menuItems, nor how many can be displayed at once. As Klaus mentioned, the inspector setting only limits the length of the menuItem list before the OS provides a scrollbar. But that scrollbar is native to the control.
Craig
Re: Combo box limitation ?
Posted: Wed Oct 26, 2022 6:51 pm
by dunbarx
Playing around, what I see is that the inspector's "Number of lines to Display" only applies to combo boxes. Likely because only that menu button has a scrollbar at all. The other three, I am guessing, simply ignore that value.
They all can display what seems like any number of menuItems. It all depends on how tall your monitor is.
Craig
Re: Combo box limitation ?
Posted: Thu Oct 27, 2022 2:07 pm
by CAsba
Well,
It was my experience that the Combo box would not accept any more than 13 items, (for whatever reason), so, as it's only a navigation tool for me - that the user will never see - I got around the problem by adding another combo box that the Navigator button automatically picks up.
Thanks for all the replies.
Re: Combo box limitation ?
Posted: Thu Oct 27, 2022 2:38 pm
by dunbarx
CAsba
Drag a combo box onto a card and put many lines of random chars "into" it. You can do that in the inspector or by (pseudo):
Code: Select all
put 30 lines of text into btn "yourComboBox"
Whatever. When I click on the combo box, I get a very long list of menu items. The inspector can limit the length of the exposed list.
What did you do?
Craig
Re: Combo box limitation ?
Posted: Thu Oct 27, 2022 5:17 pm
by CAsba
I used the property inspector and entered the card names, one after the other, that is one below the other, until when I pressed enter, the cursor did not move to the next line.
Re: Combo box limitation ?
Posted: Thu Oct 27, 2022 5:29 pm
by Klaus
Hi CAsba,
so you entered all the card names manually? Not neccessary in LC!

Create a button, delete or hide it later, and add this script:
Code: Select all
on mouseup
## LC knows bettr than us how we named our cards
put the cardnames of this stack into tCardNames
## Now put them into your combo box, using: set the text of btn xyz to zx
set the text of btn "your combo box here" to tCardNames
end mouseup
Best
Klaus
Re: Combo box limitation ?
Posted: Thu Oct 27, 2022 6:02 pm
by dunbarx
CAsba
If you have your menuItems open, you can use the arrow keys to move up and down along the list, but then you must use the mouse to select a menuItem. I am not sure that pressing "Enter" or "Return" will do anything at all.
The best way to use a control like this is with a "menuPick" handler in the button script, such as:
Code: Select all
on menuPick pItemName
answer pItemName
answer the label of me
answer the menuHistory of me
go card pItemname -- for your particular use
end menuPick
But since the mouse has to be used to do the actual selecting, barring any special gadgetry you add to the mix, why use any keys at all? The user interface guidelines want everything to be done with the mouse; Open the menu, select a menuItem and click.
Craig
Re: Combo box limitation ?
Posted: Fri Oct 28, 2022 12:42 pm
by CAsba
Thank you, guys, good info !