123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255 |
- class IUP_PROGRESS_BAR
- inherit
- IUP_WIDGET
- redefine
- execute_map,
- execute_unmap,
- execute_destroy
- end
- IUP_WIDGET_BGCOLOR
- IUP_WIDGET_FGCOLOR
- IUP_WIDGET_RASTERSIZE
- IUP_WIDGET_USERSIZE
- IUP_WIDGET_ACTIVE
- IUP_WIDGET_EXPAND
- IUP_WIDGET_FONT
- IUP_WIDGET_SCREENPOSITION
- IUP_WIDGET_POSITION
- IUP_WIDGET_MAXMIN_SIZE
- IUP_WIDGET_TIP
- IUP_WIDGET_SIZE
- IUP_WIDGET_ZORDER
- IUP_WIDGET_VISIBLE
- IUP_WIDGET_CHILD
- IUP_WIDGET_NAME
- IUP_WIDGET_CUSTOM_ATTRIBUTES
- create {ANY}
- progress_bar
-
- feature {ANY}
- progress_bar
-
- local
- a_progress_bar: POINTER
- do
- min := 0
- max := 1
-
- a_progress_bar := int_progress_bar
- set_widget(a_progress_bar)
- end
-
- set_dashed (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "DASHED", boolean_to_yesno(state))
- end
- set_marquee (state: BOOLEAN)
-
-
-
- do
- iup_open.set_attribute(Current, "MARQUEE", boolean_to_yesno(state))
- end
- set_max (value: REAL_64)
-
-
-
- require
- value > min
- do
- iup_open.set_attribute(Current, "MAX", value.out)
-
- max := value
- ensure
- updated: max = value
- end
- set_min (value: REAL_64)
-
-
-
- require
- value < max
- do
- iup_open.set_attribute(Current, "MIN", value.out)
-
- min := value
- ensure
- updated: min = value
- end
- set_horizontal_orientation
-
-
- do
- iup_open.set_attribute(Current, "ORIENTATION", "HORIZONTAL")
- end
- set_vertical_orientation
-
-
-
- do
- iup_open.set_attribute(Current, "ORIENTATION", "VERTICAL")
- end
- set_value (value: REAL_64)
-
-
- do
- iup_open.set_attribute(Current, "VALUE", value.out)
- end
- get_value: REAL_64
-
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "VALUE")
- if str.is_real then
- Result := str.to_real
- end
- end
-
- set_cb_map (act: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING])
-
- local
- operation: INTEGER
- do
- cb_map := act
-
- if cb_map /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "MAP_CB", "NONEEDED", operation)
- end
- set_cb_unmap (act: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING])
-
- local
- operation: INTEGER
- do
- cb_unmap := act
- if cb_unmap /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "UNMAP_CB", "NONEEDED", operation)
- end
- set_cb_destroy (act: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING])
-
- local
- operation: INTEGER
- do
- cb_destroy := act
- if cb_destroy /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "DESTROY_CB", "NONEEDED", operation)
- end
-
-
- min: REAL_64
- max: REAL_64
- feature {IUP}
- execute_map: STRING
- do
- if attached cb_map as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_unmap: STRING
- do
- if attached cb_unmap as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_destroy: STRING
- do
- if attached cb_destroy as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_map: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING]
- cb_unmap: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING]
- cb_destroy: detachable FUNCTION[TUPLE[IUP_PROGRESS_BAR], STRING]
-
- int_progress_bar: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupProgressBar();"
- end
- invariant
- max > min
- end
|