123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- class IUP_ALARM
- inherit
- IUP_WIDGET
- create {ANY}
- alarm_one_button,
- alarm_two_buttons,
- alarm_three_buttons
-
- feature {ANY}
-
- alarm_one_button (title: STRING; message: STRING; text_button_1: STRING)
-
- do
- t := title
- m := message
- bt1 := text_button_1
- type := 1
- end
- alarm_two_buttons (title, message, text_button_1, text_button_2: STRING)
-
- do
- t := title
- m := message
- bt1 := text_button_1
- bt2 := text_button_2
- type := 2
- end
- alarm_three_buttons (title, message, text_button_1,
- text_button_2, text_button_3: STRING)
-
- do
- t := title
- m := message
- bt1 := text_button_1
- bt2 := text_button_2
- bt3 := text_button_3
- type := 3
- end
- launch: INTEGER
-
-
- local
- p: POINTER
- do
- if type.is_equal(1) then
- Result := int_alarm (get_pointer(t.to_c), get_pointer(m.to_c),
- get_pointer(bt1.to_c), p, p)
- elseif type.is_equal(2) and
- attached bt2 as button_2 then
- Result := int_alarm (get_pointer(t.to_c), get_pointer(m.to_c),
- get_pointer(bt1.to_c),
- get_pointer(button_2.to_c), p)
- elseif type.is_equal(3) and
- attached bt2 as button_2 and
- attached bt3 as button_3 then
- Result := int_alarm (get_pointer(t.to_c), get_pointer(m.to_c),
- get_pointer(bt1.to_c),
- get_pointer(button_2.to_c),
- get_pointer(button_3.to_c))
- else
- Result := 0
- end
- end
-
- feature {NONE}
- t, m, bt1: STRING
- bt2, bt3: detachable STRING
- type: INTEGER
-
-
- int_alarm (title: POINTER; message: POINTER; b1, b2, b3: POINTER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupAlarm ($title, $message, $b1, $b2, $b3);"
- end
-
- end
|