ecere:gui:controls:DataBox,DropBox,PathBox; improve carrying foreground/background...
authorRejean Loyer <redj@ecere.com>
Mon, 11 Nov 2013 22:19:10 +0000 (17:19 -0500)
committerRejean Loyer <redj@ecere.com>
Wed, 20 Nov 2013 20:40:37 +0000 (15:40 -0500)
ecere/src/gui/controls/DataBox.ec
ecere/src/gui/controls/DropBox.ec
ecere/src/gui/controls/PathBox.ec

index a6efd8c..82e760f 100644 (file)
@@ -96,6 +96,12 @@ public:
 private:
    bool inAutoSize;
 
+   watch(background)     { if(editor) editor.background = background; };
+   watch(foreground)     { if(editor) editor.foreground = foreground; };
+   //watch(selectionColor) { if(editor) editor.selectionColor = selectionColor; };
+   //watch(selectionText)  { if(editor) editor.selectionText = selectionText; };
+   watch(opacity)        { if(editor) editor.opacity = opacity; };
+
    bool OnPostCreate()
    {
       // Right now for read-only DataBoxes the only reason we'd want to create an editor is for autoSize purposes, when using the default EditBox editor that supports it.
index 8a791ea..2baae53 100644 (file)
@@ -24,22 +24,11 @@ public class DropBox : CommonControl
 
    class_property(icon) = "<:ecere>controls/dropBox.png";
 
-   watch(foreground)
-   {
-      listBox.foreground = foreground;
-   };
-   watch(background)
-   {
-      listBox.background = background;
-   };
-   watch(selectionColor)
-   {
-      listBox.selectionColor = selectionColor;
-   };
-   watch(selectionText)
-   {
-      listBox.selectionText = selectionText;
-   };
+   watch(foreground)     { listBox.foreground = foreground;         if(editBox) editBox.foreground = foreground; };
+   watch(background)     { listBox.background = background;         if(editBox) editBox.background = background; };
+   watch(selectionColor) { listBox.selectionColor = selectionColor; if(editBox) editBox.selectionColor = selectionColor; };
+   watch(selectionText)  { listBox.selectionText = selectionText;   if(editBox) editBox.selectionText = selectionText; };
+   watch(opacity)        { listBox.opacity = opacity;               if(editBox) editBox.opacity = opacity; };
 
 public:
    property bool activeStipple
@@ -149,6 +138,10 @@ public:
                      this, textHorzScroll = true, borderStyle = 0;
                      anchor = Anchor { left = 0, top = 0, right = BTN_WIDTH, bottom = 0 };
                      // visible = false, modifyVirtualArea = false;
+                     foreground = foreground;
+                     background = background;
+                     selectionColor = selectionColor;
+                     selectionText = selectionText;
                   };
                   incref editBox;
                   editBox.Create();
index 73a0883..82664c5 100644 (file)
@@ -109,9 +109,11 @@ public class PathBox : CommonControl
    borderStyle = deep;
    clientSize = { 64, 18 };
 
-   watch(background) { editBox.background = background; };
-   watch(foreground) { editBox.foreground = foreground; };
-   watch(opacity)    { editBox.opacity    = opacity; };
+   watch(background)     { editBox.background = background; };
+   watch(foreground)     { editBox.foreground = foreground; };
+   watch(selectionColor) { editBox.selectionColor = selectionColor; };
+   watch(selectionText)  { editBox.selectionText = selectionText; };
+   watch(opacity)        { editBox.opacity = opacity; };
 
 #if defined(__WIN32__)
    PathBox()
@@ -382,8 +384,11 @@ public:
    virtual bool OnPrepareBrowseDir(char ** directory);
    virtual bool OnBrowsedDir(char ** directory);
 
-   watch(foreground) { list.foreground = foreground; };
-   watch(background) { list.background = background; };
+   watch(foreground)     { list.foreground = foreground; };
+   watch(background)     { list.background = background; };
+   //watch(selectionColor) { list.selectionColor = selectionColor; };
+   //watch(selectionText)  { list.selectionText = selectionText; };
+   watch(opacity)        { list.opacity = opacity; };
 
    property Array<String> strings
    {