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

HotKey Control. More...

#include <SHotKeyCtrl.h>

Inheritance diagram for SHotKeyCtrl:
SAccelerator IAccelerator

Public Member Functions

 SHotKeyCtrl (void)
 Constructor.
 
virtual ~SHotKeyCtrl (void)
 Destructor.
 
void SetRule (WORD wInvalidComp, WORD wModifier) OVERRIDE
 Set the rules for invalid combinations and modifiers.
 
void SetHotKey (WORD wKey, WORD wModifiers) OVERRIDE
 Set the hotkey.
 
void GetHotKey (WORD *wKey, WORD *wModifiers) SCONST OVERRIDE
 Get the hotkey.
 
virtual SStringT GetWindowText (BOOL bRawText=FALSE)
 Get the window text.
 
- Public Member Functions inherited from SAccelerator
 SAccelerator (DWORD dwAccel)
 Constructor.
 
 SAccelerator (WORD vKey=0, bool bCtrl=false, bool bAlt=false, bool bShift=false)
 Constructor.
 
 ~SAccelerator (void)
 Destructor.
 
WORD GetModifier () SCONST OVERRIDE
 Gets the modifier keys.
 
WORD GetKey () SCONST OVERRIDE
 Gets the key value.
 
DWORD GetAcc () SCONST OVERRIDE
 Gets the accelerator key value.
 
SStringT FormatHotkey ()
 Formats the accelerator key as a string.
 

Protected Member Functions

virtual UINT WINAPI OnGetDlgCode () const
 Get the dialog code.
 
void OnLButtonDown (UINT nFlags, CPoint pt)
 Handle left mouse button down event.
 
void OnPaint (IRenderTarget *pRT)
 Paint the control.
 
void OnSetFocus (SWND wndOld)
 Handle set focus event.
 
void OnKillFocus (SWND wndFocus)
 Handle kill focus event.
 
void OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle key down event.
 
void OnKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle key up event.
 
void OnSysKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle system key down event.
 
void OnSysKeyUp (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handle system key up event.
 
void UpdateModifier ()
 Update the modifier keys.
 
void UpdateCaret (IRenderTarget *pRT)
 Update the caret position.
 
UINT GetTextAlign ()
 Get the text alignment.
 
HRESULT OnAttrInvalidComb (const SStringW &value, BOOL bLoading)
 Handle custom attribute "invalidComb".
 
HRESULT OnAttrInvalidSysKey (const SStringW &value, BOOL bLoading)
 Handle custom attribute "invalidSysKey".
 
HRESULT OnAttrInvalidModifier (const SStringW &value, BOOL bLoading)
 Handle custom attribute "invalidModifier".
 
HRESULT OnAttrHotKey (const SStringW &value, BOOL bLoading)
 Handle custom attribute "hotKey".
 
virtual HRESULT SetAttribute (const SNS::SStringW &amp;amp;amp;amp;strAttribName, const SNS::SStringW &amp;amp;amp;amp;strValue, BOOL bLoading=FALSE)
 

Protected Attributes

WORD m_wInvalidComb
 
WORD m_wInvalidModifier
 
BOOL m_bInSetting
 
- Protected Attributes inherited from SAccelerator
WORD m_wModifier
 
WORD m_wVK
 

Additional Inherited Members

- Static Public Member Functions inherited from SAccelerator
static WORD VkFromString (LPCTSTR pszKey)
 Converts a string to a virtual key code.
 
static SStringT GetKeyName (WORD vk)
 Converts a virtual key code to its string representation.
 
static SStringT FormatAccelKey (DWORD dwAccel)
 Formats an accelerator key as a string.
 
static DWORD TranslateAccelKey (LPCTSTR pszKeyName)
 Translates a string to an accelerator key value.
 

Detailed Description

HotKey Control.

A control for setting and displaying hotkeys.

Definition at line 16 of file SHotKeyCtrl.h.

Constructor & Destructor Documentation

◆ SHotKeyCtrl()

SNSBEGIN SHotKeyCtrl::SHotKeyCtrl ( void )

Constructor.

Definition at line 6 of file SHotKeyCtrl.cpp.

◆ ~SHotKeyCtrl()

SHotKeyCtrl::~SHotKeyCtrl ( void )
virtual

Destructor.

Definition at line 15 of file SHotKeyCtrl.cpp.

Member Function Documentation

◆ GetHotKey()

void SHotKeyCtrl::GetHotKey ( WORD * wKey,
WORD * wModifiers )

Get the hotkey.

Parameters
wKeyOutput key code
wModifiersOutput modifier flags

Definition at line 208 of file SHotKeyCtrl.cpp.

◆ GetTextAlign()

UINT SHotKeyCtrl::GetTextAlign ( )
protected

Get the text alignment.

Returns
Text alignment

Definition at line 57 of file SHotKeyCtrl.cpp.

◆ GetWindowText()

SStringT SHotKeyCtrl::GetWindowText ( BOOL bRawText = FALSE)
virtual

Get the window text.

Parameters
bRawTextWhether to get raw text
Returns
Window text

Reimplemented from SWindow.

Definition at line 216 of file SHotKeyCtrl.cpp.

◆ OnAttrHotKey()

HRESULT SHotKeyCtrl::OnAttrHotKey ( const SStringW & value,
BOOL bLoading )
protected

Handle custom attribute "hotKey".

Parameters
valueAttribute value
bLoadingLoading flag
Returns
HRESULT

Definition at line 286 of file SHotKeyCtrl.cpp.

◆ OnAttrInvalidComb()

HRESULT SHotKeyCtrl::OnAttrInvalidComb ( const SStringW & value,
BOOL bLoading )
protected

Handle custom attribute "invalidComb".

Parameters
valueAttribute value
bLoadingLoading flag
Returns
HRESULT

Definition at line 221 of file SHotKeyCtrl.cpp.

◆ OnAttrInvalidModifier()

HRESULT SHotKeyCtrl::OnAttrInvalidModifier ( const SStringW & value,
BOOL bLoading )
protected

Handle custom attribute "invalidModifier".

Parameters
valueAttribute value
bLoadingLoading flag
Returns
HRESULT

Definition at line 279 of file SHotKeyCtrl.cpp.

◆ OnAttrInvalidSysKey()

HRESULT SHotKeyCtrl::OnAttrInvalidSysKey ( const SStringW & value,
BOOL bLoading )
protected

Handle custom attribute "invalidSysKey".

Parameters
valueAttribute value
bLoadingLoading flag
Returns
HRESULT

Definition at line 256 of file SHotKeyCtrl.cpp.

◆ OnGetDlgCode()

virtual UINT WINAPI SHotKeyCtrl::OnGetDlgCode ( ) const
inlineprotectedvirtual

Get the dialog code.

Returns
Dialog code

This function is a message handler.

Definition at line 76 of file SHotKeyCtrl.h.

◆ OnKeyDown()

void SHotKeyCtrl::OnKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle key down event.

Parameters
nCharKey code
nRepCntRepeat count
nFlagsFlags

This function is a message handler.

Definition at line 126 of file SHotKeyCtrl.cpp.

◆ OnKeyUp()

void SHotKeyCtrl::OnKeyUp ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle key up event.

Parameters
nCharKey code
nRepCntRepeat count
nFlagsFlags

This function is a message handler.

Definition at line 147 of file SHotKeyCtrl.cpp.

◆ OnKillFocus()

void SHotKeyCtrl::OnKillFocus ( SWND wndFocus)
protected

Handle kill focus event.

Parameters
wndFocusNew focus window handle

This function is a message handler.

Definition at line 84 of file SHotKeyCtrl.cpp.

◆ OnLButtonDown()

void SHotKeyCtrl::OnLButtonDown ( UINT nFlags,
CPoint pt )
protected

Handle left mouse button down event.

Parameters
nFlagsFlags
ptMouse coordinates

This function is a message handler.

Definition at line 19 of file SHotKeyCtrl.cpp.

◆ OnPaint()

void SHotKeyCtrl::OnPaint ( IRenderTarget * pRT)
protected

Paint the control.

Parameters
pRTRendering target handle

This function is a message handler.

Definition at line 25 of file SHotKeyCtrl.cpp.

◆ OnSetFocus()

void SHotKeyCtrl::OnSetFocus ( SWND wndOld)
protected

Handle set focus event.

Parameters
wndOldPrevious focus window handle

This function is a message handler.

Definition at line 65 of file SHotKeyCtrl.cpp.

◆ OnSysKeyDown()

void SHotKeyCtrl::OnSysKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle system key down event.

Parameters
nCharKey code
nRepCntRepeat count
nFlagsFlags

This function is a message handler.

Definition at line 175 of file SHotKeyCtrl.cpp.

◆ OnSysKeyUp()

void SHotKeyCtrl::OnSysKeyUp ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handle system key up event.

Parameters
nCharKey code
nRepCntRepeat count
nFlagsFlags

This function is a message handler.

Definition at line 183 of file SHotKeyCtrl.cpp.

◆ SetAttribute()

virtual HRESULT SHotKeyCtrl::SetAttribute ( const SNS::SStringW &amp;amp;amp;amp; strAttribName,
const SNS::SStringW &amp;amp;amp;amp; strValue,
BOOL bLoading = FALSE )
inlineprotectedvirtual

Reimplemented from SWindow.

Definition at line 196 of file SHotKeyCtrl.h.

◆ SetHotKey()

void SHotKeyCtrl::SetHotKey ( WORD wKey,
WORD wModifiers )

Set the hotkey.

Parameters
wKeyKey code
wModifiersModifier flags

Definition at line 197 of file SHotKeyCtrl.cpp.

◆ SetRule()

void SHotKeyCtrl::SetRule ( WORD wInvalidComp,
WORD wModifier )

Set the rules for invalid combinations and modifiers.

Parameters
wInvalidCompInvalid combination flags
wModifierModifier flags

Definition at line 191 of file SHotKeyCtrl.cpp.

◆ UpdateCaret()

void SHotKeyCtrl::UpdateCaret ( IRenderTarget * pRT)
protected

Update the caret position.

Parameters
pRTRendering target handle

Definition at line 37 of file SHotKeyCtrl.cpp.

◆ UpdateModifier()

void SHotKeyCtrl::UpdateModifier ( )
protected

Update the modifier keys.

Definition at line 91 of file SHotKeyCtrl.cpp.

Member Data Documentation

◆ m_bInSetting

BOOL SHotKeyCtrl::m_bInSetting
protected

Flag indicating if the control is being set

Definition at line 217 of file SHotKeyCtrl.h.

◆ m_wInvalidComb

WORD SHotKeyCtrl::m_wInvalidComb
protected

Flags for invalid key combinations

Definition at line 215 of file SHotKeyCtrl.h.

◆ m_wInvalidModifier

WORD SHotKeyCtrl::m_wInvalidModifier
protected

Replacement modifiers for invalid combinations

Definition at line 216 of file SHotKeyCtrl.h.


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