Hi Peter,

On Tuesday March 9 2010 16:19:45 Peter Schneider wrote:
> I am currently completely lost on my quest to migrate a simple custom
> widget. I've attached the 0.7.4-style class to give an idea of what is
> should do.
> 
> Here's my problem: I'm completely lost somewhere between 'bom', 'dom' and
> 'html' ;)
BOM is (mainly) the abstraction layer for all browsers. DOM provides methods 
to interact with the DOM (suprising, I know :) ) and HTML is the layer between 
the DOM and the UI core (widget) layer. Adding some features like queuing and 
other neat stuff.

You probably should extend a given widget and customize it.

> I tried to understand the concept by reading the "Custom Widgets"[1]
> documentation but somehow I think I am not going into the right direction.
> 
> The "widget" I've attached should do the following:
> 1) Be a singleton...there can be (needs to be) only one
Same in 1.0.x -> "type : "singleton"

> 2) Depending on the client engine ("mshtml" vs. "default") insert a
>    <bgsound> or a <embed> HTML-Element.
> 3) Inserts itself (once) into the DOM somewhere
You can use the class "qx.ui.embed.Html" as your base class and customize it. 

Two things to do:
  * instead of checking for "null" at construct you can directly call 
"setHtml"
  * take a look at the "_applyHtml" method. Just take your HTML code and add 
it as "html" attribute to the "contentElement" (retrieved with 
"getContentElement")

This should do the job if you distinguish the HTML code to insert inside the 
"_applyHtml" method.
 
> So the widget itself is relatively simple...but as I mentioned above, I'm
> more confused than I like to be :-/
Hopefully, things are getting clearer now.

> Do I really have to implement a class in 'html' and 'bom' namespace (like
> IFrame or Flash e.g.)?
No. You only need to extend an existing widget and customize it. The split 
into the different namespaces is only to be able to separate the low-level from 
the high-level code.

> As you can see, I replaced (removeChild, appendChild) the complete element
> on each _syncHtml() call; this might not necessary anymore, because if I
> am understanding the new concept correct, I can overwrite the
> _applyProperty method, can't I?
Use the "_applyHtml" method to show that you are actually manipulating HTML 
code of the embed.

But you need to remove the line "addToDocument", since in 0.8+ you need to add 
the widget to a container with a proper layout.


cheers,
  Alex

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to