Message arguments for the pre-focus messages. More...
#include <kanzi/core.ui/input/focus_manager.hpp>
Public Member Functions | |
void | setAccepted (bool accepted) |
Sets the acceptance status. More... | |
bool | isAccepted () const |
Returns the focus acceptance status. More... | |
Public Member Functions inherited from kanzi::FocusManager::PostFocusMessageArguments | |
FocusManager::FocusReason | getFocusReason () const |
Returns the stored value for the focus reason. More... | |
void | setFocusReason (FocusManager::FocusReason reason) |
Sets the focus reason value. More... | |
Public Member Functions inherited from kanzi::MessageArguments | |
MessageArguments () | |
MessageArguments (AbstractMessageType messageType) | |
~MessageArguments () | |
template<typename TDataType > | |
TDataType | getArgument (const PropertyType< TDataType > &argumentType) const |
bool | getAbstractArgument (AbstractPropertyType argumentType, Variant &variant) const |
template<typename TDataType > | |
void | setArgument (const PropertyType< TDataType > &argumentType, typename PropertyType< TDataType >::DataType value) |
void | setAbstractArgument (AbstractPropertyType argumentType, const Variant &variant) |
bool | isFrom (const Node &source) const |
shared_ptr< Node > | getSource () const |
void | setHandled (bool handled) |
bool | isHandled () const |
chrono::milliseconds | getTimestamp () const |
KzuMessageDispatcher * | getDispatcher () const |
AbstractMessageType | getType () const |
void | setSource (Node *source) |
void | setTimestamp (chrono::milliseconds timestamp) |
void | setValid (bool valid) |
bool | isValid () const |
void | setDispatcher_internal (KzuMessageDispatcher *dispatcher) |
Internal function. More... | |
void | setType_internal (AbstractMessageType type) |
Internal function. More... | |
Static Public Attributes | |
Properties | |
The property that holds the state of the pre-focus message acceptance. If the value is true, the pre-focus step is accepted, otherwise the focus move is rejected. Defaults to true.
| |
static PropertyType< bool > | AcceptFocusProperty |
Static Public Attributes inherited from kanzi::FocusManager::PostFocusMessageArguments | |
static PropertyType< int > | FocusReasonProperty |
Additional Inherited Members | |
Static Public Member Functions inherited from kanzi::MessageArguments | |
static PropertyTypeEditorInfoSharedPtr | makeEditorInfo () |
Message arguments for the pre-focus messages.
These arguments hold the information for the reason of the focus change and the acceptance flag.
void kanzi::FocusManager::PreFocusMessageArguments::setAccepted | ( | bool | accepted | ) |
Sets the acceptance status.
By default the pre-focus messages are in accepted state. You need to call this method if you want to deny the focus move.
accepted | The new acceptance status. // Reject losing focus when Tab or Backtab navigation reason is received. static void allowLosingFocusOnOtherReason(FocusManager::PreFocusMessageArguments& arguments) { if (arguments.getFocusReason() != FocusManager::OtherFocusReason) { arguments.setAccepted(false); arguments.setHandled(true); } } // Allow getting focus when focus chain navigation reason is received. static void allowGainingFocusOnFocusNavigation(FocusManager::PreFocusMessageArguments& arguments) { if (arguments.getFocusReason() != FocusManager::FocusChainNavigationReason) { arguments.setAccepted(false); arguments.setHandled(true); } } |
bool kanzi::FocusManager::PreFocusMessageArguments::isAccepted | ( | ) | const |
Returns the focus acceptance status.
|
static |