Components for Delphi and C++ Builder.

Go to Russian forum
Go to EhLib.com
It is currently 27 Apr 2024, 13:45

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Focus Color
PostPosted: 04 May 2016, 08:23 
Offline

Joined: 16 Nov 2015, 09:06
Posts: 4
Hi,
there is a property for change background color when editors (standalone) receive focus?
I normally set to yellow the active editor...
Thanks in advance!
Stefano Monterisi

P.s. Any progress or news on FMX version?


Top
 Profile  
 
 Post subject: Re: Focus Color
PostPosted: 04 May 2016, 09:22 
Offline

Joined: 08 May 2014, 18:06
Posts: 663
Hello

What about Color propery. It must work.
Code:
Edit1.Color := clMoneyGreen;

_________________
Best regards
EhLib Support Team


Top
 Profile  
 
 Post subject: Re: Focus Color
PostPosted: 09 May 2016, 08:43 
Offline

Joined: 16 Nov 2015, 09:06
Posts: 4
I think that this is obvious...
My need (derived in porting from Infopower) is to have a method for assign a focused color on editor, when a form contain 200 editors, for example... without taking care to manage event for every editor...
Stefano


Top
 Profile  
 
 Post subject: Re: Focus Color
PostPosted: 24 Aug 2016, 09:22 
Offline

Joined: 01 Aug 2016, 12:31
Posts: 3
Hi Stemonte,
i patched this Problem since years.
All EhLib-Edit-Components were inherited like this:

type
TDBEditEhX = class(TDBEditEh)
private
{ Private-Deklarationen }
bFocusColorChange : boolean; // +BK
cFocusColor : TColor; // +BK
cColor : TColor; // +BK
procedure SetFocusColor(const Value: TColor);
procedure CMEnter(var Message: TCMEnter); message CM_ENTER;
procedure CMExit(var Message: TCMExit); message CM_EXIT;
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
constructor Create(AOwner: TComponent); override;
published
{ Published-Deklarationen }
property FocusColorChange : Boolean read bFocusColorChange write bFocusColorChange default True; // +BK
property FocusColor : TColor read cFocusColor write setFocusColor; // default clWindow; // +BK
end;

procedure Register;
begin
RegisterComponents('EhLib', [TDBEditEhX]);
RegisterComponents('EhLib', [TDBMemoX]);
RegisterComponents('EhLib', [TDBNumberEditEhX]);
RegisterComponents('EhLib', [TDBComboBoxEhX]);
RegisterComponents('EhLib', [TDBLookupComboboxEhX]);
RegisterComponents('EhLib', [TDBdateTimeEditEhX]);
RegisterComponents('EhLib', [TDBCheckBoxEhX]);
end;

// TDBEditEh-Anpassungen
constructor TDBEditEhX.Create(AOwner: TComponent);
begin
inherited;
cFocusColor := clSkyBlue;
bFocusColorChange := true;
end;

procedure TDBEditEhX.SetFocusColor(const Value: TColor);
begin
cFocusColor := Value;
end;

procedure TDBEditEhX.CMEnter(var Message: TCMEnter);
begin
cColor := Color;
if bFocusColorChange then
Color := cFocusColor;
inherited;
end;

procedure TDBEditEhX.CMExit(var Message: TCMEnter);
begin
if bFocusColorChange then
Color := cColor;
inherited;
end;

and that works very fine.
Perhaps could the EhLib-crew overtake this as standard-propertys for the future!!!
Bernd


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 72 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group