SDK:Layout Manager Concept

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

.SDK|SDK ..SDK:Types|SDK Types ..SDK:Using the SDK|Using the SDK ..VCOM:VCOM (Vectorworks Component Object Model)|VCOM Basics ..VCOM:Class Reference|VCOM Class Reference

Cross-Platform Dialogs

The Layout Manager is the recommended way to implement dialogs for SDK Plug-ins. It allows you to define a user interface once using the cross-platform VectorScript syntax and then ask Vectorworks to create and display your dialog for you. Vectorworks will display a dialog on each platform that looks appropriate for that platform. It will automatically adjust the position of dialog items based on the current font size. Vectorworks encourages SDK developers to use this method for implementing a user interface.

The Layout Manager system consists of two phases: dialog creation(SDK:Creating Dialogs and SDK:Arrange Controls), and dialog management (SDK:Managing Dialogs).

SDK developers should specify the dialog using VectorScript in a Macintosh 'TEXT' resource and manage the dialog with the SDK API.

The complete layout manager API is available in both the C++ SDK and in VectorScript, which means there are several ways to use the layout manager. The technique used here is the most common.

Dialog Resources

Usually the dialog is provided as VectorScript code as a separate file (.vs). The resources for this dialog, usually are provided by the same named file with extension (.r).

The plug-in project includes the dialog string resource (.r) file:

#include "MyDialog.r"

And 'MyDialog.r' string resource file includes the VectorScript definition of the dialog (.vs) file, and provides strings for the dialog:

read 'TEXT' (11000, "MyDialog")	   "MyDialog.vs";

resource 'STR#' (11000, "MyDialog") {
    /* [1] */ "OK",
    /* [2] */ "Cancel",
    /* [3] */ "...",

Creating Dialogs

Managing Dialogs

Control Specific