Thread View: adobe.scripting.indesign
5 messages
5 total messages
Started by John_Kordas
Mon, 09 Feb 2009 00:02
CS3 JS Radio button layout
Author: John_Kordas
Date: Mon, 09 Feb 2009 00:02
Date: Mon, 09 Feb 2009 00:02
3 lines
669 bytes
669 bytes
In all the examples I've seen the radio buttons align vertically. Is it possible to align then horizontally?
Re: CS3 JS Radio button layout
Author: Peter Kahrel
Date: Mon, 09 Feb 2009 09:18
Date: Mon, 09 Feb 2009 09:18
3 lines
615 bytes
615 bytes
With scriptUI, yes. Peter
Re: CS3 JS Radio button layout
Author: John_Kordas
Date: Mon, 09 Feb 2009 22:59
Date: Mon, 09 Feb 2009 22:59
35 lines
1588 bytes
1588 bytes
Thanks Peter,
Did a bit of a search on scriptUI and found a couple by Dave Sanders.
In his example he codes the dialog;
myDlg = new Window('dialog', 'Drop-down List');
myDlg.orientation = 'column';
myDlg.alignment = 'right';
//add drop-down
myDlg.DDgroup = myDlg.add('group');
myDlg.DDgroup.orientation = 'row';
The test I was working on is as follows:
function myDisplayDialog(){
var myDialog = app.dialogs.add({name:"Radio layout"});
//Add a dialog column.
with(myDialog.dialogColumns.add()){
var myRadioButtonGroup = radiobuttonGroups.add();
with(myRadioButtonGroup){
var myFirst = radiobuttonControls.add({staticLabel:"One", checkedState:true});
var mySecond = radiobuttonControls.add({staticLabel:"Two"});
}
}
//Show the dialog box.
var myResult = myDialog.show();
}
myDisplayDialog();
So is it possible to do somthing like:
with(myRadioButtonGroup.orientation = "row" ){
or should i be following the format Dave has in his example?
Re: CS3 JS Radio button layout
Author: Peter Kahrel
Date: Tue, 10 Feb 2009 05:37
Date: Tue, 10 Feb 2009 05:37
23 lines
1294 bytes
1294 bytes
John,
Dave's example is scriptUI, yours uses InDesign's dialog system. The latter doesn't let you organise buttons in rows, you have to use scriptUI. Here's your example in scriptUI:
function myDisplayDialog()
{
var myDialog = new Window ('dialog', "Radio layout");
var rg = myDialog.add ('group')
var rb1 = rg.add ('radiobutton', undefined, 'Button 1');
rb1.value = true;
var rb2 = rg.add ('radiobutton', undefined, 'Button 2');
myResult = myDialog.show();
}
myDisplayDialog();
scripUI's documentation is in the ESTK: Help > SDK > JavaScript's Toolguide CS3. scriptUI's object model is at Help > scriptUI classes.
Peter
Re: CS3 JS Radio button layout
Author: John_Kordas
Date: Tue, 10 Feb 2009 05:57
Date: Tue, 10 Feb 2009 05:57
5 lines
739 bytes
739 bytes
Thanks Peter, That's what I was after. Much appreciated.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads