1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- class EXAMPLE8
- -- This example show how use a cbox, a gridbox and a zbox.
- insert
- IUP_INTERFACE
- create {ANY}
- make
- feature {ANY}
- make
- local
- gui: IUP
- v: IUP_VBOX
- b1, b2, b3, b4, b5, b6, b7, b8, b9, b10: IUP_BUTTON
- cb: IUP_CBOX
- gb: IUP_GRID_BOX
- zb: IUP_ZBOX
- w: IUP_DIALOG
- i: STRING
- do
- gui := iup_open
- create b1.button("Button 1")
- b1.set_cx(10)
- b1.set_cy(10)
- create b2.button("Button 2")
- b2.set_cx(50)
- b2.set_cy(45)
- create b3.button("Button 3")
- create b4.button("Button 4")
- create b5.button("Button 5")
- create b6.button("Button 6")
- create b7.button("Button 7")
- create b8.button("Button 8")
- create b9.button("Button 9")
- create b10.button("Button 10")
- -- The cbox
- create cb.cbox({ARRAY[IUP_WIDGET] 1, << b1, b2 >>})
- -- The gridbox
- create gb.grid_box({ARRAY[IUP_WIDGET] 1, << b3, b4, b5, b6, b7, b8 >>})
- gb.set_numdiv(2) -- Display two elements per row
- -- The zbox
- create zb.zbox({ARRAY[IUP_WIDGET] 1, << b9, b10 >>})
- zb.set_value_widget(b10) -- Make the b10 visible, this hide b9
- -- Put all into a vertical box.
- create v.vbox({ARRAY[IUP_WIDGET] 1, << cb, gb, zb >>})
- v.set_alignment("ACENTER")
- v.set_gap(10)
- v.set_margin(10, 10)
- -- Create the window.
- create w.dialog(v)
- w.set_title("Example 8")
- i := w.show
- gui.main_loop
- gui.close
- end
- end
|