こんな感じですか?
ClassType.get-optionで受け取れる引数をハンドリングして
それぞれのコンテンツに渡すイメージです。
渡すべきオプションや渡すべきでないオプションもあると思うので
その辺は適宜調整という感じで。
Code:
{curl 8.0 applet}{curl-file-attributes character-encoding = "utf8"}
{define-class public MultiControlField {inherits HBox}
{constructor public {default ... } let (tf-args:Arguments,cb-args:Arguments,self-args:Arguments) = {self.separate-arguments {splice ...}}
{construct-super {TextField {splice tf-args}}, {CommandButton {splice cb-args}}, {splice self-args} }
}
{method private {separate-arguments ... }:(tf-args:Arguments,cb-args:Arguments,self-args:Arguments)
let tf-type:ClassType = TextField let cb-type:ClassType = CommandButton let self-type:ClassType = {type-of self} asa ClassType
let (tf-args:Arguments,cb-args:Arguments,self-args:Arguments) = ({Arguments},{Arguments},{Arguments})
||/// ||1.何れか1つに振り分ける ||/// {for (value:any,name:#String) in ... do
{if-non-null name then {if-non-null {tf-type.get-option name} then {tf-args.append value,keyword = name} {continue} }
{if-non-null {cb-type.get-option name} then {cb-args.append value,keyword = name} {continue} }
{if-non-null {self-type.get-option name} then {self-args.append value,keyword = name} }
else {self-args.append value} }
}
||++||///||++||2.引き受ける引数は全て振り分ける||++||///||++{for (value:any,name:#String) in ... do||++||++ {if-non-null name||++ then||++ {if-non-null {tf-type.get-option name}||++ then||++ {tf-args.append value,keyword = name}||++ }||++||++ {if-non-null {cb-type.get-option name}||++ then||++ {cb-args.append value,keyword = name}||++ }||++||++||++ {self-args.append value,keyword = name}||++||++||++ else||++ {tf-args.append value}||++ {cb-args.append value}||++ {self-args.append value}||++ }||++||++||++}
{return tf-args,cb-args,self-args} }
}
{MultiControlField editable? = false, show-focus? = false}