Difference between revisions of "VS:ShowItem"

From Vectorworks Developer
Jump to: navigation, search
m (1 revision)
 
Line 50: Line 50:
 
PROCEDURE dialogID_Setup;
 
PROCEDURE dialogID_Setup;
 
BEGIN
 
BEGIN
dialogID := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel');
+
  dialogID := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel');
CreateRadioButton (dialogID,  4,  'Option One');
+
  CreateRadioButton (dialogID,  4,  'Option One');
CreateEditReal    (dialogID,  5,  1, 0.0, 16);
+
  CreateEditReal    (dialogID,  5,  1, 0.0, 16);
CreateRadioButton (dialogID,  6,  'Option Two');
+
  CreateRadioButton (dialogID,  6,  'Option Two');
CreateEditReal    (dialogID,  7,  1, 0.0, 16);
+
  CreateEditReal    (dialogID,  7,  1, 0.0, 16);
SetFirstLayoutItem(dialogID,  4);
+
  SetFirstLayoutItem(dialogID,  4);
SetRightItem      (dialogID,  4,  5,  0, 0);
+
  SetRightItem      (dialogID,  4,  5,  0, 0);
SetBelowItem      (dialogID,  4,  6,  0, 0);
+
  SetBelowItem      (dialogID,  4,  6,  0, 0);
SetRightItem      (dialogID,  6,  7,  0, 0);
+
  SetRightItem      (dialogID,  6,  7,  0, 0);
 
END;
 
END;
  
Line 64: Line 64:
 
BEGIN
 
BEGIN
 
CASE item OF
 
CASE item OF
SetupDialogC:
+
  SetupDialogC: BEGIN
BEGIN
+
      ShowItem(dialogID, 4, TRUE);
SetItem(4, TRUE);
+
      ShowItem(dialogID, 7, FALSE);
ShowItem(dialogID, 7, FALSE);
+
    END;
END;
+
  4: BEGIN
4:
+
      ShowItem(dialogID, 5, TRUE);
BEGIN
+
      ShowItem(dialogID, 7, FALSE);
ShowItem(dialogID, 5, TRUE);
+
    END;
ShowItem(dialogID, 7, FALSE);
+
  6: BEGIN
END;
+
      ShowItem(dialogID, 7, TRUE);
6:
+
      ShowItem(dialogID, 5, FALSE);
BEGIN
+
    END;
ShowItem(dialogID, 7, TRUE);
+
  END;
ShowItem(dialogID, 5, FALSE);
+
END;
+
END;
+
 
END;
 
END;
  
 
BEGIN
 
BEGIN
dialogID_Setup;
+
  dialogID_Setup;
IF RunLayoutDialog(dialogID, dialogID_Handler) = 1 then BEGIN
+
  IF RunLayoutDialog(dialogID, dialogID_Handler) = 1 THEN BEGIN
END;
+
  END;
 
END;
 
END;
 
RUN(dialogID_Main);
 
RUN(dialogID_Main);

Latest revision as of 21:04, 14 September 2018

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


Description

Sets the visibility of the referenced dialog control.
PROCEDURE ShowItem(
dialogID  :LONGINT;
item  :INTEGER;
show  :BOOLEAN);
def vs.ShowItem(dialogID, item, show):
    return None

Parameters

dialogID LONGINT ID of the currently executing dialog.
item INTEGER Item ID of dialog control to show or hide.
show BOOLEAN New visibility state of dialog control.

Example

VectorScript

PROCEDURE dialogID_Main;
VAR
dialogID :INTEGER;

PROCEDURE dialogID_Setup;
BEGIN
  dialogID := CreateLayout('Example Dialog', FALSE, 'OK', 'Cancel');
  CreateRadioButton (dialogID,  4,  'Option One');
  CreateEditReal    (dialogID,  5,  1, 0.0, 16);
  CreateRadioButton (dialogID,  6,  'Option Two');
  CreateEditReal    (dialogID,  7,  1, 0.0, 16);
  SetFirstLayoutItem(dialogID,  4);
  SetRightItem      (dialogID,  4,   5,  0, 0);
  SetBelowItem      (dialogID,  4,   6,  0, 0);
  SetRightItem      (dialogID,  6,   7,  0, 0);
END;

PROCEDURE dialogID_Handler(VAR item :LONGINT; data :LONGINT);
BEGIN
CASE item OF
  SetupDialogC: BEGIN
      ShowItem(dialogID, 4, TRUE);
      ShowItem(dialogID, 7, FALSE);
    END;
  4: BEGIN
      ShowItem(dialogID, 5, TRUE);
      ShowItem(dialogID, 7, FALSE);
    END;
  6: BEGIN
      ShowItem(dialogID, 7, TRUE);
      ShowItem(dialogID, 5, FALSE);
    END;
  END;
END;

BEGIN
  dialogID_Setup;
  IF RunLayoutDialog(dialogID, dialogID_Handler) = 1 THEN BEGIN
  END;
END;
RUN(dialogID_Main);

Python


Version

Availability: from VectorWorks11.5
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox