123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558 |
- class IUP_FILE_DIALOG
- inherit
- IUP_WIDGET
- redefine
- execute_help,
- execute_file,
- execute_button,
- execute_motion,
- execute_wheel
- end
- IUP_WIDGET_TITLE
- IUP_WIDGET_POPUP
- IUP_WIDGET_ICON
- IUP_WIDGET_PARENT_DIALOG
- create {ANY}
- file_dialog
-
- feature {ANY}
- file_dialog
- local
- a_file_dialog: POINTER
- do
- a_file_dialog := int_file_dialog
- set_widget(a_file_dialog)
- end
-
- set_allow_new (state: BOOLEAN)
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "ALLOWNEW", boolean_to_yesno(state))
- end
- set_dialog_type (type: STRING)
-
-
-
-
-
-
-
-
-
-
- require
- is_valid_type(type)
- do
- iup_open.set_attribute(Current, "DIALOGTYPE", type)
- end
- set_directory (dir: STRING)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "DIRECTORY", dir)
- end
- get_directory: STRING
-
-
-
- do
- Result := iup_open.get_attribute(Current, "DIRECTORY")
- end
- set_ext_filter (filter: STRING)
-
-
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "EXTFILTER", filter)
- end
- set_ext_default (ext: STRING)
-
-
-
-
- do
- iup_open.set_attribute(Current, "EXTDEFAULT", ext)
- end
- set_file (file: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "FILE", file)
- end
- file_exist: BOOLEAN
-
-
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "FILEEXIST")
- Result := yesno_to_boolean(str)
- end
- set_filter (filter: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "FILTER", filter)
- end
- set_filter_info (info: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "FILTERINFO", info)
- end
- set_filter_used (id: INTEGER)
-
-
- require
- id >= 1
- do
- iup_open.set_attribute(Current, "FILTERUSED", id.out)
- end
- get_filter_used: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "FILTERUSED")
- if str.is_integer then
- Result := str.to_integer
- end
- end
- set_multiple_files (state: BOOLEAN)
-
-
-
-
-
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "MULTIPLEFILES",
- boolean_to_yesno(state))
- end
- set_no_change_dir (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "NOCHANGEDIR",
- boolean_to_yesno(state))
- end
- set_no_overwrite_prompt (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "NOOVERWRITEPROMPT",
- boolean_to_yesno(state))
- end
- set_no_places_bar (state: BOOLEAN)
-
- do
- iup_open.set_attribute(Current, "NOPLACESBAR", boolean_to_yesno(state))
- end
- set_show_edit_box (state: BOOLEAN)
-
-
- do
- iup_open.set_attribute(Current, "SHOWEDITBOX",
- boolean_to_yesno(state))
- end
- set_show_hidden (state: BOOLEAN)
-
- do
- iup_open.set_attribute(Current, "SHOWHIDDEN",
- boolean_to_yesno(state))
- end
-
- get_status: INTEGER
-
-
-
-
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "STATUS")
- if str.is_integer then
- Result := str.to_integer
- end
- end
- get_value: STRING
-
-
-
- local
- r, sf: STRING
- do
- r := iup_open.get_attribute(Current, "VALUE")
- create sf.make_from_c(get_pointer(r.to_c))
- Result := sf
- end
- get_multivalue_count: INTEGER
-
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "MULTIVALUECOUNT")
- if str.is_integer then
- Result := str.to_integer
- end
- end
- get_multivalue_at (id: INTEGER): STRING
-
-
-
-
- require
- id >= 0
- do
- Result := iup_open.get_attribute_id(Current, "MULTIVALUE", id)
- end
-
- set_multivalue_path (state: BOOLEAN)
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "MULTIVALUEPATH",
- boolean_to_yesno(state))
- end
-
- set_cb_help (act: detachable PROCEDURE[TUPLE[IUP_FILE_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_file (act: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, STRING, STRING], STRING])
-
-
-
- local
- operation: INTEGER
- do
- cb_file := act
- if cb_file /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "FILE_CB", "NONEEDED", operation)
- end
- set_cb_button (act: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING])
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_button := act
- if cb_button /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "BUTTON_CB", "NONEEDED", operation)
- end
- set_cb_motion (act: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, INTEGER, INTEGER, STRING], STRING])
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_motion := act
- if cb_motion /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "MOTION_CB", "NONEEDED", operation)
- end
- set_cb_wheel (act: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, REAL_32, INTEGER, INTEGER, STRING], STRING])
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- local
- operation: INTEGER
- do
- cb_wheel := act
- if cb_wheel /= Void then
- operation := 1
- else
- operation := 0
- end
-
- iup_open.set_callback (Current, "WHEEL_CB", "NONEEDED", operation)
- end
-
- is_valid_type(type: STRING): BOOLEAN
- do
- if type.is_equal("OPEN") or
- type.is_equal("SAVE") or
- type.is_equal("DIR") then
- Result := True
- else
- Result := False
- end
- end
- feature {IUP}
-
- execute_help
- do
- if attached cb_help as int_cb then
- int_cb.call([Current])
- end
- end
-
- execute_file (file_name, status: STRING): STRING
- do
- if attached cb_file as int_cb then
- Result := int_cb.item([Current, file_name, status])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_button (btn, pressed, x, y: INTEGER; status: STRING): STRING
- do
- if attached cb_button as int_cb then
- Result := int_cb.item([Current, btn, pressed, x, y, status])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_motion (x, y: INTEGER; status: STRING): STRING
- do
- if attached cb_motion as int_cb then
- Result := int_cb.item([Current, x, y, status])
- else
- Result := "IUP_DEFAULT"
- end
- end
- execute_wheel (delta: REAL_32; x, y: INTEGER; status: STRING): STRING
- do
- if attached cb_wheel as int_cb then
- Result := int_cb.item([Current, delta, x, y, status])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
-
- cb_help: detachable PROCEDURE[TUPLE[IUP_FILE_DIALOG]]
- cb_file: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, STRING, STRING], STRING]
- cb_button: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, INTEGER, INTEGER, INTEGER, INTEGER, STRING], STRING]
- cb_motion: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, INTEGER, INTEGER, STRING], STRING]
- cb_wheel: detachable FUNCTION[TUPLE[IUP_FILE_DIALOG, REAL_32, INTEGER, INTEGER, STRING], STRING]
-
- int_file_dialog: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupFileDlg();"
- end
-
- end
|