Hi Alexander,

> Can you explain why do you need this? The child controls are internal 
> parts of a widget and are for good reasons private class members.
Well, actually no objective reasons, but the overall approach looks 
really neat due to following abilities it provides:

- it allows to separate widgets creation code & their logic, so that 
important methods are not cluttered with defining non-functional & 
helper widgets (like toolbars, containers etc...), defining their 
properties and so on;

- it allows me not to care about disposing(deleting) all those private 
members I'd have to define otherwise, (since _disposeChildControls 
method does the job for me).

I'm thinking about patching (using qx.Class.patch) ui.core.Widget with 
the similar functionality but without linking to appearance theme.

Thanks,
        Oleksiy



>> But now I have to 
>> patch the Modern theme (using qx.Theme.patch) or instantiate it just to 
>> define the aliases... (since those cotrols I'm refering using ID are 
>> simple qooxdoo widgets, like selectbox, button etc...). Btw, I tried 
>> another hack:
> Patching the theme is one way. Another more cleaner way is to inherit 
> from the appearance theme and to create an own appearance theme and 
> adding the appearance IDs.
> 
>>     _createChildControlImpl: function(id) {
>>         var control = null;
>>
>>         switch(id) {
>>             case 'mainpane':
>>                 var control = new qx.ui.splitpane.Pane('vertical');
>>                 control.setAppearance('splitpane'); # <- this is hack:)
>>                 this.add(control, {edge: 0});
>>                 break;
>>
>>             case 'topframe':
>>                 var control = new qx.ui.embed.Iframe();
>>                 this._getChildControl('mainpane').add(control, 3);
>>                 break;
>>
>>             case 'finderpane':
>>                 var control = new dbgui.ui.splitpane.Pane();
>>                 this._getChildControl('mainpane').add(control, 2);
>>                 break;
>>
>>             case 'finder':
>>                 var control = new dbgui.ui.finder.Box();
>>                 this._getChildControl('finderpane').add(control);
>>                 break;
>>         }
>>
>> setting appearance just after widget is created, but that didn't help 
>> (still getting those annoying messages). So the only way of using this 
>> sweet feature is to define appropriate aliases/appearances, correct?
> The "hack" you describe is not quite one. You *can* set the appearance 
> in this way. However, in this specific case you do not need to - the 
> "qx.ui.splitpane.Pane" widget has already the appearance "splitpane" by 
> default.
> 
> Those "annoying" messages you get are due your other child controls you 
> create.
> Suppose you inherit from "qx.ui.core.Widget" which has the appearance id 
> "widget" and you create a child control inside your class named 
> "finderpane". This will lead to an appearance ID named 
> "widget/finderpane" automatically. If you do not define this in your 
> used appearance theme a "annoying" message is displayed.
> 
> So yes, the only way to get rid off these messages is to create matching 
> appearance IDs :)
> 
> cheers,
>    Alex
> 
> 
> 
>> Alexander Back wrote:
>>> Hi Oleksiy,
>>>
>>> Oleksiy Golovko wrote:
>>>> Hi
>>>>
>>>> While researching qooxdoo source code I found quite nice approach of 
>>>> creating widgets and easy access to them without creating ton of 
>>>> private class members. I mean _getChildControl & 
>>>> _createChildControlImpl methods , the approach really rocks! Although 
>>>> I faced some strange behavior when started using it, here is the 
>>>> messages I see in firebug:
>>>>
>>>> ----
>>>> 7846ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/finderpane
>>>> 7865ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/mainpane/splitter/knob
>>>> 7874ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/mainpane/splitter
>>>> 7883ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/mainpane
>>>> 7892ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/topframe
>>>> 7903ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/finder/sbAspect/atom/label
>>>> 7912ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/finder/sbAspect/atom
>>>> 7921ms qx.theme.manager.Appearance[k]: Missing appearance: 
>>>> widget/finder/sbAspect/arrow
>>>> ----
>>> Every widget (and I suppose you develop some own widgets) has an 
>>> appearance property and its value is used inside the appearance theme 
>>> to style this widget.
>>> The messages you get are a feature to inform you about that some 
>>> appearances are missing. These warnings are only outputted in the 
>>> source version.
>>> See http://qooxdoo.org/documentation/0.8/ui_appearance for details to 
>>> the appearance theme.
>>>
>>> Looking at the messages you are inheriting from "qx.core.Widget" and 
>>> creating child controls "finderpane", "mainpane", "topframe" etc.
>>> The appearance IDs listed in the messages have to be part of your 
>>> appearance theme, so the best way to go would be to create an own 
>>> appearance theme. How to develop it is explained at 
>>> http://qooxdoo.org/documentation/0.8/ui_custom_themes
>>>
>>> To overwrite the "appearance" property (default is "widget") to better 
>>> organize your widgets inside the appearance theme you can simply add
>>>
>>> --snip--
>>> properties :
>>> {
>>>     ...
>>>     appearance :
>>>     {
>>>         init : "yourappearance"
>>>     }
>>> }
>>> --snip--
>>>
>>> to your widget code and the resulting appearance ID would be e.g. 
>>> "yourappearance/mainpane".
>>>
>>>> and I see that widgets rendered with errors...
>>>>
>>>> I didn't think that those IDs are connected to appearance somehow... 
>>>> Is that a qooxdoo bug or feature? And how could I fix that (given 
>>>> that I really like the method and want to use it)?
>>> As said, the messages are a feature to inform you the appearance IDs 
>>> are missing. To fix it create an own appearance theme (inheriting from 
>>> an existing one) and add your appearance IDs.
>>>
>>> Hope this helps :)
>>>
>>> cheers,
>>>    Alex
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> qooxdoo-devel mailing list
> qooxdoo-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
> 


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
qooxdoo-devel mailing list
qooxdoo-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to