ecere/gui/controls/DataBox: Only setting autoSize on editor if DataBox's autoSize...
authorJerome St-Louis <jerome@ecere.com>
Sat, 19 Dec 2015 21:10:07 +0000 (16:10 -0500)
committerJerome St-Louis <jerome@ecere.com>
Mon, 21 Dec 2015 19:11:34 +0000 (14:11 -0500)
- This allows to set autoSize on editor from outside without the DataBox reverting it to 'false'
- Useful to setup editor alignment by setting autoSize on the editor itself within a DataBox
  filling up the ListBox cell ( http://ecere.com/forums/viewtopic.php?f=1&t=414 )

ecere/src/gui/controls/DataBox.ec

index 4e90f0c..0c3faa4 100644 (file)
@@ -129,7 +129,8 @@ private:
             if(eClass_IsDerived(editor._class, class(EditBox)))
             {
                ((EditBox)editor).readOnly = readOnly;
-               ((EditBox)editor).autoSize = autoSize;
+               if(autoSize)
+                  ((EditBox)editor).autoSize = autoSize;
                ((EditBox)editor).clickThrough = true;
             }
             else if(eClass_IsDerived(editor._class, class(Button)) && autoSize)