prev | index | next

MX-GUI-ChoiceHandler
6
12
2163 bytes
1549 bytes
2003-06-03 00:00:00
2003-06-10 23:31:52
Oldes (oliva.david@seznam.cz)


To show how to use gui-checkbox

(mx-gui-choicehandler.rswf)
background 153.165.139
require %includes/gui-mainfonts.rswf
require %includes/gui-checkbox.rswf
require %includes/gui-choicehandler.rswf
require %includes/gui-button.rswf

;fnt_arial: defineFont2 [name "Arial"] 

txt_test: EditText 'test 219x99 [
        WordWrap Multiline
        ReadOnly ; noSelect
        Color #cc0000 
        Font [fnt_gui_arial 11 bold] 
        border
        UseOutlines
] 
place txt_test at 0x100

showFrame
CheckBox1: place gui_checkbox at 0x0
CheckBox2: place gui_checkbox at 0x18
CheckBox3: place gui_checkbox at 0x36

choiceHandler: place gui_choiceHandler

Button1: place gui_button at 100x0
Button2: place gui_button at 100x18
doAction [
    choiceHandler.onChangeItemState: func[][
        _root.test: _root.test add this.label add " = " add this.checked add newline
    ]
    choiceHandler.setSupervisionOn(([CheckBox1 CheckBox2 CheckBox3]))
    
    Button1.setLabel("Values")
    Button1.onRelease: func[][
        this.setState(1)
        tmp: this._parent.choiceHandler.getValues()
        _root.test: _root.test add "CheckBoxes:" add this._parent.choiceHandler.aValues add newline
    ]
    _root.test: _root.test add "XXCheckBoxes:" add  newline
    Button2.setLabel("Reset")
    Button2.onRelease: func[][
        this.setState(1)
        this._parent.choiceHandler.resetValues()
    ]
    stop
]
showFrame end