123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- class IUP_BACKGROUND_BOX
- -- Creates a simple native container with no decorations. Useful for
- -- controlling children visibility for IUP_ZBOX or IUP_EXPANDER.
- -- The box can be created with no elements and be dynamic filled using
- -- "append" or "insert".
-
- inherit
- IUP_CANVAS
- redefine
- set_border,
- set_can_focus
- end
- IUP_WIDGET_CLIENTSIZE
- IUP_WIDGET_CLIENTOFFSET
- IUP_WIDGET_DECORATION
- IUP_WIDGET_BGCOLOR
- IUP_WIDGET_BACK_IMAGE_0
- create {ANY}
- background_box_empty,
- background_box
- feature {ANY}
- background_box_empty
- local
- a_background_box, p: POINTER
- do
- a_background_box := int_background_box (p)
- set_widget(a_background_box)
- end
- background_box (child: IUP_WIDGET)
- local
- a_background_box: POINTER
- do
- a_background_box := int_background_box (child.widget)
- set_widget(a_background_box)
- end
- -- Commands to handle attributes
-
- set_border (state: BOOLEAN)
- -- (creation only): the default value is "False".
- do
- Precursor(state)
- end
- has_border: BOOLEAN
- -- Return if the element has border.
- local
- str: STRING
- do
- str := iup_open.get_attribute(Current, "BORDER")
- Result := yesno_to_boolean(str)
- end
- set_canvas_box (state: BOOLEAN)
- -- (non inheritable): enable the behavior of a canvas box instead of a
- -- regular container. Default: "False".
- do
- iup_open.set_attribute(Current, "CANVASBOX", boolean_to_yesno(state))
- end
- set_child_offset (dx, dy: INTEGER)
- -- Allow to specify a position offset for the child. Available for native
- -- containers only. It will not affect the natural size, and allows to
- -- position controls outside the client area. Format "dxxdy", where dx
- -- and dy are integer values corresponding to the horizontal and vertical
- -- offsets, respectively, in pixels. Default: 0x0.
- require
- non_negative: dx >= 0
- dy >= 0
- local
- size: STRING
- do
- size := dx.out
- size.append_string("x")
- size.append_string(dy.out)
- iup_open.set_attribute(Current, "CHILDOFFSET", size)
- end
- get_child_offset: TUPLE[INTEGER, INTEGER]
- -- The child offset.
- local
- offset: STRING
- do
- offset := iup_open.get_attribute(Current, "CHILDOFFSET")
- Result := components_of_size(offset)
- end
- set_can_focus (state: BOOLEAN)
- -- Default: False.
- do
- Precursor (state)
- end
- feature {NONE}
- -- Internals
- int_background_box (child: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupBackgroundBox ($child);"
- end
- end
- -- The MIT License (MIT)
- -- Copyright (c) 2016, 2017, 2019 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.
-
|