Setting ThemeDrawStyle for Tab Sheet Caption

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jyoung
Posts: 694
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Setting ThemeDrawStyle for Tab Sheet Caption

Post by jyoung »

How can I set the ThemeDrawStyle for a Tab Sheet Caption?

It seems like I can only set it for the TabFolder and when I do, it overrides any child controls that have a style applied.

This is a shot without any ThemeDrawStyle applied to the TabFolder. The Calendar is a custom resuable part that I made to allow selection of a week and to set the start day on Monday (since you cannot set the start day on the LANSA Calendar control on the web).
capture2.png
capture2.png (26.13 KiB) Viewed 3937 times
When I set the TabFolder's ThemeDrawStyle to Heading2, then the TabSheets have the right styling (although it is missing the color), but it also affect the child calendar but the other labels are not affected.
capture1.png
capture1.png (22.9 KiB) Viewed 3937 times
The calendar itself has its styles applied via a style that is dynamically set when the calendar is populated.

Code: Select all

#Cells<#workingDate>.Style <= #Active
or

Code: Select all

#Cells<#workingDate>.Style <= #Inactive
Is there a way to set JUST the TabSheet Caption? Can different TabSheet Caption's in a TabFolder have different styling?
User avatar
Stewart Marshall
Posts: 417
Joined: Thu Nov 05, 2015 5:25 pm

Re: Setting ThemeDrawStyle for Tab Sheet Caption

Post by Stewart Marshall »

Hi Joe

Tab folders/sheets are a bit tricky when it comes to styling as you've discovered, particularly when it comes to the adoption of fonts, which are picked up by child controls. This is a perfect for the majority case where we want to set a font and text color at the start and have it used throughout an application, but a bit annoying for things like tab folder.

So, the best I technique today is not to use the caption area of a tab folder.

Have a look at xDemoWebStylingTabFolder. This uses tab sheets as normal, but hides the caption area, using labels instead. This is a tiny bit more work, but means that you have a set of labels over which you have complete control and can do far more interesting things with the caption area.


With regards to your popup calendar, it is adopting the font information from its parent control as it should. However, you only need to set the parent of a popup if you want it behave like a child e.g. You want to manipulate its position via layout. If all you want is a popup to show, you can use it in the code with Parent(*Null).

Regards
Stewart Marshall

Independent IT Consultant
www.marshallfloyd.com.au
Post Reply