soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SFocusManager Class Reference

Focus management object for DUI windows. More...

#include <SFocusManager.h>

Inheritance diagram for SFocusManager:
IAcceleratorMgr

Public Types

enum  FocusChangeReason { kReasonDirectFocusChange = 0 , kReasonFocusTraversal , kReasonFocusRestore }
 Reason for focus change. More...
 

Public Member Functions

 SFocusManager ()
 Constructor.
 
 ~SFocusManager (void)
 Destructor.
 
void SetOwner (SWindow *pOwner)
 Sets the owner window.
 
BOOL IsTabTraversalKey (UINT vKey)
 Checks if a key is a tab traversal key.
 
BOOL OnKeyDown (UINT vKey)
 Handles key down events.
 
void AdvanceFocus (bool reverse)
 Advances the focus.
 
void SetFocusedHwndWithReason (SWND swnd, FocusChangeReason reason)
 Sets the focused window with a reason.
 
void SetFocusedHwnd (SWND swnd)
 Sets the focused window.
 
void ClearFocus ()
 Clears the focused window.
 
SWND GetFocusedHwnd () const
 Gets the focused window.
 
void StoreFocusedView ()
 Stores the focused view.
 
void RestoreFocusedView ()
 Restores the focused view.
 

Protected Member Functions

void RegisterAccelerator (const IAccelerator *pAcc, IAcceleratorTarget *target) OVERRIDE
 Registers a keyboard accelerator for a target.
 
void UnregisterAccelerator (const IAccelerator *pAcc, IAcceleratorTarget *target) OVERRIDE
 Unregisters a keyboard accelerator for a target.
 
void UnregisterAccelerators (IAcceleratorTarget *target) OVERRIDE
 Unregisters all keyboard accelerators for a target.
 

Detailed Description

Focus management object for DUI windows.

Manages the focus for DUI windows, handling focus traversal and keyboard accelerators.

Definition at line 115 of file SFocusManager.h.

Member Enumeration Documentation

◆ FocusChangeReason

Reason for focus change.

Enumerates the reasons why the focus might change.

Enumerator
kReasonDirectFocusChange 

Focus changed due to a direct action like a click or shortcut.

kReasonFocusTraversal 

Focus changed due to keyboard traversal (e.g., Tab, Shift+Tab).

kReasonFocusRestore 

Focus changed due to restoring the focus.

Definition at line 123 of file SFocusManager.h.

Constructor & Destructor Documentation

◆ SFocusManager()

SFocusManager::SFocusManager ( )

Constructor.

Definition at line 191 of file SFocusManager.cpp.

◆ ~SFocusManager()

SFocusManager::~SFocusManager ( void )

Destructor.

Definition at line 198 of file SFocusManager.cpp.

Member Function Documentation

◆ AdvanceFocus()

void SFocusManager::AdvanceFocus ( bool reverse)

Advances the focus.

Parameters
reverseTRUE to advance backward, FALSE to advance forward

Advances the focus to the next or previous focusable view based on the specified direction.

Definition at line 271 of file SFocusManager.cpp.

◆ ClearFocus()

void SFocusManager::ClearFocus ( )

Clears the focused window.

Clears the focused window and sets the native focus to the top root view.

Definition at line 350 of file SFocusManager.cpp.

◆ GetFocusedHwnd()

SWND SFocusManager::GetFocusedHwnd ( ) const

Gets the focused window.

Returns
Handle to the focused window

Returns the handle to the currently focused window.

Definition at line 355 of file SFocusManager.cpp.

◆ IsTabTraversalKey()

BOOL SFocusManager::IsTabTraversalKey ( UINT vKey)

Checks if a key is a tab traversal key.

Parameters
vKeyVirtual key code
Returns
TRUE if the key is a tab traversal key, otherwise FALSE

Determines if the specified virtual key code is a tab traversal key.

Definition at line 207 of file SFocusManager.cpp.

◆ OnKeyDown()

BOOL SFocusManager::OnKeyDown ( UINT vKey)

Handles key down events.

Parameters
vKeyVirtual key code
Returns
TRUE if the key event is handled, otherwise FALSE

Handles key down events and performs focus traversal if necessary.

Definition at line 220 of file SFocusManager.cpp.

◆ RegisterAccelerator()

void SFocusManager::RegisterAccelerator ( const IAccelerator * pAcc,
IAcceleratorTarget * target )
protected

Registers a keyboard accelerator for a target.

Parameters
pAccPointer to the accelerator
targetPointer to the accelerator target

Registers a keyboard accelerator for the specified target.

Implements IAcceleratorMgr.

Definition at line 388 of file SFocusManager.cpp.

◆ RestoreFocusedView()

void SFocusManager::RestoreFocusedView ( )

Restores the focused view.

Restores the focused view from the stored state.

Definition at line 377 of file SFocusManager.cpp.

◆ SetFocusedHwnd()

void SFocusManager::SetFocusedHwnd ( SWND swnd)

Sets the focused window.

Parameters
swndHandle to the window to focus

Sets the focused window without specifying a reason.

Definition at line 325 of file SFocusManager.cpp.

◆ SetFocusedHwndWithReason()

void SFocusManager::SetFocusedHwndWithReason ( SWND swnd,
FocusChangeReason reason )

Sets the focused window with a reason.

Parameters
swndHandle to the window to focus
reasonReason for the focus change

Sets the focused window and records the reason for the focus change.

Definition at line 290 of file SFocusManager.cpp.

◆ SetOwner()

void SFocusManager::SetOwner ( SWindow * pOwner)

Sets the owner window.

Parameters
pOwnerPointer to the owner window

Sets the owner window for the focus manager.

Definition at line 202 of file SFocusManager.cpp.

◆ StoreFocusedView()

void SFocusManager::StoreFocusedView ( )

Stores the focused view.

Stores the currently focused view for later restoration.

Definition at line 360 of file SFocusManager.cpp.

◆ UnregisterAccelerator()

void SFocusManager::UnregisterAccelerator ( const IAccelerator * pAcc,
IAcceleratorTarget * target )
protected

Unregisters a keyboard accelerator for a target.

Parameters
pAccPointer to the accelerator
targetPointer to the accelerator target

Unregisters a keyboard accelerator for the specified target.

Implements IAcceleratorMgr.

Definition at line 395 of file SFocusManager.cpp.

◆ UnregisterAccelerators()

void SFocusManager::UnregisterAccelerators ( IAcceleratorTarget * target)
protected

Unregisters all keyboard accelerators for a target.

Parameters
targetPointer to the accelerator target

Unregisters all keyboard accelerators for the specified target.

Implements IAcceleratorMgr.

Definition at line 406 of file SFocusManager.cpp.


The documentation for this class was generated from the following files: