Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

TTMSFMX7SegLED Change Color

 Post Reply Post Reply
Author
Matthiensen Frank View Drop Down
New Member
New Member
Avatar

Joined: 11 Sep 2013
Posts: 12
Post Options Post Options   Quote Matthiensen Frank Quote  Post ReplyReply Direct Link To This Post Topic: TTMSFMX7SegLED Change Color
    Posted: 02 Aug 2015 at 4:21pm
Hello,

how can I change the color of a number (TTMSFMX7SegLED) ?

I try

leddisp.Shape.FillActive.Color := clagreen; in On Show event.

But this produce an error.

regards Frank


Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 9212
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 03 Aug 2015 at 9:16am
After setting the color, call UpdateLedObjects.

Example:
procedure TForm1.TMSFMX7SegLED1ApplyStyleLookup(Sender: TObject);
begin
 TMSFMX7SegLED1.Shape.FillActive.Color := clagreen;
 TMSFMX7SegLED1.UpdateLedObjects
end;

Back to Top
Matthiensen Frank View Drop Down
New Member
New Member
Avatar

Joined: 11 Sep 2013
Posts: 12
Post Options Post Options   Quote Matthiensen Frank Quote  Post ReplyReply Direct Link To This Post Posted: 03 Aug 2015 at 9:57am
Thank you, now it works.
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2020 at 6:43pm
How remove the Shape.Fill color , default is gray, because it disturb reading ...
Back to Top
Bruno Fierens View Drop Down
TMS Support
TMS Support
Avatar

Joined: 11 May 2010
Posts: 9212
Post Options Post Options   Quote Bruno Fierens Quote  Post ReplyReply Direct Link To This Post Posted: 05 Mar 2020 at 7:39pm
In the IDE select "Edit custom style" from the component content menu and in the style editor you can edit all colors.
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 06 Mar 2020 at 10:40am
by code is possible ?    Shape.Fill.Kind:=TBrushKind.bkNone; remove only a part of gray i want to remove all ...

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3715
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 09 Mar 2020 at 4:25pm
Yes, you can access all style information programmatically after calling NeedStyleLookup / ApplyStyleLookup.
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 11 Mar 2020 at 8:26am
can you provide me a code please ? thx
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3715
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 11 Mar 2020 at 8:38am
var
  s: TTMSFMX7SegLED;
begin
  s := TTMSFMX7SegLED.Create(Self);
  s.Parent := Self;
  s.NeedStyleLookup;
  s.ApplyStyleLookup;
  s.Shape.Fill.Kind := TBrushKind.None;
  s.Shape.Stroke.Kind := TBrushKind.None;
  s.UpdateLedObjects;
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2020 at 7:03pm
hi on win fmx i use follow code to remove default is gray, because it disturb reading ...

procedure TfrmTDPMon.ledApplyStyleLookup(Sender: TObject);
begin
 With (Sender AS TTMSFMX7SegLed) Do Begin
   Shape.Fill.Kind:=TBrushKind.None;
   Shape.Stroke.Kind:=TBrushKind.None;

   UpdateLedObjects();
 End;
end;

But on android doesnt work ! Can you help me ?

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3715
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2020 at 7:06pm
Can you use the code as originally mentioned?
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2020 at 8:13pm
yes dont go ... i see always gray lines on android. On win go fine
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3715
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 30 Apr 2020 at 10:29am
Please use this code instead:

var
  s: TTMSFMX7SegLED;
begin
  s := TTMSFMX7SegLED.Create(Self);
  s.Parent := Self;
  s.NeedStyleLookup;
  s.ApplyStyleLookup;
  s.Shape.Fill.Color := TAlphaColorRec.Null;
  s.Shape.Stroke.Color := TAlphaColorRec.Null;
  s.Shape.Fill.Kind := TBrushKind.None;
  s.Shape.Stroke.Kind := TBrushKind.None;
  s.UpdateLedObjects;
end;
Back to Top
Cavalera Guido View Drop Down
Senior Member
Senior Member
Avatar

Joined: 25 Jan 2013
Posts: 270
Post Options Post Options   Quote Cavalera Guido Quote  Post ReplyReply Direct Link To This Post Posted: 30 Apr 2020 at 11:26am
Go fine thx
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down