SDK:Layout Manager Concept: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
Line 5: Line 5:
== Cross-Platform Dialogs ==
== 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.  Nemetschek North America encourages SDK developers to use this method for implementing a user interface.   
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]]).  
The Layout Manager system consists of two phases: dialog creation([[SDK:Creating Dialogs]] and [[SDK:Arrange Controls]]), and dialog management ([[SDK:Managing Dialogs]]).  

Latest revision as of 12:52, 16 September 2015

.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