Repository navigation
Version 3.0.0
The release takes the major number: the rename below breaks every
installation of 2.1.0.
Added
-
ReadOnly: Boolean, defaultFalse. A read-only switch shows a value the
user may not change: the pointer, the space bar and a drag of the thumb are
all closed, whileCheckedset from code works as always and still raises
OnChange. It is notEnabled := False— the switch keeps its normal
colours, stays in the tab order and still takes the focus when clicked. Since
nothing the user does reaches it, there is no hover highlight and no pressed
state, andOnClick, which reports a switch that changed, does not fire. -
An accelerator in the header.
&Soundunderlines the S, and Alt+S gives the
switch the focus and toggles it, the way an accelerator works a check box.
Both halves follow the rules a click follows: the value changes only where the
keyboard may change it, soKeyboardToggleoff orReadOnlyon leaves the
switch as it was, and the focus is taken only where a click would take it. The
underline keeps to the convention Windows sets for the window: hidden until
Alt is pressed, like the focus ring. -
ParentHeaderFont: Boolean, defaultTrue. The header font used to follow
Fontonly until something assigned toHeaderFont, and after that there was
no way back: the flag that remembered it was internal and write-once, so a
header font touched once in the designer stayed detached for good, with
nothing in the Object Inspector to say so or undo it. The flag is now a
property, and putting it back toTruereturns the header toFontat once. -
TCustomFluentToggleSwitch, the ancestor that carries the implementation.
TFluentToggleSwitchdescends from it and does nothing but publish
properties, so a component descending from the custom class can publish its
own selection or leave a property out. Code usingTFluentToggleSwitchis
unaffected: the class name, the published properties and the.dfmit
streams are what they were. -
Right-to-left layout.
BiDiModewas published from the start and never
read, so a switch on a right-to-left form laid itself out left to right. At
bdRightToLeftthe switch is now mirrored, the way WinUI, Android and iOS
mirror theirs: the thumb rests at the right end while off and travels left
to turn on, the caption goes to the other side of the track, the header and
the switch under it align against the other edge, and both lines are read
right to left.TextPositionandHeaderAlignmentare read the way the
text runs, asTCheckBoxandTLabelreadAlignment. The two reading-only
modes change the reading order alone. As everywhere in the VCL, this takes a
system set up for a right-to-left language; elsewhereBiDiModestill
changes nothing.
Changed
-
Breaking. An ampersand in
HeaderTextis no longer drawn as one. It marks
the letter after it, and&&draws a single ampersand, as in every VCL
caption. A header that carried a literal ampersand —Sound & vibration—
now readsSound vibrationwith the space underlined, and measures
narrower, so a switch left atAutoSizechanges width with it. Doubling the
ampersand keeps the old picture:Sound && vibration. -
Breaking. A compiled package carries the compiler version in its name:
FluentToggleSwitchR370.bplunder Florence,FluentToggleSwitchR290.bpl
under Athens, the way RAD Studio namesrtl290andvcl370. Both packages
used to build asFluentToggleSwitchR.bplandFluentToggleSwitchD.bpl
whichever IDE produced them. Inside the IDE that collided with nothing, since
every version keeps its ownBpldirectory, but two applications deployed
with runtime packages into one directory overwrote each other's copy, and the
name said nothing about which was which. -
Each package states what it is for. The runtime package is runtime only and
no longer appears in Component → Install Packages, where installing it
registered nothing; the design-time package is design-time only. Their
descriptions name the role, so the two are no longer identical entries in the
IDE lists. -
Both packages build for Win64 as well as Win32, and so do the tests. The
runtime package targeted Win32 alone while the README promised both, so a
Win64 application built with runtime packages had nothing to link against.
The component source needed no change for it — no pointer casts, no
assembler, no platform conditionals — and the tests pass on both platforms.
The Win64 design-time package installs into the 64-bit IDE of Florence. -
Both packages are set to explicit rebuild, the way component libraries
ship: a project that requires them no longer rebuilds them under its own
settings. -
The version resource of both packages is filled in: company, product and
copyright as they read inLICENSE, a description naming the package, and a
comment pointing at the repository. The properties of a.bplnow say who
made it and under what licence — which is worth something, since the file
travels withoutLICENSEbeside it.
Upgrading from 2.1.0
The .bpl files are renamed, so the IDE still has the old ones registered.
- Under Component → Install Packages remove the entry without a version
suffix,FluentToggleSwitchD.bpl, andFluentToggleSwitchR.bplif it is
listed there too. - Delete
FluentToggleSwitchR.bplandFluentToggleSwitchD.bpl— the ones
without a suffix — from$(BDSCOMMONDIR)\Bpl. Nothing rebuilds them any
more, and while they are there a project asking for the package by name can
still find them. The.dcp,.bpiand.libin$(BDSCOMMONDIR)\Dcp
keep their names: the suffix applies to the.bplalone, so those files are
simply overwritten and must stay. - Build and install the packages again, as in Installing in the README.