CHAPTER 7: User Interfaces Creating a More Complex User Interface 115
({staticLabel:"Left", checkedState:true});
var myCenterRadioButton = radiobuttonControls.add
({staticLabel:"Center"});
var myRightRadioButton = radiobuttonControls.add({staticLabel:"Right"});
}
}
}
}
//Display the dialog box.
if(myDialog.show() == true){
var myParagraphAlignment, myString, myPointSize, myVerticalJustification;
//If the user didn't click the Cancel button,
//then get the values back from the dialog box.
//Get the example text from the text edit field.
myString = myTextEditField.editContents
//Get the point size from the point size field.
myPointSize = myPointSizeField.editValue;
//Get the vertical justification setting from the pop-up menu.
if(myVerticalJustificationMenu.selectedIndex == 0){
myVerticalJustification = VerticalJustification.topAlign;
}
else if(myVerticalJustificationMenu.selectedIndex == 1){
myVerticalJustification = VerticalJustification.centerAlign;
}
else{
myVerticalJustification = VerticalJustification.bottomAlign;
}
//Get the paragraph alignment setting from the radiobutton group.
if(myRadioButtonGroup.selectedButton == 0){
myParagraphAlignment = Justification.leftAlign;
}
else if(myRadioButtonGroup.selectedButton == 1){
myParagraphAlignment = Justification.centerAlign;
}
else{
myParagraphAlignment = Justification.rightAlign;
}
myDialog.destroy();
myMakeDocument(myString, myPointSize, myParagraphAlignment,
myVerticalJustification);
}
else{
myDialog.destroy()
}
Here is the myMakeDocument function referred to in the above fragment: