--- Begin Message ---yes great! thanks Cheers Alain > On 27 Jun 2015, at 00:30, Thierry Goubier <thierry.goub...@gmail.com> wrote: > > Very cool. Thanks Stephan. > > Thierry > > Le 26 juin 2015 6:17 PM, "Stephan Eggermont" <step...@stack.nl > <mailto:step...@stack.nl>> a écrit : > Morphic offers everything needed to create highly interactive applications in > Pharo. It is however, difficult to find out how to actually create those > applications. Morphic tutorials provide a starting point, and are not very > good at showing how the different features interact and are supposed to be > used together. Morph has lots of methods, and some of them are not in the > method category where you might expect them. The result is that most Morphs > in Pharo do not use much of what Morphic has to offer. > > Wouldn't it be great if there would be some sample code, showing how Morphic > can be used to great effect? > > Well, here is some code that takes a first step towards that goal. > DragPanels shows how to create a floating palette, filled with > wells that support dragging a property towards a target. It shows how to > combine drag-and drop with click: and context menu actions, and show to give > UI feedback when over a well and when holding the mouse down over an element > that reacts to click:. > > You can see the code in action here: > https://vimeo.com/131889858 <https://vimeo.com/131889858> > > The color panel shows some colors. If you don't set the allowDropBlock, > it will work with any morph that responds to #color: (like the world). > By clicking on the plus, you can add more colors to the panel. The panel has > a context menu to restore the default values. > > ColorPanel withSevenPaleColors > allowDropBlock: [ :source :target | > target class = CardMorph ]; > openInHand > > The people panel shows avatars belonging to an email addres. By default it > uses gravatar for them, and caches the images. > > PeoplePanel new > defaultValues: > #('step...@stack.nl <mailto:step...@stack.nl>' > > 'serge.stinckw...@gmail.com > <mailto:serge.stinckw...@gmail.com>' > 'nicolas.anque...@inria.fr <mailto:nicolas.anque...@inria.fr>' > 'thierry.goub...@gmail.com <mailto:thierry.goub...@gmail.com>' > 'stephane.duca...@inria.fr <mailto:stephane.duca...@inria.fr>' > 'marcus.den...@inria.fr <mailto:marcus.den...@inria.fr>'); > allowDropBlock: [ :source :target | > target class = CardMorph ]; > openInHand > > When dropping, the dragSource sends #color: resp. #email: to the target by > default. By setting the dropSelector of the DragWell this > can be overridden. > > You can try the code by do-ing > > Gofer new > smalltalkhubUser: 'StephanEggermont' project: 'Dragpanels' > package: 'DragPanels'; > load. > > It is used in (a work in progress) > > Gofer new > smalltalkhubUser: 'StephanEggermont' project: 'Documentation' > package: 'CardsMorphic'; > load. > > Stephan > > p.s. > > On the wishlist are > - add more color palettes > - add a dark theme, refactoring the colors > - add a small close cross in the title bar of the palette > - define the dropSelector in the panel, not the well > - support different sized wells, refactoring the sizes > - make the mouseOver rectangle color content dependent > - add pharo contributors as an avatar source > - add a configuration > > >
--- End Message ---
Re: [Pharo-users] [Ann] DragPanels: Floating palette windows with drag-and-drop in Morphic
Alain Plantec via Pharo-users Sat, 27 Jun 2015 02:19:49 -0700
- [Pharo-users] [Ann] DragPanels: Floating pal... Stephan Eggermont
- Re: [Pharo-users] [Ann] DragPanels: Flo... Stephan Eggermont
- Re: [Pharo-users] [Ann] DragPanels: Flo... Thierry Goubier
- Re: [Pharo-users] [Ann] DragPanels:... Alain Plantec via Pharo-users
- Re: [Pharo-users] [Ann] DragPan... stepharo
- Re: [Pharo-users] [Ann] Dra... Stephan Eggermont
- Re: [Pharo-users] [Ann... Stephan Eggermont
- Re: [Pharo-users] [Ann] DragPanels: Flo... Hannes Hirzel
- Re: [Pharo-users] [Ann] DragPanels:... Stephan Eggermont
- Re: [Pharo-users] [Ann] DragPan... Peter Uhnák
- Re: [Pharo-users] [Ann] Dra... H. Hirzel
- Re: [Pharo-users] [Ann... Nicolai Hess
- Re: [Pharo-users] [Ann] DragPan... Nicolai Hess
- Re: [Pharo-users] [Ann] Dra... Stephan Eggermont