123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- class IUP_LIST_DIALOG
- inherit
- IUP_WIDGET
- create {ANY}
- list_dialog_simple,
- list_dialog_multiple
- feature {ANY}
- list_dialog_simple (title: STRING; list: ARRAY[STRING];
- op, max_col, max_lin: INTEGER)
-
-
-
-
-
-
-
-
- do
- t := 1
- ttl := title
- l := list
- o := op
- mc := max_col
- ml := max_lin
- convert_to_native(list)
- end
- list_dialog_multiple (title: STRING; list: ARRAY[STRING];
- max_col, max_lin: INTEGER)
-
-
-
-
-
-
- do
- t := 2
- ttl := title
- l := list
- o := 0
- mc := max_col
- ml := max_lin
- convert_to_native(list)
- end
- launch: TUPLE[INTEGER, STRING]
-
-
-
-
-
-
-
-
-
- local
- i: INTEGER
- so: STRING
- marks: ARRAY[INTEGER]
- do
- create marks.make_filled(0, 1, l.count)
-
- i := int_list_dialog (t, get_pointer(ttl.to_c),
- l.count, get_pointer(arg.to_c), o, mc, ml,
- get_pointer(marks.to_c))
- if i.is_equal(-1) then
- Result := [i, ""]
- else
- if t.is_equal(1) then
- Result := [i, l.item(i)]
- else
- so := ""
- across
- marks as ic
- loop
- so.append_string(ic.item.out)
- end
- Result := [i, so]
- end
- end
- end
- feature {NONE}
- t, o, mc, ml: INTEGER
- ttl: STRING
- l: ARRAY[STRING]
- arg: ARRAY[POINTER]
-
-
- int_list_dialog (type: INTEGER; title: POINTER; size: INTEGER; list: POINTER; op, max_col, max_lin: INTEGER; marks: POINTER): INTEGER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupListDialog ($type, $title, $size, $list, $op, $max_col, $max_lin, $marks);"
- end
- convert_to_native (col: ARRAY[STRING])
- local
- i: INTEGER; s: STRING
- do
- i := col.count
- create arg.make_filled(default_pointer, 1, i + 1)
- i := 0
-
- across
- col as ic
- loop
- i := i + 1
- s := ic.item
- arg.put(get_pointer(s.to_c), i)
- end
- end
- end
|