Hi Dmitry,

that's quite simpel. A widget is nothing else than a normal class that 
need to extend a base class for GUI widgets.

In Qooxdoo 0.7 you can often build new widgets that are based on older 
widgets.
For example, your color filled shape would nothing less that an extended 
temirnator, or if it should hold other widgets, extend on of the box 
classes.

Let's take a look into 
http://demo.qooxdoo.org/current/apiviewer/#qx.ui.basic.Atom
Atom is a very basic component that is the base for other components.
If you look at the parent classes we see:

Object
qx.core.Object
qx.core.Target
qx.ui.core.Widget
qx.ui.core.Parent
qx.ui.layout.BoxLayout
qx.ui.basic.Atom

In Qooxdoo 0.8 I heared that the parent list will be shorter ;)

Atom is based on the basic Box Layout. And the Box Layout based on the 
qx.ui.core.Parent class. That Means that BoxLayout can hold childs. And 
qx.ui.core.Parent extends itself the basic Widget class.
So far, so nice and boring.

The trick is now that you can extend, as said, the old classed, and 
extend them where needed with your own code.

Small (I think not working example, written only there, not tested) example:

qx.Class.define("custom.myShape",
{
  extend : qx.ui.layout.BoxLayout,
 
   construct : function(border, backgroundColor)
   {
       this.base(arguments);
       this.setBorder(border);
       this.setBackgroundColor(backgroundColor);
   }
}

Now you have a boxLayout based widget that accept the border and 
backgroundcolor as constructor parameters, but do everythink like the 
original boxlayout.
Now you could also create a new button inside of your constructor (or 
later) and add it to the instance, then you have a new widget with a 
button on it after creating.

The problem in understanding qooxdoos own classes is that they uses the 
layout engine at important points. If you don't understand it you will 
miss important layout informations, and could get confused by 
it-seems-so missing settings. Also often important parts of the widget 
are in extended classes. So are with the button. Important parts of it 
are handled in the ATOM classes, which itself uses important parts from 
the boxlayout. Qooxdoo 0.8 will be different in mportant points here, 
but I hadn't took a longer look there.

Hope this helps. If anyone finds a mistake, please write :)

Greetings,
  Leander

Dmitry Pryadkin schrieb:
> Greetings,
>
> I'm sorry to ask that sort of a question here, but is there anything 
> that could help me start making my own widgets?
>
> I've opened the qx.ui.form.Button widget but still can't see my way to 
> understand how do I implement let's say a color-filled shape.
>
> Cheers,
> Dmitry
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft 
> Defy all challenges. Microsoft(R) Visual Studio 2008. 
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to