VrOne/Python Programming

ON-LINE REFERENCE DOCUMENTATION

CARDINAL SYSTEMS, LLC

386-439-2525    

www.cardinalsystems.net    mike@cardinalsystems.net
 

 

VrPromBox Class Reference

Allows easy creation of parameter dialogs (Prompt Boxes). More...

Members


Detailed Description

Creates a dialog box with programmable entry fields (prompts) to allow entry of parameters. Fields are laid out automatically with options for multiple columns and tabbed dialogs. The dialog is built up using calls to Add… methods, it is then displays with the Display method. The Display method returns 0 if the user pressed 0. After the return from Display, the user-entered parameters can be queried using the Get… methods. See testprombox.py for examples.


Member Function Documentation

PromBox (Title, EditWidthChars, Modal)

Class constructor

Title

Title for window border.

EditWidthChars

Edit field width in characters.

Modal

Is box modal? (default=TRUE)

AddMessage (Message)

Adds message to the top of the prompt box. This is for user information

Message

Message string.

AddImage (ImgWidth, ImgHeight, ImgFileName)

Adds an image to the top of the prompt box.

ImgWidth

Image width (pixels)

ImgHeight

Image height (pixels)

ImgFileName

Image file name with path. (can be .bmp file). This is for user information

AddColumn (EditWidthChars)

Adds a dialog column after the current item.

EditWidthChars

Width of edit field in characters. -1=Same as first column (default)

AddPage (Name)

Adds a new page resulting in a tabbed dialog interface

Name

Page name (shown on tab)

AddShort (Prompt, Value, Min, Max)

Prompt

Prompt string.

Value

Default value.

Min

Minimum allowed value  (Optional)

Max

Maximum allowed value (Optional)

AddInt (Prompt, Value, Min, Max)

Adds a prompt for an integer.

Prompt

Prompt string.

Value

Default value.

Min

Minimum allowed value  (Optional)

Max

Maximum allowed value  (Optional)

AddDouble (Prompt, Value, Decimal, Min, Max)

Adds a prompt for a double.

Prompt

Prompt string.

Value

Default value.

Decimal

Number of decimal places to display.

Min

Minimum allowed value (Optional).

Max

Maximum allowed value  (Optional).

AddStrg (Prompt, Value, MaxChars)

Adds a prompt for a string.

Prompt

Prompt string.

Value

Default value.

MaxChars

Maximum number of characters allowed. (up to 512)

AddBrowse (BrowsePostfix, BrowseDir, BrowseType)

Adds a browse button to the previous prompt.

BrowsePostfix

File name postfix. (Example: .dxf)

BrowseDir

Directory (default=NULL=Default directory)

BrowseType

0=Save dialog (default) 1=Open dialog (file must exist) 2=Directory (directory must exist)

SetBrowsePath (BrowsePath)

Sets the default browse path which is used if the existing file name is NULL.

BrowsePath

Browse path (64 char)

AddCombo (Prompt, NumItems, DefaultItem, EditFlag)

Adds a combo box.

Prompt

Prompt string.

NumItems

Number of items in combo box.

DefaultItem

Default item (0-18)

EditFlag

Are fields editable?

AddComboItem (Strg)

Adds item to current combo box. Use AddCombo to start combo box.

Strg

String to add.

AddList (Prompt, NumItems, Height, DefaultItem)

Adds a list box. Use AddListItem to add string items to list box.

Prompt

Prompt string.

NumItems

Maximum number of items in combo box.

Height

Height of list box (chars).

DefaultItem

Default item (0-NumItems-1)

AddListItem (Strg)

Adds item to current list box. Use AddList to start list box.

Strg

String to add.

AddCheck (Prompt, Checked)

Adds a check box.

Prompt

Prompt string.

Checked

Initial checked state (0=Not checked, 1=checked)

AddButton (Label)

Adds a push button

Label

Label for button

AddColorButton (Label, Color)

Adds a color push button

Label

Label for color button

Color

Integer representation of RGB color

AddLabel (Label)

Adds a label field. This may be used to label a group of prompts

Label

Label for button

AddTip (Strg)

Adds a tool tip to the previous prompt.

Strg

ToolTip to add (any length)

AddWhatsThis (Strg)

Adds a What's This to the previous prompt.

Strg

Whats this to add (any length)

SetTab (TabNum)

Set tab order number for previous prompt.

TabNum

Tab order number to set

SetEnable (EnableFlag, Item)

Enables/Disables the previous prompt.

EnableFlag

0 = Disable 1 = Enable (default)

Item

Item number (0-MAXPROMPTS) -1=Ok button -2=Cancel button

SetEdit (EditFlag)

Enables/Disables editing for the previous prompt.

EditFlag

0 = Disable 1 = Enable (default)

SetHidden (Item, HiddenFlag)

Hides/Shows an item.

Item

Item number (0-MAXPROMPTS) -1=Ok button -2=Cancel button

HiddenFlag

0 = Hide 1 = Show

SetFocus ()

Sets focus to the previous prompt.

ClearField (Item)

Clears a field to blank

Item

Item number (0=first item).

ChangeMessage (Message)

Changes the value of a previously defined message

Message

New message

ChangeShort (Item, Value)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value.

ChangeShortByPrompt (Prompt, Value)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value.

ChangeInt (Item, Value, WhatsThisValue)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value.

WhatsThisValue

New whats this value. (NULL if no change)

ChangeIntByPrompt (Prompt, Value, WhatsThisValue)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value.

WhatsThisValue

New whats this value. (NULL if no change)

ChangeDouble (Item, Value)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value.

ChangeDoubleByPrompt (Prompt, Value)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value.

ChangeStrg (Item, Value, WhatsThisValue)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value. (NULL if no change)

WhatsThisValue

New whats this value. (NULL if no change)

ChangeStrgByPrompt (Prompt, Value, WhatsThisValue)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value. (NULL if no change)

WhatsThisValue

New whats this value. (NULL if no change)

ChangeCombo (Item, Value)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value.

ChangeComboByPrompt (Prompt, Value)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value.

ChangeComboPrompt (Item, Value)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Value

New value.

ChangeComboPromptByPrompt (Prompt, Value)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Value

New value.

ChangeList (Item, Value)

Changes the highlighted item in a list box.

Item

Item number (0=first item).

Value

String to hightlight

ChangeListByPrompt (Prompt, Value)

Changes the highlighted item in a list box.

Prompt

Prompt of item to change.

Value

String to hightlight

ChangeCheck (Item, Checked)

Changes the value of a previously defined item.

Item

Item number (0=first item).

Checked

Checked state (0=Not checked, 1=checked)

ChangeCheckByPrompt (Prompt, Checked)

Changes the value of a previously defined item.

Prompt

Prompt of item to change.

Checked

Checked state (0=Not checked, 1=checked)

ChangeButton (Item, NewLabel)

Changes a buttons label

Item

Item number (0=first item).

NewLabel

New button label (0=No change)

ChangeButtonByPrompt (Prompt, NewLabel)

Changes a buttons label

Prompt

Prompt of item to change.

NewLabel

New button label (0=No change)

ChangeColorButton (Item, NewLabel, Color)

Changes a buttons label

Item

Item number (0=first item).

NewLabel

New button label (0=No change)

Color

New button color

ChangeColorButtonByPrompt (Prompt, NewLabel, Color)

Changes a buttons label

Prompt

Prompt of item to change.

NewLabel

New button label (0=No change)

Color

New button color

ChangeLabel (Item, NewLabel)

Changes a label

Item

Item number (0=first item).

NewLabel

New label (0=No change)

GetShort (Item)

Get short item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetShortByPrompt (Prompt)

Get short item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetInt (Item)

Get integer item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetIntByPrompt (Prompt)

Get integer item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetDouble (Item)

Get double item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetDoubleByPrompt (Prompt)

Get double item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetStrg (Item)

Get string item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetStrgByPrompt (Prompt)

Get string item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetCombo (Item)

Get combo item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetComboByPrompt (Prompt)

Get combo item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetList (Item)

Get list item value. Search by item number.

Item

Item number (0=first item).

returns

(ret)

 

ret

Current value

GetListByPrompt (Prompt)

Get list item value. Search by prompt.

Prompt

Prompt of item to get.

returns

(ret)

 

ret

Current value

GetCheck (Item)

Get checkbox item value. Search by item number.

Item

Item number (0=first item).

GetCheckByPrompt (Prompt)

Get checkbox item value. Search by prompt.

Prompt

Prompt of item to get.

GetColorButton (Item)

Get color button item value. Search by item number.

Item

Item number (0=first item).

GetColorButtonByPrompt (Prompt)

Prompt

Prompt of item to get.

Display (WarpMouse)

Constructs and displays the dialog box

WarpMouse