1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- class SIMPLE_NOTEPAD_2
- insert
- IUP_INTERFACE
- create {ANY}
- make
- feature {ANY}
- exit_cb (widget: IUP_MENU_ITEM): STRING
- do
- Result := "IUP_CLOSE"
- end
- make
- local
- i: STRING
- gui: IUP
- ml: IUP_MULTILINE
- v: IUP_VBOX
- w: IUP_DIALOG
- item_exit, item_open, item_saveas: IUP_MENU_ITEM
- sep: IUP_MENU_SEPARATOR
- file_menu, menu: IUP_MENU
- sub1_menu: IUP_SUBMENU
- do
- gui := iup_open
-
- create ml.multiline
- ml.set_expand("YES")
-
- create v.vbox({ARRAY[IUP_WIDGET] 1, << ml >>})
- create item_open.item("Open")
- item_open.set_hide_mark(True)
- create item_saveas.item("Save As")
- item_saveas.set_hide_mark(True)
- create item_exit.item("Exit")
- item_exit.set_hide_mark(True)
- item_exit.set_cb_action(agent exit_cb(?))
- create sep.separator
- create file_menu.menu({ARRAY[IUP_MENU_ELEMENT] 1, << item_open, item_saveas, sep, item_exit >>})
- create sub1_menu.submenu("File", file_menu)
- create menu.menu({ARRAY[IUP_MENU_ELEMENT] 1, << sub1_menu >>})
-
- create w.dialog(v)
- w.set_menu_widget(menu)
- w.set_title("Simple Notepad")
- w.set_predefined_size("QUARTER", "QUARTER")
-
- i := w.show_predefined_xy("IUP_CENTER", "IUP_CENTER")
- w.set_user_size(0, 0)
-
- gui.main_loop
- gui.close
- end
- end
|