diff options
| author | Konstantin <const@const.me> | 2023-01-16 14:52:43 +0100 |
|---|---|---|
| committer | Konstantin <const@const.me> | 2023-01-16 14:52:43 +0100 |
| commit | 8c4603c73675958efc960fbd4bb599a2909d106a (patch) | |
| tree | 714dc6fc9a1672d5fd7f89676b97e10959662abc /Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp | |
| parent | 990a8d0dbaefc996244097397259e92758b15cce (diff) | |
Source codes
Diffstat (limited to 'Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp')
| -rw-r--r-- | Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp b/Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp new file mode 100644 index 0000000..c5e6ac0 --- /dev/null +++ b/Examples/WhisperDesktop/Utils/TranslateCheckbox.cpp @@ -0,0 +1,25 @@ +#include "stdafx.h" +#include "TranslateCheckbox.h" + +static const LPCTSTR regValTranslate = L"translate"; + +void TranslateCheckbox::initialize( HWND owner, int idc, AppState& state ) +{ + m_hWnd = GetDlgItem( owner, idc ); + assert( nullptr != m_hWnd ); + + if( state.dwordLoad( regValTranslate, 0 ) != 0 ) + ::SendMessage( m_hWnd, BM_SETCHECK, BST_CHECKED, 0L ); +} + +bool TranslateCheckbox::checked() +{ + assert( nullptr != m_hWnd ); + const int state = ( int )::SendMessage( m_hWnd, BM_GETCHECK, 0, 0 ); + return state == BST_CHECKED; +} + +void TranslateCheckbox::saveSelection( AppState& state ) +{ + state.dwordStore( regValTranslate, checked() ? TRUE : FALSE ); +}
\ No newline at end of file |
