Thread: UI question
View Single Post
# 1 16-07-2004 , 01:31 AM
Registered User
Join Date: Jul 2004
Location: Vancouver
Posts: 9

UI question

I am designing a simple user interface. I want user to input 2 separate float values, a text string, and select from a choice of 2 items. I want the window I create to behave like a `promptDialog ... ` but with the required embedded fields:
floatFieldGrp (2), textFieldGrp (1), and radioButtonGrp. I want execution of Mel script to stop until user presses "OK" button ... and then be able to query the inputs of the others fields entered and continue on ...

can a confirmDialog or promptDialog be embedded inside window command ?

How can I get Mel script to query field inputs and then close window ?

Here is some code ... but it doesn't do what I want ....
and its really a pain to do a series of `promptDialog ...` commands in order to get

all the info before Mel script continues.


---cut cut cut---

proc queryInput(string $posScaleField, string $distanceScaleField, string

$fileNameField, string $camSwField)
{
global float $posScale;
global float $distScale;
global string $fileName;
global int $camsw;

$posScale = `floatFieldGrp -q -v1 $posScaleField`;
$distScale = `floatFieldGrp -q -v1 $distanceScaleField`;
$fileName = `textFieldGrp -q -text $fileNameField`;
$camSw = `radioButtonGrp -q -select $camSwField`;

}


global proc mfExporter()
{
.
.
.

string $myWindow = `window -title "Export file" -rtf true`;
columnLayout;
string $posScaleField = `floatFieldGrp -label "position scale:" -v1 1.0`;
string $distanceScaleField = `floatFieldGrp -label "distance scale:" -v1 1.0`;
string $fileNameField = `textFieldGrp -label "input file name:"`;
string $camSwField = `radioButtonGrp
-numberOfRadioButtons 2
-label "Select camera type:"
-labelArray2 "Target" "Free"
-select 1`;
rowLayout -nc 2;
button -label "OK" -command "queryInput($posScaleField, $distanceScaleField,

$fileNameField, $camSwField)";
button -label "Cancel" -command "someExitProc()";

showWindow $myWindow;


----cut cut cut----

... if only button could behave like one from a promptDialog ???