« MBS Xojo Plugins, ver… | Home | MBS Xojo Developer Co… »

NSSegmentedControl and NSPathControl

For Xojo in macOS we got two new controls for you:

Sample controls

The NSSegmentedControlControlMBS control hosts a NSSegmentedControlMBS view to show a button with multiple segments. Similar to the SegmentedControl in Xojo itself. You can query the NSSegmentedControlMBS object for the SegmentedControl to configure it with more options.

The NSPathControlControlMBS control hosts a NSPathControlMBS view to show a file path visually to the user. You may have seen this in the Finder in various places. The texts will localize automatically to the user and it shows icons for the folders if they have one.

On the way to implement this control we added two new events for NSPathControlMBS class: willDisplayOpenPanel and willPopUpMenu. This events allow you to customize the control for what shows up when it shows a menu because there is not enough space available to show the full path. Further customization is possible using NSPathComponentCellMBS, the cell subclass to display the path components.

We know that control is double there, but that's how the scheme works. We take the name of the view and append Control for the hosting control object in Xojo. The API 2 version has a Desktop prefix added automatically. But otherwise both variants are identical.

The new controls are available for version 24.0 for you to try. The control works on macOS only, but you can put it on a window and it will do nothing for Linux and Windows. If you use API 2 for your desktop projects, you will automatically use DesktopNSPathControlControlMBS and DesktopNSPathControlControlMBS controls. The biggest plugin in space...
10 01 24 - 12:37