Page 1 of 1

Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Fri Sep 16, 2016 7:41 pm
by Kazunori Kasahara

I would like to apply Visual LANSA theme draw style to controls on VLF-ONE command handler. I have done the following steps but VL theme draw style is not applied to. I may misunderstand that. Any advise will be helpful. Thank you in advance.

1. I have specified DarkTitle to the Columnthemedrawstyle property of list component on VLF-ONE command handler. The color of list columns look grey.

Define_Com Class(#PRIM_LIST) Name(#List1) Displayposition(1) Left(45) Parent(#COM_OWNER) Tabposition(1) Top(51) Rowheight(22) Columnthemedrawstyle('DarkTitle')

2. I have created my Visual LANSA theme having the draw style named DarkTitle which background color is blue.

Define_Com Class(#PRIM_THM.DrawStyle) Name(#DarkTitle) Style(#DarkTitleStyle)
Define_Com Class(#PRIM_VS.Style) Name(#DarkTitleStyle) Backgroundbrush(#DarkTitleBackground) Foregroundbrush(#DarkTitleForeground)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#DarkTitleForeground) Color(White)
Define_Com Class(#PRIM_VS.SolidBrush) Name(#DarkTitleBackground) Color(Blue)

3. I have created my original VLF-ONE theme according to the instructions in documentation. ... 8_6520.htm I have specified my VL theme name to the Vlwebapplicationtheme property in VLF-ONE sanp-in theme customizer.

Set Com(#NewTheme) Symbolicname(MYTHEME1) Description('My VLF ONE Theme') Vlwebapplicationtheme(my VL theme name)

4. I have expected the background color of the list column is changed to blue when selecting My VLF ONE Theme in VLF-ONE. But the color of the list column is grey.

Best Regards,
Kazunori Kasahara

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Mon Sep 19, 2016 10:34 am
by MarkD
The #VF_SY170O Vlwebapplicationtheme(xxxxx) property is designed to be used with (and is tested for) the standard shipped VL themes.
I do not think you can create a new VL theme and then use it that way in VLF-ONE.
I think you should just create VL themes and styles and apply them to your PRIM_LIST individually.

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Tue Sep 20, 2016 12:01 pm
by Kazunori Kasahara
Thank you very much!

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Wed Sep 21, 2016 10:49 pm
by davidbalansa
Hi Mark,

I have a similar question so I thought I would continue this thread. I have a need to customize the VLF-ONE colours to follow a corporate colour scheme.

I was able to implement the snap in theme customizer and modify various aspects of the VLFONE using the VF_SY170O properties.

Set Com(#NewTheme) Symbolicname(DBCCTHEME) Description('DB Custom Theme') Vlwebapplicationtheme(#DBCCTHEME.BaseTheme)

#NewTheme.FloatingPanel_AtFrontTitleStyle.BackgroundBrush <= #DBCCTheme<MainTitleStyle>.BackgroundBrush

One requirement is to change the colour of all the buttons throughout the VLF-ONE. Currently my custom theme 'NewTheme' has Vlwebapplicationtheme(#DBCCTHEME.BaseTheme) where the BaseTheme for #DBCCTHEME is 'Green2015' so all the buttons take on the Control Theme Draw Style for PushButtons of ' Green2015'. Which is not the exact green I need. There are no properties in VF_SY170O to set the buttons in VLF-ONE and from your response I can only use shipped VL Themes for the Vlwebapplicationtheme property.

Is there any way I can change my push button controls draw style globally in VLF-ONE or do I need to set the FocusedStyle, MouseOverStyle and Style properties on every button?


Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Thu Sep 22, 2016 9:32 am
by MarkD
There is really no such thing as VLF-ONE theme.
A VLF-ONE theme is simply a conceptual extension of a standard VL-Web theme
The base VL-Web theme is named in the VLWebApplicationTheme property.
That VL-Web theme impacts the majority of VLF-ONE things, like how push buttons appear.
The rest of the VLF-ONE ‘theme’ properties mostly relate to sizing and locations, or very specific contextual things like the colour and font size on a VLF-ONE title bar, etc.

We ship using these shipped VL-Web themes in the VLWebApplicationTheme property:


A start up a VLF-ONE application executes this line:

Code: Select all

#SYS_WEB.WebPage.Theme <= #Sys_Theme<#USystem.CurrentTheme.VLWebApplicationTheme>

Which, if you were using VLWebApplicationTheme=2015Green is in effect saying:

Code: Select all

#SYS_WEB.WebPage.Theme <= #Sys_Theme<2015Green>
This raises two points of consideration:

1. The value you define in the VLF-ONE VLWebApplicationTheme property must be in the #Sys_Theme<> collection. ... THEMES.htm

2. If you want experiment with changing things it may be simpler to create a simple VL-Web form and start it up with #SYS_WEB.WebPage.Theme <= #Sys_Theme<2015Green> (say). For example, how would you change the shade of green on buttons in that context - which is something I don't know the answer to. You can check out the list of themes by doing this in your test form:
Capture.PNG (17.22 KiB) Viewed 7528 times

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Thu Sep 22, 2016 11:02 am
by davidbalansa
Hi Mark,

Thank you for the information it was very helpful. I have been able to achieved my goal of using a corporate colour scheme in a VL Web Page. This is the concept I have been trying to reproduce in VLF-ONE. The way I went about it is a little different to how you explained. The steps to implementing this in a VL Web Page.

1. Create a Theme repository component (#CorporateTheme) and select the closest Shipped theme as the BaseTheme (2015Green)

Begin_Com Role(*EXTENDS #PRIM_THM) Style(#ThemeStyle) Basetheme(2015Green)

2. Modify the Control Theme Draw Style For Push Button. I changed its colour from grey to green.
Image2.png (29.22 KiB) Viewed 7523 times
Image3.png (59.16 KiB) Viewed 7523 times
3 Create a webpage and assign #CorporateTheme as the theme for the webpage.

Begin_Com Role(*EXTENDS #PRIM_WEB) Theme(#CorporateTheme)

4. When the webpage is displayed all buttons now automatically take on the modified Push Button Control Theme Draw Style defined in my Theme #CorporateTheme.
Image4.png (8.4 KiB) Viewed 7523 times
This is what I was hoping to achieve in the VLF-ONE. I think my issue lies in not being able to assign a repository defined Theme #CorporateTheme to the property Vlwebapplicationtheme.

Thank you for your time and assistance.

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Thu Sep 22, 2016 3:13 pm
by Stewart Marshall
Hi David

The WebPage property of Sys_web provides access to the page being executed, so you can always apply a theme at runtime

#sys_web.WebPage.Theme <= #YourTheme


Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Thu Sep 22, 2016 3:25 pm
by MarkD
eg: In your IIP at start up time.

Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Thu Sep 22, 2016 9:52 pm
by davidbalansa
Hi Stewart, Mark,

Thanks for the additional information. I was able to achieve the result I wanted by setting the WebPage theme in the VLF-ONE IIP using the statement:

#sys_web.WebPage.Theme <= #MyTheme

This technique allows me to customize both the overall theme of the VLF-ONE and still use the ThemeCustomizer reusable part to customize other aspects of the VLF-ONE.

Your assistance is greatly appreciated!


Re: Is it possible to apply Visual LANSA theme draw style to VLF-ONE command handler?

Posted: Tue Apr 10, 2018 2:30 pm
by Tim McEntee
This is how I would implement my own theme. Not much different to the previous posts except that the definitions are static.

1) I would define a Theme and assign my corporate colours:
BEGIN_COM Role(*EXTENDS #PRIM_THM) BaseTheme(MaterialDesignGreen) Style(#Style1) Theme500Color(240:0:120) Theme900Color(120:0:60) Theme50Color(252:199:226) Theme100Color(249:159:204) Theme400Color(244:60:152) Theme300Color(245:84:165) Theme200Color(247:116:181) Theme600Color(210:0:105) Theme700Color(180:0:90) Theme800Color(150:0:75) ThemeA700Color(146:49:142) ThemeA400Color(160:75:156) ThemeA200Color(173:101:170) ThemeA100Color(187:126:184) ThemeBorderColor(0:154:68) ThemeLineColor(64:179:115) ThemeInactiveColor(255:176:96) ThemeDisabledColor(255:176:96) ThemeTextColor(40:0:112) ThemeTextLightColor(121:96:166) ThemeSuccessDarkColor(0:96:43) ThemeSuccessMediumColor(0:154:68) ThemeSuccessLightColor(128:205:162) ThemeErrorDarkColor(179:8:51) ThemeErrorMediumColor(238:11:68) ThemeErrorLightColor(246:133:162) ThemeAccentDarkColor(191:96:0) ThemeAccentMediumColor(255:128:0) ThemeAccentLightColor(255:176:96)

* MenuBar

DEFINE_COM Class(#PRIM_VS.Style) Name(#Style1) FaceName('Roboto Black') FontWeight(Normal) FontSize(9) FontUnits(Point)


2) Next I would define a reusable that extends the VLF theme object #VF_SY1700. I would statically define each of the VLF properties from the ancestor component. It took a couple or hours mucking around to get the few I have below, so to do the lot would take about a month on and off.


DEFINE_COM Class(*ANCESTOR) Name(#BaseFormBackgroundandFont) ForegroundBrush(#BFBAFBrush)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#BFBAFBrush) Color(ThemeText)

DEFINE_COM Class(*ANCESTOR) Name(#BasePanelBodyStyle) ForegroundBrush(#BFBAFBrush)

DEFINE_COM Class(*ANCESTOR) Name(#FloatingPanel_TitleStyle) ForegroundBrush(#FP_TSBrush) FontSize(10) BackgroundBrush(#FP_TSBackgroundBrush)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#FP_TSBrush) Color(ThemeInactive)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#FP_TSBackgroundBrush) Color(Theme300)

DEFINE_COM Class(*ANCESTOR) Name(#FloatingPanel_AtFrontTitleStyle) ForegroundBrush(#FP_AFTSBrush) FontSize(15) Italic(True) BorderBrush(#FP_AFTSBorderBrush) BackgroundBrush(#FP_AFTSBackgroundBrush) BorderBottom(1) BorderLeft(1) BorderTop(1) BorderRight(1)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#FP_AFTSBrush) Color(ThemeText)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#FP_AFTSBackgroundBrush) Color(Theme600)
DEFINE_COM Class(#PRIM_VS.SolidBrush) Name(#FP_AFTSBorderBrush) Color(ThemeBorder) Opacity(60)


3) Then in the theme customiser
#NewTheme <= *New #TimVLFTheme

#Themes.Insert Item(#NewTheme)

SET Com(#NewTheme) SymbolicName("MYTHEME1") Description('Tims Theme') VLWebApplicationTheme("TIMTHEME1")

4) And finally in the uInitialize routine in your system IIP set the web theme then the VLF theme.
#sys_web.WebPage.Theme <= #TimTheme1
#USYSTEM.CurrentTheme <= #TimVLFTheme