Prompt Box Class Reference (VrPromBox)
Allows easy creation of parameter dialogs (Prompt Boxes). More...
Members
• | PromBox (Title, EditWidthChars, Modal) |
• | AddImage (ImgWidth, ImgHeight, ImgFileName) |
• | AddInt (Prompt, Value, Min, Max, Max) |
• | AddDouble (Prompt, Value, Decimal, Min, Max, Max) |
• | AddBrowse (BrowsePostfix, BrowseDir, BrowseType) |
• | AddCombo (Prompt, NumItems, DefaultItem, EditFlag) |
• | AddList (Prompt, NumItems, Height, DefaultItem) |
Description
Creates a dialog box with programmable entry fields (prompts). Fields are laid out automatically with options for multiple columns and tabbed dialogs. The dialog is built up using calls to Add… methods. It then displays with the Display method. The Display method returns "0", for example, if the user presses 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
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.
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.
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
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
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)
Sets 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
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)
Gets short item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetShortByPrompt (Prompt)
Gets short item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetInt (Item)
Gets integer item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetIntByPrompt (Prompt)
Gets integer item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetDouble (Item)
Gets double item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetDoubleByPrompt (Prompt)
Gets double item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetStrg (Item)
Gets string item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetStrgByPrompt (Prompt)
Gets string item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetCombo (Item)
Gets combo item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetComboByPrompt (Prompt)
Gets combo item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetList (Item)
Gets list item value. Searches by item number.
Item
|
Item number (0=first item).
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetListByPrompt (Prompt)
Gets list item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
returns
|
(ret)
|
|
ret
|
Current value
|
GetCheck (Item)
Gets checkbox item value. Searches by item number.
Item
|
Item number (0=first item).
|
GetCheckByPrompt (Prompt)
Gets checkbox item value. Searches by prompt.
Prompt
|
Prompt of item to get.
|
GetColorButton (Item)
Gets color button item value. Searches 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
|
Place mouse in center of dialog? (default=TRUE)
|
returns
|
(ret)
|
|
ret
|
0 = OK pressed
-1 = Cancel pressed or no prompts defined.
|
Hide ()
Hides the dialog box.
Show ()
Shows the dialog box
SetPosition (x, y)
Sets the position of the dialog box. By default, the dialog is positioned in the middle of the window. If this is called before Display then it will be placed at the location sent.
x
|
X position of window
|
y
|
Y position of window
|
|