123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263 |
- class IUP_COLOR_BROWSER
-
- inherit
- IUP_WIDGET
- redefine
- execute_change,
- execute_drag,
- execute_valuechanged
- end
- IUP_WIDGET_INTERNALS
- IUP_WIDGET_ACTIVE
- IUP_WIDGET_BGCOLOR
- IUP_WIDGET_FONT
- IUP_WIDGET_POSITION
- IUP_WIDGET_MAXMIN_SIZE
- IUP_WIDGET_WID
- IUP_WIDGET_TIP
- IUP_WIDGET_SIZE
- IUP_WIDGET_ZORDER
- IUP_WIDGET_VISIBLE
- IUP_WIDGET_RASTERSIZE
- redefine
- set_raster_size
- end
- IUP_WIDGET_EXPAND
- redefine
- set_expand
- end
- create {ANY}
- color_browser
- feature {ANY}
- color_browser
- local
- a_color_browser: POINTER
- do
- a_color_browser := int_color_browser
- set_widget(a_color_browser)
- end
-
- set_expand (type: STRING)
-
- do
- Precursor (type)
- end
- set_raster_size (width: INTEGER; height: INTEGER)
-
- do
- Precursor (width, height)
- end
- set_automatic_layout
-
- do
- iup_open.set_attribute_null(Current, "RASTERSIZE")
- end
- set_value_rgb (red, green, blue: INTEGER)
-
-
-
- do
- iup_open.set_attribute(Current, "RGB", rgb_to_string(red,
- green,
- blue))
- end
- get_value_rgb: TUPLE[INTEGER, INTEGER, INTEGER]
-
- do
- Result := iup_open.get_rgb(Current, "RGB")
- end
- set_value_hsi (h, s, i: REAL_64)
-
-
-
- do
- iup_open.set_attribute(Current, "HSI", hsi_real_to_string(h, s, i))
- end
- get_value_hsi: TUPLE[REAL_64, REAL_64, REAL_64]
-
- do
- Result := iup_open.get_hsi_real(Current, "HSI")
- end
-
- set_cb_change (act: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER, INTEGER, INTEGER, INTEGER], STRING])
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_change := act
- if cb_change /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "CHANGE_CB", "NONEEDED", operation)
- end
- set_cb_drag (act: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER, INTEGER, INTEGER, INTEGER], STRING])
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_drag := act
- if cb_drag /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "DRAG_CB", "NONEEDED", operation)
- end
- set_cb_value_changed (act: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER], STRING])
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_valuechanged := act
- if cb_valuechanged /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "VALUECHANGED_CB", "NONEEDED", operation)
- end
- feature {IUP}
- execute_change (red, green, blue: INTEGER): STRING
- do
- if attached cb_change as int_cb then
- Result := int_cb.item([Current, red, green, blue])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_drag (red, green, blue: INTEGER): STRING
- do
- if attached cb_drag as int_cb then
- Result := int_cb.item([Current, red, green, blue])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_valuechanged: STRING
- do
- if attached cb_valuechanged as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_change: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER, INTEGER, INTEGER, INTEGER], STRING]
- cb_drag: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER, INTEGER, INTEGER, INTEGER], STRING]
- cb_valuechanged: detachable FUNCTION[TUPLE[IUP_COLOR_BROWSER], STRING]
-
-
- int_color_browser: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupColorBrowser();"
- end
- end
|