Expand description
Message and events module contains all possible widget messages and OS events. See UiMessage
docs for more info and
examples.
Structs§
- Keyboard
Modifiers - A set of possible keyboard modifiers.
- UiMessage
- Message is basic communication element that is used to deliver information to widget or to user code.
Enums§
- Button
State - Mouse button state.
- Cursor
Icon - A fixed set of cursor icons that available on most OSes.
- Force
- Describes the force of a touch event
- KeyCode
- Code of a key on keyboard. Shamelessly taken from
winit
source code to match their key codes withfyrox-ui
’s. - Message
Direction - Message direction allows you to distinguish from where message has came from. Often there is a need to find out who created a message to respond properly. Imagine that we have a NumericUpDown input field for a property and we using some data source to feed data into input field. When we change something in the input field by typing, it creates a message with new value. On other hand we often need to put new value in the input field from some code, in this case we again creating a message. But how to understand from which “side” message has came from? Was it filled in by user and we should create a command to change value in the data source, or it was created from syncing code just to pass new value to UI? This problem solved by setting a direction to a message. Also it solves another problem: often we need to respond to a message only if it did some changes. In this case at first we fire a message with ToWidget direction, widget catches it and checks if changes are needed and if so, it “rethrows” message with direction FromWidget. Listeners are “subscribed” to FromWidget messages only and won’t respond to ToWidget messages.
- Mouse
Button - A set of possible mouse buttons.
- OsEvent
- An event that an OS sends to a window, that is then can be used to “feed” the user interface so it can do some actions.
- Routing
Strategy - Defines a way of how the message will behave in the widget tree after it was delivered to the destination node.
- Touch
Phase - A set of possible touch phases
Traits§
- Message
Data - A trait, that is used by every messages used in the user interface. It contains utility methods, that are used for downcasting and equality comparison.
Functions§
- compare_
and_ set - Compares the new value with the existing one, and if they do not match, sets the new value to it and sends the given message back to the message queue with the opposite direction. This function is useful to reduce boilerplate code when reacting to widget messages.