123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190 |
- class IUP_MESSAGE_DIALOG
- inherit
- IUP_WIDGET
- redefine
- execute_help
- end
- IUP_WIDGET_TITLE
- IUP_WIDGET_POPUP
- IUP_WIDGET_ICON
- IUP_WIDGET_PARENT_DIALOG
- create {ANY}
- message_dialog
- feature {ANY}
- message_dialog
-
- local
- a_message_dialog: POINTER
- do
- a_message_dialog := int_message_dialog
- set_widget(a_message_dialog)
- end
-
- set_default_button (id: INTEGER)
-
-
-
- require
- id >= 1
- id <= 3
- do
- iup_open.set_attribute(Current, "BUTTONDEFAULT", id.out)
- end
- set_buttons (buttons: STRING)
-
-
-
- require
- are_valid_buttons(buttons)
- do
- iup_open.set_attribute(Current, "BUTTONS", buttons)
- end
- set_dialog_type (type: STRING)
-
-
-
-
- require
- is_valid_type(type)
- do
- iup_open.set_attribute(Current, "DIALOGTYPE", type)
- end
- set_value (text: STRING)
-
- do
- iup_open.set_attribute(Current, "VALUE", text)
- end
- get_button_response: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "BUTTONRESPONSE")
- if str.is_integer then
- Result := str.to_integer
- end
- end
-
- set_cb_help (act: detachable PROCEDURE[TUPLE[IUP_MESSAGE_DIALOG]])
-
-
-
-
- local
- operation: INTEGER
- do
- cb_help := act
- if cb_help /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "HELP_CB", "NONEEDED", operation)
- end
-
- are_valid_buttons(buttons: STRING): BOOLEAN
- do
- if buttons.is_equal("OK") or
- buttons.is_equal("OKCANCEL") or
- buttons.is_equal("RETRYCANCEL") or
- buttons.is_equal("YESNO") or
- buttons.is_equal("YESNOCANCEL") then
- Result := True
- else
- Result := False
- end
- end
- is_valid_type(type: STRING): BOOLEAN
- do
- if type.is_equal("MESSAGE") or
- type.is_equal("ERROR") or
- type.is_equal("WARNING") or
- type.is_equal("QUESTION") or
- type.is_equal("INFORMATION") then
- Result := True
- else
- Result := False
- end
- end
- feature {IUP}
-
- execute_help
- do
- if attached cb_help as int_cb then
- int_cb.call([Current])
- end
- end
-
- feature {NONE}
-
- cb_help: detachable PROCEDURE[TUPLE[IUP_MESSAGE_DIALOG]]
-
- int_message_dialog: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupMessageDlg();"
- end
- end
|