Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

There's coffee in that nebula! -- Capt. Kathryn Janeway, Star Trek: Voyager, "The Cloud"


devel / comp.lang.clipper.visual-objects / SingleLineEdit ReadOnly color & textcolor

SubjectAuthor
* SingleLineEdit ReadOnly color & textcolorGrzegorz R.
`* Re: SingleLineEdit ReadOnly color & textcolorKarl-Heinz
 `- Re: SingleLineEdit ReadOnly color & textcolorGrzegorz R.

1
SingleLineEdit ReadOnly color & textcolor

<bbbe7dec-72da-4da1-80d0-7314fc19b3f8n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=953&group=comp.lang.clipper.visual-objects#953

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:620a:31a0:: with SMTP id bi32mr5469358qkb.439.1634382844072;
Sat, 16 Oct 2021 04:14:04 -0700 (PDT)
X-Received: by 2002:a05:622a:190e:: with SMTP id w14mr15622837qtc.112.1634382843796;
Sat, 16 Oct 2021 04:14:03 -0700 (PDT)
Path: rocksolid2!i2pn.org!weretis.net!feeder6.news.weretis.net!news.misty.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Sat, 16 Oct 2021 04:14:03 -0700 (PDT)
Injection-Info: google-groups.googlegroups.com; posting-host=83.5.246.103; posting-account=D5fG0goAAADqRXT4F2tZQt5KfDZfW15T
NNTP-Posting-Host: 83.5.246.103
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bbbe7dec-72da-4da1-80d0-7314fc19b3f8n@googlegroups.com>
Subject: SingleLineEdit ReadOnly color & textcolor
From: ramotny64@gmail.com (Grzegorz R.)
Injection-Date: Sat, 16 Oct 2021 11:14:04 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 7
 by: Grzegorz R. - Sat, 16 Oct 2021 11:14 UTC

Hello all..
In certain circumstances I wanted to change color of text in SLE using:
SELF:oDCsle:TextColor := Color{COLORRED}
However if the SLE gets READONLY:=TRUE the background gets white instead of default (gray).
How can I change/set foreground text color without affecting background independently of ReadOnly/Enable state or ...
how can I find and remember respective background (and foreground) colors for Normal, ReadOnly and Disabled states?
Regards
Gregory

Re: SingleLineEdit ReadOnly color & textcolor

<it827iFsoukU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=956&group=comp.lang.clipper.visual-objects#956

  copy link   Newsgroups: comp.lang.clipper.visual-objects
Path: i2pn2.org!rocksolid2!news.neodome.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: invalid@invalid.invalid (Karl-Heinz)
Newsgroups: comp.lang.clipper.visual-objects
Subject: Re: SingleLineEdit ReadOnly color & textcolor
Date: Tue, 19 Oct 2021 16:11:00 +0200
Lines: 86
Message-ID: <it827iFsoukU1@mid.individual.net>
References: <bbbe7dec-72da-4da1-80d0-7314fc19b3f8n@googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain;
format=flowed;
charset="UTF-8";
reply-type=original
Content-Transfer-Encoding: 8bit
X-Trace: individual.net t158Rij9/U7I/4gDZSwlygTLXrsX41xjeKapNFFVsNQjlP1Rg=
Cancel-Lock: sha1:xNn2NLIjsQnsUCluNkUCpvh5+uo=
In-Reply-To: <bbbe7dec-72da-4da1-80d0-7314fc19b3f8n@googlegroups.com>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216
X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216
 by: Karl-Heinz - Tue, 19 Oct 2021 14:11 UTC

Hi Gregory,

[...]
In certain circumstances I wanted to change color of text in SLE
[...]

With the modified Readonly assign and the modified Enable()/Disable()
methods below you can set the colors and brushes you like. If you use the
code unchanged and Readonly is set to true or Disable() is called, the
Textcolor will be green. All other background and text colors use the
windows default colors.

CLASS MySle INHERIT SingleLineEdit

ASSIGN ReadOnly(lNewValue) CLASS MySle

SUPER:ReadOnly := lNewValue

IF SELF:ValidateControl()

IF lNewValue
SELF:Background := Brush { Color { GetSysColor (
COLOR_BTNFACE ) } }
SELF:TextColor := Color { COLORGREEN}

// This would set the default Textcolor when Readonly is set to
true
// SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }

ELSE
SELF:Background := Brush { Color { GetSysColor (
COLOR_WINDOW ) } }
SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
ENDIF

ENDIF

RETURN lNewValue

METHOD Enable() CLASS MySle

// no need to call SUPER:Enable()

IF SELF:ValidateControl()

SELF:Setstyle ( WS_DISABLED , FALSE )

SELF:Background := Brush { Color { GetSysColor ( COLOR_WINDOW ) } }
SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }

ENDIF

RETURN SELF

METHOD Disable() CLASS MySle

// don´t call SUPER:Disable(), because afterwards you can´t change the
colors !

IF SELF:ValidateControl()

SELF:Setstyle ( WS_DISABLED , TRUE )

SELF:Background := Brush { Color { GetSysColor ( COLOR_BTNFACE ) } }
SELF:TextColor := Color { COLORGREEN }

// This would set the default disabled Textcolor
// SELF:TextColor := Color { GetSysColor ( COLOR_GRAYTEXT ) }

ENDIF

RETURN SELF

btw. implement a global system where the required colors and brushes are
created only once.

regards
Karl-Heinz

Re: SingleLineEdit ReadOnly color & textcolor

<56440566-c75d-49ce-93b4-4302a92c676fn@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=966&group=comp.lang.clipper.visual-objects#966

  copy link   Newsgroups: comp.lang.clipper.visual-objects
X-Received: by 2002:a05:622a:554:: with SMTP id m20mr13831427qtx.382.1636988119095;
Mon, 15 Nov 2021 06:55:19 -0800 (PST)
X-Received: by 2002:ac8:45d2:: with SMTP id e18mr41574551qto.112.1636988118923;
Mon, 15 Nov 2021 06:55:18 -0800 (PST)
Path: i2pn2.org!i2pn.org!aioe.org!news.mixmin.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.clipper.visual-objects
Date: Mon, 15 Nov 2021 06:55:18 -0800 (PST)
In-Reply-To: <it827iFsoukU1@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=79.190.238.18; posting-account=D5fG0goAAADqRXT4F2tZQt5KfDZfW15T
NNTP-Posting-Host: 79.190.238.18
References: <bbbe7dec-72da-4da1-80d0-7314fc19b3f8n@googlegroups.com> <it827iFsoukU1@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <56440566-c75d-49ce-93b4-4302a92c676fn@googlegroups.com>
Subject: Re: SingleLineEdit ReadOnly color & textcolor
From: ramotny64@gmail.com (Grzegorz R.)
Injection-Date: Mon, 15 Nov 2021 14:55:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Grzegorz R. - Mon, 15 Nov 2021 14:55 UTC

wtorek, 19 października 2021 o 16:15:16 UTC+2 Karl-Heinz napisał(a):
> Hi Gregory,
>
> [...]
> In certain circumstances I wanted to change color of text in SLE
> [...]
>
> With the modified Readonly assign and the modified Enable()/Disable()
> methods below you can set the colors and brushes you like. If you use the
> code unchanged and Readonly is set to true or Disable() is called, the
> Textcolor will be green. All other background and text colors use the
> windows default colors.
>
>
> CLASS MySle INHERIT SingleLineEdit
>
> ASSIGN ReadOnly(lNewValue) CLASS MySle
>
> SUPER:ReadOnly := lNewValue
>
> IF SELF:ValidateControl()
>
> IF lNewValue
> SELF:Background := Brush { Color { GetSysColor (
> COLOR_BTNFACE ) } }
> SELF:TextColor := Color { COLORGREEN}
>
> // This would set the default Textcolor when Readonly is set to
> true
> // SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
>
> ELSE
> SELF:Background := Brush { Color { GetSysColor (
> COLOR_WINDOW ) } }
> SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
> ENDIF
>
> ENDIF
>
> RETURN lNewValue
>
>
> METHOD Enable() CLASS MySle
>
> // no need to call SUPER:Enable()
>
> IF SELF:ValidateControl()
>
> SELF:Setstyle ( WS_DISABLED , FALSE )
>
> SELF:Background := Brush { Color { GetSysColor ( COLOR_WINDOW ) } }
> SELF:TextColor := Color { GetSysColor ( COLOR_WINDOWTEXT ) }
>
> ENDIF
>
>
> RETURN SELF
>
>
> METHOD Disable() CLASS MySle
>
> // don´t call SUPER:Disable(), because afterwards you can´t change the
> colors !
>
>
> IF SELF:ValidateControl()
>
> SELF:Setstyle ( WS_DISABLED , TRUE )
>
> SELF:Background := Brush { Color { GetSysColor ( COLOR_BTNFACE ) } }
> SELF:TextColor := Color { COLORGREEN }
>
> // This would set the default disabled Textcolor
> // SELF:TextColor := Color { GetSysColor ( COLOR_GRAYTEXT ) }
>
> ENDIF
>
>
> RETURN SELF
>
>
> btw. implement a global system where the required colors and brushes are
> created only once.
>
> regards
> Karl-Heinz

Hello Karl

thank You - it works fine.

Gregory

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor