Finding a combo box to increase its lines

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Finding a combo box to increase its lines

Steve Cline
Assuming I have defined a combo box with the id #cardChoicesComboBox, and I want to increase the number of lines it displays in the dropdown. I did not see a way to do that throught the UI Painter. I think the code below would work if I could find the right method(s) to replace "foo:". Self is a subclass of ApplicationModel. Using VW 7.9.

I have tried the suggestions that Holger Guhl made in his Feb 22 reply to a similar query ( http://forum.world.st/Finding-and-manipulating-a-menu-tp4671497p4671521.html ) - no luck so far.

initializeCardComboBoxFrom: cards

        | obj |
        self card value: cards first.
        self cardChoices value: cards asList.
        obj := self foo: #cardChoicesComboBox              .
        self assert: (obj isKindOf: ComboBoxButtonView).
        obj maxLines: cards size

the following have not worked:

component:
widget:


Thanks, Steve
Reply | Threaded
Open this post in threaded view
|

Re: Finding a combo box to increase its lines

Dennis smith-4
At the lowest level, this should work ...


     w := self builder componentAt: #cardChoicesComboBox.
    (w notNil ifTrue: [
         w widget menuButton maxLines: n]





On 2013-06-08 9:21 PM, Steve Cline wrote:

> Assuming I have defined a combo box with the id #cardChoicesComboBox, and I
> want to increase the number of lines it displays in the dropdown. I did not
> see a way to do that throught the UI Painter. I think the code below would
> work if I could find the right method(s) to replace "foo:". Self is a
> subclass of ApplicationModel. Using VW 7.9.
>
> I have tried the suggestions that Holger Guhl made in his Feb 22 reply to a
> similar query (
> http://forum.world.st/Finding-and-manipulating-a-menu-tp4671497p4671521.html
> ) - no luck so far.
>
> initializeCardComboBoxFrom: cards
>
> | obj |
> self card value: cards first.
> self cardChoices value: cards asList.
> obj := self foo: #cardChoicesComboBox              .
> self assert: (obj isKindOf: ComboBoxButtonView).
> obj maxLines: cards size
>
> the following have not worked:
>
> component:
> widget:
>
>
> Thanks, Steve
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-a-combo-box-to-increase-its-lines-tp4692421.html
> Sent from the VisualWorks mailing list archive at Nabble.com.
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

--
Dennis Smith                                  +1 416.798.7948
Cherniak Software Development Corporation   Fax: +1 416.798.0948
509-2001 Sheppard Avenue East        [hidden email]
Toronto, ON M2J 4Z8              sip:[hidden email]
Canada                     http://www.CherniakSoftware.com
Entrance off Yorkland Blvd south of Sheppard Ave east of the DVP

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Finding a combo box to increase its lines

Holger Guhl
In reply to this post by Steve Cline
Please, check out the attached example. It's reused from some Support case, so please apologize for
not cleaning up the irrelevant stuff.
The check box controls whether you'll have a long choices list or a short one. It toggles the menu
length from constant 2 to choices number. Whenever you change the checkbox value, the menu length
changes. The approach for this demo is a change notification callback hooked to the checkbox aspect
implemented with this method

choiceListPreferenceChanged
     | combobox lines |
     combobox := self widgetAt: #ComboBox1.
     lines := self allChoicesVisible value ifTrue: [self choices value size] ifFalse: [2].
     combobox menuButton maxLines: lines

The "art" is looking up and navigating to the object having the responsibility for the menu length.
This should give you an idea how to control combobox menu length in other applications.

Cheers,
Holger

Am 09.06.2013 03:21, schrieb Steve Cline:

> Assuming I have defined a combo box with the id #cardChoicesComboBox, and I
> want to increase the number of lines it displays in the dropdown. I did not
> see a way to do that throught the UI Painter. I think the code below would
> work if I could find the right method(s) to replace "foo:". Self is a
> subclass of ApplicationModel. Using VW 7.9.
>
> I have tried the suggestions that Holger Guhl made in his Feb 22 reply to a
> similar query (
> http://forum.world.st/Finding-and-manipulating-a-menu-tp4671497p4671521.html
> ) - no luck so far.
>
> initializeCardComboBoxFrom: cards
>
> | obj |
> self card value: cards first.
> self cardChoices value: cards asList.
> obj := self foo: #cardChoicesComboBox              .
> self assert: (obj isKindOf: ComboBoxButtonView).
> obj maxLines: cards size
>
> the following have not worked:
>
> component:
> widget:
>
>
> Thanks, Steve
>
>
>
> --
> View this message in context: http://forum.world.st/Finding-a-combo-box-to-increase-its-lines-tp4692421.html
> Sent from the VisualWorks mailing list archive at Nabble.com.
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>

Holger Guhl
--
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

Test-GUIWithCombobox.st (9K) Download Attachment