From: Kevin <ke...@ke...> - 2003-08-07 17:06:30
|
Raymond wrote: > The StyleManager is not about CSS. It's about being > able to apply javascript functions to an exiting > widget to modify it's functions, change it's look and > it's behavior. > > For example you can use the StyleManager to convert an > ordinary DynLayer into a button widget by just > applying the "ButtonStyle". Later you could then > change that layer into a ProgressBar by just applying > the "ProgressBarStyle". > > IMO it's a completely modular and fashionable way to > design DynAPI widgets. With StyleManager a basic > widget can be morphed into another widget by just > simply changing the style. My thinking is: button1=new Button() button1.setHighLight(...) progressbar1=new ProgressBar() progressbar1.setScale(...) ... Morph button1 to a progressbar ... button1.setScale(..) ? How would we know button1 has new methods as setScale() was before meaningless for a button? button1 and progessbar1 are instances of their own class with separate attributes and methods. Morphing button1 to a progressbar? Ok fine, but morphing 'setStyle(...) or maybe setMorph(...)' is not a method of either class but more a method of a management class not related to (or inherited from) a DynLayer. Perhaps an example would help in understanding what is intended in an OOP context. Thanks. - Kevin. > > With an established interface it is preferable to > > add to, > > rather than change and break backward compatibility > > Ok, I guess we'll just keep the 7th argument and use > setStyle() to change styles on DynLayers. > > -- > Raymond Irving > |