flat_controls.e 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. class FLAT_CONTROLS
  2. insert
  3. IUP_INTERFACE
  4. create {ANY}
  5. make
  6. feature {ANY}
  7. make
  8. local
  9. gui: IUP
  10. i: STRING
  11. a, b, c, d: ARRAY[IUP_WIDGET]
  12. ff: IUP_FLAT_FRAME
  13. ft: IUP_FLAT_TABS
  14. f1, f2, f3, f4, f5, f6, f7, f8: IUP_FLAT_BUTTON
  15. scroll: IUP_FLAT_SCROLL_BOX
  16. v: IUP_VBOX
  17. h1, h2: IUP_HBOX
  18. w: IUP_DIALOG
  19. do
  20. gui := iup_open
  21. create f1.flat_button("Flat button 1")
  22. f1.set_cb_flat_action(agent close(?))
  23. f1.set_padding(5, 3)
  24. f1.set_border(True)
  25. create f2.flat_button("Flat button 2")
  26. f2.set_cb_flat_action(agent close(?))
  27. f2.set_padding(5, 3)
  28. f2.set_border(True)
  29. create f3.flat_button("Flat button 3")
  30. f3.set_cb_flat_action(agent close(?))
  31. f3.set_padding(5, 3)
  32. f3.set_border(True)
  33. create f4.flat_button("Flat button 4")
  34. f4.set_cb_flat_action(agent close(?))
  35. f4.set_padding(5, 3)
  36. f4.set_border(True)
  37. create f5.flat_button("Flat button 5")
  38. f5.set_cb_flat_action(agent close(?))
  39. f5.set_padding(5, 3)
  40. f5.set_border(True)
  41. create f6.flat_button("Flat button 6 to test a flat scroll box at eiffel-iup")
  42. f6.set_cb_flat_action(agent close(?))
  43. f6.set_padding(5, 3)
  44. f6.set_border(True)
  45. create f7.flat_button("Flat button 7 to test a flat scroll box at eiffel-iup")
  46. f7.set_cb_flat_action(agent close(?))
  47. f7.set_padding(5, 3)
  48. f7.set_border(True)
  49. create f8.flat_button("Flat button 8 to test a flat scroll box at eiffel-iup")
  50. f8.set_cb_flat_action(agent close(?))
  51. f8.set_padding(5, 3)
  52. f8.set_border(True)
  53. a := {ARRAY[IUP_WIDGET] 1, << f4, f5 >>}
  54. create h1.hbox(a)
  55. create ff.flat_frame(h1)
  56. ff.set_title("A flat frame")
  57. b := {ARRAY[IUP_WIDGET] 1, << f1, f2, f3, ff >>}
  58. create ft.flat_tabs(b)
  59. ft.set_tab_n_title("One", 0)
  60. ft.set_tab_n_title("Two", 1)
  61. ft.set_tab_n_title("Three", 2)
  62. ft.set_tab_n_title("Four", 3)
  63. ft.set_size(250, 250)
  64. c := {ARRAY[IUP_WIDGET] 1, << f6, f7, f8 >>}
  65. create h2.hbox(c)
  66. create scroll.flat_scroll_box(h2)
  67. scroll.set_size(5, 5)
  68. d := {ARRAY[IUP_WIDGET] 1, << ft, scroll >>}
  69. create v.vbox(d)
  70. create w.dialog(v)
  71. w.set_title("Flat controls and containers")
  72. w.set_predefined_size("HALF", "HALF")
  73. i := w.show
  74. gui.main_loop
  75. gui.close
  76. end
  77. close (widget: IUP_WIDGET): STRING
  78. do
  79. io.put_string("Executed %N")
  80. Result := "IUP_CLOSE"
  81. end
  82. end -- class FLAT_CONTROLS