123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- deferred class IUP_WIDGET_FOCUS
- -- Command to handle the focus.
- inherit
- IUP_WIDGET_INTERNALS
-
- feature {ANY}
- set_focus: detachable IUP_WIDGET
- -- Sets the interface element that will receive the keyboard focus,
- -- i.e., the element that will receive keyboard events.
- --
- -- Returns: the identifier of the interface element that previously
- -- had the keyboard focus.
- local
- p: POINTER
- do
- p := int_set_focus(widget)
- if p /= default_pointer then
- Result := iup_open.get_widget_for_object(p)
- end
- end
- next_field: detachable IUP_WIDGET
- -- Shifts the focus to the next element that can have the focus. It is
- -- relative to the current element and does not depend on the element
- -- currently with the focus.
- --
- -- It will search for the next element first in the children, then in the
- -- brothers, then in the uncles and their children, and so on.
- --
- -- This sequence is not the same sequence used by the Tab key, which is
- -- dependent on the native system.
- --
- -- Returns: the element that received the focus or Void if not found.
- local
- p: POINTER
- do
- p := int_next_field(widget)
- if p /= default_pointer then
- Result := iup_open.get_widget_for_object(p)
- end
- end
- previous_field: detachable IUP_WIDGET
- -- Shifts the focus to the previous element that can have the focus. It
- -- is relative to the current element and does not depend on the element
- -- currently with the focus.
- --
- -- Returns: the element that received the focus or Void if not found.
- local
- p: POINTER
- do
- p := int_previous_field(widget)
- if p /= default_pointer then
- Result := iup_open.get_widget_for_object(p)
- end
- end
- feature {NONE}
- -- Internals
- int_set_focus (wgt: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupSetFocus ($wgt);"
- end
- int_next_field (wgt: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupNextField ($wgt);"
- end
- int_previous_field (wgt: POINTER): POINTER
- external
- "C inline use %"eiffel-iup.h%""
- alias
- "return IupPreviousField ($wgt);"
- 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.
|