Combo box limitation ?

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

CAsba
Posts: 431
Joined: Fri Sep 30, 2022 12:11 pm

Combo box limitation ?

Post by CAsba » Wed Oct 26, 2022 3:05 pm

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 ?

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Combo box limitation ?

Post by Klaus » Wed Oct 26, 2022 3:12 pm

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

CAsba
Posts: 431
Joined: Fri Sep 30, 2022 12:11 pm

Re: Combo box limitation ?

Post by CAsba » Wed Oct 26, 2022 3:42 pm

OK, many thanks Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Combo box limitation ?

Post by richmond62 » Wed Oct 26, 2022 3:49 pm

SShot 2022-10-26 at 17.49.00.png
SShot 2022-10-26 at 17.49.00.png (24.91 KiB) Viewed 4653 times
-
Err ?

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Combo box limitation ?

Post by Klaus » Wed Oct 26, 2022 4:30 pm

Code: Select all

set the visible of the_amount_of_scrolled_pixel of btn "CM" to TRUE
Really? :D

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Combo box limitation ?

Post by dunbarx » Wed Oct 26, 2022 5:55 pm

Richmond.

What Klaus means is:

"You want to set the visible of an integer??" :roll:

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10094
Joined: Fri Feb 19, 2010 10:17 am

Re: Combo box limitation ?

Post by richmond62 » Wed Oct 26, 2022 5:57 pm

Aha,
be displayed WITHOUT a scrollbar in the menu
And how would one go about setting up a vertical scrollbar in a combo thing?

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Combo box limitation ?

Post by dunbarx » Wed Oct 26, 2022 6:46 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Combo box limitation ?

Post by dunbarx » Wed Oct 26, 2022 6:51 pm

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

CAsba
Posts: 431
Joined: Fri Sep 30, 2022 12:11 pm

Re: Combo box limitation ?

Post by CAsba » Thu Oct 27, 2022 2:07 pm

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.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Combo box limitation ?

Post by dunbarx » Thu Oct 27, 2022 2:38 pm

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

CAsba
Posts: 431
Joined: Fri Sep 30, 2022 12:11 pm

Re: Combo box limitation ?

Post by CAsba » Thu Oct 27, 2022 5:17 pm

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.

Klaus
Posts: 14190
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Combo box limitation ?

Post by Klaus » Thu Oct 27, 2022 5:29 pm

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

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10317
Joined: Wed May 06, 2009 2:28 pm

Re: Combo box limitation ?

Post by dunbarx » Thu Oct 27, 2022 6:02 pm

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

CAsba
Posts: 431
Joined: Fri Sep 30, 2022 12:11 pm

Re: Combo box limitation ?

Post by CAsba » Fri Oct 28, 2022 12:42 pm

Thank you, guys, good info !

Post Reply