I think that mixing a class to use mixin's method only internally is not the
correct use. I've chenged the class using directly a qx.ui.core.Blocker
instance:

-----------------------------------------------------------------------------------
qx.Class.define("MyClass", {
  extend: qx.core.Object,

  construct: function () {
    this.base(arguments);

    this.__blocker = new qx.ui.core.Blocker(this);
this.__blocker.setColor("#D5D5D5");
this.__blocker.setOpacity(0.5);
  },

  members: {
__blocker: null
  }
});

var instance = new MyClass();
--------------------------------------------------------------------------------------

This way works and it's IMO a more clear design

Gian Marco Gherardi
http://gianmarco.gherardi.me


On Thu, Aug 25, 2011 at 1:45 PM, Gian Marco Gherardi <
[email protected]> wrote:

> Yes, refining properties doesn't work..
>
> Gian Marco Gherardi
> http://gianmarco.gherardi.me
>
>
> On Thu, Aug 25, 2011 at 1:20 PM, Seldaiendil D. Flourite <
> [email protected]> wrote:
>
>> Sorry, I missunderstood your problem, trying to found a way to do it...
>>
>>
>>
>> 2011/8/25 Seldaiendil D. Flourite <[email protected]>
>>
>> If you want to set initial values for properties I think you can use the
>>> init configuration:
>>>
>>>
>>> qx.Class.define("MyClass", {
>>>
>>>   extend: qx.core.Object,
>>>
>>>
>>>
>>>
>>>
>>>
>>>   include: [qx.ui.core.MBlocker],
>>>
>>>
>>>
>>>
>>>
>>>
>>>   properties: {
>>>     blockerColor: {
>>>       // refine means we are modifying an existing property
>>>
>>>
>>>
>>>       refine: true,
>>>
>>>
>>>
>>>
>>>       init: "#D5D5D5"
>>>
>>>     },
>>>     blockerOpacity: {
>>>       refine: true,
>>>
>>>
>>>
>>>
>>>       init: 0.5
>>>     }
>>>
>>>
>>>
>>>
>>>   }
>>>
>>>
>>>
>>>
>>>
>>>   construct: function () {
>>>
>>>     this.base(arguments);
>>>
>>>     this.setBlockerColor("#D5D5D5"); // method from mixin
>>>
>>>
>>>
>>>
>>>
>>>     this.setBlockerOpacity(0.5); // method from mixin
>>>
>>>
>>>
>>>
>>>
>>>   }
>>> });
>>>
>>>
>>>
>>> ---
>>> Seldaiendil
>>>
>>>
>>> 2011/8/25 Gian Marco Gherardi <[email protected]>
>>>
>>>> Hi, the following (playground compatible) code:
>>>>
>>>> ------------------------------------------------------------------------------------------------------
>>>>
>>>> qx.Class.define("MyClass", {
>>>>   extend: qx.core.Object,
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   include: [qx.ui.core.MBlocker],
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   construct: function () {
>>>>
>>>>     this.base(arguments);
>>>>
>>>>     this.setBlockerColor("#D5D5D5"); // method from mixin
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>     this.setBlockerOpacity(0.5); // method from mixin
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   }
>>>> });
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> var instance = new MyClass(); // throws error because 
>>>> qx.ui.core.MBlocker.construct will be called AFTER MyClass.construct
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------------------------------
>>>> throws error. What's the proper way of setting mixin properties on class
>>>> initialization?
>>>>
>>>> Thanks
>>>>
>>>> Gian Marco Gherardi
>>>> http://gianmarco.gherardi.me
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> EMC VNX: the world's simplest storage, starting under $10K
>>>> The only unified storage solution that offers unified management
>>>> Up to 160% more powerful than alternatives and 25% more efficient.
>>>> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>>>> _______________________________________________
>>>> qooxdoo-devel mailing list
>>>> [email protected]
>>>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>>>
>>>>
>>>
>>
>>
>> ------------------------------------------------------------------------------
>> EMC VNX: the world's simplest storage, starting under $10K
>> The only unified storage solution that offers unified management
>> Up to 160% more powerful than alternatives and 25% more efficient.
>> Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
>> _______________________________________________
>> qooxdoo-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>>
>>
>
------------------------------------------------------------------------------
EMC VNX: the world's simplest storage, starting under $10K
The only unified storage solution that offers unified management 
Up to 160% more powerful than alternatives and 25% more efficient. 
Guaranteed. http://p.sf.net/sfu/emc-vnx-dev2dev
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to