123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656 |
- class IUP_CONFIG
- inherit
- IUP_WIDGET
- rename
- refresh as config
- redefine
- execute_recent,
- config
- end
- IUP_WIDGET_INTERNALS
- rename
- refresh as config
- redefine
- config
- end
- create {ANY}
- config
- feature {ANY}
- config
-
- local
- a_config: POINTER
- do
- a_config := int_config
- set_widget(a_config)
- end
-
- load: INTEGER
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do
- Result := int_load(widget)
- end
- save: INTEGER
-
-
-
-
-
- do
- Result := int_save(widget)
- end
- set_recent_file_menu (menu: IUP_MENU;
- recent_cb: FUNCTION[TUPLE[IUP_CONFIG], STRING];
- max_recent: INTEGER)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do
- cb_recent := recent_cb
- int_config_recent_init(widget, menu.widget, max_recent)
- end
- set_recent_file_list (list: IUP_LIST;
- recent_cb: FUNCTION[TUPLE[IUP_CONFIG], STRING];
- max_recent: INTEGER)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do
- cb_recent := recent_cb
- int_config_recent_init(widget, list.widget, max_recent)
- end
- update_recent_file_list (filename: STRING)
-
-
-
- do
- int_config_recent_update(widget, get_pointer(filename.to_c))
- end
- show_dialog (dialog: IUP_WIDGET; name: STRING)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- do
- int_config_dialog_show (widget, dialog.widget, get_pointer(name.to_c))
- end
- save_dialog (dialog: IUP_WIDGET; name: STRING)
-
-
-
-
-
- do
- int_config_dialog_closed (widget, dialog.widget, get_pointer(name.to_c))
- end
-
- set_app_config (state: BOOLEAN)
-
- do
- iup_open.set_attribute(Current, "APP_CONFIG", boolean_to_yesno(state))
- end
- set_app_system_path (state: BOOLEAN)
-
-
-
-
- do
- iup_open.set_attribute(Current, "APP_SYSTEMPATH", boolean_to_yesno(state))
- end
- set_app_file_name (file_name: STRING)
-
- do
- iup_open.set_attribute(Current, "APP_FILENAME", file_name)
- end
- set_app_name (app_name: STRING)
-
- do
- iup_open.set_attribute(Current, "APP_NAME", app_name)
- end
- set_app_path (app_path: STRING)
-
-
-
- do
- iup_open.set_attribute(Current, "APP_PATH", app_path)
- end
- get_file_name: STRING
-
- do
- Result := iup_open.get_attribute(Current, "FILENAME")
- end
- get_title: STRING
-
- do
- Result := iup_open.get_attribute(Current, "TITLE")
- end
-
- set_variable_string (group, key, value: STRING)
- do
- int_set_variable_str (widget, get_pointer(group.to_c), get_pointer(key.to_c),
- get_pointer(value.to_c))
- end
- set_variable_string_id (group, key: STRING; id: INTEGER; value: STRING)
- do
- int_set_variable_str_id (widget, get_pointer(group.to_c), get_pointer(key.to_c),
- id, get_pointer(value.to_c))
- end
- set_variable_integer (group, key: STRING; value: INTEGER)
- do
- int_set_variable_int (widget, get_pointer(group.to_c), get_pointer(key.to_c),
- value)
- end
- set_variable_integer_id (group, key: STRING; id, value: INTEGER)
- do
- int_set_variable_int_id (widget, get_pointer(group.to_c), get_pointer(key.to_c),
- id, value)
- end
- set_variable_double (group, key: STRING; value: REAL_64)
- do
- int_set_variable_double (widget, get_pointer(group.to_c), get_pointer(key.to_c),
- value)
- end
- set_variable_double_id (group, key: STRING; id: INTEGER; value: REAL_64)
- do
- int_set_variable_double_id (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id, value)
- end
-
- get_variable_string (group, key: STRING): STRING
- local
- p: POINTER
- str: STRING
- do
- p := int_get_variable_str (widget,
- get_pointer(group.to_c),
- get_pointer(key.to_c))
- if p /= default_pointer then
- create str.make_from_c(p)
- Result := str
- else
- Result := ""
- end
- end
- get_variable_string_id (group, key: STRING; id: INTEGER): STRING
- local
- p: POINTER
- str: STRING
- do
- p := int_get_variable_str_id (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id)
- if p /= default_pointer then
- create str.make_from_c(p)
- Result := str
- else
- Result := ""
- end
- end
- get_variable_integer (group, key: STRING): INTEGER
- do
- Result := int_get_variable_int (widget, get_pointer(group.to_c),
- get_pointer(key.to_c))
- end
- get_variable_integer_id (group, key: STRING; id: INTEGER): INTEGER
- do
- Result := int_get_variable_int_id (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id)
- end
- get_variable_double (group, key: STRING): REAL_64
- do
- Result := int_get_variable_double (widget, get_pointer(group.to_c),
- get_pointer(key.to_c))
- end
- get_variable_double_id (group, key: STRING; id: INTEGER): REAL_64
- do
- Result := int_get_variable_double_id (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id)
- end
-
- get_variable_string_default (group, key, def: STRING): STRING
- local
- p: POINTER
- str: STRING
- do
- p := int_get_variable_str_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c),
- get_pointer(def.to_c))
- if p /= default_pointer then
- create str.make_from_c(p)
- Result := str
- else
- Result := ""
- end
- end
- get_variable_string_id_default (group, key: STRING; id: INTEGER;
- def: STRING): STRING
- local
- p: POINTER
- str: STRING
- do
- p := int_get_variable_str_id_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id,
- get_pointer(def.to_c))
- if p /= default_pointer then
- create str.make_from_c(p)
- Result := str
- else
- Result := ""
- end
- end
- get_variable_integer_default (group, key: STRING; def: INTEGER): INTEGER
- do
- Result := int_get_variable_int_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), def)
- end
- get_variable_integer_id_default (group, key: STRING; id, def: INTEGER): INTEGER
- do
- Result := int_get_variable_int_id_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id, def)
- end
- get_variable_double_default (group, key: STRING; def: REAL_64): REAL_64
- do
- Result := int_get_variable_double_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), def)
- end
- get_variable_double_id_default (group, key: STRING; id: INTEGER;
- def: REAL_64): REAL_64
- do
- Result := int_get_variable_double_id_def (widget, get_pointer(group.to_c),
- get_pointer(key.to_c), id, def)
- end
- feature {IUP}
- execute_recent: STRING
- do
- if attached cb_recent as int_cb then
- Result := int_cb.item([Current])
- else
- Result := "IUP_DEFAULT"
- end
- end
- feature {NONE}
- cb_recent: detachable FUNCTION[TUPLE[IUP_CONFIG], STRING]
-
- int_config: POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfig();"
- end
- int_load (wgt: POINTER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigLoad ($wgt);"
- end
- int_save (wgt: POINTER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigSave ($wgt);"
- end
- int_config_recent_init (wgt, menu: POINTER; max_recent: INTEGER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "config_recent_init ($wgt, $menu, $max_recent);"
- end
- int_config_recent_update (wgt, filename: POINTER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigRecentUpdate ($wgt, $filename);"
- end
- int_config_dialog_show (wgt, dialog, name: POINTER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigDialogShow ($wgt, $dialog, $name);"
- end
- int_config_dialog_closed (wgt, dialog, name: POINTER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigDialogClosed ($wgt, $dialog, $name);"
- end
-
- int_set_variable_str (wgt, group, key, value: POINTER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableStr ($wgt, $group, $key, $value);"
- end
- int_set_variable_str_id (wgt, group, key: POINTER; id: INTEGER; value: POINTER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableStrId ($wgt, $group, $key, $id, $value);"
- end
- int_set_variable_int (wgt, group, key: POINTER; value: INTEGER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableInt ($wgt, $group, $key, $value);"
- end
- int_set_variable_int_id (wgt, group, key: POINTER; id, value: INTEGER)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableIntId ($wgt, $group, $key, $id, $value);"
- end
- int_set_variable_double (wgt, group, key: POINTER; value: REAL_64)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableDouble ($wgt, $group, $key, $value);"
- end
- int_set_variable_double_id (wgt, group, key: POINTER; id: INTEGER; value: REAL_64)
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "IupConfigSetVariableDoubleId ($wgt, $group, $key, $id, $value);"
- end
-
- int_get_variable_str (wgt, group, key: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return unconst_char(IupConfigGetVariableStr ($wgt, $group, $key));"
- end
- int_get_variable_str_id (wgt, group, key: POINTER; id: INTEGER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return unconst_char(IupConfigGetVariableStrId ($wgt, $group, $key, $id));"
- end
- int_get_variable_int (wgt, group, key: POINTER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableInt ($wgt, $group, $key);"
- end
- int_get_variable_int_id (wgt, group, key: POINTER; id: INTEGER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableIntId ($wgt, $group, $key, $id);"
- end
- int_get_variable_double (wgt, group, key: POINTER): REAL_64
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableDouble ($wgt, $group, $key);"
- end
- int_get_variable_double_id (wgt, group, key: POINTER; id: INTEGER): REAL_64
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableDoubleId ($wgt, $group, $key, $id);"
- end
-
- int_get_variable_str_def (wgt, group, key, def: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return unconst_char(IupConfigGetVariableStrDef ($wgt, $group, $key, $def));"
- end
- int_get_variable_str_id_def (wgt, group, key: POINTER; id: INTEGER; def: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return unconst_char(IupConfigGetVariableStrIdDef ($wgt, $group, $key, $id, $def));"
- end
- int_get_variable_int_def (wgt, group, key: POINTER; def: INTEGER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableIntDef ($wgt, $group, $key, $def);"
- end
- int_get_variable_int_id_def (wgt, group, key: POINTER; id, def: INTEGER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableIntIdDef ($wgt, $group, $key, $id, $def);"
- end
- int_get_variable_double_def (wgt, group, key: POINTER; def: REAL_64): REAL_64
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableDoubleDef ($wgt, $group, $key, $def);"
- end
- int_get_variable_double_id_def (wgt, group, key: POINTER; id: INTEGER; def: REAL_64): REAL_64
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupConfigGetVariableDoubleIdDef ($wgt, $group, $key, $id, $def);"
- end
- end
|