VLF-ONE DataTable Color Changes

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: 642
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

VLF-ONE DataTable Color Changes

Post by jyoung » Thu Sep 20, 2018 4:22 am

In VLF-ONE I have a data table that contains a Reusable Part and a couple strings

Code: Select all

define_com class(#PRIM_LIST.Part) name(#ColumnASCCHDP011) columnwidth(3) design(#ASCCHDInstanceListCellDesign) displayposition(1) parent(#DataList) columncaption('Name') columnunits(Proportion)
define_com class(#PRIM_LIST.String) name(#ColumnWK_STR21) columnwidth(1) displayposition(2) parent(#DataList) source(#wk_String2) columncaption('Date') columncaptiontype(Caption) columnunits(Proportion)
define_com class(#PRIM_LIST.String) name(#ColumnWK_STR31) columnwidth(1) displayposition(3) parent(#DataList) source(#wk_String3) columncaption('Amount') columncaptiontype(Caption) columnunits(Proportion)
The part looks like this.

Code: Select all

function options(*DIRECT)
begin_com role(*EXTENDS #PRIM_PANL *implements #Prim_List.iListCellDesign *ListFields #ListFields) displayposition(1) left(0) tabposition(1) top(0) width(361) layoutmanager(#MainLayout) themedrawstyle('ForegroundTheme') height(145)

* ================================================================================
* LAYOUT
* ================================================================================
define_com class(#PRIM_VS.Style) name(#Style1) fontsize(80) fontunits(Percent)

define_com class(#PRIM_TBLO) name(#MainLayout)
define_com class(#PRIM_TBLO.Row) name(#Layout1Row1) displayposition(1) parent(#MainLayout)
define_com class(#PRIM_TBLO.Column) name(#Layout1Column1) displayposition(1) parent(#MainLayout)
define_com class(#PRIM_TBLO.Item) name(#MainLayoutItem1) alignment(CenterLeft) column(#Layout1Column1) manage(#NameLabel) parent(#MainLayout) row(#Layout1Row1) sizing(FitToWidth) flow(CenterVertical)
define_com class(#PRIM_TBLO.Item) name(#MainLayoutItem2) alignment(CenterLeft) column(#Layout1Column1) manage(#PayLabel) parent(#MainLayout) row(#Layout1Row1) sizing(FitToWidth) flow(CenterVertical) marginleft(10)
define_com class(#PRIM_TBLO.Item) name(#MainLayoutItem3) alignment(CenterLeft) column(#Layout1Column1) manage(#BillLabel) parent(#MainLayout) row(#Layout1Row1) sizing(FitToWidth) flow(CenterVertical) marginleft(10)

define_com class(#PRIM_MD.Label) name(#NameLabel) displayposition(1) left(0) parent(#COM_OWNER) tabposition(1) top(35) width(361) caption('[Name]') height(25)
define_com class(#PRIM_MD.Label) name(#PayLabel) caption('[PayDescription]') displayposition(2) parent(#COM_OWNER) tabposition(2) top(60) width(351) height(25) style(#Style1)
define_com class(#PRIM_MD.Label) name(#BillLabel) caption('[Bill Description]') displayposition(3) parent(#COM_OWNER) tabposition(3) top(85) width(351) height(25) style(#Style1)

* ================================================================================
* UI COMPONENTS
* ================================================================================

* ================================================================================
* FIELDS
* ================================================================================
group_by name(#ListFields) fields(#wk_String1 #STD_CODES)

* ================================================================================
* ROUTINES
* ================================================================================
mthroutine name(OnAdd) options(*REDEFINE)

#NameLabel := #wk_String1

if (#STD_CODES = P)
#COM_SELF.ToggleDescriptions( True )
else
#COM_SELF.ToggleDescriptions( False )
endif
endroutine

mthroutine name(ToggleDescriptions)
define_map for(*INPUT) class(#PRIM_BOLN) name(#pVisible)

#PayLabel.Visible := #pVisible
#BillLabel.Visible := #pVisible
endroutine
end_com
Nothing terribly special.

When this renders, the RP text is lighter than the other columns
capture3.PNG
capture3.PNG (16.37 KiB) Viewed 2099 times
Why is this?

The same thing DOES NOT happen in normal VLWeb.

I can change it to be different colors when the themes, but leaving the theme empty renders a light grey. That SAME CONTROL (PRIM_MD.Label) outside a list renders the correct color.

I have a theme Customizer in place:

Code: Select all

function options(*DIRECT)
begin_com role(*EXTENDS #VF_AC033O)

define_com class(#VF_SY170O) name(#VF_SY170O)

mthroutine name(Customize) options(*REDEFINE)

define_com class(#PRIM_ALPH) name(#lBlue)
define_com class(#PRIM_ALPH) name(#lPurple)

* #lBlue := "0:114:198"
#lBlue := "0:82:136"
#lPurple := "102:57:183"

for each(#theme) in(#Themes)
case of_field(#theme.SymbolicName)
when ('= MATERIALBLUE' '= BLUE')
#theme.BaseTitleStyle.NormBackColor := #lBlue
#theme.FloatingPanel_AtFrontTitleStyle.NormBackColor := #lBlue
#theme.FloatingPanel_AtFrontBorderBrush.Color := #lBlue
otherwise
#theme.Enabled := False
endcase
endfor

endroutine

end_com
And a Theme

Code: Select all

begin_com role(*EXTENDS #PRIM_THM) basetheme(MaterialDesignBlue) theme500color(0:118:192) theme700color(0:82:136) theme100color(0:150:214) themeaccentmediumcolor(102:57:180) themetextcolor(88:89:91)

define_com class(#PRIM_THM.DrawStyle) name(#PopupTitleBar) style(#Style1)
define_com class(#PRIM_VS.Style) name(#Style1) backgroundbrush(#Brush1) foregroundbrush(#Brush2)
define_com class(#PRIM_VS.SolidBrush) name(#Brush2) color(255:255:255)
define_com class(#PRIM_VS.SolidBrush) name(#Brush1) color(Theme700)

end_com

MarkD
Posts: 620
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE DataTable Color Changes

Post by MarkD » Fri Sep 21, 2018 9:21 am

I tried out your list and RP in my system using a shipped theme and could not reproduce the problem:

Capture.PNG
Capture.PNG (28.11 KiB) Viewed 2079 times

Could you swap out your custom VL theme and use a shipped one instead to see it that makes the problem go away?

MarkD
Posts: 620
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE DataTable Color Changes

Post by MarkD » Fri Sep 21, 2018 9:24 am

Also, when you say "The same thing DOES NOT happen in normal VLWeb" does that mean in normal VL-Web using your customized VL theme?

jyoung
Posts: 642
Joined: Thu Jan 21, 2016 6:43 am
Location: Oklahoma City, OK USA

Re: VLF-ONE DataTable Color Changes

Post by jyoung » Sat Sep 22, 2018 1:01 am

Right. In VLWeb using my custom theme I don't have the same issue.

After much trial and error and inspecting the elements in Google Chrome's Dev Tools, I saw that the RP elements color was (88 89 91 .087) whereas all other elements where "inherit".

Started poking around for that RBG combo and realized that there was an entry in the theme that matched.
themetextcolor(88:89:91)

Removing that line solved the issue, but brings up another question.

If that is supposed to be the "base text color" why were the other controls not that color?

MarkD
Posts: 620
Joined: Wed Dec 02, 2015 9:56 am

Re: VLF-ONE DataTable Color Changes

Post by MarkD » Fri Sep 28, 2018 4:55 pm

I notice that most of the VLF_ONE main container panels panes start with a standard global reference to

Define_Com Class(#VF_SY001O) Name(#uSystem) Scope(*APPLICATION)

and then do this when starting up .................

#COM_OWNER.Style <= #uSystem.CurrentTheme.BaseFormBackgroundandFont

Does doing that have any influence on this?

Post Reply