123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- class FLAT_CONTROLS
- insert
- IUP_INTERFACE
- create {ANY}
- make
- feature {ANY}
- make
- local
- gui: IUP
- i: STRING
- a, b, c, d: ARRAY[IUP_WIDGET]
- ff: IUP_FLAT_FRAME
- ft: IUP_FLAT_TABS
- f1, f2, f3, f4, f5, f6, f7, f8: IUP_FLAT_BUTTON
- scroll: IUP_FLAT_SCROLL_BOX
- v: IUP_VBOX
- h1, h2: IUP_HBOX
- w: IUP_DIALOG
- do
- gui := iup_open
-
- create f1.flat_button("Flat button 1")
- f1.set_cb_flat_action(agent close(?))
- f1.set_padding(5, 3)
- f1.set_border(True)
- create f2.flat_button("Flat button 2")
- f2.set_cb_flat_action(agent close(?))
- f2.set_padding(5, 3)
- f2.set_border(True)
- create f3.flat_button("Flat button 3")
- f3.set_cb_flat_action(agent close(?))
- f3.set_padding(5, 3)
- f3.set_border(True)
- create f4.flat_button("Flat button 4")
- f4.set_cb_flat_action(agent close(?))
- f4.set_padding(5, 3)
- f4.set_border(True)
- create f5.flat_button("Flat button 5")
- f5.set_cb_flat_action(agent close(?))
- f5.set_padding(5, 3)
- f5.set_border(True)
- create f6.flat_button("Flat button 6 to test a flat scroll box at eiffel-iup")
- f6.set_cb_flat_action(agent close(?))
- f6.set_padding(5, 3)
- f6.set_border(True)
- create f7.flat_button("Flat button 7 to test a flat scroll box at eiffel-iup")
- f7.set_cb_flat_action(agent close(?))
- f7.set_padding(5, 3)
- f7.set_border(True)
- create f8.flat_button("Flat button 8 to test a flat scroll box at eiffel-iup")
- f8.set_cb_flat_action(agent close(?))
- f8.set_padding(5, 3)
- f8.set_border(True)
- a := {ARRAY[IUP_WIDGET] 1, << f4, f5 >>}
-
- create h1.hbox(a)
- create ff.flat_frame(h1)
- ff.set_title("A flat frame")
-
- b := {ARRAY[IUP_WIDGET] 1, << f1, f2, f3, ff >>}
- create ft.flat_tabs(b)
- ft.set_tab_n_title("One", 0)
- ft.set_tab_n_title("Two", 1)
- ft.set_tab_n_title("Three", 2)
- ft.set_tab_n_title("Four", 3)
- ft.set_size(250, 250)
- c := {ARRAY[IUP_WIDGET] 1, << f6, f7, f8 >>}
- create h2.hbox(c)
- create scroll.flat_scroll_box(h2)
- scroll.set_size(5, 5)
- d := {ARRAY[IUP_WIDGET] 1, << ft, scroll >>}
- create v.vbox(d)
-
- create w.dialog(v)
- w.set_title("Flat controls and containers")
- w.set_predefined_size("HALF", "HALF")
- i := w.show
- gui.main_loop
- gui.close
- end
- close (widget: IUP_WIDGET): STRING
- do
- io.put_string("Executed %N")
- Result := "IUP_CLOSE"
- end
- end -- class FLAT_CONTROLS
|