How do I find out the maximum extent that a morph can be set to,
without this impacting the current extent of its owner morph?
Alexandre Rousseau
alexr at mailsnare.net
Thu Nov 29 13:03:33 UTC 2007
Hi Edgar
> I following your previous post, trying to understand how should be
> constructed your morph.
>
> Until now, I think you wish some kind of Post It note, maybe I wrong.
>
Yes, and that's working fine, for the most part (see attached
screenshot: note.gif).
-------------- next part --------------
A non-text attachment was scrubbed...
Name: note.gif
Type: image/gif
Size: 3641 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071129/b2c81644/note.gif
-------------- next part --------------
>> 1. a SimpleButtonMorph, to trigger collapse/expansion of the stickie
>> note (collapsed = stickie note's editor submorph hidden)
>
> Why not change collapsed/expanded state via click ?
>
Personal preference, but regardless of how, collapse works too. See
note-collapsed.gif.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: note-collapsed.gif
Type: image/gif
Size: 2098 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071129/b2c81644/note-collapsed.gif
-------------- next part --------------
As you can see from the screenshot, the collapsed note contains a
summary of its contents, obtained until now with this:
NPNote>>updateSummaryLabel
self contents ifNotNil:
[(self summaryMorph)
contents: (self contents asString withSeparatorsCompacted
contractTo: (32 min: self contents size "NEED TO CHANGE THIS
CODE"))]
What I would want to do instead is be able to get the maximum string
length that my summary can be set to without triggering a resize of
the title bar, hence the note. Right now, if I widen my note (via the
halo), my summary does not fill the title bar, i.e., note-collapsed-
wide.gif:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: note-collapsed-wide.gif
Type: image/gif
Size: 2609 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071129/b2c81644/note-collapsed-wide.gif
-------------- next part --------------
I am not sure if this is clear enough. Also, I hope the size of this
email (20K) doesn't cause too much trouble.
Thanks
Alex
>> 2. a StringMorph that contains a summary -- a contracted copy -- of
>> the stickie note's editor's contents. I would like the length of that
>> summary to depend on the width of the stickie note's title bar.
>
> I could use a ScrollableField instead, like in old versions of 3.10.
> Now I embed into a SystemWindow as some like more .
>
>> 3. a StringMorph instance that is set to the last modification date
>> of the stickie note.
> This is a very easy, you need a inst var like lastdate, and appropiate
> senders and getters to #lastdate.
>
> Then this should be a submorph, and the children morph have
> comeToFront in
> his initialize
>
>> So, question: how do I determine the maximum space that #2 can occupy
>> before provoking a resize of the stickie note, and given that stickie
>> note widths are left to user discretion, i.e., can and will vary.
>
> If you send a example of full text, contracted text, maybe more
> help come.
>
> Edgar
>
>
>
More information about the Squeak-dev
mailing list
|