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?

Edgar J. De Cleene edgardec2001 at yahoo.com.ar
Thu Nov 29 13:43:19 UTC 2007




El 11/29/07 10:03 AM, "Alexandre Rousseau" <alexr at mailsnare.net> escribió:

> 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).
> ?
> ?
> ?
> 
>>> 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.
> ?
> ?
> ?
> 
> 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:
> ?
> ?
> ?
> 
> 
> 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



>> 
Alexandre :

Very clear now, and you could put any pict as attached.
The max size on this list is 100 k on newbies is only 40 k.
The most easy way is changing name overriding #collapse , as you could see
in this very quick and dirty using current "history of 3.10 " as example.
You could see what if I change arbritray the name to "Pepe", the collapsed
label shows  only this four letters.

If still unclear, send new mail.


Edgar

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Picture 3.png
Type: application/octet-stream
Size: 46331 bytes
Desc: not available
Url : http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20071129/732fedfe/Picture3.obj


More information about the Squeak-dev mailing list