summaryrefslogtreecommitdiffstats
path: root/Examples/WhisperDesktop/Utils/LanguageDropdown.h
diff options
context:
space:
mode:
authorKonstantin <const@const.me>2023-01-16 14:52:43 +0100
committerKonstantin <const@const.me>2023-01-16 14:52:43 +0100
commit8c4603c73675958efc960fbd4bb599a2909d106a (patch)
tree714dc6fc9a1672d5fd7f89676b97e10959662abc /Examples/WhisperDesktop/Utils/LanguageDropdown.h
parent990a8d0dbaefc996244097397259e92758b15cce (diff)
Source codes
Diffstat (limited to 'Examples/WhisperDesktop/Utils/LanguageDropdown.h')
-rw-r--r--Examples/WhisperDesktop/Utils/LanguageDropdown.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/Examples/WhisperDesktop/Utils/LanguageDropdown.h b/Examples/WhisperDesktop/Utils/LanguageDropdown.h
new file mode 100644
index 0000000..640b81e
--- /dev/null
+++ b/Examples/WhisperDesktop/Utils/LanguageDropdown.h
@@ -0,0 +1,26 @@
+#pragma once
+#include "../AppState.h"
+
+// Dropdown list which implements language selector control
+class LanguageDropdown
+{
+ HWND m_hWnd = nullptr;
+ std::vector<uint32_t> keys;
+ int getInitialSelection( AppState& state ) const;
+
+public:
+ operator HWND() const
+ {
+ return m_hWnd;
+ }
+
+ // Query language list form the native library, populate the combo box
+ // Then load the last saved language selection from registry, and preselect an item.
+ void initialize( HWND owner, int idc, AppState& state );
+
+ // Get the ID of the currently selected language, or UINT_MAX if nothing's selected
+ uint32_t selectedLanguage();
+
+ // Get the ID of the currently selected language, and store in registry
+ void saveSelection( AppState& state );
+}; \ No newline at end of file