Basic controls <Normal List> does not change selection

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

Basic controls <Normal List> does not change selection

bachitoph
Hello,

porting my digitalk / dolphin application to pharo (www.trimfox.com) I have to port my dialog creation part. Unfortunately I can't use Spec because my dialog creation depends on boundingBox: (Pharo bounds:) by calculation position and extent in pixels. So I have to use Morphic. There is the nice class WidgetExamples which helped me very much. But the Normal List control does not change selection if there is a click on another item. You can see the behavior evaluating the code below, and click maybe on the <Two> item.  Same behavior in my Dialog class. Any hint!

WidgetExamples exampleBasicControls

thanks
cjb
Reply | Threaded
Open this post in threaded view
|

Re: Basic controls <Normal List> does not change selection

EstebanLM
Hi,

why you say you cannot doit with Spec?
If I understand correctly, what you want to do is to attach the windows you do to the Pharo world. For doing that with Spec you would do something like this:

myMorph := mySpecModel buildWithSpec.
World addMorph: myMorph fullFrame: LayoutFrame identity.
myMorph beSticky.
(also you have to change the layout of myMorph, etc.)

anyway… the other thing you ask is how to attach one list to another? Let’s say you have listA and listB, you want to change selection on listB when listA changes?
That you have to doit listening the change event.
Using a FTTableMorph (or FTEasyListMorph), which are the ones I recommend you to use, you would do something like this:

listB := FTEasyListMorph new
        elements: myElementsForB;
        display: [ :each | each asString ];
        yourself.

listA := FTEasyListMorph new
        elements: myElementsForA;
        display: [ :each | each asString ];
        onAnnouncement: FTSelectionChanged do: [ :ann | listB selection: newSelectionForB ];
        yourself.

then you can add your list morph whenever you want.

hope this helps :)
Esteban

> On 28 Apr 2017, at 10:57, bachitoph <[hidden email]> wrote:
>
> Hello,
>
> porting my digitalk / dolphin application to pharo (www.trimfox.com) I have
> to port my dialog creation part. Unfortunately I can't use Spec because my
> dialog creation depends on boundingBox: (Pharo bounds:) by calculation
> position and extent in pixels. So I have to use Morphic. There is the nice
> class WidgetExamples which helped me very much. But the Normal List control
> does not change selection if there is a click on another item. You can see
> the behavior evaluating the code below, and click maybe on the <Two> item.
> Same behavior in my Dialog class. Any hint!
>
> WidgetExamples exampleBasicControls
>
> thanks
> cjb
>
>
>
> --
> View this message in context: http://forum.world.st/Basic-controls-Normal-List-does-not-change-selection-tp4944700.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Basic controls <Normal List> does not change selection

bachitoph
Hi Esteban,

>>why you say you cannot doit with Spec?
As I understand Spec it depends on a SpecLayout which uses columns and rows instead of rectangles. Is there any way to define in Spec a dialog with explicite setting to any control view, something like aControlMorph bounds: (50@50 extent: 100@30).

>>Using a FTTableMorph (or FTEasyListMorph), which are the ones I recommend you to use, you would do something like this:
I will give it a try.

Is there any recommendation about the different morphs. What is the best button, droplist, input field .., because this is a great bulk of classes.

Thanks
cjb

Reply | Threaded
Open this post in threaded view
|

Re: Basic controls <Normal List> does not change selection

Denis Kudriashov

2017-04-28 12:58 GMT+02:00 bachitoph <[hidden email]>:
Is there any recommendation about the different morphs. What is the best
button, droplist, input field .., because this is a great bulk of classes.

For input field look at Twisty http://forum.world.st/ANN-Twisty-text-with-active-state-framework-td4863625.html