IMO I think it's very useful in many areas for
example, LoadPanels, Labels, etc. It would not require
the user to overload the setSize function or listen to
onresize to adjust the size of the layer.

By default it would be turned off. To activate
auto-resize the user will have to use setAutoSize(w,h)
where w and h must be either true or false. If w
and/or h is set to false then it will disable
auto-resizing for that part of the layer.

I think it should go on DynLayer. Do you agree.?

--
Raymond Irving 

--- Leif W <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm not too sure where it should go, but I'd think
> about where it's most
> frequently going to be used, in DynLayer or
> TemplateManager?  I followed the
> discussion but have not tried any of my own tests. 
> The question came up
> related to TemplateManager, but is it a general
> enough thing that it would
> be useful in DynLayer?.  Is it something that will
> be useful to have on the
> DynLayer as an option which can be turned on or off
> (i.e. off by default,
> and TemplateManager could turn it on, etc.).
> 
> Leif
> 
> ----- Original Message ----- 
> From: "Raymond Irving" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, August 17, 2003 11:02 AM
> Subject: [Dynapi-Dev] Re: [Dynapi-Help] Dynapi3
> getContentWidth and Template
> 
> 
> > Hello Everyone,
> >
> > I just have one simply question:
> >
> > Should the setAutoSize() function be added
> > to DynLayer or to TemplateManager? (see below for
> more
> > info)
> >
> > --
> > Raymond Irving
> >
> >
> > --- Raymond Irving <[EMAIL PROTECTED]> wrote:
> > >
> > > This might call for a setAutoSize() function on
> > > either
> > > DynLayer or TemplateManager.
> > >
> > > lyr.setAutoSize(true) // will adjust the size of
> the
> > > layer everytime its content changes or a new
> child
> > > is
> > > added.
> > >
> > > lyr.setAutoSize(false) // will disable
> auto-resize
> > >
> > > Sometime ago I had create such a function for
> use in
> > > one of my test systems. Should this function be
> > > added
> > > to DynLayer or to TemplateManager?
> > >
> > > --
> > > Raymond Irving
> > >
> > >
> > > --- [EMAIL PROTECTED] wrote:
> > > >
> > > > Okay, what is the correct way to do the
> following
> > > > then:
> > > >
> > > >   Have containers sized so that the entirety
> of
> > > > their contents are
> > > >   visible.
> > > >
> > > >
> > > > I have a template that I change the content
> of. I
> > > > want the object it
> > > > is in display the entire template contents.
> > > >
> > > > And so on up the tree of containers till I get
> to
> > > > the dynapi.document.
> > > >
> > > > Basically, I have templates and other objects
> that
> > > > change as the user
> > > > interacts with the page. I want the entire
> content
> > > > to be visible to
> > > > the user.
> > > >
> > > >
> > > >
> > > > > Hi,
> > > > >
> > > > > Let me see if I can explain what's on:
> > > > >
> > > > >
> > > > > DynAPI.onLoad(init);
> > > > > function init() {
> > > > > var body = 'I am a simply layer, what is my
> > > size,
> > > > > oldWidth is my size before we fill in a
> template
> > > > > field, newWidth is the size afterwards.
> > > [EMAIL PROTECTED]';
> > > > > var sizeTemplate = new Template(body);
> > > > > dynapi.document.addChild(sizeTemplate);
> > > > >
> > > > > // ^ At this point sizeTemplate is created
> and
> > > > given
> > > > > a
> > > > > // width and a height. This is by design. if
> no
> > > > > height or width
> > > > > // was specified then DynAPI will assign a
> > > height
> > > > and
> > > > > a width to
> > > > > // the layer once it's created.
> > > > >
> > > > >
> > > > > sizeTemplate.addChild(new
> > > > DynLayer('hello'),'field');
> > > > > sizeTemplate.generate();
> > > > >
> > > > > // ^ At this point the DynLayer is added to
> the
> > > > > templated but
> > > > > // due to text wrapping you'll not see the
> word
> > > > > "hello"
> > > > > // to see the new layer modify your code
> above
> > > to
> > > > > reflect:
> > > > > // var sizeTemplate = new
> > > > > Template(body,null,null,null,50);
> > > > >
> > > > > The problem you're having is that once the
> he
> > > > Template
> > > > > gets a width assigned to it, it will start
> text
> > > > > wrapping. That's why you are not able to see
> the
> > > > > 'hello' layer or get a different width. The
> > > > > getContentHeight() function should however
> > > reflect
> > > > a
> > > > > new height.
> > > > >
> > > > > Notes. If you call getWidth() on a layer
> that
> > > you
> > > > did
> > > > > specify a width for you'll get a 0 or null
> > > value.
> > > > >
> > > > >
> > > > > --
> > > > > Raymond Irving
> > > > >
> > > > > --- [EMAIL PROTECTED] wrote:
> > > > > > I originally had my size check in the
> onload
> > > > > > function. Then I moved it
> > > > > > to the body as I miss-understood Raymond's
> > > > response.
> > > > > >
> > > > > > This test file has the code back in the
> > > > onload/init
> > > > > > function per
> > > > > > Raymond's last message. The behavior is
> the
> > > > same.
> > > > > >
> > > > > >
> > > > > >
> > > > > ---------------------------------
> > > > > GetWidth & GetContentWidth test page
> > > > > dynapi.library.setPath('dynapi3x/src/')
> > > > > dynapi.library.include('dynapi.library');
> > > > > dynapi.library.include('dynapi.api');
> > > > >
> > > >
> > >
> >
>
dynapi.library.include('TemplateManager');DynAPI.onLoad(init);function
> > > > > init() { var body = 'I am a simply layer,
> what
> > > is
> > > > my
> > > > > size, oldWidth is my size before we fill in
> a
> > > > template
> > > > > field, newWidth is the size afterwards.
> 
=== message truncated ===


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to