Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: VCL StyleServices for TPageControl tab colors


This question is answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Feb 19, 2017 7:58 PM Last Post By: Brett Wilton
Brett Wilton

Posts: 45
Registered: 10/1/11
VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 5:08 PM
Hi All,

I'm trying to use the StyleServices to query the theme's colors for Tab items e.g hot, hover and normal e.g.

LDetails := StyleServices.GetElementDetails(ttTabItemNormal);
StyleServices.GetElementColor(LDetails, ecFillColor, FNormalColor);
StyleServices.GetElementColor(LDetails, ecTextColor, FFontNormalColor);´╗┐

The above I was hoping would get the text color for normal operation and fill color of the tab.

I'm getting I think the text color correctly but not the tab background color.

Anyone know the correct way to get this information for tab colors ?

Brett.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 6:30 PM   in response to: Brett Wilton in response to: Brett Wilton
Brett wrote:

The above I was hoping would get the text color for normal operation
and fill color of the tab.

I'm getting I think the text color correctly but not the tab background
color.

What color are you expecting it to return? What color is it actually returning
instead? What style/theme do you have active? Do you have the same problem
with other styles/themes?

--
Remy Lebeau (TeamB)
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 6:42 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
What color are you expecting it to return? What color is it actually returning
instead? What style/theme do you have active? Do you have the same problem
with other styles/themes?

Hi Remey,

I have the style "Window 10 Blue" but also tried "Windows 10 Dark" in testing.

So the text color seems to be correct with it returning white but the fill color (which I'm assuming is the tab background) always seems to return black.

So I would expect the text color in this case to return white and the fill color to be a blue of some sort.
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 6:48 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Ok, just ran the code again to refresh my memory.

LDetails := StyleServices.GetElementDetails(ttTopTabItemNormal);
StyleServices.GetElementColor(LDetails, ecFillColor, LBtn.FNormalColor);
StyleServices.GetElementColor(LDetails, ecTextColor, LBtn.FFontNormalColor);
LDetails := StyleServices.GetElementDetails(ttTopTabItemSelected);
StyleServices.GetElementColor(LDetails, ecFillColor, LBtn.FHotColor);
StyleServices.GetElementColor(LDetails, ecTextColor, LBtn.FFontHotColor);

So I was slightly wrong.

FNormal = Blue background of panel (should be a slightly darker blue)
FFontNormalColor = white (correct)
FHotColor = Black (should be light blue)
FFontHotColor = White (correct)

There must be some other value to get the fill or correct background colors.

Edited by: Brett Wilton on Feb 15, 2017 7:26 PM
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 15, 2017 8:24 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Just had a moment to step into the functions.

Looks like Vcl.Styles function for GetElementColor() does nothing if you dont have ecTextColor set.

So getting the details for ecFillColor or anything else will not work. The function will only return text colors.

Doh.
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2017 7:58 PM   in response to: Brett Wilton in response to: Brett Wilton
It seems that the colors are stored in Bitmaps and not possible to get.
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: VCL StyleServices for TPageControl tab colors  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Feb 19, 2017 7:58 PM   in response to: Brett Wilton in response to: Brett Wilton
It seems that the colors are stored in Bitmaps and not possible to get.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02