AddButton Dialogs - Custom 

Declaration:

PROCEDURE   AddButton
(   buttonStr :STRING;
    itemID :INTEGER;
    buttonType :INTEGER;
    x1 :INTEGER;
    y1 :INTEGER;
    x2 :INTEGER;
    y2 :INTEGER
) ;

Description:

Procedure AddButton defines the standard button types(such as the OK or Cancel buttons, check boxes, radio buttons) within a custom dialog definition.

In addition to the regular button styles, there are also two "auto" button styles. These styles(check box and radio button) automatically handle user selection- deselection, and can be activated or deactivated by calling SetItemEnable.

To create a default button, assign the button an item ID of 1.

Table - Custom Dialog Button Styles

Button Style Style Constant
Standard Button 1
Check Box 2
Radio Button 3
Auto Check Box 4
Auto Radio Button 5



Parameters:

buttonStr Descriptive text for dialog button.
itemID Unique itemID for the dialog button, in a range of 1-50.
buttonType Style of dialog button control.
x1 Top left X coordinate of button bounding box.
y1 Top left Y coordinate of button bounding box.
x2 Bottom right X coordinate of button bounding box.
y2 Bottom right Y coordinate of button bounding box.

Example:

AddButton('Hot Fudge',4,3,25,60,125,80);

See Also:

SetItemEnable  



  AddChoiceItem Dialogs - Custom 

Declaration:

PROCEDURE   AddChoiceItem
(   choiceTitle :STRING;
    itemID :INTEGER;
    choiceType :INTEGER;
    x1 :INTEGER;
    y1 :INTEGER;
    x2 :INTEGER;
    y2 :INTEGER
) ;

Description:

Procedure AddChoiceItem adds a choice item control to a custom dialog definition. A choice item allows the user to select an item from multiple list options. Currently, the only supported choice item control type is a combo box/popup menu control; 1 should always be passed as the itemID parameter.

Combo Box-Popup Default State





Combo Box-Popup Open State



Parameters:

choiceTitle Descriptive text string for the choice item.
itemID Unique item ID for the choice item control, in a range of 1-50.
choiceType The type(style) of choice item control to be displayed.
x1 Top left X coordinate of the control bounding box.
y1 Top left Y coordinate of the control bounding box.
x2 Bottom right X coordinate of control bounding box.
y2 Bottom right Y coordinate of control bounding box.

Example:

AddChoiceItem('Topping Type',4,1,25,50,150,115);



  AddField Dialogs - Custom 

Declaration:

PROCEDURE   AddField
(   fieldStr :STRING;
    itemID :INTEGER;
    fieldType :INTEGER;
    x1 :INTEGER;
    y1 :INTEGER;
    x2 :INTEGER;
    y2 :INTEGER
) ;

Description:

Procedure AddField defines a static or editable text field within the custom dialog definition.

Note: Static and editiable text fields can be activated or deactivated using SetItemEnable().

Table - Field Types

Button Style Style Constant
Static Text Field 1
Editable Text Field 2



Text Field Types


Parameters:

fieldStr The descriptive text for the field item.
itemID Unique item ID for the dialog field, in a range of 1-50.
fieldType The type of field item to be displayed.
x1 Top left X coordinate of field item bounding box.
y1 Top left Y coordinate of field item bounding box.
x2 Bottom right X coordinate of field item bounding box
y2 Bottom right Y coordinate of field item bounding box.

Example:

AddField('Enter number:',4,1,35,64,115,80);



  AddGroupBox Dialogs - Custom 

Declaration:

PROCEDURE   AddGroupBox
(   s :STRING;
    item :INTEGER;
    left :INTEGER;
    top :INTEGER;
    right :INTEGER;
    bottom :INTEGER
) ;

Description:

Procedure AddGroupBox adds a group box to a custom dialog.

Group Box Dialog Control


Parameters:

s Group box title string.
item Dialog item ID value.
left Top left X coordinate of group box bounds in dialog.
top Top left Y coordinate of group box bounds in dialog.
right Bottom right X coordinate of group box bounds in dialog.
bottom Bottom right Y coordinate of group box bounds in dialog.

Example:

AddField('Find:',3,1,16,10,95,36);
AddField('',4,2,20,30,305,46);
AddField('Replace with:',5,1,16,59,113,75);
AddField('',6,2,20,80,305,96);
AddGroupBox('Options',7,20,110,305,250);	
AddChoiceItem('Text Options',8,1,27,135,152,145);
AddChoiceItem('Layer Options',9,1,27,165,152,175);



  AutoKey Dialogs - Custom 

Declaration:

FUNCTION   AutoKey
VAR asciiCode:LONGINT ) :BOOLEAN ;

Description:

Function AutoKey returns TRUE if a non-modifier keyboard character has been continually depressed for longer than the system defined key repeat rate. If a keyboard character has been continually depressed, then ASCII code of the character is returned in parameter asciiCode.

Modifier keys are defined as the Caps Lock, Command, Control, Option, and Shift keys.

Parameters:

asciiCode The ASCII code of the key depressed.

Example:

WHILE NOT AutoKey(keyHit) DO
BEGIN
     SysBeep;
     SysBeep;
END;
Message('The key pressed was ',keyHit);



  BeginDialog Dialogs - Custom 

Declaration:

PROCEDURE   BeginDialog
(   dialogID :INTEGER;
    dialogType :INTEGER;
    x1 :INTEGER;
    y1 :INTEGER;
    x2 :INTEGER;
    y2 :INTEGER
) ;

Description:

Procedure BeginDialog begins the custom dialog definition process. All VectorScript calls made between the BeginDialog and EndDialog will be used to construct a custom dialog.

Parameters:

dialogID Unique identifier ID for dialog(in a range of 1-32).
dialogType Dialog style(always pass 1 for this parameter).
x1 Top left X coordinate of custom dialog window.
y1 Top left Y coordinate of custom dialog window.
x2 Bottom right X coordinate of custom dialog window.
y2 Bottom right Y coordinate of custom dialog window.

Example:

BeginDialog(1,1,TLeft,100,BRight,SCH);



  ClrDialog Dialogs - Custom 

Declaration:

PROCEDURE   ClrDialog
;

Description:

Procedure ClrDialog closes a dialog which is currently displayed.



  DelChoice Dialogs - Custom 

Declaration:

PROCEDURE   DelChoice
(   item :INTEGER;
    whichChoice :INTEGER
) ;

Description:

Procedure DelChoice deletes an item from a VectorScript dialog choice item list.

Parameters:

item Item ID of dialog control.
whichChoice Position in list of item to be deleted.

Example:

numOptions:=NumChoices(8);
DelChoice(8,(numChoices-1));



  DialogEvent Dialogs - Custom 

Declaration:

PROCEDURE   DialogEvent
VAR item:INTEGER ) ;

Description:

Procedure DialogEvent monitors user activity within a dialog; when an item is selected, the numeric identifier of the item is returned.

Parameters:

item Returns item selected in dialog event.

Example:

REPEAT
  DialogEvent(Item);
		
  CASE Item OF
  {- OK button case -}
  1:Done:=TRUE;
  {- Cancel button case -}
  2:Stop:=TRUE;
  OTHERWISE SysBeep;
  END;
UNTIL Done;



  DrawDialog Dialogs - Custom 

Declaration:

PROCEDURE   DrawDialog
;

Description:

Procedure DrawDialog redraws the topmost dialog box.



  EndDialog Dialogs - Custom 

Declaration:

PROCEDURE   EndDialog
;

Description:

Procedure EndDialog terminates the dialog definition process.



  GetChoiceStr Dialogs - Custom 

Declaration:

PROCEDURE   GetChoiceStr
(   item :INTEGER;
    whichChoice :INTEGER;
  VAR  s :STRING
) ;

Description:

GetChoiceStr returns the string associated with a particular choice item value.

Parameters:

item Item ID of dialog control.
whichChoice Position of choice item in list (in a range of 1- n).
s Returns string value associated with position in list.

Example:

GetSelChoice(7,1,selectedText);



  GetDialog Dialogs - Custom 

Declaration:

PROCEDURE   GetDialog
( dialogID:INTEGER ) ;

Description:

Procedure GetDialog calls and displays a custom dialog. This procedure should NOT be a part of the dialog definition.

Parameters:

dialogID ID number of dialog to be displayed.

Example:

BEGIN
  Done:=False;
  Stop:=FALSE;
		
  GetDialog(1);
  SetTitle('Dessert Toppings');
  InsertChoice(4,0,'Basic');
  InsertChoice(4,1,'Deluxe');
  InsertChoice(4,2,'Mmm!Yummy!');



  GetField Dialogs - Custom 

Declaration:

FUNCTION   GetField
( fieldID:INTEGER ) :STRING ;

Description:

Function GetField retrieves the text from an editable text field. This procedure is called when exiting a custom dialog to retrieve user data.

Parameters:

fieldID Item ID of field from which to retrieve data.

Example:

REPEAT
  DialogEvent(Item);
		
  CASE Item OF
  {// OK Button //}
  1:BEGIN
    Done:=TRUE;
    targetValue	:= GetField(4);
    replaceValue:= GetField(6);
					
    IF ItemSel(9) THEN textMode:=2;
    IF ItemSel(10) THEN textMode:=4;
    IF ItemSel(11) THEN textMode:=8;



  GetSelChoice Dialogs - Custom 

Declaration:

PROCEDURE   GetSelChoice
(   item :INTEGER;
    atChoice :INTEGER;
  VAR  choiceNumber :INTEGER;
  VAR  choiceString :STRING
) ;

Description:

Procedure GetSelChoice returns the selected value in a VectorScript choice item.

Parameters:

item Item ID of dialog control.
atChoice Position in list where search begins(always pass 0 to this parameter).
choiceNumber Returns index of selected item in choice list.
choiceString Returns string of selected item in choice list.



  InsertChoice Dialogs - Custom 

Declaration:

PROCEDURE   InsertChoice
(   item :INTEGER;
    before :INTEGER;
    choice :STRING
) ;

Description:

Procedure InsertChoice adds a new value to a dialog choice item list.

Parameters:

item Item ID of dialog control.
before Position in list where new item will be inserted.
choice String value of new item.



  ItemSel Dialogs - Custom 

Declaration:

FUNCTION   ItemSel
( fieldID:INTEGER ) :BOOLEAN ;

Description:

Function ItemSel returns TRUE if the specified checkbox or radio button is selected. This procedure is used to return the status of check boxes or radio buttons when exiting a custom dialog.

Parameters:

fieldID Item ID of dialog control whose state will be returned.

Example:

REPEAT
  DialogEvent(Item);
		
  CASE Item OF
  {// OK Button //}
  1:BEGIN
    Done:=TRUE;
    targetValue	:= GetField(4);
    replaceValue:= GetField(6);
					
    IF ItemSel(9) THEN textMode:=2;
    IF ItemSel(10) THEN textMode:=4;
    IF ItemSel(11) THEN textMode:=6;



  NumChoices Dialogs - Custom 

Declaration:

FUNCTION   NumChoices
( item:INTEGER ) :INTEGER ;

Description:

Function NumChoices returns the number of values available in the specified VectorScript dialog choice item list.

Parameters:

item Item ID of dialog choice item control.

Example:

numOptions:=NumChoices(8);



  SelChoice Dialogs - Custom 

Declaration:

PROCEDURE   SelChoice
(   item :INTEGER;
    choice :INTEGER;
    select :BOOLEAN
) ;

Description:

Procedure SelChoice makes a specified list value the selected value for the choice item.

Parameters:

item Item ID of dialog control.
choice Position in list of item to be set as selected.
select Selection status of list item.



  SelField Dialogs - Custom 

Declaration:

PROCEDURE   SelField
( fieldID:INTEGER ) ;

Description:

Procedure SelField activates and highlights the specified text field. This call is useful for highlighting a default field value so it can be deleted and replaced by a user-input value.

Parameters:

fieldID Item ID of dialog field to highlight/select.

Example:

GetDialog(1);
SetTitle('Find-Replace Text');
SelField(4);



  SetField Dialogs - Custom 

Declaration:

PROCEDURE   SetField
(   fieldID :INTEGER;
    str :STRING
) ;

Description:

Procedure SetField updates the text in the specified text field. Static or editable fields may be updated using this call, which can only be used while the dialog is displayed on screen.

Parameters:

fieldID Item ID of dialog field to be updated.
str New string value for field.

Example:

CASE whatSelected OF		
1:BEGIN
  SetItemEnable(11,TRUE);
  SetItemEnable(12,FALSE);
  SetItemEnable(13,FALSE);
  SetItemEnable(14,FALSE);
END;
2:BEGIN
  SetField(11,'Use Class Settings');
  SetItemEnable(11,TRUE);
  SetField(12,'Use Layer Settings');
  SetItemEnable(12,TRUE);
END;



  SetItem Dialogs - Custom 

Declaration:

PROCEDURE   SetItem
(   fieldID :INTEGER;
    select :BOOLEAN
) ;

Description:

Procedure SetItem selects or deselects the specified check box or radio button.
Auto button styles do not require this call for activation/deactivation.

Parameters:

fieldID Item ID of dialog control to be selected or deselected.
select Selection status to be assigned to button.



  SetItemEnable Dialogs - Custom 

Declaration:

PROCEDURE   SetItemEnable
(   item :INTEGER;
    enable :BOOLEAN
) ;

Description:

Procedure SetItemEnable sets the enable state of a custom dialog item. When an item is enabled, it is available as a valid choice in the dialog; when disabled, an item is grayed and cannot be chosen by the user. SetItemEnable supports all custom dialog controls in VectorScript.

Enable States of Dialog Items


Parameters:

item Item ID of dialog control whose enable state will be modified.
enable New enable state of dialog control.

Example:

InsertChoice(10,1,'All Classes');
InsertChoice(10,2,'Visible Classes');
SetItemEnable(11,TRUE);
SetItemEnable(12,FALSE);
SetItemEnable(13,FALSE);
SetItemEnable(14,FALSE);



  SetTitle Dialogs - Custom 

Declaration:

PROCEDURE   SetTitle
( theTitle:STRING ) ;

Description:

Procedure SetTitle sets the title of custom dialogs in VectorScript. The title will be displayed in the dialogs' title bar.

Parameters:

theTitle Title string of dialog.

Example:

GetDialog(1);
SetTitle('Find-Replace Text');
InsertChoice(8,1,'Selected Text');
InsertChoice(8,2,'Selected Objs');



  ValidAngStr Dialogs - Custom 

Declaration:

FUNCTION   ValidAngStr
(   str :STRING;
  VAR  value :REAL
) :BOOLEAN ;

Description:

Function ValidAngStr returns TRUE if the specified value can be converted into a numeric angle value. If TRUE, the value (in decimal degrees) of the string is returned.

Parameters:

str String value to be checked for angle validity.
value Returns numeric angle value converted from input string.

Result:

Returns TRUE if the specified string can be converted into a angle value.

Example:

CASE Item OF
{// OK Button //}
1:BEGIN
  IF ValidAngStr(GetField(4),startAng) THEN BEGIN
    Done:=TRUE;
    replaceValue:= GetField(6);
					
    IF ItemSel(9) THEN textMode:=2;
    IF ItemSel(10) THEN textMode:=4;
    IF ItemSel(11) THEN textMode:=8;
    IF ItemSel(12) THEN layerMode:=16;
    IF ItemSel(13) THEN layerMode:=32;
    IF ItemSel(14) THEN caseMode:=1;
  END
  ELSE SysBeep;
END;



  ValidNumStr Dialogs - Custom 

Declaration:

FUNCTION   ValidNumStr
(   str :STRING;
  VAR  value :REAL
) :BOOLEAN ;

Description:

Function ValidNumStr returns TRUE if the specified string can be converted into a numeric value. If TRUE, the numeric value is returned.

Parameters:

str String value to be checked for numeric validity.
value Numeric value converted from input string.

Result:

Returns TRUE if specified string can be converted into a numeric value.

Example:

CASE Item OF
{// OK Button //}
1:BEGIN
  IF ValidNumStr(GetField(4),value) THEN BEGIN
    Done:=TRUE;
    replaceValue:= GetField(6);
					
    IF ItemSel(9) THEN textMode:=2;
    IF ItemSel(10) THEN textMode:=4;
    IF ItemSel(11) THEN textMode:=8;
    IF ItemSel(12) THEN layerMode:=16;
    IF ItemSel(13) THEN layerMode:=32;
    IF ItemSel(14) THEN caseMode:=1;
  END
  ELSE SysBeep;
END;