Style modules and classes
Attached controls canât be styled with these systems, to detach, cut the label or other attached control and re-paste it.
There are a variety of different styling approaches being implemented.
Control and Form Designers
Section titled âControl and Form DesignersâLatest version of styling.
In these classes, methods are called and the styling is coded into the form itself.
Usage (in Form_Open):
Dim Style As ControlDesignerClassDim Layout As FormDesignerClassDim ctl As Control
On Error GoTo Error_Handler
Set Layout = New FormDesignerClass Set Style = New ControlDesignerClass
Application.Echo False
Layout.Form = Me Call Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)
Call Style.DefineColumnWidth(12, Me.Form.InsideWidth)
For Each ctl In Me.Form.Controls Style.Control = ctl With ctl Select Case .Name Case "txtRecordingID", "txtProjectID" .Top = 0 .Left = 0 Style.DisplayHidden Case "cmdOpenRecording", "imgRecordingType" .width = Style.ColumnWidth * 1.5 .Top = Theme.HeightUnit * 0.5 .Left = 0 .ControlTipText = "Click to open chart" Style.CenterOnWidth Call Style.Mixin_ImageWithButton(bIsThumbnail:=True) Case "txtSongTitle" .width = Style.ColumnWidth * 7 .Top = Theme.HeightUnit * 0.5 .Left = Style.ColumnWidth * 1.5 .BorderWidth = 0 .BorderStyle = 0 Style.CenterOnWidth Style.Text ("h3") Case "txtRecordingType", "lblRecordingType" .Top = Theme.HeightUnit * 0.5 .Left = Style.ColumnWidth * 8.5 .width = Style.ColumnWidth * 3.5 Style.Mixin_InputBox ("display") Style.CenterOnWidth Case "cmdGoToProjectSong" .Top = Theme.HeightUnit * 1.5 .Left = Style.ColumnWidth * 1.5 .width = Style.ColumnWidth * 4 Style.Mixin_Button ("rounded") Style.CenterOnWidth End Select End With Next ctl
Application.Echo TrueControlDesignerClass
Section titled âControlDesignerClassâDim Style As ControlDesignerClassDim ctl As Control
Set Style = New ControlDesignerClass
Call Style.DefineColumnWidth(12, Me.Form.InsideWidth)
For Each ctl In Me.Form.Controls Style.Control = ctl With ctl Select Case .Name Case "txtRecordingID", "txtProjectID" .Top = 0 .Left = 0 Style.DisplayHidden Case "cmdOpenRecording", "imgRecordingType" .width = Style.ColumnWidth * 1.5 .Top = Theme.HeightUnit * 0.5 .Left = 0 .ControlTipText = "Click to open chart" Style.CenterOnWidth Style.Mixin_ImageWithButton(bIsThumbnail:=True) Case "txtSongTitle" .width = Style.ColumnWidth * 7 .Top = Theme.HeightUnit * 0.5 .Left = Style.ColumnWidth * 1.5 .BorderWidth = 0 .BorderStyle = 0 Style.CenterOnWidth Style.Text ("h3") Case "txtRecordingType", "lblRecordingType" .Top = Theme.HeightUnit * 0.5 .Left = Style.ColumnWidth * 8.5 .width = Style.ColumnWidth * 3.5 Style.Mixin_InputBox ("display") Style.CenterOnWidth Case "cmdGoToProjectSong" .Top = Theme.HeightUnit * 1.5 .Left = Style.ColumnWidth * 1.5 .width = Style.ColumnWidth * 4 Style.Mixin_Button ("rounded") Style.CenterOnWidth End Select End WithNext ctlOrdering Properties
Section titled âOrdering PropertiesâThe ordering of the propeties is important!
width and height, then positioning, those values are relied on by the other properties:
.width = Style.ColumnWidth * 3.Top = Theme.HeightUnit * 5.left = Style.ColumnWidth * 8âComponentâ styles should be called next,
Call Style.Mixin_Button("rounded")Style.CenterOnWidth must be called after .width.
Miscelaneous and Style overrides are last.
.ControlTipText = "Click to open chart"Style.CenterOnWidthStyle.DisplayHiddenStyle.Text ("h3")Mixins take arguments
Section titled âMixins take argumentsâStyle.Mixin_Button ("rounded")Style.Mixin_DeleteButtonStyle.Mixin_ImageWithButton(bIsThumbnail:=True)Mixin_InputBox(Optional strType As String = âdefaultâ, Optional withLabel = True)
strType
- default- displayProperties
Section titled âPropertiesâ.width = Style.ColumnWidth * 1.5.height = Me.Form.InsideHeight - Theme.HeightUnit * 0.5.Top = 0.Top = Theme.HeightUnit * 0.5.Left = 0.BackColor = Theme.LightColor.BorderWidth = 0.BorderStyle = 0.ControlTipText = "Click to ...".FontSize = 18 ' 14, 18.FontWeight = 600 '100=thin, 200=extra light, 300=light, 400=normal, 500=medium, 600=semi-bold, 700=bold, 800=extra bold, 900=heavyFormDesignerClass
Section titled âFormDesignerClassâMethods for setting the head, detail and footer.
SetDetail(3, Theme.MediumColor, Theme.LightColor)Usage (in Form_Open):
Dim Layout As FormDesignerClass
Set Layout = New FormDesignerClass
Layout.Form = MeCall Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)Used by FormDesignerClass and ControlDesingerClass.
Example with colors
Layout.SetDetail(3, Theme.MediumColor, Theme.LightColor)Example with sizes
Top = Theme.HeightUnit * 0.5clsDesign
Section titled âclsDesignâDeprecated method.
Class called on form open for styling the form, call individual styles per form.
This contains the styling for the form, alphabetically filtered.
cssControl
Section titled âcssControlâUsed in add songs.
cssReport
Section titled âcssReportâused in setlist