VS:SetLayoutDialogPosition

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

This function moves the dialog window to the given location. Call this function to override the default automatic positioning of the dialog window. The dialog will be pinned so that it is at least partly onscreen.

This function can be useful for displaying a dialog in a position in which it was placed during prior use.

FUNCTION SetLayoutDialogPosition(
dialogID  :LONGINT;
left  :INTEGER;
top  :INTEGER) : BOOLEAN;
def vs.SetLayoutDialogPosition(dialogID, left, top):
    return BOOLEAN

Parameters

dialogID LONGINT Index of the dialog.
left INTEGER Location of left edge of dialog in pixels.
top INTEGER Location of top edge of dialog in pixels.

Return Value

true - success - the dialog window was moved.

false - failure - the dialog window was not moved, likely because it does not currently exist, or the dialogID is invalid. The dialog window will exist anytime between the Setup message and OK/Cancel message.

Example

VectorScript

PROCEDURE Dialog;
VAR
   id,tmpInt : INTEGER;
   result : BOOLEAN;

   PROCEDURE dialog_Handler(VAR item : LONGINT; data : LONGINT);
   BEGIN
      CASE item OF
         SetupDialogC:
         BEGIN
            result:=SetLayoutDialogPosition(id,100,100);
         END;
         1: ;
         2: ;
      END;
   END;
   
BEGIN
   id:=CreateLayout('Title',FALSE,'OK','Cancel');
   CreateStaticText(id,100,'Message',20);
   SetFirstLayoutItem(id,100);
   tmpInt:=RunLayoutDialog(id,dialog_Handler);
END;
RUN(Dialog);

Python


Version

Availability: from VectorWorks11.0

See Also

VS Functions:

VS:GetLayoutDialogPosition

VS Functions: [[VS:GetLayoutDialogPosition]]
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox