Thread Rating:
  • 415 Vote(s) - 2.81 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ComboBoxのラベル表示
02-17-2012, 12:11 PM,
#2
RE: ComboBoxのラベル表示
少々強引ですが、こんな感じでしょうか?
リストが選択されたら値を変数に保持し、unset-valueによってクリアさせて
選択された行に対するラベルを表示させています。
Code:
{def display:VBox = {VBox}}
{def model:DefaultListModel =
    {DefaultListModel
        "1", "2", "3"
    }
}
{def lb:ListBox =
    {ListBox
        "A","B","C"
    }
}
{let st:String = ""}
{Frame
    color = "black",
    {ComboBox
        control-appearance-changeable? = true,
        data-model = model,
        prompt = "select here",
        list-item-creation-proc =
            {proc {val:any}:ListItem
                {return
                    {ListValueItem
                        val,
                        label = lb[{val.to-int} - 1].value
                    }
                }
            },
        {on e:ValueFinished at cbo:ComboBox do
            set st = cbo.value
            {display.clear}
            {display.add {format "value: %s", st}}
            set cbo.prompt = lb[{cbo.value.to-int} - 1].value
            {cbo.unset-value}
            {e.consume}
        }
    }
}
{value display}


Messages In This Thread
ComboBoxのラベル表示 - by okm - 02-16-2012, 07:04 PM
RE: ComboBoxのラベル表示 - by usami - 02-17-2012, 12:11 PM
RE: ComboBoxのラベル表示 - by okm - 02-20-2012, 02:38 PM
RE: ComboBoxのラベル表示 - by usami - 02-20-2012, 04:00 PM
RE: ComboBoxのラベル表示 - by okm - 02-22-2012, 06:23 PM
Forum Jump:


Users browsing this thread:
3 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('412')