Skip to content

Version 3.0.0

Choose a tag to compare

@Abduction-Lamp Abduction-Lamp released this 22 Sep 23:40
· 7 commits to master since this release

The release takes the major number: the rename below breaks every
installation of 2.1.0.

Added

  • ReadOnly: Boolean, default False. 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, while Checked set from code works as always and still raises
    OnChange. It is not Enabled := 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, and OnClick, which reports a switch that changed, does not fire.

  • An accelerator in the header. &Sound underlines 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, so KeyboardToggle off or ReadOnly on 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, default True. The header font used to follow
    Font only until something assigned to HeaderFont, 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 to True returns the header to Font at once.

  • TCustomFluentToggleSwitch, the ancestor that carries the implementation.
    TFluentToggleSwitch descends 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 using TFluentToggleSwitch is
    unaffected: the class name, the published properties and the .dfm it
    streams are what they were.

  • Right-to-left layout. BiDiMode was published from the start and never
    read, so a switch on a right-to-left form laid itself out left to right. At
    bdRightToLeft the 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. TextPosition and HeaderAlignment are read the way the
    text runs, as TCheckBox and TLabel read Alignment. 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; elsewhere BiDiMode still
    changes nothing.

Changed

  • Breaking. An ampersand in HeaderText is 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 reads Sound vibration with the space underlined, and measures
    narrower, so a switch left at AutoSize changes width with it. Doubling the
    ampersand keeps the old picture: Sound && vibration.

  • Breaking. A compiled package carries the compiler version in its name:
    FluentToggleSwitchR370.bpl under Florence, FluentToggleSwitchR290.bpl
    under Athens, the way RAD Studio names rtl290 and vcl370. Both packages
    used to build as FluentToggleSwitchR.bpl and FluentToggleSwitchD.bpl
    whichever IDE produced them. Inside the IDE that collided with nothing, since
    every version keeps its own Bpl directory, 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 in LICENSE, a description naming the package, and a
    comment pointing at the repository. The properties of a .bpl now say who
    made it and under what licence — which is worth something, since the file
    travels without LICENSE beside it.

Upgrading from 2.1.0

The .bpl files are renamed, so the IDE still has the old ones registered.

  1. Under Component → Install Packages remove the entry without a version
    suffix, FluentToggleSwitchD.bpl, and FluentToggleSwitchR.bpl if it is
    listed there too.
  2. Delete FluentToggleSwitchR.bpl and FluentToggleSwitchD.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, .bpi and .lib in $(BDSCOMMONDIR)\Dcp
    keep their names: the suffix applies to the .bpl alone, so those files are
    simply overwritten and must stay.
  3. Build and install the packages again, as in Installing in the README.