Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/Reference/CustomControls/Enumerations/CornerShape.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,16 @@ Determines how a single corner of a control is shaped. Carried by [**Corner.Shap
| **tbCurve**{: #tbCurve } | 0 | Quarter-circle round corner; the radius gives the curve. |
| **tbNotched**{: #tbNotched } | 1 | Diagonal notch across the corner; the radius gives the cut depth. |
| **tbCutOut**{: #tbCutOut } | 2 | Inverse round-corner — the corner area is carved *out* of the control. |

[**Corners.SetAll**](../Styles/Corners#setall) applies one shape to every corner at once; setting [**TopLeft**](../Styles/Corners#topleft) / [**TopRight**](../Styles/Corners#topright) / [**BottomLeft**](../Styles/Corners#bottomleft) / [**BottomRight**](../Styles/Corners#bottomright) individually lets the shapes mix:

```tb
With btnDemo.NormalState.Corners
.TopLeft.Shape = tbCurve : .TopLeft.Radius = 16 ' rounded
.TopRight.Shape = tbNotched : .TopRight.Radius = 16 ' diagonal cut
.BottomLeft.Shape = tbCutOut : .BottomLeft.Radius = 16 ' carved-out
.BottomRight.Shape = tbCurve : .BottomRight.Radius = 0 ' sharp 90°
End With
```

A [**Radius**](../Styles/Corners#radius) of 0 produces a sharp 90° corner regardless of [**Shape**](../Styles/Corners#shape); a radius greater than or equal to half the control's smaller dimension turns a [**tbCurve**](#tbCurve) corner into a quarter-circle that touches the centreline, which is the technique the package's `Circle` sample button uses to render a full circle from a rectangular control.
14 changes: 14 additions & 0 deletions docs/Reference/CustomControls/Enumerations/DockMode.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,17 @@ How a control is positioned relative to its container — pinned to one edge, fi
| **tbDockRight**{: #tbDockRight } | 3 | Pinned to the container's right edge. Width is preserved; height is stretched. |
| **tbDockBottom**{: #tbDockBottom } | 4 | Pinned to the container's bottom edge. Height is preserved; width is stretched. |
| **tbDockFill**{: #tbDockFill } | 5 | Fills the entire remaining client area, after other docked siblings have claimed their edges. |

Order matters when more than one sibling is docked inside the same container: each docked control claims its edge from whatever client area remains *after* its earlier-added siblings have claimed theirs. The control with **Dock = tbDockFill** is therefore added last so that it inherits the residual space:

```tb
Private Sub Form_Load()
lblHeader.Dock = tbDockTop ' pinned to the top, full width
lblStatus.Dock = tbDockBottom ' pinned to the bottom, full width
pnlTree.Dock = tbDockLeft ' pinned to the left, between header and status
pnlAside.Dock = tbDockRight ' pinned to the right, between header and status
pnlMain.Dock = tbDockFill ' fills whatever is left in the middle
End Sub
```

Setting **Dock** to anything other than **tbDockNone** makes the control's own [**Anchors**](../Styles/Anchors) irrelevant — docking takes over the position and size completely. To return to manual positioning, set **Dock** back to **tbDockNone**.
18 changes: 18 additions & 0 deletions docs/Reference/CustomControls/Enumerations/FillPattern.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,21 @@ Identifies how the colour table held by a [**Fill**](../Styles/Fill) is applied
| **tbGradientCornerBottomRightAlt**{: #tbGradientCornerBottomRightAlt } | 20 | Alternate bottom-right corner gradient with the stops mirrored. |

The colour table itself comes from the array of [**FillColorPoint**](../Styles/Fill#fillcolorpoint-class) values inside [**Fill.ColorPoints**](../Styles/Fill#colorpoints), interpolated to the configured [**Granularity**](../Styles/Fill#granularity).

The same two-stop pair painted with three different patterns produces three quite different results:

```tb
' Top fades to bottom
pnlOne.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
Pattern:=tbGradientNorthToSouth

' Left fades to right
pnlTwo.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
Pattern:=tbGradientWestToEast

' Emanates from the top-left corner
pnlThree.BackgroundFill.SetSimplePattern vbWhite, &H99CCFF, _
Pattern:=tbGradientCornerTopLeft
```

For a flat region with no gradient at all, use **tbPatternNone** — the `Fill` becomes fully transparent and the area behind the control shows through.
18 changes: 18 additions & 0 deletions docs/Reference/CustomControls/Styles/Borders.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,24 @@ Reached as `<state>.Borders`, [**CellRenderingOptions.Borders**](../WaynesGrid/C
btnGo.NormalState.Borders.SetSimpleBorder StrokeSize:=1, ColorRGB:=vbBlack
```

Layered borders — multiple [**Border**](#border-class) instances stroked in order — are assigned to the [**Elements**](#elements) array directly. Each element can have its own [**StrokeSize**](#strokesize) and its own [**Fill**](Fill), so a thin black outline can sit on top of a wide coloured band, or three bands of different colours can stack into a "shadow":

```tb
Dim elems(0 To 2) As Border
Set elems(0) = New Border
elems(0).StrokeSize = 4
elems(0).Fill.ColorPoints.SetSolidColor vbBlack
Set elems(1) = New Border
elems(1).StrokeSize = 7
elems(1).Fill.ColorPoints.SetSolidColor &H99CCFF ' light blue band
Set elems(2) = New Border
elems(2).StrokeSize = 4
elems(2).Fill.ColorPoints.SetSolidColor &H4D7AB4 ' deeper blue
btnGo.NormalState.Borders.Elements = elems
```

A single [**Border**](#border-class) can also carry a gradient instead of a solid colour — assign a multi-stop [**Fill**](Fill) to its [**Fill**](#fill) member. Set [**BlendWithBackgroundFill**](#blendwithbackgroundfill) to **True** on a translucent border to make it tint with the control's own **BackgroundFill** rather than with whatever lies under the control.

* TOC
{:toc}

Expand Down
13 changes: 13 additions & 0 deletions docs/Reference/CustomControls/Styles/Corners.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ With btnGo.NormalState.Corners
End With
```

The three [**CornerShape**](../Enumerations/CornerShape) values can mix on a single control. Setting [**TopLeft**](#topleft), [**TopRight**](#topright), [**BottomLeft**](#bottomleft), and [**BottomRight**](#bottomright) individually gives full control over the silhouette:

```tb
With btnTab.NormalState.Corners
.TopLeft.Shape = tbCurve : .TopLeft.Radius = 12
.TopRight.Shape = tbCurve : .TopRight.Radius = 12
.BottomLeft.Shape = tbNotched : .BottomLeft.Radius = 0
.BottomRight.Shape = tbNotched : .BottomRight.Radius = 0
End With
```

A circular control is just a square one with all four corners set to [**tbCurve**](../Enumerations/CornerShape#tbCurve) and a radius greater than or equal to half the control's smaller dimension — that is what the `Circle` button in the package's sample forms uses.

* TOC
{:toc}

Expand Down
12 changes: 12 additions & 0 deletions docs/Reference/CustomControls/Styles/Fill.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ btnGo.HoverState.BackgroundFill.SetSimplePattern vbBlue, vbWhite, _
Pattern:=tbGradientNorthToSouth
```

For three or more colour stops, build [**FillColorPoint**](#fillcolorpoint-class) instances and pass them to [**SetColorPoints**](#setcolorpoints). The stops accept fully-opaque ARGB literals (`&HFF` alpha in the high byte) — see [**ColorRGBA**](../Enumerations/ColorRGBA) for the encoding:

```tb
With pnlHeader.BackgroundFill
.Pattern = tbGradientNorthToSouth
.ColorPoints.SetColorPoints _
New FillColorPoint(&HFFF3E58F, 0), _
New FillColorPoint(&HFF99CCFF, 50), _
New FillColorPoint(&HFF014C99, 100)
End With
```

* TOC
{:toc}

Expand Down
19 changes: 19 additions & 0 deletions docs/Reference/CustomControls/Styles/TextRendering.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ With lblTitle.TextRendering
End With
```

[**Fill**](#fill) can hold a gradient just as well as a solid colour, so glyphs themselves can be painted with a top-to-bottom or corner-to-corner colour transition. [**Outlines**](#outlines) is an array of [**Border**](Borders#border-class) elements stroked around the glyphs — a single thin black outline gives a "stickered" look; layering several outlines with different [**StrokeSize**](Borders#strokesize) values produces a glow or drop-shadow:

```tb
With lblBanner.TextRendering
.Font.Size = 32
.Font.Weight = tbBold
.Alignment = tbAlignMiddleCenter
.Fill.SetSimplePattern vbWhite, &HCCCCFF, _
Pattern:=tbGradientNorthToSouth
Dim outline(0 To 0) As Border
Set outline(0) = New Border
outline(0).StrokeSize = 2
outline(0).Fill.ColorPoints.SetSolidColor vbBlack
.Outlines = outline
End With
```

Set [**OverflowMode**](#overflowmode) to **tbShrinkToFit** to scale the glyphs down rather than truncating with an ellipsis when the text is too long for the available width — useful on fixed-width labels whose caption is set at runtime from data of unpredictable length.

* TOC
{:toc}

Expand Down
9 changes: 9 additions & 0 deletions docs/Reference/CustomControls/WaynesForm/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ Private Sub Form_Load()
End Sub
```

[**BackgroundFill**](#backgroundfill) is an ordinary [**Fill**](../Styles/Fill), so the form can carry a gradient backdrop just as easily as a solid colour — this is what the package's `HelloWorld` sample form uses to give itself a soft top-to-bottom wash:

```tb
Private Sub Form_Load()
Me.BackgroundFill.SetSimplePattern &HE5E5E5, &HF8F8F8, _
Pattern:=tbGradientNorthToSouth
End Sub
```

* TOC
{:toc}

Expand Down
2 changes: 2 additions & 0 deletions docs/Reference/CustomControls/WaynesFrame.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Private Sub Form_Load()
End Sub
```

Frames work well as containers for [**Dock**](Enumerations/DockMode)-positioned children. Set the frame's own **Dock** to **tbDockFill** so it claims the form's body, then dock its children to **tbDockTop** / **tbDockLeft** / **tbDockFill** / etc. — the docking calculation walks the container tree, so children dock to the frame's client area rather than to the form. The order in which the children are added still determines which edges they claim first.

## Properties

### Anchors
Expand Down
22 changes: 22 additions & 0 deletions docs/Reference/CustomControls/WaynesGrid/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,28 @@ Private Sub Grid1_GetCellText( _
End Sub
```

The six [**CellRenderingOptions**](CellRenderingOptions) sub-objects ([**ColumnHeaderOptions**](#columnheaderoptions), [**RowHeaderOptions**](#rowheaderoptions), [**CellOptions**](#celloptions), [**HoverCellOptions**](#hovercelloptions), [**SelectedCellOptions**](#selectedcelloptions), [**MultiSelectCellOptions**](#multiselectcelloptions)) give the grid its visual personality. A typical setup gives headers a gradient, body cells left-aligned text with a small left-padding indent, and the selected cell a contrasting border:

```tb
With Grid1.ColumnHeaderOptions
.Fill.SetSimplePattern &HE0E0E0, &HC0C0C0, _
Pattern:=tbGradientNorthToSouth
.TextRendering.Font.Weight = tbBold
.TextRendering.Alignment = tbAlignMiddleCenter
End With

With Grid1.CellOptions
.Fill.ColorPoints.SetSolidColor vbWhite
.TextRendering.Alignment = tbAlignMiddleLeft
.TextRendering.Padding.Left = 10
End With

With Grid1.SelectedCellOptions
.Fill.ColorPoints.SetSolidColor &HFFEEDD ' pale blue
.Borders.SetSimpleBorder StrokeSize:=2, ColorRGB:=vbBlue
End With
```

* TOC
{:toc}

Expand Down
15 changes: 15 additions & 0 deletions docs/Reference/CustomControls/WaynesLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ Private Sub Form_Load()
End Sub
```

Because [**BackgroundFill**](#backgroundfill) and [**TextRendering**](#textrendering) accept the same [**Fill**](Styles/Fill) gradients and the same [**Outlines**](Styles/TextRendering#outlines) array as any other control, a label can serve as a banner, header strip, or status panel without dropping a heavier control onto the form. Setting [**TextRendering.OverflowMode**](Styles/TextRendering#overflowmode) to **tbShrinkToFit** keeps a dynamically-set caption visible even when it is wider than the label:

```tb
With Label1.TextRendering
.Font.Size = 24
.Font.Weight = tbBold
.Alignment = tbAlignMiddleCenter
.OverflowMode = tbShrinkToFit
.Fill.SetSimplePattern vbWhite, &HCCCCFF, _
Pattern:=tbGradientNorthToSouth
End With
Label1.BackgroundFill.SetSimplePattern &H014C99, &H99CCFF, _
Pattern:=tbGradientNorthWestToSouthEast
```

## Properties

### Anchors
Expand Down
20 changes: 20 additions & 0 deletions docs/Reference/CustomControls/WaynesSlider/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,26 @@ Private Sub Form_Load()
End Sub
```

[**Value**](#value) is just a **Long** property — assigning to it from outside the control moves the block and triggers a repaint. Combined with a [**WaynesTimer**](../WaynesTimer), the slider can animate itself across its range:

```tb
Private Sub Form_Load()
sldProgress.MinValue = 0
sldProgress.MaxValue = 100
sldProgress.Value = 0
Timer1.Interval = 50
Timer1.Enabled = True
End Sub

Private Sub Timer1_Timer()
If sldProgress.Value < sldProgress.MaxValue Then
sldProgress.Value = sldProgress.Value + 1
Else
Timer1.Enabled = False
End If
End Sub
```

* TOC
{:toc}

Expand Down
22 changes: 22 additions & 0 deletions docs/Reference/CustomControls/WaynesTextBox/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,28 @@ Private Sub Form_Load()
End Sub
```

The three states are styled independently — a common pattern is to give the focused state a heavier border in an accent colour and brighten its fill, so the active field stands out from its siblings:

```tb
Private Sub Form_Load()
With txtName.NormalState
.BackgroundFill.ColorPoints.SetSolidColor vbWhite
.Borders.SetSimpleBorder StrokeSize:=1, ColorRGB:=&HC0C0C0
.Corners.SetAll tbCurve, 4
.TextRendering.Padding.Left = 6
.TextRendering.Padding.Right = 6
End With

With txtName.FocusedState
.BackgroundFill.ColorPoints.SetSolidColor vbWhite
.Borders.SetSimpleBorder StrokeSize:=2, ColorRGB:=&HC07014 ' accent blue
.Corners.SetAll tbCurve, 4
.TextRendering.Padding.Left = 6
.TextRendering.Padding.Right = 6
End With
End Sub
```

* TOC
{:toc}

Expand Down
Loading