123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268 |
- class IUP_COLOR_DIALOG
- inherit
- IUP_WIDGET
- redefine
- execute_colorupdate,
- execute_help
- end
- IUP_WIDGET_INTERNALS
- IUP_WIDGET_TITLE
- IUP_WIDGET_POPUP
- IUP_WIDGET_ICON
- IUP_WIDGET_PARENT_DIALOG
- create {ANY}
- color_dialog
-
- feature {ANY}
- color_dialog
- local
- a_color_dialog: POINTER
- do
- a_color_dialog := int_color_dialog
- set_widget(a_color_dialog)
- end
-
- set_alpha (value: INTEGER)
-
-
-
-
- require
- value >= 0
- value <= 255
- do
- iup_open.set_attribute(Current, "ALPHA", value.out)
- end
- set_color_table (colors: STRING)
-
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "COLORTABLE", colors)
- end
- get_color_table: STRING
- do
- Result := iup_open.get_attribute(Current, "COLORTABLE")
- end
- set_show_alpha (state: BOOLEAN)
-
-
-
- do
- iup_open.set_attribute(Current, "SHOWALPHA", boolean_to_yesno(state))
- end
- set_show_color_table (state: BOOLEAN)
-
-
-
-
- do
- iup_open.set_attribute(Current, "SHOWCOLORTABLE", boolean_to_yesno(state))
- end
- set_show_hexadecimal (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "SHOWHEX", boolean_to_yesno(state))
- end
- set_show_help (state: BOOLEAN)
-
-
-
- do
- iup_open.set_attribute(Current, "SHOWHELP", boolean_to_yesno(state))
- end
- get_status: INTEGER
-
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "STATUS")
- if not str.is_empty then
- Result := 1
- else
- Result := 0
- end
- end
- set_value (red, green, blue, alpha: INTEGER)
-
-
-
- do
- iup_open.set_attribute(Current, "VALUE", rgba_to_string(red,
- green,
- blue,
- alpha))
- end
- get_value: TUPLE[INTEGER, INTEGER, INTEGER, INTEGER]
-
-
- do
- Result := iup_open.get_rgba(Current, "VALUE")
- end
- set_value_hsi (h, s, i: INTEGER)
-
-
-
- do
- iup_open.set_attribute(Current, "VALUEHSI", hsi_to_string(h, s, i))
- end
- get_value_hsi: TUPLE[INTEGER, INTEGER, INTEGER]
-
-
- do
- Result := iup_open.get_hsi(Current, "VALUEHSI")
- end
- set_value_hexadecimal (color: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "VALUEHEX", color)
- end
- get_value_hexadecimal: STRING
-
-
-
- do
- Result := iup_open.get_attribute(Current, "VALUEHEX")
- end
-
- set_cb_help (act: detachable PROCEDURE[TUPLE[IUP_COLOR_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
- set_cb_color_update (act: detachable FUNCTION[TUPLE[IUP_COLOR_DIALOG], STRING])
-
-
-
- local
- operation: INTEGER
- do
- cb_colorupdate := act
- if cb_colorupdate /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "COLORUPDATE_CB",
- "NONEEDED", operation)
- end
- feature {IUP}
- execute_help
- do
- if attached cb_help as int_cb then
- int_cb.call([Current])
- end
- end
- execute_colorupdate: STRING
- do
- if attached cb_colorupdate as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_help: detachable PROCEDURE[TUPLE[IUP_COLOR_DIALOG]]
- cb_colorupdate: detachable FUNCTION[TUPLE[IUP_COLOR_DIALOG], STRING]
-
- int_color_dialog: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupColorDlg();"
- end
- end
|