123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- class IUP_PROGRESS_DIALOG
-
- inherit
- IUP_DIALOG
- redefine
- execute_cancel
- end
- IUP_WIDGET_CUSTOM_ATTRIBUTES
- export
- {NONE} all
- end
-
- create {ANY}
- progress_dialog
-
- feature {ANY}
- progress_dialog
- local
- a_progress_dialog: POINTER
- do
- a_progress_dialog := int_progress_dialog
- set_widget(a_progress_dialog)
- end
-
- exit_loop
-
- do
- iup_open.exit_loop
- end
-
- set_count (value: INTEGER)
-
- do
- iup_open.set_attribute(Current, "COUNT", value.out)
- end
- get_count: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "COUNT")
- if str.is_integer then
- Result := str.to_integer
- end
- end
- increment (value: INTEGER)
-
- do
- iup_open.set_attribute(Current, "INC", value.out)
- end
- increment_one
-
- do
- iup_open.set_attribute(Current, "INC", "1")
- end
- set_percent (value: INTEGER)
-
- do
- iup_open.set_attribute(Current, "PERCENT", value.out)
- end
- get_percent: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "PERCENT")
- if str.is_integer then
- Result := str.to_integer
- end
- end
- set_total_count (value: INTEGER)
-
- do
- iup_open.set_attribute(Current, "TOTALCOUNT", value.out)
- end
- set_state (state: STRING)
-
-
-
-
-
-
-
-
- require
- is_valid_state(state)
- do
- iup_open.set_attribute(Current, "STATE", state)
- end
- get_state: STRING
-
- do
- Result := iup_open.get_attribute(Current, "STATE")
- end
- set_description (text: STRING)
-
- do
- iup_open.set_attribute(Current, "DESCRIPTION", text)
- end
- set_progress_bar_height (height: INTEGER)
-
- require
- height > 0
- do
- iup_open.set_attribute(Current, "PROGRESSHEIGHT", height.out)
- end
- set_minimun_clock (value: INTEGER)
-
-
-
- require
- value > 0
- do
- iup_open.set_attribute(Current, "MINCLOCK", value.out)
- end
- set_minimun_percent (value: INTEGER)
-
-
-
-
-
- require
- value > 0
- do
- iup_open.set_attribute(Current, "MINPERCENT", value.out)
- end
-
- set_cb_cancel (act: detachable FUNCTION[TUPLE[IUP_PROGRESS_DIALOG], STRING])
-
-
-
- local
- operation: INTEGER
- do
- cb_close_dialog := act
-
- if cb_close_dialog /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "CLOSE_CB", "NONEEDED", operation)
- end
-
- is_valid_state (value: STRING): BOOLEAN
- do
- if value.is_equal("IDLE") or
- value.is_equal("PROCESSING") or
- value.is_equal("UNDEFINED") or
- value.is_equal("ABORTED") then
- Result := True
- else
- Result := False
- end
- end
- feature {IUP}
- execute_cancel: STRING
- do
- if attached cb_close_dialog as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_close_dialog: detachable FUNCTION[TUPLE[IUP_PROGRESS_DIALOG], STRING]
-
- int_progress_dialog: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupProgressDlg ();"
- end
- end
|