123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136 |
- class IUP_VBOX
- -- Container for composing elements vertically
- inherit
- IUP_LINEAL_BOX
- redefine
- set_alignment,
- set_expand_children,
- set_size,
- set_raster_size
- end
-
- create {ANY}
- vbox_empty,
- vbox
- feature {ANY}
-
- vbox_empty
- -- Create an empty vbox
- local
- p, a_vbox: POINTER
- do
- a_vbox := int_vbox_empty (p)
- set_widget(a_vbox)
- end
-
- vbox (col: ARRAY[IUP_WIDGET])
- -- Create a new vbox containing the list of widgets
- local
- i: INTEGER; s: IUP_WIDGET; a_vbox: POINTER
- arg: ARRAY[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_vbox := int_vbox(get_pointer(arg.to_c))
- set_widget(a_vbox)
- end
- -- Attributes
- set_alignment (value: STRING)
- -- (non inheritable): Horizontally aligns the elements. Possible
- -- values: "ALEFT", "ACENTER", "ARIGHT". Default: "ALEFT".
- do
- Precursor (value)
- end
- set_expand_children (state: BOOLEAN)
- -- (non inheritable): forces all children to expand horizontally and to
- -- fully occupy its space available inside the box. Default: "NO". This
- -- has the same effect as setting EXPAND=HORIZONTAL on each child.
- do
- Precursor (state)
- end
- set_size (width: INTEGER; height: INTEGER)
- -- (non inheritable): Defines the width of the box. Height will be
- -- ignored. When consulted behaves as the standard SIZE attribute.
- do
- Precursor (width, height)
- end
- set_raster_size (width: INTEGER; height: INTEGER)
- -- (non inheritable): Defines the width of the box. Height will be
- -- ignored. When consulted behaves as the standard RASTERSIZE attribute.
- do
- Precursor (width, height)
- end
- -- Validation
- is_valid_alignment (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
- feature {NONE}
- -- Internals
-
- int_vbox_empty (arguments: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupVbox ($arguments);"
- end
-
- int_vbox (arguments: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupVboxv ($arguments);"
- end
- end -- class IUP_VBOX
- -- The MIT License (MIT)
- -- Copyright (c) 2016, 2019, 2020 by German A. Arias
- -- Permission is hereby granted, free of charge, to any person obtaining a copy
- -- of this software and associated documentation files (the "Software"), to deal
- -- in the Software without restriction, including without limitation the rights
- -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- -- copies of the Software, and to permit persons to whom the Software is
- -- furnished to do so, subject to the following conditions:
- --
- -- The above copyright notice and this permission notice shall be included in
- -- all copies or substantial portions of the Software.
- --
- -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- -- SOFTWARE.
|