Cool :)

It is added in the last version. Thank you for your participation at
NewInspector !

I think the best way to preview a form is to show it in the right side of
the NewInspector in place of the description panel, but it is a really big
challenge: NewInspector is unaware about the composants of the frame
(everything is done by model). I must found a way to achieve this :)

Fréd
----
Frédéric Pluquet
Université Libre de Bruxelles (ULB)
Assistant
http://www.ulb.ac.be/di/fpluquet


On Mon, Dec 21, 2009 at 4:57 PM, Mariano Martinez Peck <
[email protected]> wrote:

> Hi Frederic.  Henrik Sperre Johansen  created this method:
>
> Form >> asNINode
>    ^ (super asNINode)
>        addAction:
>                (NIAction labeled: 'Preview'
>                        shortcut: $p
>                        target:
>                            [ :aForm |
>                            | anOffset aFrame |
>                            anOffset := aForm width @ aForm height / -2.
>                            aFrame := LayoutFrame fractions: (0.5 @ 0.5
> corner: 0.5 @ 0.5) offsets: (anOffset corner: anOffset).
>                            (SystemWindow labelled: 'Form preview')
>                                addMorph: (ImageMorph new image: aForm)
> fullFrame: aFrame;
>                                openInWorldExtent: (aForm extent max: 267 @
> 0) ]
>                        actionSelector: #value:
>                        withArgs: {self}
>                        category: 'Preview');
>        yourself
>
>
>
> It let you see the image of something. Example, inspect a form ( ThemeIcons
> infoIcon ), right-click the Form
> node, and select preview.
>
> In addition, he told me this:
>
> "For inclusion in the NewInspector package on SqueakSource, I would at
> least change the magic number 267 first, to one computed based on the width
> of the Window label, 267 is merely what is needed to display it fully with
> the standard window font in PharoDev :)
> Feel free to do so, and ask Frederique Pluquet to to include it there."
>
> So....can you take care of this and include it ? would be very useful!!!
>
> Thank you very much.
>
> Mariano
>
>
> ---------- Forwarded message ----------
> From: Henrik Sperre Johansen <[email protected]>
> Date: Thu, Dec 17, 2009 at 10:12 PM
> Subject: Re: [Pharo-project] [ANN] MagmaBrowser
> To: [email protected]
>
>
> On 16.12.2009 11:29, Mariano Martinez Peck wrote:
> > This is an excellent job. Congratulations Hernán.
> >
> > I have a question....how could you draw the photo instead of the array
> > of bytes on the browser?  I really hate when developing with seaside
> > and I have some pictures in my filelibrary class and when I browse
> > them I see the array of bits...but I want to see the picture!!!
> >
> > Thanks
> >
> > Mariano
> For a proof of concept of what is possible using the NewInspector,
> install this method:
> Form>>asNINode
>     ^ (super asNINode)
>         addAction:
>                 (NIAction labeled: 'Preview'
>                         shortcut: $p
>                         target:
>                             [ :aForm |
>                              aForm depth < 32 ifTrue: [ Display
> getCanvas image: aForm at: 10 @ 10 ]
>                                 ifFalse: [ Display getCanvas
> translucentImage: aForm at: 10 @ 10 ] ]
>                          actionSelector: #value:
>                         withArgs: {self}
>                         category: 'Preview');
>         yourself
>
>   then inspect a form (Say, ThemeIcons infoIcons ), right-click the Form
> node, and select preview.
>
> Ideally it'd be nice to add an extra "Preview" item to the subnodes of
> Forms in the NI, which when clicked would show the form on the right
> side, but I don't (easily) see how you can temporarily replace the
> TextMorph on the right side with something capable of displaying Forms
>
> With some more work on the closure it should be possible to open the
> preview in a separate window though :)
>
> Cheers,
> Henry
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to