Focus management object for DUI windows. More...
#include <SFocusManager.h>
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. | |
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.
Reason for focus change.
Enumerates the reasons why the focus might change.
Definition at line 123 of file SFocusManager.h.
SFocusManager::SFocusManager | ( | ) |
Constructor.
Definition at line 191 of file SFocusManager.cpp.
SFocusManager::~SFocusManager | ( | void | ) |
Destructor.
Definition at line 198 of file SFocusManager.cpp.
void SFocusManager::AdvanceFocus | ( | bool | reverse | ) |
Advances the focus.
reverse | TRUE 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.
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.
SWND SFocusManager::GetFocusedHwnd | ( | ) | const |
Gets the focused window.
Returns the handle to the currently focused window.
Definition at line 355 of file SFocusManager.cpp.
BOOL SFocusManager::IsTabTraversalKey | ( | UINT | vKey | ) |
Checks if a key is a tab traversal key.
vKey | Virtual key code |
Determines if the specified virtual key code is a tab traversal key.
Definition at line 207 of file SFocusManager.cpp.
BOOL SFocusManager::OnKeyDown | ( | UINT | vKey | ) |
Handles key down events.
vKey | Virtual key code |
Handles key down events and performs focus traversal if necessary.
Definition at line 220 of file SFocusManager.cpp.
|
protected |
Registers a keyboard accelerator for a target.
pAcc | Pointer to the accelerator |
target | Pointer to the accelerator target |
Registers a keyboard accelerator for the specified target.
Implements IAcceleratorMgr.
Definition at line 388 of file SFocusManager.cpp.
void SFocusManager::RestoreFocusedView | ( | ) |
Restores the focused view.
Restores the focused view from the stored state.
Definition at line 377 of file SFocusManager.cpp.
void SFocusManager::SetFocusedHwnd | ( | SWND | swnd | ) |
Sets the focused window.
swnd | Handle to the window to focus |
Sets the focused window without specifying a reason.
Definition at line 325 of file SFocusManager.cpp.
void SFocusManager::SetFocusedHwndWithReason | ( | SWND | swnd, |
FocusChangeReason | reason ) |
Sets the focused window with a reason.
swnd | Handle to the window to focus |
reason | Reason for the focus change |
Sets the focused window and records the reason for the focus change.
Definition at line 290 of file SFocusManager.cpp.
void SFocusManager::SetOwner | ( | SWindow * | pOwner | ) |
Sets the owner window.
pOwner | Pointer to the owner window |
Sets the owner window for the focus manager.
Definition at line 202 of file SFocusManager.cpp.
void SFocusManager::StoreFocusedView | ( | ) |
Stores the focused view.
Stores the currently focused view for later restoration.
Definition at line 360 of file SFocusManager.cpp.
|
protected |
Unregisters a keyboard accelerator for a target.
pAcc | Pointer to the accelerator |
target | Pointer to the accelerator target |
Unregisters a keyboard accelerator for the specified target.
Implements IAcceleratorMgr.
Definition at line 395 of file SFocusManager.cpp.
|
protected |
Unregisters all keyboard accelerators for a target.
target | Pointer to the accelerator target |
Unregisters all keyboard accelerators for the specified target.
Implements IAcceleratorMgr.
Definition at line 406 of file SFocusManager.cpp.