Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » in-place editing for a Compound Collapse All
Subject Author Date
a a Jan 24, 2006 - 3:32 AM

I can’t edit a compound node to change the values of the childs, when the child contains a color node.


It works for 2 integers, but not with color + integer. It’s only when the compound is modifies (when the child nodes are changed, the value is reported to the compound).


code:


  RGBAPropertyValue::RGBAPropertyValue(const std::string &name,
    const std::string &description, COLORREF rgb, int alpha)
    : CExtPropertyValueCompound(name.c_str())
  {
    CExtGridCellColor *color_cell;


    DescriptionSet(description.c_str());


    _rgb_value = new CExtPropertyValue("RGB");
    color_cell = STATIC_DOWNCAST(CExtGridCellColor,
      _rgb_value->ValueDefaultGetByRTC(RUNTIME_CLASS(CExtGridCellColor)));
    color_cell->m_PackedColor.SetColor(rgb);
    color_cell->SetMode(CExtGridCellColor::eRGB);
    _rgb_value->ValueActiveFromDefault();
    ItemInsert(_rgb_value);


    _alpha_value = new CExtPropertyValue("Alpha");
    _alpha_value->ValueDefaultSet(new CExtGridCellVariant(255));
    _alpha_value->ValueActiveFromDefault();
    ItemInsert(_alpha_value);

    // ...


 

Technical Support Jan 26, 2006 - 4:00 AM

The instance of the CExtPropertyValueCompound class or derived from it should be used as is. You do not need to initialize its active and default cell values. Please check this issue.

a a Jan 26, 2006 - 7:30 PM

Ok.


RGBAPropertyValue is indeed a CExtPropertyValueCompound-derived.
But I didn’t set its active/default values...


_rgb_value and _alpha_value are the child values.
In fact, this is just a copy of one of your samples, it seemed you initialized the child’s values like this.


Should I remove them?


PS: The code above is the one that produces this:


[-] Color | 12, 45, 253, 255
 |- RGB   | [XXX] 12, 45, 253 [...] <- default/active value of _rgb_value
 |- Alpha | 255                     <- default/active value of _alpha_value

Technical Support Jan 27, 2006 - 10:49 AM

No, you should not remove initialization of the Alpha value and Color value. Please do the same as we did in the sample application. Initialize the Alpha and Color values independently and finally synchronize the parent RGBA compound value.

Technical Support Jan 25, 2006 - 9:54 AM

The compound value is not hard to use. Besides in your case the compound value can be based on two basic properties: color property and numeric value as the alpha channel property. The color property can be optionally compound.

The property store synchronization problem has been fixed in Prof-UIS 2.52, which you can download from our website.

a a Jan 25, 2006 - 6:27 PM

Thanks.


But I still don’t understand why you can’t modify the child values from the parent one...
It does work with intergers or strings, but not when there is a color value.


This is what I get.


[-] Color | 12, 45, 253, 255         <- editing ’Color’ does nothing
 |- RGB   | [XXX] 12, 45, 253 [...]  <- editing ’RGB’ modifies ’Color’
 |- Alpha | 255                      <- editing ’Alpha’ modifies ’Color’


With 2 integers, there’s no problem.


[-] Size   | 640, 448     <- editing ’Size’ modifies ’Width’ and/or ’Height’
 |- Width  | 640          <- editing ’Width’ modifies ’Size’
 |- Height | 448          <- editing ’Height’ modifies ’Size’