动态控件02

fn fn_newRollout int_count =
(
 local i_pos = GetDialogPos test
 
 destroyDialog test
 test = undefined
 
 rol = rolloutCreator "test" "Untitled"
 rol.begin()
 rol.addControl #spinner #spn1 "" paramStr:"type:#integer scale:0"
 rol.addHandler #spn1 #changed paramStr:"val" codeStr:"fn_newRollout val"
 for n = 1 to int_count do
 (
  execute ("rol.addControl #button #btn"+(n as integer) as string+" \"++++++\"")
 )
 rol.end()
 createDialog rol.def pos:i_pos
 test.spn1.value = int_count
)

rollout test "Untitled" width:162 height:30
(
 spinner spn1 "" pos:[13,12] width:127 height:16 type:#integer scale:0
 on spn1 changed val do
 (
  fn_newRollout val
 )
)

createDialog test

你可能感兴趣的:(动态)