No checkboxes, but here's a way to show a list of system fonts. When you select one, it's weights are shown in the second pulldown (complete dialog code below):
ADM code that does the fonts thing
var whichfontList = new PopupList(dialog);
whichfontList.add(fonts[0].name).selected = true;
for(i=1; fonts.length>i; i++){
if(fonts[i].name=="Verdana"){
whichfontList.add(fonts[i].name).selected=true;
}else{
whichfontList.add(fonts[i].name);
}
}
whichfontList.setBounds(10, fontsY-3, 100, 20);
whichfontList.onDraw=function(){
whichweightsList.removeAll();
whichweightsList.add(fonts[whichfontList.activeEntry.text][0].name).selected=true;
for(i=1; fonts[whichfontList.activeEntry.text].length>i; i++){
whichweightsList.add(fonts[whichfontList.activeEntry.text][i].name);
}
}
var whichweightsList = new PopupList(dialog);
whichweightsList.add(fonts["Verdana"][0].name).selected = true;
for(i=1; fonts["Verdana"].length>i; i++){
whichweightsList.add(fonts["Verdana"][i].name);
}
whichweightsList.setBounds(10, 20, 100, 20);
Complete dialog code:
var dialog = new FloatingDialog(FloatingDialog.OPTION_TABBED);
dialog.setTitle("Rotational Text Placer");
var thewordTextedit = new TextEdit(dialog,TextEdit.OPTION_MULTILINE);
thewordTextedit.setBounds(8, 13, 200, 5*20);
thewordTextedit.text="Placing words = FUN!";
thewordTextedit.setMaxLength(9000)
var thewordButton = new Button(dialog);
thewordButton.setText("Refresh Text");
thewordButton.setSize(thewordButton.bestSize);
thewordButton.setLocation(127,114);
thewordButton.onClick = function(){
splitText();
}
var thewordFrame=new Frame(dialog);
thewordFrame.setText("Text");
thewordFrame.setSize(210,140);
thewordFrame.setLocation(3, 0);
var fontsY=142;
var thefontFrame=new Frame(dialog);
thefontFrame.setText("Font");
thefontFrame.setSize(210,60);
thefontFrame.setLocation(3, fontsY);
var wordsList = new PopupList(dialog);
wordsList.setBounds(10, 117, 100, 20);
wordsList.onDraw=function(){
if(wordsList.length>0) count=wordsList.activeEntry.index-1;
}
var fontsY=fontsY+16;
var whichweightsList = new PopupList(dialog);
whichweightsList.add(fonts["Verdana"][0].name).selected = true;
for(i=1; fonts["Verdana"].length>i; i++){
whichweightsList.add(fonts["Verdana"][i].name);
}
whichweightsList.setBounds(10, fontsY+20, 100, 20);
var whichfontList = new PopupList(dialog);
whichfontList.add(fonts[0].name).selected = true;
for(i=1; fonts.length>i; i++){
if(fonts[i].name=="Verdana"){
whichfontList.add(fonts[i].name).selected=true;
}else{
whichfontList.add(fonts[i].name);
}
}
whichfontList.setBounds(10, fontsY-3, 100, 20);
whichfontList.onDraw=function(){
whichweightsList.removeAll();
whichweightsList.add(fonts[whichfontList.activeEntry.text][0].name).selected=true;
for(i=1; fonts[whichfontList.activeEntry.text].length>i; i++){
whichweightsList.add(fonts[whichfontList.activeEntry.text][i].name);
}
}
var theFontSize = new Static(dialog);
theFontSize.setText("Size:");
theFontSize.setSize(theFontSize.bestSize);
theFontSize.setLocation(whichfontList.bounds.maxX+10, fontsY);
var theFontSizeField = new TextEdit(dialog);
theFontSizeField.setBounds(theFontSize.bounds.maxX, fontsY-3, 50, 20);
theFontSizeField.text="20";
var setimageText = new Static(dialog);
setimageText.setText("www.jonathanpuckey.com 2006");
setimageText.setSize(setimageText.bestSize);
setimageText.setLocation(12, 210);
var helpButton = new Button(dialog);
helpButton.setText("Help");
helpButton.setSize(helpButton.bestSize);
helpButton.setLocation(162,205);
helpButton.onClick = function(){
Dialog.alert("While the mouse is down:nnPress Shift to set a new rotation pointnPress Option to place a wordnPress Alt and drag the mouse horizontally to change the size of the text");
}
dialog.setSize(216, 230);
dialog.setVisible(true);
dialog.onClose = function() {
this.destroy();
}
Which produces: