Dear Users,
I am having one small problem with using XP/Vista Themes Support in my components.
For some reason when I change from XP Classic to XP Themed theme, components such as TNxButton are no longer painted correctly.
Does anymody know how to solve this. Is there a some event which occur when system theme is changed, to recreate current theme.
Thanks for any tips.
Best regards
Need Help
Started by Boki (Berg), Oct 19 2009 01:18 AM
2 replies to this topic
#1
Posted 19 October 2009 - 01:18 AM
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.
#2
Posted 19 October 2009 - 08:50 AM
Hi Boki
This is from another component set that I use, which "adapts" to theme changes:
Hope it helps.....
This is from another component set that I use, which "adapts" to theme changes:
CODE
const
WM_THEMECHANGED = $031A;
WM_THEMECHANGED = $031A;
CODE
procedure TSomething.WndProc(var Msg: TMessage);
begin
if Msg.Msg = WM_THEMECHANGED then
begin
if Assigned(FOnThemeChange) then
FOnThemeChange(Self);
end;
inherited;
end;
begin
if Msg.Msg = WM_THEMECHANGED then
begin
if Assigned(FOnThemeChange) then
FOnThemeChange(Self);
end;
inherited;
end;
Hope it helps.....
#3
Posted 19 October 2009 - 04:53 PM
Hello Deon,
Thank you for your help, this worked
I have done slightly different method:
In NxClasses.pas I have write:
Then, in NxCustomGridControl.pas write:
I hope that this approach is fine too
Again, thank you for your help!
Best regards
Thank you for your help, this worked
I have done slightly different method:
In NxClasses.pas I have write:
CODE
const
exIndexOutOfBounds = 'Index out of bounds (%d) for %s.';
{$IFDEF VER140}
WM_THEMECHANGED = $031A;
{$ENDIF}
exIndexOutOfBounds = 'Index out of bounds (%d) for %s.';
{$IFDEF VER140}
WM_THEMECHANGED = $031A;
{$ENDIF}
Then, in NxCustomGridControl.pas write:
CODE
procedure TNxCustomGridControl.WMThemeChanged(var Message: TMessage);
begin
inherited;
CloseThemeData(FTheme);
FTheme := OpenThemeData(Handle, teHeader);
FDefaultStyleDisplay.Theme := FTheme;
end;
begin
inherited;
CloseThemeData(FTheme);
FTheme := OpenThemeData(Handle, teHeader);
FDefaultStyleDisplay.Theme := FTheme;
end;
I hope that this approach is fine too
Again, thank you for your help!
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.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users