123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699 |
- class IUP_GRID_BOX
- inherit
- IUP_CONTAINER
- IUP_WIDGET_EXPAND
- IUP_WIDGET_WID
- IUP_WIDGET_SIZE
- IUP_WIDGET_RASTERSIZE
- IUP_WIDGET_USERSIZE
- IUP_WIDGET_FONT
- IUP_WIDGET_CLIENTSIZE
- IUP_WIDGET_CLIENTOFFSET
- IUP_WIDGET_POSITION
- IUP_WIDGET_MAXMIN_SIZE
- IUP_WIDGET_CHILD
- IUP_WIDGET_NAME
- IUP_WIDGET_CUSTOM_ATTRIBUTES
- IUP_WIDGET_NORMALIZE_SIZE
- redefine
- set_normalize_size
- end
- create {ANY}
- grid_box_empty,
- grid_box
-
- feature {ANY}
-
- grid_box_empty
-
- local
- p, a_grid_box: POINTER
- do
- a_grid_box := int_grid_box_empty (p)
- set_widget(a_grid_box)
- end
-
- grid_box (col: ARRAY[IUP_WIDGET])
-
- local
- i: INTEGER; arg: ARRAY[POINTER]; s: IUP_WIDGET; a_grid_box: POINTER
- 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(s.widget, i)
- end
- a_grid_box := int_grid_box (get_pointer(arg.to_c))
- set_widget(a_grid_box)
- end
-
-
- set_alignment_line (value: STRING)
-
-
-
- require
- valid_lin: is_valid_alignment_lin(value)
- do
- iup_open.set_attribute(Current, "ALIGNMENTLIN", value)
- end
- get_alignment_line: STRING
-
- do
- Result := iup_open.get_attribute(Current, "ALIGNMENTLIN")
- end
- set_alignment_for_line (value: STRING; line: INTEGER)
-
- require
- valid_lin: is_valid_alignment_lin(value)
- line >= 0
- local
- str: STRING
- do
- str := "ALIGNMENTLIN" + line.out
- iup_open.set_attribute(Current, str, value)
- end
- get_alignment_for_line (line: INTEGER): STRING
-
- require
- line >= 0
- local
- str: STRING
- do
- str := "ALIGNMENTLIN" + line.out
- Result := iup_open.get_attribute(Current, str)
- end
-
- set_alignment_column (value: STRING)
-
-
-
- require
- valid_col: is_valid_alignment_col(value)
- do
- iup_open.set_attribute(Current, "ALIGNMENTCOL", value)
- end
- get_alignment_column: STRING
-
- do
- Result := iup_open.get_attribute(Current, "ALIGNMENTCOL")
- end
- set_alignment_for_column (value: STRING; col: INTEGER)
-
- require
- valid_col: is_valid_alignment_col(value)
- col >= 0
- local
- str: STRING
- do
- str := "ALIGNMENTCOL" + col.out
- iup_open.set_attribute(Current, str, value)
- end
- get_alignment_for_column (col: INTEGER): STRING
-
- require
- col >= 0
- local
- str: STRING
- do
- str := "ALIGNMENTCOL" + col.out
- Result := iup_open.get_attribute(Current, str)
- end
- set_expand_children (value: STRING)
-
-
-
-
-
- require
- valid_expand_children: is_valid_expand_children(value)
- do
- iup_open.set_attribute(Current, "EXPANDCHILDREN", value)
- end
- get_expand_children: STRING
-
- do
- Result := iup_open.get_attribute(Current, "EXPANDCHILDREN")
- end
- set_fit_to_children_at_line (line: INTEGER)
-
-
-
-
-
- require
- line > 0
- local
- str: STRING
- do
- str := "L" + line.out
- iup_open.set_attribute(Current, "FITTOCHILDREN", str)
- end
- set_fit_to_children_at_column (column: INTEGER)
-
-
-
-
-
- require
- column > 0
- local
- str: STRING
- do
- str := "C" + column.out
- iup_open.set_attribute(Current, "FITTOCHILDREN", str)
- end
- set_gaplin (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "GAPLIN", space.out)
- end
- get_gaplin: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "GAPLIN")
- Result := value.to_integer
- end
- set_cgaplin (space: INTEGER)
-
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "CGAPLIN", space.out)
- end
- get_cgaplin: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "CGAPLIN")
- Result := value.to_integer
- end
- set_gapcol (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "GAPCOL", space.out)
- end
- get_gapcol: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "GAPCOL")
- Result := value.to_integer
- end
- set_cgapcol (space: INTEGER)
-
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "CGAPCOL", space.out)
- end
- get_cgapcol: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "CGAPCOL")
- Result := value.to_integer
- end
- set_ngaplin (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "NGAPLIN", space.out)
- end
- get_ngaplin: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "NGAPLIN")
- Result := value.to_integer
- end
- set_ncgaplin (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "NCGAPLIN", space.out)
- end
- get_ncgaplin: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "NCGAPLIN")
- Result := value.to_integer
- end
-
- set_ngapcol (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "NGAPCOL", space.out)
- end
- get_ngapcol: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "NGAPCOL")
- Result := value.to_integer
- end
- set_ncgapcol (space: INTEGER)
-
- require
- space >= 0
- do
- iup_open.set_attribute(Current, "NCGAPCOL", space.out)
- end
- get_ncgapcol: INTEGER
-
- local
- value: STRING
- do
- value := iup_open.get_attribute(Current, "NCGAPCOL")
- Result := value.to_integer
- end
- set_homogeneous_lines (state: BOOLEAN)
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "HOMOGENEOUSLIN", boolean_to_yesno(state))
- end
- is_homogeneous_lines: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "HOMOGENEOUSLIN")
- Result := yesno_to_boolean(str)
- end
- set_homogeneous_columns (state: BOOLEAN)
-
-
-
-
-
- do
- iup_open.set_attribute(Current, "HOMOGENEOUSCOL", boolean_to_yesno(state))
- end
- is_homogeneous_columns: BOOLEAN
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "HOMOGENEOUSCOL")
- Result := yesno_to_boolean(str)
- end
- set_margin (horizontal, vertical: INTEGER)
-
- require
- horizontal >= 0
- vertical >= 0
- local
- margin: STRING
- do
- margin := horizontal.out
- margin.append_string("x")
- margin.append_string(vertical.out)
- iup_open.set_attribute(Current, "MARGIN", margin)
- end
- get_margin: TUPLE[INTEGER, INTEGER]
-
- local
- margin: STRING
- do
- margin := iup_open.get_attribute(Current, "MARGIN")
- Result := components_of_size(margin)
- end
- set_cmargin (horizontal, vertical: INTEGER)
-
-
- require
- horizontal >= 0
- vertical >= 0
- local
- margin: STRING
- do
- margin := horizontal.out
- margin.append_string("x")
- margin.append_string(vertical.out)
- iup_open.set_attribute(Current, "CMARGIN", margin)
- end
- get_cmargin: TUPLE[INTEGER, INTEGER]
-
- local
- margin: STRING
- do
- margin := iup_open.get_attribute(Current, "CMARGIN")
- Result := components_of_size(margin)
- end
- set_nmargin (horizontal, vertical: INTEGER)
-
- require
- horizontal >= 0
- vertical >= 0
- local
- margin: STRING
- do
- margin := horizontal.out
- margin.append_string("x")
- margin.append_string(vertical.out)
- iup_open.set_attribute(Current, "NMARGIN", margin)
- end
- get_nmargin: TUPLE[INTEGER, INTEGER]
-
- local
- margin: STRING
- do
- margin := iup_open.get_attribute(Current, "NMARGIN")
- Result := components_of_size(margin)
- end
- set_ncmargin (horizontal, vertical: INTEGER)
-
- require
- horizontal >= 0
- vertical >= 0
- local
- margin: STRING
- do
- margin := horizontal.out
- margin.append_string("x")
- margin.append_string(vertical.out)
- iup_open.set_attribute(Current, "NCMARGIN", margin)
- end
- get_ncmargin: TUPLE[INTEGER, INTEGER]
-
- local
- margin: STRING
- do
- margin := iup_open.get_attribute(Current, "NCMARGIN")
- Result := components_of_size(margin)
- end
- set_numdiv (num: INTEGER)
-
-
-
-
-
- require
- num >= 0
- local
- str: STRING
- do
- if num.is_equal(0) then
- str := "AUTO"
- else
- str := num.out
- end
- iup_open.set_attribute(Current, "NUMDIV", str)
- end
- get_numdiv: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "NUMDIV")
- if str.is_equal("AUTO") then
- Result := 0
- else
- Result := str.to_integer
- end
- end
- get_lines: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "NUMLIN")
- Result := str.to_integer
- end
- get_columns: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "NUMCOL")
- Result := str.to_integer
- end
- set_normalize_size (value: STRING)
-
-
-
-
-
-
-
-
- do
- Precursor (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
- is_horizontal: BOOLEAN
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "ORIENTATION")
- if str.is_equal("HORIZONTAL") then
- Result := True
- else
- Result := False
- end
- end
- is_vertical: BOOLEAN
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "ORIENTATION")
- if str.is_equal("VERTICAL") then
- Result := True
- else
- Result := False
- end
- end
- set_reference_column (col: INTEGER)
-
-
- require
- col >= 0
- do
- iup_open.set_attribute(Current, "SIZECOL", col.out)
- end
- get_reference_column: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "SIZECOL")
- Result := str.to_integer
- end
- set_reference_line (line: INTEGER)
-
-
- require
- line >= 0
- do
- iup_open.set_attribute(Current, "SIZELIN", line.out)
- end
- get_reference_line: INTEGER
-
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "SIZELIN")
- Result := str.to_integer
- end
-
- is_valid_alignment_lin (value: STRING): BOOLEAN
- do
- if value.is_equal("ATOP") or
- value.is_equal("ACENTER") or
- value.is_equal("ABOTTOM") then
- Result := True
- else
- Result := False
- end
- end
- is_valid_alignment_col (value: STRING): BOOLEAN
- do
- if value.is_equal("ALEFT") or
- value.is_equal("ACENTER") or
- value.is_equal("ARIGHT") then
- Result := True
- else
- Result := False
- end
- end
- is_valid_expand_children (value: STRING): BOOLEAN
- do
- if value.is_equal("YES") or
- value.is_equal("HORIZONTAL") or
- value.is_equal("VERTICAL") or
- value.is_equal("NO") then
- Result := True
- else
- Result := False
- end
- end
- feature {NONE}
-
-
- int_grid_box_empty (arguments: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupGridBox ($arguments);"
- end
-
- int_grid_box (arguments: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupGridBoxv ($arguments);"
- end
-
- end
|