Skip to content

1.2.0

Latest

Choose a tag to compare

@mrsw mrsw released this 30 Nov 10:33
· 2 commits to main since this release

Added

  • TS4YHTMLEditor: the new property PlaceholderHTMLStyle chooses how the placeholders are written in the HTML. phsChip (the default) is the element with the look of the chip, as before; phsNone writes only the text of the placeholder, like any other text of the document, with the bold and the colors that the user gave it and without the element and the bold of the chip, so that a template engine fills in the values without leaving the look of a chip around them. The placeholders are found again when the HTML is loaded, and the look in the editor does not change.
  • TS4YTag and TS4YChip: short colored labels with a text, an icon or a picture on the left and a close button on the right, as wide as their content. The tag classifies (Urgent, Draft); the chip is chosen by the user: it reacts to the mouse, to the finger and to the keyboard, can be clicked, chosen alone or in a group of chips (GroupName, as radio buttons), and closed with its button or with Delete. Six kinds (neutral, primary, success, warning, danger, info) give the color, with three variants (filled, tonal, outlined), three shapes and three sizes, the large one on Android and iOS, and the colors of the kinds come from the style. A chosen chip is drawn with a stronger variant and a check mark. OnClose can stop the control from being hidden. MaxWidth limits the width that follows the text, cutting it with an ellipsis. The look comes from a style for each platform, S4YTagStyle and S4YChipStyle, whose parts are seen and changed in the style designer; the style can give the colors of the text of the tonal and outlined variants, to use them on a dark background. The mobile gallery has a page for them, with the group and the edit too.
  • TS4YChipGroup: chips made from a list of texts (Items), of which the user chooses one, some or none (SelectionMode), read with ItemIndex, Selected and SelectedItems, with OnChange; Tab enters the group on one chip and the arrow keys move among the chips. TS4YChipEdit: a text field where each entry becomes a chip, as the recipients of an email: Enter, a separator, the loss of the focus or a paste create the chips, Backspace removes the last one, OnValidate refuses a text or accepts it with another kind (a danger for an invalid address), OnAdd and OnRemove, AllowDuplicates and MaxItems. Both wrap the chips on new lines, with AutoSize and MaxHeight, and scroll with the wheel and the finger when the content is longer; the edit has a style, S4YChipEditStyle. The tag, the chip and the chips of the group and the edit can have a free size (tgzCustom with Height) and their own TextSettings (family, style and, with a style of their own, size of the font) and HorizontalPadding. The group and the edit have a style each (S4YChipGroupStyle, S4YChipEditStyle) with a frame, the space inside it (the part content) and a TS4YChip that is the model of their chips: its size, font, padding, shape and variant are the ones of the chips of the control, as the badge of the TS4YExpander is in its style. The style of the edit also has a TEdit that is the model of its text field, with its own font.
  • TS4YPopover: a popover, a box with an arrow shown next to a control, that holds a frame of the application with what the user needs (a filter, a small form, a menu of choices). The frame is an ordinary frame, designed in the designer of the frames, outside the form; if it wants to know the popover and what happens to it (it opened, it is about to close, it closed) it implements the interface IS4YPopoverContent. The header of the box, a Title and a close button (ShowCloseButton), is set in the popover. The popover is a component with no control in the form: ContentClass (or OnCreateContent) gives the frame, and it opens from the code, where you choose, with Open(Control), OpenAt(Form, Point) or Toggle(Control), so that nothing is attached to the events of the controls. The same popover can open for several controls. The box is shown in a layer over the form, below the control, above it or on the sides (Placement), moved inside the form with the arrow that points at the control; a click outside closes it and goes no further (CloseOnOutsideClick), Esc closes it on Windows, only one is open at a time, and OnBeforeClose and OnClose give the reason. Animated, AnimationDuration, CacheContent (the frame is kept between the openings) and ShowArrow can be set. The look, with the arrow, the shadow, the header and the close button, comes from a style S4YPopoverStyle for each platform. The layer over the form and the placement are shared with the tooltip. It has been tried on Windows and, in the gallery of the phones, on an Android device.
  • TS4YTooltip: the tooltips of the application, in place of the native tooltip of the platform: a box with an arrow, a title and a text that shows the Hint of the controls. One component, in a form, a frame or a data module (or made in the code with Application as owner), is enough for all the controls; they need no other setting. The hint can be Title|Text, or only the text. The tooltip takes Application.OnHint and passes the call on to the handler that was there, uses Hint, ShowHint, ParentShowHint and Application.ShowHint as every tooltip, and waits the delay of the platform (ShowDelay; on Windows the double click time). The box is shown in a layer over the form, below the control, above it if there is no room, or on the sides (Placement), against the control or against the mouse cursor (Anchor); it is moved inside the form and the arrow keeps pointing at the control. MaxWidth, AutoHideDelay, ShowArrow, Animated and AnimationDuration can be set, and OnBeforeShow changes the texts or cancels the tooltip. The look, with the arrow, comes from a style S4YTooltipStyle for each platform. On Windows the native tooltip is turned off and the tooltip hides when a button of the mouse or Esc is pressed. The native tooltip of macOS is not turned off yet, and Android and iOS have no tooltips yet.
  • TS4YRating: a rating made of stars, to show a value or to let the user choose it. Value goes from 0 to MaxValue (5 by default) and can have decimals: the last star that has a part of the value is filled in proportion, and a value set by the code is never rounded. Step is how the user chooses it: whole stars (1), half stars (0.5), tenths (0.1) or any value (0), following the pointer exactly. When the value changes the stars fill smoothly, one after the other (AnimationDuration); while the user drags the value follows the pointer with no delay. The user chooses with the mouse (with a preview of where the click would arrive), with the finger by tapping and dragging, and with the keyboard (the arrows, Home, End and the digits); touching again the chosen value clears it (AllowClear). ReadOnly, StarSize, Spacing, FilledColor and EmptyColor can be set, and the size follows the stars (AutoSize). The shape of the star, its size and the colors come from a style S4YRatingStyle for each platform, so another path in the style gives another shape. The value can be bound with the LiveBindings, as the one of a track bar: a link to a field gives the value to the rating, and the change of the user goes to the field at once with Track or when the rating loses the focus, with the dataset in edit mode. The mobile gallery has a page for it.
  • TS4YSkeleton: a skeleton, grey shapes with a band of light that crosses them, that take the place of the content of a container (Target) while its data are loaded, shown and hidden with Active and a fade. The shapes are made from the controls of the container: a label gets lines of text, as many as its text takes and the last one shorter, a circle or an avatar a circle, any other control without controls inside a rounded rectangle, a container the shapes of its controls; the controls are not touched, the skeleton is drawn by a cover put over the target, which does not disturb a container that lays out its controls (the flexbox). Rules and ClassRules choose another shape for a control or for a class, OnGetShape does it from the code, and ManualShapes add shapes tied to a control, in pixels or in percent of its size, so that they follow it. The shimmer is the same for all the skeletons, so that the light is in step; there is also a pulse and no animation. The colors follow the background, light or dark, until they are set. A command of the context menu of the component, Show preview, draws the skeleton still over the target in the form designer, to set the rules and the shapes while they are seen; the preview is not saved in the form. The mobile gallery has a page for it.
  • TS4YSnackbar: a message over the form with a kind (information, success, warning, danger) that gives it an icon, drawn as a path, and a colored bar, and an optional action such as Undo, a text button that runs your code, fires OnAction and closes the message. Show returns the id of the message and Close(Id) closes it, also while it waits in the queue; OnClose tells the id and why it went (its time was over, the user closed it, the user pressed the action, the code closed it). A tap or a click closes the message, a close button is shown on a desktop (CloseButton), and on a phone the message can be dragged sideways to dismiss it. On Android the message is announced to TalkBack. It shares the layer, the queue, the positions and the animations of TS4YToast; the look comes from a style S4YSnackbarStyle for each platform, whose colors and icons can be changed in the style designer. The mobile gallery has a page for it.
  • TS4YToast: a toast, a short text message that appears over the form, stays for a few seconds and goes away by itself, shown with Show or, without a component on the form, with the class procedure Notify. The messages that arrive together are stacked from the edge of the position, up to MaxVisible, and the others wait in a queue; the toast is at most three lines long, fades in while it slides from the edge, closes with a tap or a click and, on a desktop, does not run out of time while the mouse is over it. Position (top, center, bottom, top right, bottom right, or automatic: bottom on a phone and bottom right on a desktop), Duration (0 to keep the toast until it is tapped), Width, Margin, Spacing and AnimationDuration can be changed, CloseAll closes the toasts and OnClose tells the message of the one that went. The look comes from a style S4YToastStyle for each platform. On Android UseNativeOnAndroid shows the toast of the system instead, which is seen when the application is in the background. On a phone the toasts at the bottom go up over the virtual keyboard. The mobile gallery has a page for it.
  • TS4YCard: a card, a container with a header (Title, Subtitle, and controls at its start and at its end), a content area, a footer (ShowFooter) and a shadow drawn by the style (Elevation from 0 to 3). The controls put on the card go to the content, which Align = Client fills; the controls of the header and of the footer are chosen from the form in the lists HeaderStartControls, HeaderEndControls and FooterControls, stored in the form by reference, and the card sets their position; each part has an area of its own that is hidden with it, and the content and the areas clip their controls. The line under the header is shown only when the card has content. ShowMenuButton shows the menu button, the three dots at the end of the header, drawn by the style, with the event OnMenuButtonClick and MenuButtonPopupPoint to open a popup menu under it. With Clickable the card works as a button, with a hover, a pressed state, the focus and Enter or Space. Corner radius, colors and the spaces around the parts can be changed; the look comes from a style S4YCardStyle for each platform.
  • TS4YButton: a button that is both a TButton and a TSpeedButton. It has the focus, Default and Cancel, the images and the tint of the icon of the TButton; from the TSpeedButton, the toggle (StaysPressed, IsChecked) and the groups of buttons that release each other (GroupName, shared with the TSpeedButton), with Checked and GroupIndex from an action; and it implements IEditControl, so that a TEdit takes it as one of its buttons, beside the text, and a click on it gives the focus to the edit. The space key toggles the button and clicks it, as the mouse does. DisableFocusEffectOnClick hides the focus effect on the click.
  • TS4YComboBox: a TComboBox that the user cannot change when its new property ReadOnly is True, or when it is bound to a link that does not allow editing, as a view that is not in edit mode: the mouse wheel, the drop down and the characters and navigation keys do nothing, and the wheel goes to the parent. The value can still be changed by code and by the binding. The RTL TComboBox lets the user change the value, and through the binding the model, in those cases.
  • TS4YLayout and TS4YFlowLayout: layouts that take the size of their content. TS4YLayout is a TLayout with AutoSize, which makes it as high or as wide as its children on the axis that its Align leaves free (both with Align = None or Center), and with SizeConstraints, the minimum and maximum width and height. TS4YFlowLayout is a TFlowLayout whose height follows its lines of controls, so that what is below it moves when the controls wrap on a new line; AutoSize is on by default. The mobile gallery uses it for the tags and chips of its page.
  • TS4YAvatar: the picture of a person, or the initials of the name on a color chosen from it, always the same for the same name, or the outline of a person without picture and name. The picture comes from a bitmap or an image list and fills the shape, a circle, a square with rounded corners or a square, keeping its proportions. Ready sizes or a free one, a ring around the avatar, a dot with the state of the person (online, away, busy, offline) in a corner, and a camera button on the edge, always shown or only under the mouse, that fires an event or executes an action: with the actions of FMX that take a photo from the camera or the gallery of the phone, the photo becomes the picture of the avatar. On the phones the button reacts to the finger in a larger area. A TS4YBadge on the avatar shows a counter of notifications. The look comes from a style for each platform.
  • TS4YStepProgressBar: progress indicator made of steps along a horizontal or vertical line, with completed, current, pending and failed steps, an animated line that can also show the progress inside the current step, steps that the user can select with the mouse and the keyboard, with a halo around the step under the mouse pointer, and a look that comes from a style, where the markers and the line can have any shape and whose parts are seen and changed in the style designer. The size of the markers, also different for each state, their position on the line or beside it, the spaces between markers, line and labels, and the visibility of the line can be set. The list of the steps has always a first and a last step, and the steps are edited in the IDE with an editor of their own, opened also with a double click on the control. Each step can have a look of its own in the states chosen, with its marker settings, a part of the style for the marker and a text of the style for the caption; the first and the last step of a new control have a start and an end marker.
  • TS4YLinearGauge: gauge drawn as a horizontal or vertical bar that fills with a value in a range, with a caption and the value written on one side of the bar. A large change of the value is animated, the value has a format of its own or a text given by an event, and the look comes from a style, where the track and the fill can have any shape; properties can replace their brushes. The parts of the styles of the linear and circular gauges and of the meters are seen and changed in the style designer.
  • TS4YCircularGauge: gauge drawn as a ring, an open arc or a half circle that fills with a value in a range, with the value and the caption in the middle. The start, the length and the direction of the arc can be set, so that it can be drawn in any position, also upside down or on a side; it has the same range, animation, format of the value, brushes and style mechanism as TS4YLinearGauge, and the arcs of the style give the brush and the round or flat ends.
  • TS4YLinearMeter and TS4YCircularMeter: the linear and the circular gauge with a graduation, like a ruler or a thermometer and like the dial of an instrument. The graduation has major ticks with their numbers and minor ticks between them, on either side of the bar or inside or outside the arc, with an automatic or fixed step, a format of the numbers, and ticks and numbers whose look comes from the style. Ranges of values with their colors are drawn on the track, in thin bands on its sides or in both places, the fill can take the color of the range of the value, and a target value can be marked across the track. The circular meter shows the value with a needle, with the texts beside its center on the side opposite to the arc and the fill hidden by default; the linear meter can add a pointer beside the bar and hide the fill.
  • TS4YSkinCircularGauge: circular gauge whose look is made only of the parts of its style, such as a dial and a needle drawn as images or shapes, resized together with the gauge, also in the form designer. The gauge turns the needle of the style to the value, with the angles and the center of rotation of a hidden arc of the style or with its own angles, and writes the value and the caption in the texts of the style; it has the same range, animation and format of the value as the other gauges. The collection Needles turns other needles of the style to values of their own, with their own range, scale and wrap around the scale, for the hands of a clock or a small dial inside the main one.
  • TS4YSkinLinearGauge: linear gauge whose look is made only of the parts of its style, such as a thermometer or a level drawn as images or shapes. The gauge moves a pointer of the style along a scale of the style, horizontal or vertical and from either end, uncovers the filled part of an image of the style and writes the value and the caption in the texts of the style. The collection Pointers moves other pointers of the style to values of their own.
  • TS4YPieChart: pie chart, or ring chart with a hole in the middle, with a legend on any side, values, percents or captions written inside or beside the slices, the total in the middle of the ring, an animation when the chart appears and when its data change, and a click on a slice. The slices are stored in the form or filled by the LiveBindings through a standard TLinkGridToDataSource, kept apart from the stored ones, with the current record following the current slice and an event to change the look of each bound slice. The colors come from a palette, of the chart or of the style, and the look from a style, whose parts are seen and changed in the style designer, as in the styles of the bar and line charts. Placed on a form in the IDE, the pie, bar and line charts start with sample data, stored as the data of the user.
  • TS4YBarChart: bar chart, with vertical or horizontal bars, categories and series side by side, a value axis with an automatic or fixed range and grid lines, grid lines between the categories, values written beyond the bars, negative values, a legend of the series, animation and a click on a bar. Like the pie chart, the data are stored in the form or filled by a TLinkGridToDataSource, where each column after the first is a series, with events to change the look of the bound series and categories.
  • TS4YLineChart: line chart, with the same categories, series, axes and LiveBindings as the bar chart, a line for each series with points on the values, and the area under the lines that can be filled with the color of the series.
  • TS4YGrid: grid (a TGrid) with a filter row under the header, where the user writes for each column a filter made of an operator and a value (abc, = abc, ! abc, abc*, *abc, > 10, <= 15/03/2026, = for the empty values, <> for the others, double quotes for a text as it is), read with the type of the column: text, number, date, time, a value of a list (a TPopupColumn or the values given in FilterItems, also as text and value, such as Open=1, filled from an enumerated type with SetFilterEnum, for columns whose cells show a text for each value); a check column has a check box with three states. A text that cannot be read takes a color of the style, and Esc clears a filter. The button of each field opens a menu with the operators, the values of the list, a calendar, today or the current time and an item that clears the filter, which the application can change with OnFilterMenu or replace with a TPopupMenu of its own; the style of the popup, of its items and of its calendar can be chosen. The filters apply only while the filter row is shown, which the user shows and hides with a button on the right side of the header or with Ctrl+Shift+F, and the application with ToggleFilterRow; the settings of the grid and the public properties Filtered and Sorted can be bound with the LiveBindings, which are told when they change. The grid fires OnFilter when the application must filter its data, with Enter or by itself after a pause in the typing with AutoFilter, and gives the operator and the value of each filter, for a query, or compares the values of the rows with FilterMatches, for the data in memory. A footer can show under each column the sum, the average, the count, the lowest or the highest value of the rows of the grid, or a text, with the format of the column or one of its own, and OnGetFooterText to change it. The filter row and the footer are added to the style of the grid, from the platform or from a style book, which can give them a background, the font of the footer and the space around the editors and the texts, and follow the width, the order, the visibility and the horizontal scroll of the columns. A style S4YGridStyle in the style book is the style of all the grids of the form, and Edit Custom Style copies the parts of the filter row and of the footer too, ready to be changed. A click on the header sorts the rows by a column, Shift+click by more columns, Ctrl+click removes a column and Alt+click goes back to the order of the data; the header shows the arrow of the direction and the position of each key, and the application sorts its data in OnSort. The height of the header can come from the style, from HeaderHeight or from the height of the rows, which it then follows when RowHeight changes.
  • TS4YHTMLEditor on Android and iOS works with the virtual keyboard of the platform: a tap shows it, and the letters, the suggestions and the corrections of the keyboard, Backspace and Enter go into the document. The new properties KeyboardType and ReturnKeyType choose the keyboard and the label of its Enter key. A finger scrolls the document with inertia, a tap puts the caret, a long press or a double tap selects a word, with two handles to change the selection and the Cut, Copy, Paste and Select all menu of the platform.
  • TS4YHTMLEditor: the new method InsertEmbeddedImage inserts an image file at the caret as a data: URI, with the bytes of the file as they are (a JPEG stays a JPEG), and the optional width, height and alternative text; the new function ImageFileToDataURI of the unit Soft4You.HTML.Types gives only the URI of a file, for InsertHTML.
  • TS4YHTMLEditor: the new property PlainText and the method TS4YHTMLDocument.ToPlainText write the document as plain text, for example for the text part of an e-mail: paragraphs and headings separated by an empty line, lists with - and 1. , links as text (address), images as their alternative text, tables with the cells of a row separated by a tab, quotes with > . PlainTextWidth (the parameter of ToPlainText) sets the longest line, with the text going to the next line between two words.
  • TS4YHTMLEditor: Backspace at the start of the paragraph after a table, or Delete at the end of the paragraph before it, selects the table, and a second press deletes it; the new method DeleteTable deletes the selected table or the one of the caret. Before, the key did nothing there.
  • TS4YHTMLEditor: the new method GetImages lists the images of the document (source, kind, path of the local file, size and whether LocalImageAccess allows it), HasRemoteImages tells whether some come from the network, and GetHTMLWithImageSources and GetFullHTMLWithImageSources give the HTML with the source of each image replaced by a function of the caller, for example by cid: references to send the document by e-mail. The document is not changed.

Fixed

  • TS4YHTMLEditor: the Font property is now the base font of the whole document. Before, it changed only the text typed into an empty document, while the text of the document and the text loaded from HTML stayed at 12 pt. The HTML written by the editor has no font-family and no font-size for the base font, the text with a size of its own keeps it, and changing Font at run time changes the text that used the previous one and redraws the document. The sizes of the headings and the steps of IncreaseFontSize and DecreaseFontSize are in proportion to the size of Font: with 12 pt they are the same as before (headings 24, 20, 16, 14, 12 and 10 pt; steps 8, 10, 12, 14, 18 and 24 pt), with 14 pt the headings are 28 pt and the steps 9, 12, 14, 16, 21 and 28 pt. The new overload FontSizePresets(ABaseFontSize) gives the steps for a base size. The default font is that of a new TFont (Segoe UI 12 pt on Windows), now also shown by the Object Inspector instead of an empty family. TS4YHTMLParser and TS4YHTMLGenerator have the new properties BaseFontName and BaseFontSize, which start from the same default.
  • TS4YHTMLEditor reads the named HTML entities of Latin-1 and the most common others, such as &egrave;, &euro;, the typographic quotes, &bull; and the arrows, which were left in the text as written when the HTML was not made by the editor; an unknown entity stays as written. &mdash; and &ndash; now become the characters of the long and the short dash, instead of -- and -.
  • TS4YHTMLEditor bound to a field with a TLinkControlToField follows Track of the link: the field receives the HTML after every edit with Track on, else when the editor loses the focus. Before, the field was written after every key, even with Track off, without putting the source into edit mode, and the value given back by the link could move the caret to the start and clear the undo history. Undo and redo reach the field, and removing the link gives back the ReadOnly the editor had before.
  • TS4YBadge and TS4YExpander use a style named S4YBadgeStyle or S4YExpanderStyle in the style book of the form or in the active style, instead of always the style linked into the package. A StyleLookup that names no style makes them use their own style: before, they were left without one.
  • TS4YExpander: OnExpandedChanged fires after the height of the control is set, and with Animated when the animation ends, so that a handler that reads Height finds the final one. Before, it fired first and found the height that the base class sets for a moment. A change made while the animation runs replaces it, and the event fires once, when the last one ends. Existing forms keep their handler.
  • TS4YExpander no longer raises an access violation when it is destroyed after the icon or the badge of its style has already been freed elsewhere: those parts now tell the expander when they are freed, and it forgets them.
  • On Android TS4YBadge and TS4YExpander had no style linked into the application and could not be drawn. Every control with a style of its own now links a style for each platform, Windows, macOS, Android and iOS: the four are identical, and the one of a platform can be changed without touching the others.

Breaking changes

  • TS4YFlexSizeConstraints is renamed TS4YSizeConstraints and moves to the new unit Soft4You.FMX.Controls.Types, to be shared with TS4YLayout; the unit Soft4You.FMX.Controls.FlexBox.SizeConstraints is removed. The SizeConstraints property of the flexbox items and the forms do not change. The projects that declare a variable of the old type use the new name and add the new unit to the uses.
  • S_EDITOR_FONT_NAME and C_EDITOR_FONT_SIZE of the unit Soft4You.HTML.Types are removed: the base font of the HTML editor is its Font property, and the default is the font of a new TFont; GetDefaultBaseFont gives it. The projects that use the constants read Editor.Font.Family and Editor.Font.Size instead, or GetDefaultBaseFont when there is no editor.