• Returning the background color of an SLE

    From jrollo64@gmail.com@21:1/5 to All on Tue Nov 16 17:18:26 2021
    Hi, does anyone know how to return the RBG values for the background of an SLE, please? I've got the TextColor worked out, but cannot for the life of me find out how to do the same thing for the background. I want to retrieve the background colour of
    the SLE in exactly the same way as I am for the TextColor so I can save it to a DBF, for restoration later "on the fly"

    This is how I'm saving the TextColor:

    self:oDCP1BTNNAME:TextColor:Blue
    self:oDCP1BTNNAME:TextColor:Red
    self:oDCP1BTNNAME:TextColor:Green

    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED

    Any ideas please?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From JohnMartens@21:1/5 to All on Wed Nov 17 07:35:10 2021
    Hi,

    Just looked in the help file.
    Background of SLE inherits the Background fom the Control class

    It is not strong typed but is a brush. Looks like the brush is a class
    that designed to be set to a value more that the properties to be read

    Look in the help for the brush class and maybe find more info in

    https://groups.google.com/g/comp.lang.clipper.visual-objects

    John



    Op 17-11-2021 om 02:18 schreef jrol...@gmail.com:
    Hi, does anyone know how to return the RBG values for the background of an SLE, please? I've got the TextColor worked out, but cannot for the life of me find out how to do the same thing for the background. I want to retrieve the background colour of
    the SLE in exactly the same way as I am for the TextColor so I can save it to a DBF, for restoration later "on the fly"

    This is how I'm saving the TextColor:

    self:oDCP1BTNNAME:TextColor:Blue
    self:oDCP1BTNNAME:TextColor:Red
    self:oDCP1BTNNAME:TextColor:Green

    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED

    Any ideas please?


    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jrollo64@gmail.com@21:1/5 to JohnMartens on Wed Nov 17 14:16:41 2021
    On Wednesday, 17 November 2021 at 17:35:10 UTC+11, JohnMartens wrote:
    Hi,

    Just looked in the help file.
    Background of SLE inherits the Background fom the Control class

    It is not strong typed but is a brush. Looks like the brush is a class
    that designed to be set to a value more that the properties to be read

    Look in the help for the brush class and maybe find more info in

    https://groups.google.com/g/comp.lang.clipper.visual-objects

    John



    Op 17-11-2021 om 02:18 schreef jrol...@gmail.com:
    Hi, does anyone know how to return the RBG values for the background of an SLE, please? I've got the TextColor worked out, but cannot for the life of me find out how to do the same thing for the background. I want to retrieve the background colour of
    the SLE in exactly the same way as I am for the TextColor so I can save it to a DBF, for restoration later "on the fly"

    This is how I'm saving the TextColor:

    self:oDCP1BTNNAME:TextColor:Blue
    self:oDCP1BTNNAME:TextColor:Red
    self:oDCP1BTNNAME:TextColor:Green

    Attempting to do the same with the Background like: self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED

    Any ideas please?

    Thanks John, but I've been right through the "help" but I still can't work out where I'm going wrong. Thanks again.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl-Heinz@21:1/5 to All on Thu Nov 18 11:08:36 2021
    Hi,

    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED

    What´s missing is the access to the color object.

    self:oDCP1BTNNAME:Background:Color:Red

    regards
    Karl-Heinz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jrollo64@gmail.com@21:1/5 to Karl-Heinz on Thu Nov 18 14:20:36 2021
    On Thursday, 18 November 2021 at 21:09:03 UTC+11, Karl-Heinz wrote:
    Hi,
    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED
    What´s missing is the access to the color object.

    self:oDCP1BTNNAME:Background:Color:Red

    regards
    Karl-Heinz
    Excellent, I knew it would be easy and obvious, but I kept getting confused. Thank you very much, Karl-Heinz.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jrollo64@gmail.com@21:1/5 to Karl-Heinz on Thu Nov 18 14:44:56 2021
    On Thursday, 18 November 2021 at 21:09:03 UTC+11, Karl-Heinz wrote:
    Hi,
    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED
    What´s missing is the access to the color object.

    self:oDCP1BTNNAME:Background:Color:Red

    regards
    Karl-Heinz
    Sorry Karl-Heinz, but that doesn't work. It again says no exported variable:Color

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From jrollo64@gmail.com@21:1/5 to jrol...@gmail.com on Thu Nov 18 15:39:00 2021
    On Friday, 19 November 2021 at 09:44:57 UTC+11, jrol...@gmail.com wrote:
    On Thursday, 18 November 2021 at 21:09:03 UTC+11, Karl-Heinz wrote:
    Hi,
    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED What´s missing is the access to the color object.

    self:oDCP1BTNNAME:Background:Color:Red

    regards
    Karl-Heinz
    Sorry Karl-Heinz, but that doesn't work. It again says no exported variable:Color


    This, however, does seem to work:

    oBKgrdCol:=oWin:Color()
    nRed:=oBKgrdCol:red
    nBlue:=oBKgrdCol:blue
    nGreen:=oBKgrdCol:green
    oBrush:=Brush{Color{nRed,nGreen,nBlue}}

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Karl-Heinz@21:1/5 to All on Fri Nov 19 07:00:13 2021
    Attempting to do the same with the Background like:
    self:oDCP1BTNNAME:Background:Red
    Returns : {(0x0010)0x05D7F7AC} CLASS COLOR

    And a NO Exported Variable message Function iVARGET Arguement: RED What´s missing is the access to the color object.

    self:oDCP1BTNNAME:Background:Color:Red

    regards
    Karl-Heinz
    Sorry Karl-Heinz, but that doesn't work. It again says no exported variable:Color

    something like

    self:oDCP1BTNNAME:Background:Color:Red

    only works if a background object exists !

    try this Sle class. It detects if a background object exists. If there´s no such object the return value is the (sle) system background colorref.

    ------------------------
    CLASS YourSle INHERIT SingleLineEdit

    METHOD GetBackgroundColorRef() CLASS YourSle

    IF SELF:BackGround != NULL_OBJECT

    RETURN SELF:BackGround:color:Colorref

    ENDIF

    RETURN GetSysColor ( COLOR_WINDOW )

    ---------------------

    regards
    Karl-Heinz

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)