123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- class IUP_LINK
- inherit
- IUP_LABEL
- redefine
- execute_click
- end
- create {ANY}
- link
- feature {ANY}
- link (url, title: STRING)
-
-
-
-
-
-
-
- local
- a_link: POINTER
- do
- a_link := int_link (get_pointer(url.to_c), get_pointer(title.to_c))
- set_widget(a_link)
- end
-
-
- set_url (state: BOOLEAN)
-
- do
- iup_open.set_attribute(Current, "URL", boolean_to_yesno(state))
- end
-
- set_cb_click (act: detachable FUNCTION[TUPLE[IUP_LINK, STRING], STRING])
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_click := act
-
- if cb_click /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "ACTION", "Fns", operation)
- end
- feature {IUP}
- execute_click (url: STRING): STRING
- do
- if attached cb_click as int_cb then
- Result := int_cb.item([Current, url])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
-
- cb_click: detachable FUNCTION[TUPLE[IUP_LINK, STRING], STRING]
-
- int_link (url, title: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupLink ($url, $title);"
- end
-
- end
|