| 要約: |
|
| ||||||||||||||
|
| 例: ダイアログ内のコントロールとリンク | |
![]() | |
{let command:CommandButton={CommandButton}}
{let command2:CommandButton={CommandButton label="CommandButton2"}}
{let check:CheckButton={CheckButton}}
{let textf:TextField={TextField width=1in, prompt="TextField"}}
{set command.tab-index = 3}
{set command2.tab-index = 1}
{set textf.tab-index = 2}
{let dialog:Dialog=
{Dialog
repeat-traversal?=true,
{spaced-hbox
margin=0.25cm,
command,
command2,
check,
textf,
{link href={url "dialogs-working.curl"}, Top of Page}
}
}
}
{let tfb:TextFlowBox = {TextFlowBox "Tab index values: "}}
{for control:Control in dialog.controls do
{tfb.add control.tab-index}
{tfb.add " "}
}
{VBox
dialog, tfb
}
|
| 例: GroupBox を使ってコントロールをグループ化 | |
![]() | |
{let command:CommandButton={CommandButton}}
{let command2:CommandButton={CommandButton label="CommandButton2"}}
{let check:CheckButton={CheckButton}}
{let textf:TextField={TextField width=1in, prompt="TextField"}}
{set command.tab-index = 3}
{set command2.tab-index = 1}
{set textf.tab-index = 2}
{Dialog
repeat-traversal?=true,
{spaced-hbox
margin=0.25cm,
{GroupBox
label = "Buttons",
tab-index = 5,
{spaced-hbox
command,
command2
}
},
{GroupBox
label = "Boxes",
tab-index = 4,
{spaced-hbox
check,
textf
}
},
{link href={url "dialogs-working.curl"}, Top of Page}
}
}
|
| 例: コントロールをプログラム的にアクティブにする | |
{let textf:TextField={TextField prompt="TextField"}}
{let check:CheckButton={CheckButton}}
{let dialog:Dialog=
{Dialog
use-look-and-feel?=false,
background = "wheat",
{spaced-vbox
margin=0.5cm,
textf,
check,
{CommandButton
label="Close",
{on Action do
{dialog.close "closed"}
}
}
},
{on DialogShow at dialog:Dialog do
{check.become-active}
}
}
}
{CommandButton
{on Action do
{dialog.show style="resizable"}
}
}
|
| 例: コントロールのキーボード ショートカット | |
![]() | |
{let rf:RadioFrame =
{RadioFrame
{spaced-vbox width=1.5in,
{bold Radio Buttons},
{RadioButton
label = {text Radio Button {underline 1}},
radio-value = "1",
mnemonic = '1'},
{RadioButton
label = {text Radio Button {underline 2}},
radio-value = "2",
mnemonic = '2'},
{RadioButton
label = {text Radio Button {underline 3}},
radio-value = "3",
mnemonic = '3'}
}
},
my-dialog:Dialog =
{Dialog
use-look-and-feel?=false,
background = "wheat",
margin = 0.25cm,
{spaced-hbox
{spaced-vbox width=1.5in,
{bold Check Buttons},
{CheckButton
label = {text {underline x}ylophone},
mnemonic = 'x',
width = 1.5in},
{CheckButton
label = {text {underline y}urt},
mnemonic = 'y',
width = 1.5in},
{CheckButton
label = {text {underline z}innia},
mnemonic = 'z',
width = 1.5in}
},
rf,
{spaced-vbox
{bold Command Button},
{CommandButton
label = {text {underline V}alue of selected Radio Button},
mnemonic = 'V',
{on Action do
{popup-message
{spaced-vbox
{format
"RadioFrame's Value: %s", rf.value}
}
}
}
},
{Fill}
}
}
}
}
{value my-dialog}
|