Whatever color scheme is used, the background gradient is always painted in clBtnFace color;
May I suggest the following change ?
procedure TNxHeaderPanel.DrawBackground(ARect: TRect);
begin
case FPanelStyle of
ptDefault:
with Canvas do
begin
Brush.Color := Self.Color;
FillRect(ARect);
end;
// ptGradient: DrawVertGradient(Canvas, ARect, clWindow, clBtnFace);
// ptInverseGradient: DrawVertGradient(Canvas, ARect, clBtnFace, clWindow);
ptGradient: DrawVertGradient(Canvas, ARect, clWindow, SchemeColor(seBtnFace, FColorScheme));
ptInverseGradient: DrawVertGradient(Canvas, ARect, SchemeColor(seBtnFace, FColorScheme), clWindow);
end;
end;
this way the gradient color follows the current scheme;
alternatively it could use the color to be consistent with the Default panel style.
Best regards
Didier
tNxHeaderPanel
Started by didiergm, Dec 31 2010 12:51 AM
6 replies to this topic
#1
Posted 31 December 2010 - 12:51 AM
#2
Posted 31 December 2010 - 01:26 AM
Hello Didier,
What do you think about adding PanelColor property for controling second color (clBtnFace)?
Best regards
What do you think about adding PanelColor property for controling second color (clBtnFace)?
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 31 December 2010 - 01:38 AM
QUOTE (Boki (Berg) @ Dec 31 2010, 01:26 AM) <{POST_SNAPBACK}>
Hello Didier,
What do you think about adding PanelColor property for controling second color (clBtnFace)?
Best regards
What do you think about adding PanelColor property for controling second color (clBtnFace)?
Best regards
This would probably be even better but more work. On the other hand, I'd like to see the ColorScheme being more widely used. so if possible, add a new entry to the colorScheme array for a panelcolor;
talking of which do you have pans to add colorscheme support to your grid ? maybe in the form of an event ?
#4
Posted 31 December 2010 - 02:16 AM
Hello Didier,
I will think about your proposition. I will answer you tomorow.
I think that it is a good idea to use ColorScheme as second color.
Best regards
I will think about your proposition. I will answer you tomorow.
I think that it is a good idea to use ColorScheme as second color.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#5
Posted 31 December 2010 - 02:26 AM
Hello Didier,
Please try to replace next procedure:
Please try to replace next procedure:
CODE
procedure TNxHeaderPanel.DrawBackground(ARect: TRect);
var
SecondColor: TColor;
begin
case FPanelStyle of
ptDefault:
with Canvas do
begin
Brush.Color := Self.Color;
FillRect(ARect);
end;
ptGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, clWindow, SecondColor);
end;
ptInverseGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, SecondColor, clWindow);
end;
end;
end;
var
SecondColor: TColor;
begin
case FPanelStyle of
ptDefault:
with Canvas do
begin
Brush.Color := Self.Color;
FillRect(ARect);
end;
ptGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, clWindow, SecondColor);
end;
ptInverseGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, SecondColor, clWindow);
end;
end;
end;
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#6
Posted 31 December 2010 - 02:38 AM
QUOTE (Boki (Berg) @ Dec 31 2010, 02:26 AM) <{POST_SNAPBACK}>
Hello Didier,
Please try to replace next procedure:
Please try to replace next procedure:
CODE
procedure TNxHeaderPanel.DrawBackground(ARect: TRect);
var
SecondColor: TColor;
begin
case FPanelStyle of
ptDefault:
with Canvas do
begin
Brush.Color := Self.Color;
FillRect(ARect);
end;
ptGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, clWindow, SecondColor);
end;
ptInverseGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, SecondColor, clWindow);
end;
end;
end;
var
SecondColor: TColor;
begin
case FPanelStyle of
ptDefault:
with Canvas do
begin
Brush.Color := Self.Color;
FillRect(ARect);
end;
ptGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, clWindow, SecondColor);
end;
ptInverseGradient:
begin
SecondColor := SchemeColor(seBtnFace);
DrawVertGradient(Canvas, ARect, SecondColor, clWindow);
end;
end;
end;
This seems to work fine. thanks
If I don't speak to you before, have a great New Year's eve and a fantastic 2011
Didier
#7
Posted 31 December 2010 - 03:02 AM
Hello Didier,
Thank you.
I wish to you (and every my component user) a Happy New Year!
Best regards
Thank you.
I wish to you (and every my component user) a Happy New Year!
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users