-
Notifications
You must be signed in to change notification settings - Fork 10
August22
- Application
- Container
- FileSystem
- Font
- Format
- Frontend
- Json
- Overview
- Spinner
- Splitter
- TextEditor
- TextInput
- Tools
- Unit Tests
- Window
Here is a list of updates made during the month of August. Some of the updates will be mentioned here. For a full list of updates, please refer to the commit history. A big thanks to thnom for providing additional support.
The biggest update for this month is the File Dialog. This offers a cross platform way of navigating the file system and selecting a file for either opening or saving. The native system file dialog is also supported on Windows and Mac.
A couple of updates have been made to the Application interface.
The Application now provides a callback to set the contents of the system's clipboard.
Window related callbacks have been refactored into a single function OnWindowAction. This accepts an enum WindowAction along with a pointer to the window. Actions can be things like 'Create', 'Destroy', 'Raise', etc.
The Container class will now serialize all child controls in the OnSave function. The Container's 'IsInLayout' function will now check if any of its parents are in a layout. This helps with preventing child controls to be invalidated when they are already being processed.
A new interface has been introduced called the FileSystem. The goal of this interface is to provide a platform independent way of accessing the file system and perform operations on them such as iterating directory items or querying path information.
Opening a file dialog is now supported through the library's FileSystem interface. The dialog is a modal window that is displayed that shows a tree of directories on the left and the directory items of the selected directory on the right. An item can be selected and returned when the confirm button is pressed.
The FileSystem interface also allows the native file dialog to be displayed instead of the library defined one. This is done with the 'UseSystemFileDialog' property in the 'Application' object of a Json. There is also an API function provided to toggle this flag. The system file dialog is only supported on Mac and Windows at the moment.
All fonts are now aware of the number of spaces a tab character should use. This is currently stored as a static variable within the Font class, but would like to move this into a FontSettings object in the future.
Clang-Format has been changed to convert all tabs to spaces. Tabs could be configured differently on each dev machine. By converting to spaces, this allows for consistent spacing across all platforms and editors.
The Frontend interface has seen some changes. To fully support the various WindowActions, some platform specific function calls need to be made using a native handle. Both SDL2 and SFML provide access to these handles. These handles are then passed into the function API where the appropriate system calls are handled depending on if the platform is Mac, Linux, or Windows.
The Json class now supports converting an object to a pretty stream. This means that objects are properties are put on their own lines. This allows for easier readability when debugging the library.
The Overview app has added examples for a Splitter control and a spinner control.
A new Spinner control has been added. This control displays an integer value and can be incremented/decremented with arrow buttons. The buttons can be oriented vertically or horizontally. A minimum and maximum value can be set using the 'Range' object with a 'Min' and 'Max' property. Thanks to thnom for implementing this control.
Splitter controls have seen some updates this month. The separator has been modified to extend the full length of this control. This separator position can now be set using a normalized value between 0 and 1.
A new boolean theme property 'TextEditor_InsertSpaces' has been added. This property when true will convert any tab characters to spaces using the Font's tab size value. The default tab size is 4 spaces.
Below is a list of updates that have been made to the TextInput control.
The TextInput control now has the ability to limit the number of characters that can be accepted. This is done through the 'MaxCharacters' property. If it is 0, which is the default, then no limit is imposed. Thanks to thnom for implementing this feature.
A 'SelectAll' API function has been added to easily select the full buffer that is contained within the control.
Information for updates on various tools are listed below.
An additional command has been added to the command palette.
- dumpjson - The 'dumpjson' command will print out a Json string of the current window to standard out. This also copies the string to the system's clipboard so that it can be pasted in other applications. The command has an optional argument 'pretty' to print the string in a pretty format for easier readability.
The history of commands for a single session is now stored. Whenever a valid command is given, it is stored and can be accessed to be used again. The up/down keys can be used to navigate the history.
The Inspector tool has been updated to improve performance when interacting with the tool. The inpsector tree now loads child controls on demand as opposed to filling out the entire tree when opened.
A fix has been made to properly allow the profiler to make subsequent runs after the first one.
The testing framework now accepts an additional argument 'Verbose'. This will print out each test case that is run for a test suite.
Additional tests have been added to the following test suites:
- TextInput
Below is a list of updates made to the Window interface.
Modal windows are now supported. These are windows which will always be displayed on top of other windows. The top window on the modal window stack will be the only window that can accept events while events for all other windows are ignored except for the resize event. The background windows can be moved and resized but will receive no other event. The SDL and SFML frontends have implemented support for this when applicable. If not applicable, then a platform specific call is made to make this support work.
The mouse cursor will now change to the arrow cursor upon entering.