12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- class EXAMPLE8
- -- This example show how use a cbox, a gridbox and a zbox.
- inherit
- 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
- norm: IUP_NORMALIZER
- 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("Another Button ")
- create b5.button("Button Five")
- create b6.button("Button 6")
- create b7.button("Button Seven")
- create b8.button("Button 8")
- create b9.button("Button 9")
- create b10.button("Button 10")
- -- Normalizer
- create norm.normalizer({ARRAY[IUP_WIDGET]} << b3, b4, b5, b6, b7, b8 >>)
- -- The cbox
- create cb.cbox({ARRAY[IUP_WIDGET]} << b1, b2 >>)
- -- The gridbox
- create gb.grid_box({ARRAY[IUP_WIDGET]} << b3, b4, b5, b6, b7, b8 >>)
- gb.set_numdiv(2) -- Display two elements per row
- -- The zbox
- create zb.zbox({ARRAY[IUP_WIDGET]} << 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]} << norm, 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
-
- -- If you don't add the normalizer to the dialog, then you
- -- can call "normalize_size_XXX" after the dialog is show.
-
- -- norm.normalize_size_horizontal
- gui.main_loop
- gui.close
- end
- end
|