Ever tried my ccreation.layerpos.js widget. I use it for dynamic layouts like this (inside the head tag):
DynAPI.setLibraryPath('dynapi/src/lib/')
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.event.*');
DynAPI.include('dynapi.gui.label.js');
DynAPI.include('dynapi.gui.loadpanel');
DynAPI.include('dynapi.gui.dynimage');
DynAPI.include('dynapi.ext.inline.js');
DynAPI.include('ccreation.ext.layerpos'); // my widget under
dynapi/src/lib(/ccreation/ext/
origX=1024 // screenwidth while developing the layout
origY=800 // screenheight while developing the layout
DynAPI.onLoad=function() {
this.document.w = this.document.getWidth(); //just for secure compability
this.document.h = this.document.getHeight();
Xscale=this.document.w/origX; // gets the width division
Yscale=this.document.h/origY; // gets the height division
// here's an example of an image that resizes and positions smoothly to the
// according to current screenwidth
logoimg = DynImage.getImage('img01.gif');
CClogo = new DynImage(logoimg);
CClogo.setSize(218*Xscale,30*Xscale);
CClogo.setZIndex(5)
DynAPI.document.addChild(CClogo);
CClogo.positionInParent('topleft',3*Xscale,3*Xscale);
// an inline layer can be positioned as well
var CCiconbar = this.document.getAll()['iconbar']
CCiconbar.setZIndex(5)
// notice that in this case there's no addChild method so
// we can position as soon as we got the variable reference
CCiconbar.positionInParent('bottomright',2*Xscale,2*Xscale);
CCiconbar.setVisible(true);
}
what you do to have it resize is to add a a onresize function (I've found that this is
best put inside the document body):
DynAPI.onResize=function() {
// all screenproperties have been rerendered (at least in some browsers it seems)
// so we must regrab 'em
this.document.w = this.document.getWidth();
this.document.h = this.document.getHeight();
Xscale=this.document.w/origX;
Yscale=this.document.h/origY
// layers properties is still there, except all sizes and positions of course ;)
// need to regrab 'em to
CClogo.setSize(218*Xscale,30*Xscale);
CClogo.positionInParent('topleft',3*Xscale,3*Xscale);
var CCiconbar = this.document.getAll()['iconbar']
CCiconbar.positionInParent('bottomright',2*Xscale,2*Xscale);
var CCleftsidebar = this.document.getAll()['leftsidebar']
CCleftsidebar.positionInParent('middleleft',4*Xscale,4*Yscale);
}
just let me know if you want my widget to play with (but you can still find it at
richard's site I think) :)
Henrik V�glin [ [EMAIL PROTECTED] ]
----- Original Message -----
From: "Doug Melvin" <[EMAIL PROTECTED]>
To: "Laszlo Teglas" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Wednesday, November 28, 2001 5:14 PM
Subject: Re: [Dynapi-Dev] Questions of Direction
> While where at it, a grid-bag layout manager would be nice..
>
> ----- Original Message -----
> From: "Laszlo Teglas" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Wednesday, November 28, 2001 10:48 AM
> Subject: RE: [Dynapi-Dev] Questions of Direction
>
>
> > Good Points!
> >
> > >Finding a way of developing a leaner/more customisable set of widgets is
> > >something that really interests me, same goes for the animation code -
> but
> > >as things stand at the moment I don't feel confident that anything I
> could
> > >contribute would actually ever make it into part of the project.
> >
> > I would be interested in developing a set of widgets, that would function
> > similar to the JAVA Swing Set. You know of the generic type:
> >
> > Button, CheckBox, CheckBoxMenuItem, ColorChooser, ComboBox, Component,
> > DesktopPane, Dialog, Frame, InternalFrame, Label, LayeredPane, List, Menu,
> > MenuBar, MenuItem, OptionPane, Panel, PopupMenu, ProgressBar, RadioButton,
> > RadioButtonMenuItem, ScrollBar, ScrollPane, Slider, SplitPane, TabbedPane,
> > Table, TextArea, TextField, TextPane, ToolBar, ToolTip, Tree, Viewport,
> > Window
> >
> > Along with Utilities like:
> > BorderManager, ThemeManager, LayoutManager
> >
> > +/- a few widgets
> >
> > NanoFace =;^)
> >
> >
> >
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED]]On Behalf Of Colin
> > Thompson
> > Sent: November 27, 2001 5:53 PM
> > To: [EMAIL PROTECTED]
> > Subject: [Dynapi-Dev] Questions of Direction
> >
> >
> > Hi all,
> >
> > Before I get to my questions I think i should tell you a bit about myself
> > and let you know what I get personally from this API. To me, playing
> around
> > with this project is a hobby, something I tinker with in my spare time
> just
> > for personal knowledge. I have no formal web design or programming
> training,
> > like a lot of people out there and maybe like some of the other more
> silent
> > members on the list I started out with Notepad creating simple web pages
> for
> > friends - discovered the wonders of javascript, css etc, DynAPI 1 and
> maybe
> > 18 months or so ago I found DynAPI 2 and became hooked. I'm mostly a
> lurker
> > who reads the various posts etc and then tries out some of the ideas
> > discussed on my own personal copy for fun- I enjoy feeling a part of all
> > this even though I don't take an active roll in it...
> >
> > Now maybe as just a hobbyist I'm "sticking my nose in" so to speak, but
> I'll
> > go ahead and say what I want to say and hope I don't annoy anyone :)
> >
> > With Dan's announcement that his gui widgets will be released as a kind of
> > 'retail pack' Does that mean that none of the improvements/enhancements
> > whatever can filter back into the current code and still keep within the
> > license?
> >
> > Also the comment Dan made about nobody contributing widgets back into the
> > project is a little unfair I feel. In the eighteen months that I've been
> > following things, no new widgets have been added to the distribution - but
> I
> > think that is because nobody has bothered packaging the newer stuff up -
> it
> > usually just goes to Richards site and becomes reference material. And yet
> > some of those widgets are to my mind superior to the 'standard' versions
> in
> > many ways.
> >
> > I don't know, perhaps nobody has actually come out and said "I think my
> > widget is better/smaller/more efficient than core widget X, so would you
> > consider it as a replacement" Or perhaps most of the developers are more
> > interested in what happens in the event system/dynlayer.js etc to be
> > interested in adding new or impoved gui/anim/util components?
> >
> > Another thing that has been mentioned is the fact that everyone recreates
> > the gui widgets to suit there own 'style' or current project or whatever.
> So
> > what are all the extra components in the distribution for? They get all
> the
> > attention - bug fixes posted to the lists - tests on the compatibility
> > matrix , updated for each new release etc. They will probably even get
> > documented or have tutorials written for them soon... but why? They are in
> > effect just window dressing aren't they? Nobody in their right mind would
> > consider building a relatively complex interface that uses button.js or
> > list.js etc it would be huge!
> >
> > Would it not be more useful to break off the core API as it is now into a
> > seperate zip file? ie release the core components (api & events) as one
> zip
> > file - perhaps the animation stuff as another and then the gui components
> as
> > yet another? That way the people that want to concentrate on the core
> (Jordi
> > etc) will carry on with what they do best, releasing an updated engine -
> and
> > it leaves things open for some of us to 'give back' by way of gui
> components
> > etc. As things are now I think most of the regulars download a 130k
> zipfile
> > and then throw about 90k away.
> >
> > The DynAPI homepage could become a repository for all kinds of different
> > extensions to the core - you could go and download the latest dynapi.zip
> and
> > then choose danwidgets.zip or tinywidgets.zip, or whatever suits what your
> > working on and they would all benefit from being enhanced/supported as
> part
> > of the over all DynAPI.
> >
> > Finding a way of developing a leaner/more customisable set of widgets is
> > something that really interests me, same goes for the animation code - but
> > as things stand at the moment I don't feel confident that anything I could
> > contribute would actually ever make it into part of the project. We have
> the
> > same old widgets we have always had and that seems to be the way of
> things.
> > Sure I could go ahead and release some code on a corner of the web
> > someplace, maybe even do the same as Michael Pemberton or Pascal and make
> > another distro -but as I said, I'm a hobbyist and don't have the benefit
> of
> > browser X and OS Y to test everything on, so anything I released outside
> the
> > project would probably just 'fall by the wayside' so to speak.
> >
> > There seems to be a plan/design for the core elements but everything else
> > seems to be tacked on to that. Would anyone be interested in working with
> me
> > in actually laying down a draft or plan of what could become a replacement
> > for some of those components? I suspect that most of you out there think
> 'I
> > can improve that' about some of the code - why don't we tackle it properly
> > with a coherent design plan so that people can actually download and use
> > some gui widgets 'out of the box' instead of reinventing the wheel so
> much.
> >
> > Sorry for the length of the post - I got carried away. :)
> >
> >
> >
> >
> >
> >
> >
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> > http://www.mail-archive.com/[email protected]/
> >
> >
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> > http://www.mail-archive.com/[email protected]/
>
>
> _______________________________________________
> Dynapi-Dev mailing list
> [EMAIL PROTECTED]
> http://www.mail-archive.com/[email protected]/
layerpos.js
Description: Binary data
