Well, I must say the widget looks good! It's light
weight (small in size) and very simple.

Note the following shortcuts:

1) The arguments x, y, w, h, caption, bgColor,
fgColor, vAlign, hAlign might be too long for a user
to rememer them all. why not use the dual parameter
(or dictionary) option found in DynLayer. This way a
user can choose which way he/she wants to use:


function
DynButton(x,y,w,h,caption,bgColor,fgColor,vAlign,hAlign){

        if (x && x.constructor==Object){
                var args=x; // dictionary input
                x = args.x;
                y = args.y;
                w = args.w;
                h = args.h;
                caption = args.caption;
                bgColor= args.bgColor;
                fgColor = args.fgColor;
                vAlign = args.vAlign;
                hAlign = args.hAlign;
        }

        this.DynLayer = DynLayer;

this.DynLayer(null,(x||0),(y||0),(w||16),(h||200),(bgColor||'#CCCCCC'));

        this.id = "DynButton"+(DynButton.Count++);

        //this.setLocation(x||0,y||0);
        //this.setSize(w||16,h||200);

        this.fgColor=fgColor||'black';
        //this.setBgColor(bgColor||'#CCCCCC');

        this.vAlign=vAlign||"middle";
        this.hAlign=hAlign||"center";

        this.state=0;//0=up, 1=down
        this.addChild(new
DynLayer(null,0,0,this.getWidth(),this.getHeight()),'label');
        this.setCaption(caption||'');
    this.enableBlackboard();
    this.label.setTextSelectable(false);
        this.label.addEventListener(this.mouseEvt);
        this.setState(0);
        return this;
};


2) Instead of:
this.label=this.addChild(new
DynLayer(null,0,0,this.getWidth(),this.getHeight()));

you can do:

this.addChild(new
DynLayer(null,0,0,this.getWidth(),this.getHeight()),'label');


3) you can disable text selecting with:

this.label.setTextSelectable(false);

4) Why are you using setting your own id?

this.id = "DynButton"+(DynButton.Count++);
// the above will not work with this+'.setCaption()'


Best regards,

--
Raymond Irving


--- Doug Melvin <[EMAIL PROTECTED]> wrote:
> holey shit.. sorry.
> ----- Original Message ----- 
> From: "Raymond Irving" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, March 27, 2003 8:17 PM
> Subject: Re: [Dynapi-Dev] DynButton
> 
> 
> > 
> > Hmmm... Where are the files?
> > 
> > --
> > Raymond Irving
> > 
> > --- Doug Melvin <[EMAIL PROTECTED]>
> wrote:
> > > Her ya go..
> > > AS always, the HTMl file goes into your examples
> > > dirctory, and the js file goes 
> > > into your src/gui/ directory..
> > > 
> > > Comment, complains, suggestions?
> > > I think about adding a depth parameter, this
> ould be
> > > handles with the table border size in IE/DOM
> > > and with extra tables in NS..
> > > Note that ALL parameters have associated get and
> set
> > > methods..
> > > :-)
> > > Now for the scrollbar
> > 
> > 
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Platinum - Watch CBS' NCAA March Madness,
> live on your desktop!
> > http://platinum.yahoo.com
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.net email is sponsored by:
> > The Definitive IT and Networking Event. Be There!
> > NetWorld+Interop Las Vegas 2003 -- Register today!
> >
>
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
> > _______________________________________________
> > Dynapi-Dev mailing list
> > [EMAIL PROTECTED]
> >
>
http://www.mail-archive.com/[EMAIL PROTECTED]/
> > 

> ATTACHMENT part 2 application/x-compressed
name=DynButton.zip



__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Dynapi-Dev mailing list
[EMAIL PROTECTED]
http://www.mail-archive.com/[EMAIL PROTECTED]/

Reply via email to