1st: Sorry for the "triple-posts", I had problems accessing news.gmane.org
     via NNTP yesterday...


Hi Alex,

thanks for your "insights".

I got myself into extending qx.ui.embed.Html already, but was not able to
completely solve all my problems.
But thanks to you, I'm more confident ;)

I understand, that "addToDocument" can not be used anymore, I already tried
several container/layout/add approaches....with no success so far...
But I will come back whenever I have more knowledge to ask a more specific
question.
I would like to add the HTML-Element somewhere "near the root" of the DOM-tree
(direct after <body> or before </body> would be nice) but that's not so
important. Any tip on how to do this the clever way? I think I will look and
"steal" some ideas from popup namespace classes.

Do you have any idea of a good tutorial or other documentation that handles the
"basics" of the widget-system? Where e.g. the use-cases for overwriting
"_applyHtml" etc. are described?

As soon as I am successful I will post my result, so others with similar
problems might get some enlightenment ;)

Thanks again,
  Peter


> 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