From: Peter R. <ant...@gm...> - 2003-10-26 20:18:08
|
Hi, I have two problems here. First I cannot subclass PanelBar until I comment out some stuff in the constructor like that: function PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) { this.DynLayer = DynLayer; this.DynLayer(null,x,y,w,h,null); if (lyrmnu) { this.x = x; ... this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); } this.onPreCreate(PanelBar.PreCreateEvent); this.onCreate(PanelBar.CreateEvent); } } Is there any common pattern how to avoid problems with subclassing? Or am I doing something totally stupid in trying to subclass PanelBar? The next problem is that I can't enable the dragevents on my subclass of PanelBar until I change dragevent.js line 225 (enableDragEvents): if(lyr.isClass('DynLayer')) lyr.addEventListener(DragEvent.lyrListener); to lyr.addEventListener(DragEvent.lyrListener); That is bruteforce, I know ;) I just tried to figure out where the problem is. And I found that myPanelBarSubclass.isClass('DynLayer') yields false which I consider as wrong - it is a DynLayer since it is a subclass of PanelBar which is a subclass of DynLayer! The quickest fix I can imagine is to rewrite the isClass-method to tell whether any superclass matches the argument. I don't know if this breaks something, so I didn't try that yet. If I am trying to do something totally wrong then please tell me! Otherwise I will gladly help "fixing" the issues. Regards, Peter default disclaimer: DynAPI rules! ;) |
From: Raymond I. <xw...@ya...> - 2003-10-27 13:37:37
|
The problem PanelBar and isClass() is due to fact that the prototype was not created using dynapi.setPrototype() Instead of var p = PanelBar.prototype = new DynLayer it should be var p = dynapi.setPrototype('PanelBar','DynLayer'); -- Raymond Irving --- Peter Romianowski <ant...@gm...> wrote: > Hi, > > I have two problems here. First I cannot subclass > PanelBar until I > comment out some stuff in the constructor like that: > > function > PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) > { > > this.DynLayer = DynLayer; > this.DynLayer(null,x,y,w,h,null); > > if (lyrmnu) { > this.x = x; > ... > > this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); > } > > this.onPreCreate(PanelBar.PreCreateEvent); > this.onCreate(PanelBar.CreateEvent); > } > } > > Is there any common pattern how to avoid problems > with subclassing? Or > am I doing something totally stupid in trying to > subclass PanelBar? > > The next problem is that I can't enable the > dragevents on my subclass of > PanelBar until I change dragevent.js line 225 > (enableDragEvents): > > if(lyr.isClass('DynLayer')) > lyr.addEventListener(DragEvent.lyrListener); > > to > > lyr.addEventListener(DragEvent.lyrListener); > > That is bruteforce, I know ;) I just tried to figure > out where the > problem is. And I found that > myPanelBarSubclass.isClass('DynLayer') > yields false which I consider as wrong - it is a > DynLayer since it is a > subclass of PanelBar which is a subclass of > DynLayer! The quickest fix I > can imagine is to rewrite the isClass-method to tell > whether any > superclass matches the argument. I don't know if > this breaks something, > so I didn't try that yet. > > If I am trying to do something totally wrong then > please tell me! > Otherwise I will gladly help "fixing" the issues. > > Regards, > Peter > > default disclaimer: DynAPI rules! ;) > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The SF.net > Donation Program. > Do you like what SourceForge.net is doing for the > Open > Source Community? Make a contribution, and help us > add new > features and functionality. Click here: > http://sourceforge.net/donate/ > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ __________________________________ Do you Yahoo!? Exclusive Video Premiere - Britney Spears http://launch.yahoo.com/promos/britneyspears/ |
From: Peter R. <pet...@co...> - 2003-10-27 14:44:41
|
Hi, > Instead of var p = PanelBar.prototype = new DynLayer > it should be var p = > dynapi.setPrototype('PanelBar','DynLayer'); Ahhh, that makes everything clear! Works now. Will this be changed in the CVS too? This does not solve the problem I have with the constructor. I saw a discussion about the PanelBar before where someone suggested to move stuff out of the constructor. Will there be any fix to the PanelBar regarding this "issue" (not able to subclass it)? Keep up the good work, Peter > -- > Raymond Irving > > --- Peter Romianowski <ant...@gm...> wrote: > >>Hi, >> >>I have two problems here. First I cannot subclass >>PanelBar until I >>comment out some stuff in the constructor like that: >> >>function >> > > PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) > >>{ >> >> this.DynLayer = DynLayer; >> this.DynLayer(null,x,y,w,h,null); >> >> if (lyrmnu) { >> this.x = x; >> ... >> >> > > this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); > >> } >> >> this.onPreCreate(PanelBar.PreCreateEvent); >> this.onCreate(PanelBar.CreateEvent); >>} >>} >> >>Is there any common pattern how to avoid problems >>with subclassing? Or >>am I doing something totally stupid in trying to >>subclass PanelBar? >> >>The next problem is that I can't enable the >>dragevents on my subclass of >>PanelBar until I change dragevent.js line 225 >>(enableDragEvents): >> >>if(lyr.isClass('DynLayer')) >>lyr.addEventListener(DragEvent.lyrListener); >> >>to >> >>lyr.addEventListener(DragEvent.lyrListener); >> >>That is bruteforce, I know ;) I just tried to figure >>out where the >>problem is. And I found that >>myPanelBarSubclass.isClass('DynLayer') >>yields false which I consider as wrong - it is a >>DynLayer since it is a >>subclass of PanelBar which is a subclass of >>DynLayer! The quickest fix I >>can imagine is to rewrite the isClass-method to tell >>whether any >>superclass matches the argument. I don't know if >>this breaks something, >>so I didn't try that yet. >> >>If I am trying to do something totally wrong then >>please tell me! >>Otherwise I will gladly help "fixing" the issues. >> >>Regards, >>Peter >> >>default disclaimer: DynAPI rules! ;) >> >> >> >> > > ------------------------------------------------------- > >>This SF.net email is sponsored by: The SF.net >>Donation Program. >>Do you like what SourceForge.net is doing for the >>Open >>Source Community? Make a contribution, and help us >>add new >>features and functionality. Click here: >>http://sourceforge.net/donate/ >>_______________________________________________ >>Dynapi-Dev mailing list >>Dyn...@li... >> > > http://www.mail-archive.com/dyn...@li.../ > > > __________________________________ > Do you Yahoo!? > Exclusive Video Premiere - Britney Spears > http://launch.yahoo.com/promos/britneyspears/ > > > ------------------------------------------------------- > This SF.net email is sponsored by: The SF.net Donation Program. > Do you like what SourceForge.net is doing for the Open > Source Community? Make a contribution, and help us add new > features and functionality. Click here: http://sourceforge.net/donate/ > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li... > http://www.mail-archive.com/dyn...@li.../ > > -- Peter Romianowski coreg Brunnenstraße 153 10115 Berlin Telefon: 030 / 41 72 42 31 Fax: 030 / 41 72 42 39 Email: mailto:rom...@co... Website: http://www.coreg.de |
From: Daniel T. <de...@ti...> - 2003-10-27 19:15:32
|
Hi Peter, I am the one to blame :) Have had very little time right now, but I will try to fix the panel bar, would also be great to see what you have done with it. Regards Daniel Tiru -----Original Message----- From: dyn...@li... [mailto:dyn...@li...] On Behalf Of Peter Romianowski Sent: den 27 oktober 2003 15:41 To: dyn...@li... Subject: Re: [Dynapi-Dev] Problems in inheritence (General and PanelBar) Hi, > Instead of var p =3D PanelBar.prototype =3D new DynLayer > it should be var p =3D dynapi.setPrototype('PanelBar','DynLayer'); Ahhh, that makes everything clear! Works now. Will this be changed in the CVS too? This does not solve the problem I have with the constructor. I saw a discussion about the PanelBar before where someone suggested to move stuff out of the constructor. Will there be any fix to the PanelBar regarding this "issue" (not able to subclass it)? Keep up the good work, Peter > -- > Raymond Irving >=20 > --- Peter Romianowski <ant...@gm...> wrote: >=20 >>Hi, >> >>I have two problems here. First I cannot subclass >>PanelBar until I >>comment out some stuff in the constructor like that: >> >>function >> >=20 > PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) >=20 >>{ >> >> this.DynLayer =3D DynLayer; >> this.DynLayer(null,x,y,w,h,null); >> >> if (lyrmnu) {=09 >> this.x =3D x; >> ... >> =20 >> >=20 > this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); >=20 >> } >> =09 >> this.onPreCreate(PanelBar.PreCreateEvent); >> this.onCreate(PanelBar.CreateEvent); >>} >>} >> >>Is there any common pattern how to avoid problems >>with subclassing? Or >>am I doing something totally stupid in trying to >>subclass PanelBar? >> >>The next problem is that I can't enable the >>dragevents on my subclass of >>PanelBar until I change dragevent.js line 225 >>(enableDragEvents): >> >>if(lyr.isClass('DynLayer'))=20 >>lyr.addEventListener(DragEvent.lyrListener); >> >>to >> >>lyr.addEventListener(DragEvent.lyrListener); >> >>That is bruteforce, I know ;) I just tried to figure >>out where the >>problem is. And I found that >>myPanelBarSubclass.isClass('DynLayer')=20 >>yields false which I consider as wrong - it is a >>DynLayer since it is a=20 >>subclass of PanelBar which is a subclass of >>DynLayer! The quickest fix I=20 >>can imagine is to rewrite the isClass-method to tell >>whether any=20 >>superclass matches the argument. I don't know if >>this breaks something,=20 >>so I didn't try that yet. >> >>If I am trying to do something totally wrong then >>please tell me! >>Otherwise I will gladly help "fixing" the issues. >> >>Regards, >>Peter >> >>default disclaimer: DynAPI rules! ;) >> >> >> >> >=20 > ------------------------------------------------------- >=20 >>This SF.net email is sponsored by: The SF.net >>Donation Program. >>Do you like what SourceForge.net is doing for the >>Open >>Source Community? Make a contribution, and help us >>add new >>features and functionality. Click here: http://sourceforge.net/donate/ >>_______________________________________________ >>Dynapi-Dev mailing list >>Dyn...@li... >> >=20 > http://www.mail-archive.com/dyn...@li.../ >=20 >=20 > __________________________________ > Do you Yahoo!? > Exclusive Video Premiere - Britney Spears=20 > http://launch.yahoo.com/promos/britneyspears/ >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: The SF.net Donation Program. Do you > like what SourceForge.net is doing for the Open Source Community? =20 > Make a contribution, and help us add new features and functionality.=20 > Click here: http://sourceforge.net/donate/=20 > _______________________________________________ > Dynapi-Dev mailing list > Dyn...@li...=20 > http://www.mail-archive.com/dyn...@li.../ >=20 >=20 --=20 Peter Romianowski coreg Brunnenstra=DFe 153 10115 Berlin Telefon: 030 / 41 72 42 31 Fax: 030 / 41 72 42 39 Email: mailto:rom...@co... Website: http://www.coreg.de ------------------------------------------------------- This SF.net email is sponsored by: The SF.net Donation Program. Do you like what SourceForge.net is doing for the Open Source Community? Make a contribution, and help us add new features and functionality. Click here: http://sourceforge.net/donate/ _______________________________________________ Dynapi-Dev mailing list Dyn...@li... http://www.mail-archive.com/dyn...@li.../ |
From: Peter R. <ant...@gm...> - 2003-10-27 19:43:53
|
Hi Daniel, > Hi Peter, I am the one to blame :) to blame for these cool tiny widget ;) Whould it be acceptable if I rewrite the PanelBar a bit so that it follows the dynapi-class-paradigm and is "subclassable" (does this word really exist? ;) ? > Have had very little time right now, but I will try to fix the panel > bar, would also be great to see what you have done with it. I am writing something like a windowmanager (for mdi-environments). I hope I can write it "abstract" enough so I can share it - the current development is highly directed towards our current (special) needs though. Regards, Peter > Regards > Daniel Tiru > > -----Original Message----- > From: dyn...@li... > [mailto:dyn...@li...] On Behalf Of Peter > Romianowski > Sent: den 27 oktober 2003 15:41 > To: dyn...@li... > Subject: Re: [Dynapi-Dev] Problems in inheritence (General and PanelBar) > > > Hi, > > >>Instead of var p = PanelBar.prototype = new DynLayer >>it should be var p = dynapi.setPrototype('PanelBar','DynLayer'); > > > Ahhh, that makes everything clear! Works now. Will this be changed in > the CVS too? > > This does not solve the problem I have with the constructor. I saw a > discussion about the PanelBar before where someone suggested to move > stuff out of the constructor. Will there be any fix to the PanelBar > regarding this "issue" (not able to subclass it)? > > Keep up the good work, > > Peter > > > >>-- >>Raymond Irving >> >>--- Peter Romianowski <ant...@gm...> wrote: >> >> >>>Hi, >>> >>>I have two problems here. First I cannot subclass >>>PanelBar until I >>>comment out some stuff in the constructor like that: >>> >>>function >>> >> >>PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) >> >> >>>{ >>> >>> this.DynLayer = DynLayer; >>> this.DynLayer(null,x,y,w,h,null); >>> >>> if (lyrmnu) { >>> this.x = x; >>> ... >>> >>> >> >>this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); >> >> >>> } >>> >>> this.onPreCreate(PanelBar.PreCreateEvent); >>> this.onCreate(PanelBar.CreateEvent); >>>} >>>} >>> >>>Is there any common pattern how to avoid problems >>>with subclassing? Or >>>am I doing something totally stupid in trying to >>>subclass PanelBar? >>> >>>The next problem is that I can't enable the >>>dragevents on my subclass of >>>PanelBar until I change dragevent.js line 225 >>>(enableDragEvents): >>> >>>if(lyr.isClass('DynLayer')) >>>lyr.addEventListener(DragEvent.lyrListener); >>> >>>to >>> >>>lyr.addEventListener(DragEvent.lyrListener); >>> >>>That is bruteforce, I know ;) I just tried to figure >>>out where the >>>problem is. And I found that >>>myPanelBarSubclass.isClass('DynLayer') >>>yields false which I consider as wrong - it is a >>>DynLayer since it is a >>>subclass of PanelBar which is a subclass of >>>DynLayer! The quickest fix I >>>can imagine is to rewrite the isClass-method to tell >>>whether any >>>superclass matches the argument. I don't know if >>>this breaks something, >>>so I didn't try that yet. >>> >>>If I am trying to do something totally wrong then >>>please tell me! >>>Otherwise I will gladly help "fixing" the issues. >>> >>>Regards, >>>Peter >>> >>>default disclaimer: DynAPI rules! ;) >>> >>> >>> >>> >> >>------------------------------------------------------- >> >> >>>This SF.net email is sponsored by: The SF.net >>>Donation Program. >>>Do you like what SourceForge.net is doing for the >>>Open >>>Source Community? Make a contribution, and help us >>>add new >>>features and functionality. Click here: http://sourceforge.net/donate/ >>>_______________________________________________ >>>Dynapi-Dev mailing list >>>Dyn...@li... >>> >> >>http://www.mail-archive.com/dyn...@li.../ >> >> >>__________________________________ >>Do you Yahoo!? >>Exclusive Video Premiere - Britney Spears >>http://launch.yahoo.com/promos/britneyspears/ >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: The SF.net Donation Program. Do you > > >>like what SourceForge.net is doing for the Open Source Community? >>Make a contribution, and help us add new features and functionality. >>Click here: http://sourceforge.net/donate/ >>_______________________________________________ >>Dynapi-Dev mailing list >>Dyn...@li... >>http://www.mail-archive.com/dyn...@li.../ >> >> > > |
From: Peter R. <ant...@gm...> - 2003-10-28 12:41:47
Attachments:
panelbar.js
dynapi.gui.panelbar-stacker.html
|
... sorry for the repost - my mua always insists to send with my default emailadress as sender ... :( Hi Daniel and all, here's a fixed version of the panelbar.js and the updated example. You'll find the following changes in there: - Added proper prototype-command: var p = dynapi.setPrototype('PanelBar','DynLayer'); - Removed csscontent and cssmenu from constructor - Moved most of the init-code to the PreCreate-event. That way there is no problem with subclassing anymore. - Added the possibility to construct a PanelBar with pure HTML instead of layers, i.e. var pb = new PanelBar ('My Menu', 'My Content',...) creates a proper PanelBar. You can still construct the PanelBar with layers of course! - Added getContentLayer and getMenuLayer I discussed the whole panelbar-stuff with Daniel yesterday. We decided to build a window-widget with the following functionality: - Menubar, Content, Status-Bar (optional) - Dragable - Minimize, Maximize, Resize, Close with each action firing an event (especially close might be important ;) - Based on ViewPane or something similar (scrolling mechanism) - When using multiple windows add a proper focus handling A widget of that kind I need anyway for my current project so I think it is best to develop it as a basic and reusable widget for the dynapi. And Daniel already comited to help or better start writing that thing ;) Has anyone already done such thing (a window-widget)? Any other suggestions, comments etc. are welcome, of course! Regards, Peter ..: If wanted I can send diffs of course... Daniel Tiru wrote: > Hi Peter, I am the one to blame :) > > Have had very little time right now, but I will try to fix the panel > bar, would also be great to see what you have done with it. > > Regards > Daniel Tiru > > -----Original Message----- > From: dyn...@li... > [mailto:dyn...@li...] On Behalf Of Peter > Romianowski > Sent: den 27 oktober 2003 15:41 > To: dyn...@li... > Subject: Re: [Dynapi-Dev] Problems in inheritence (General and PanelBar) > > > Hi, > > >>Instead of var p = PanelBar.prototype = new DynLayer >>it should be var p = dynapi.setPrototype('PanelBar','DynLayer'); > > > Ahhh, that makes everything clear! Works now. Will this be changed in > the CVS too? > > This does not solve the problem I have with the constructor. I saw a > discussion about the PanelBar before where someone suggested to move > stuff out of the constructor. Will there be any fix to the PanelBar > regarding this "issue" (not able to subclass it)? > > Keep up the good work, > > Peter > > > >>-- >>Raymond Irving >> >>--- Peter Romianowski <ant...@gm...> wrote: >> >> >>>Hi, >>> >>>I have two problems here. First I cannot subclass >>>PanelBar until I >>>comment out some stuff in the constructor like that: >>> >>>function >>> >> >>PanelBar(lyrmnu,lyrcnt,mnuheight,x,y,w,h,mnucss,cntcss,minimized) >> >> >>>{ >>> >>> this.DynLayer = DynLayer; >>> this.DynLayer(null,x,y,w,h,null); >>> >>> if (lyrmnu) { >>> this.x = x; >>> ... >>> >>> >> >>this.menu.setHTML(this._mnuhtml.replace('{@min}',this._mnuhtmlmax)); >> >> >>> } >>> >>> this.onPreCreate(PanelBar.PreCreateEvent); >>> this.onCreate(PanelBar.CreateEvent); >>>} >>>} >>> >>>Is there any common pattern how to avoid problems >>>with subclassing? Or >>>am I doing something totally stupid in trying to >>>subclass PanelBar? >>> >>>The next problem is that I can't enable the >>>dragevents on my subclass of >>>PanelBar until I change dragevent.js line 225 >>>(enableDragEvents): >>> >>>if(lyr.isClass('DynLayer')) >>>lyr.addEventListener(DragEvent.lyrListener); >>> >>>to >>> >>>lyr.addEventListener(DragEvent.lyrListener); >>> >>>That is bruteforce, I know ;) I just tried to figure >>>out where the >>>problem is. And I found that >>>myPanelBarSubclass.isClass('DynLayer') >>>yields false which I consider as wrong - it is a >>>DynLayer since it is a >>>subclass of PanelBar which is a subclass of >>>DynLayer! The quickest fix I >>>can imagine is to rewrite the isClass-method to tell >>>whether any >>>superclass matches the argument. I don't know if >>>this breaks something, >>>so I didn't try that yet. >>> >>>If I am trying to do something totally wrong then >>>please tell me! >>>Otherwise I will gladly help "fixing" the issues. >>> >>>Regards, >>>Peter >>> >>>default disclaimer: DynAPI rules! ;) >>> >>> >>> >>> >> >>------------------------------------------------------- >> >> >>>This SF.net email is sponsored by: The SF.net >>>Donation Program. >>>Do you like what SourceForge.net is doing for the >>>Open >>>Source Community? Make a contribution, and help us >>>add new >>>features and functionality. Click here: http://sourceforge.net/donate/ >>>_______________________________________________ >>>Dynapi-Dev mailing list >>>Dyn...@li... >>> >> >>http://www.mail-archive.com/dyn...@li.../ >> >> >>__________________________________ >>Do you Yahoo!? >>Exclusive Video Premiere - Britney Spears >>http://launch.yahoo.com/promos/britneyspears/ >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: The SF.net Donation Program. Do you > > >>like what SourceForge.net is doing for the Open Source Community? >>Make a contribution, and help us add new features and functionality. >>Click here: http://sourceforge.net/donate/ >>_______________________________________________ >>Dynapi-Dev mailing list >>Dyn...@li... >>http://www.mail-archive.com/dyn...@li.../ >> >> > > |