mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-05 18:57:19 +02:00
Move hardcoded strings in Keyboard Manager projects to rc file (#5921)
* moved all strings in c++ side to rc file * Fixed formatting
This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
#include "pch.h"
|
||||
#include "Dialog.h"
|
||||
#include <set>
|
||||
#include "common/common.h"
|
||||
#include "keyboardmanager/dll/resource.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
|
||||
@@ -10,9 +14,9 @@ IAsyncOperation<bool> Dialog::PartialRemappingConfirmationDialog(XamlRoot root,
|
||||
confirmationDialog.Title(box_value(dialogTitle));
|
||||
confirmationDialog.IsPrimaryButtonEnabled(true);
|
||||
confirmationDialog.DefaultButton(ContentDialogButton::Primary);
|
||||
confirmationDialog.PrimaryButtonText(winrt::hstring(L"Continue Anyway"));
|
||||
confirmationDialog.PrimaryButtonText(winrt::hstring(GET_RESOURCE_STRING(IDS_CONTINUE_BUTTON)));
|
||||
confirmationDialog.IsSecondaryButtonEnabled(true);
|
||||
confirmationDialog.SecondaryButtonText(winrt::hstring(L"Cancel"));
|
||||
confirmationDialog.SecondaryButtonText(winrt::hstring(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON)));
|
||||
|
||||
ContentDialogResult res = co_await confirmationDialog.ShowAsync();
|
||||
co_return res == ContentDialogResult::Primary;
|
||||
|
||||
@@ -13,7 +13,9 @@
|
||||
#include <keyboardmanager/dll/resource.h>
|
||||
#include "../common/shared_constants.h"
|
||||
#include "keyboardmanager/common/KeyboardManagerState.h"
|
||||
#include "common/common.h"
|
||||
#include "LoadingAndSavingRemappingHelper.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
|
||||
@@ -36,13 +38,13 @@ static IAsyncOperation<bool> OrphanKeysConfirmationDialog(
|
||||
{
|
||||
ContentDialog confirmationDialog;
|
||||
confirmationDialog.XamlRoot(root);
|
||||
confirmationDialog.Title(box_value(L"The following keys are unassigned and you won't be able to use them:"));
|
||||
confirmationDialog.Title(box_value(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_ORPHANEDDIALOGTITLE)));
|
||||
confirmationDialog.Content(nullptr);
|
||||
confirmationDialog.IsPrimaryButtonEnabled(true);
|
||||
confirmationDialog.DefaultButton(ContentDialogButton::Primary);
|
||||
confirmationDialog.PrimaryButtonText(winrt::hstring(L"Continue Anyway"));
|
||||
confirmationDialog.PrimaryButtonText(winrt::hstring(GET_RESOURCE_STRING(IDS_CONTINUE_BUTTON)));
|
||||
confirmationDialog.IsSecondaryButtonEnabled(true);
|
||||
confirmationDialog.SecondaryButtonText(winrt::hstring(L"Cancel"));
|
||||
confirmationDialog.SecondaryButtonText(winrt::hstring(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON)));
|
||||
|
||||
TextBlock orphanKeysBlock;
|
||||
std::wstring orphanKeyString;
|
||||
@@ -67,7 +69,7 @@ static IAsyncAction OnClickAccept(KeyboardManagerState& keyboardManagerState, Xa
|
||||
|
||||
if (isSuccess != KeyboardManagerHelper::ErrorType::NoError)
|
||||
{
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, L"Some of the keys could not be remapped. Do you want to continue anyway?"))
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, GET_RESOURCE_STRING(IDS_EDITKEYBOARD_PARTIALCONFIRMATIONDIALOGTITLE)))
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
@@ -108,7 +110,7 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
LR_DEFAULTCOLOR);
|
||||
if (RegisterClassEx(&windowClass) == NULL)
|
||||
{
|
||||
MessageBox(NULL, L"Windows registration failed!", L"Error", NULL);
|
||||
MessageBox(NULL, GET_RESOURCE_STRING(IDS_REGISTERCLASSFAILED_ERRORMESSAGE).c_str(), GET_RESOURCE_STRING(IDS_REGISTERCLASSFAILED_ERRORTITLE).c_str(), NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -126,7 +128,7 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
// Window Creation
|
||||
HWND _hWndEditKeyboardWindow = CreateWindow(
|
||||
szWindowClass,
|
||||
L"Remap keys",
|
||||
GET_RESOURCE_STRING(IDS_EDITKEYBOARD_WINDOWNAME).c_str(),
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MAXIMIZEBOX,
|
||||
(desktopRect.right / 2) - (windowWidth / 2),
|
||||
(desktopRect.bottom / 2) - (windowHeight / 2),
|
||||
@@ -138,7 +140,7 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
NULL);
|
||||
if (_hWndEditKeyboardWindow == NULL)
|
||||
{
|
||||
MessageBox(NULL, L"Call to CreateWindow failed!", L"Error", NULL);
|
||||
MessageBox(NULL, GET_RESOURCE_STRING(IDS_CREATEWINDOWFAILED_ERRORMESSAGE).c_str(), GET_RESOURCE_STRING(IDS_CREATEWINDOWFAILED_ERRORTITLE).c_str(), NULL);
|
||||
return;
|
||||
}
|
||||
// Ensures the window is in foreground on first startup. If this is not done, the window appears behind because the thread is not on the foreground.
|
||||
@@ -168,14 +170,14 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
|
||||
// Header text
|
||||
TextBlock headerText;
|
||||
headerText.Text(L"Remap keys");
|
||||
headerText.Text(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_WINDOWNAME));
|
||||
headerText.FontSize(30);
|
||||
headerText.Margin({ 0, 0, 0, 0 });
|
||||
header.SetAlignLeftWithPanel(headerText, true);
|
||||
|
||||
// Header Cancel button
|
||||
Button cancelButton;
|
||||
cancelButton.Content(winrt::box_value(L"Cancel"));
|
||||
cancelButton.Content(winrt::box_value(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON)));
|
||||
cancelButton.Margin({ 10, 0, 0, 0 });
|
||||
cancelButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||
// Close the window since settings do not need to be saved
|
||||
@@ -184,13 +186,13 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
|
||||
// Text block for information about remap key section.
|
||||
TextBlock keyRemapInfoHeader;
|
||||
keyRemapInfoHeader.Text(L"Select the key you want to change (Key) and then the key or shortcut you want it to become (Mapped To).");
|
||||
keyRemapInfoHeader.Text(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_INFO));
|
||||
keyRemapInfoHeader.Margin({ 10, 0, 0, 10 });
|
||||
keyRemapInfoHeader.FontWeight(Text::FontWeights::SemiBold());
|
||||
keyRemapInfoHeader.TextWrapping(TextWrapping::Wrap);
|
||||
|
||||
TextBlock keyRemapInfoExample;
|
||||
keyRemapInfoExample.Text(L"For example, if you want to press A and get \"Ctrl+C\", key \"A\" would be your \"Key\" column and the shortcut \"Ctrl+C\" would be your \"Mapped To\" column.");
|
||||
keyRemapInfoExample.Text(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_INFOEXAMPLE));
|
||||
keyRemapInfoExample.Margin({ 10, 0, 0, 20 });
|
||||
keyRemapInfoExample.FontStyle(Text::FontStyle::Italic);
|
||||
keyRemapInfoExample.TextWrapping(TextWrapping::Wrap);
|
||||
@@ -217,13 +219,13 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
|
||||
// First header textblock in the header row of the keys remap table
|
||||
TextBlock originalKeyRemapHeader;
|
||||
originalKeyRemapHeader.Text(L"Key:");
|
||||
originalKeyRemapHeader.Text(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_SOURCEHEADER));
|
||||
originalKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
||||
originalKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
||||
|
||||
// Second header textblock in the header row of the keys remap table
|
||||
TextBlock newKeyRemapHeader;
|
||||
newKeyRemapHeader.Text(L"Mapped To:");
|
||||
newKeyRemapHeader.Text(GET_RESOURCE_STRING(IDS_EDITKEYBOARD_TARGETHEADER));
|
||||
newKeyRemapHeader.FontWeight(Text::FontWeights::Bold());
|
||||
newKeyRemapHeader.Margin({ 0, 0, 0, 10 });
|
||||
|
||||
@@ -261,7 +263,7 @@ void createEditKeyboardWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMan
|
||||
|
||||
// Main Header Apply button
|
||||
Button applyButton;
|
||||
applyButton.Content(winrt::box_value(L"OK"));
|
||||
applyButton.Content(winrt::box_value(GET_RESOURCE_STRING(IDS_OK_BUTTON)));
|
||||
applyButton.Style(AccentButtonStyle());
|
||||
applyButton.MinWidth(KeyboardManagerConstants::HeaderButtonWidth);
|
||||
cancelButton.MinWidth(KeyboardManagerConstants::HeaderButtonWidth);
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
#include "Dialog.h"
|
||||
#include <keyboardmanager/dll/resource.h>
|
||||
#include <keyboardmanager/common/KeyboardManagerState.h>
|
||||
#include "common/common.h"
|
||||
#include "LoadingAndSavingRemappingHelper.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
using namespace winrt::Windows::Foundation;
|
||||
|
||||
@@ -36,7 +38,7 @@ static IAsyncAction OnClickAccept(
|
||||
|
||||
if (isSuccess != KeyboardManagerHelper::ErrorType::NoError)
|
||||
{
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, L"Some of the shortcuts could not be remapped. Do you want to continue anyway?"))
|
||||
if (!co_await Dialog::PartialRemappingConfirmationDialog(root, GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_PARTIALCONFIRMATIONDIALOGTITLE)))
|
||||
{
|
||||
co_return;
|
||||
}
|
||||
@@ -67,7 +69,7 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
LR_DEFAULTCOLOR);
|
||||
if (RegisterClassEx(&windowClass) == NULL)
|
||||
{
|
||||
MessageBox(NULL, L"Windows registration failed!", L"Error", NULL);
|
||||
MessageBox(NULL, GET_RESOURCE_STRING(IDS_REGISTERCLASSFAILED_ERRORMESSAGE).c_str(), GET_RESOURCE_STRING(IDS_REGISTERCLASSFAILED_ERRORTITLE).c_str(), NULL);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -85,7 +87,7 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
// Window Creation
|
||||
HWND _hWndEditShortcutsWindow = CreateWindow(
|
||||
szWindowClass,
|
||||
L"Remap shortcuts",
|
||||
GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_WINDOWNAME).c_str(),
|
||||
WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MAXIMIZEBOX,
|
||||
(desktopRect.right / 2) - (windowWidth / 2),
|
||||
(desktopRect.bottom / 2) - (windowHeight / 2),
|
||||
@@ -97,7 +99,7 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
NULL);
|
||||
if (_hWndEditShortcutsWindow == NULL)
|
||||
{
|
||||
MessageBox(NULL, L"Call to CreateWindow failed!", L"Error", NULL);
|
||||
MessageBox(NULL, GET_RESOURCE_STRING(IDS_CREATEWINDOWFAILED_ERRORMESSAGE).c_str(), GET_RESOURCE_STRING(IDS_CREATEWINDOWFAILED_ERRORTITLE).c_str(), NULL);
|
||||
return;
|
||||
}
|
||||
// Ensures the window is in foreground on first startup. If this is not done, the window appears behind because the thread is not on the foreground.
|
||||
@@ -127,14 +129,14 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
|
||||
// Header text
|
||||
TextBlock headerText;
|
||||
headerText.Text(L"Remap shortcuts");
|
||||
headerText.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_WINDOWNAME));
|
||||
headerText.FontSize(30);
|
||||
headerText.Margin({ 0, 0, 0, 0 });
|
||||
header.SetAlignLeftWithPanel(headerText, true);
|
||||
|
||||
// Cancel button
|
||||
Button cancelButton;
|
||||
cancelButton.Content(winrt::box_value(L"Cancel"));
|
||||
cancelButton.Content(winrt::box_value(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON)));
|
||||
cancelButton.Margin({ 10, 0, 0, 0 });
|
||||
cancelButton.Click([&](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||
// Close the window since settings do not need to be saved
|
||||
@@ -143,13 +145,13 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
|
||||
// Text block for information about remap key section.
|
||||
TextBlock shortcutRemapInfoHeader;
|
||||
shortcutRemapInfoHeader.Text(L"Select the shortcut you want to change (Shortcut) and then the key or shortcut you want it to invoke (Mapped To).");
|
||||
shortcutRemapInfoHeader.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_INFO));
|
||||
shortcutRemapInfoHeader.Margin({ 10, 0, 0, 10 });
|
||||
shortcutRemapInfoHeader.FontWeight(Text::FontWeights::SemiBold());
|
||||
shortcutRemapInfoHeader.TextWrapping(TextWrapping::Wrap);
|
||||
|
||||
TextBlock shortcutRemapInfoExample;
|
||||
shortcutRemapInfoExample.Text(L"For example, if you want to press \"Ctrl+C\" and get \"Alt\" only on Microsoft Edge, \"Ctrl+C\" would be your \"Shortcut\" column, the key \"Alt\" would be your \"Mapped To\" column, and \"MSEdge\" would be your \"Target App\" column. If no target app is entered, it will apply globally. The name must be the process name and not the app name.");
|
||||
shortcutRemapInfoExample.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_INFOEXAMPLE));
|
||||
shortcutRemapInfoExample.Margin({ 10, 0, 0, 20 });
|
||||
shortcutRemapInfoExample.FontStyle(Text::FontStyle::Italic);
|
||||
shortcutRemapInfoExample.TextWrapping(TextWrapping::Wrap);
|
||||
@@ -180,19 +182,19 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
|
||||
// First header textblock in the header row of the shortcut table
|
||||
TextBlock originalShortcutHeader;
|
||||
originalShortcutHeader.Text(L"Shortcut:");
|
||||
originalShortcutHeader.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_SOURCEHEADER));
|
||||
originalShortcutHeader.FontWeight(Text::FontWeights::Bold());
|
||||
originalShortcutHeader.Margin({ 0, 0, 0, 10 });
|
||||
|
||||
// Second header textblock in the header row of the shortcut table
|
||||
TextBlock newShortcutHeader;
|
||||
newShortcutHeader.Text(L"Mapped To:");
|
||||
newShortcutHeader.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_TARGETHEADER));
|
||||
newShortcutHeader.FontWeight(Text::FontWeights::Bold());
|
||||
newShortcutHeader.Margin({ 0, 0, 0, 10 });
|
||||
|
||||
// Third header textblock in the header row of the shortcut table
|
||||
TextBlock targetAppHeader;
|
||||
targetAppHeader.Text(L"Target App:");
|
||||
targetAppHeader.Text(GET_RESOURCE_STRING(IDS_EDITSHORTCUTS_TARGETAPPHEADER));
|
||||
targetAppHeader.Width(KeyboardManagerConstants::ShortcutTableDropDownWidth);
|
||||
targetAppHeader.FontWeight(Text::FontWeights::Bold());
|
||||
targetAppHeader.Margin({ 0, 0, 0, 10 });
|
||||
@@ -245,7 +247,7 @@ void createEditShortcutsWindow(HINSTANCE hInst, KeyboardManagerState& keyboardMa
|
||||
|
||||
// Apply button
|
||||
Button applyButton;
|
||||
applyButton.Content(winrt::box_value(L"OK"));
|
||||
applyButton.Content(winrt::box_value(GET_RESOURCE_STRING(IDS_OK_BUTTON)));
|
||||
applyButton.Style(AccentButtonStyle());
|
||||
applyButton.MinWidth(KeyboardManagerConstants::HeaderButtonWidth);
|
||||
cancelButton.MinWidth(KeyboardManagerConstants::HeaderButtonWidth);
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include "KeyDropDownControl.h"
|
||||
#include "keyboardmanager/common/KeyboardManagerState.h"
|
||||
#include "keyboardmanager/common/Helpers.h"
|
||||
#include "common/common.h"
|
||||
#include "keyboardmanager/dll/resource.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
//Both static members are initialized to null
|
||||
HWND ShortcutControl::EditShortcutsWindowHandle = nullptr;
|
||||
@@ -20,7 +23,7 @@ ShortcutControl::ShortcutControl(Grid table, const int colIndex, TextBox targetA
|
||||
shortcutDropDownStackPanel.as<StackPanel>().Spacing(KeyboardManagerConstants::ShortcutTableDropDownSpacing);
|
||||
shortcutDropDownStackPanel.as<StackPanel>().Orientation(Windows::UI::Xaml::Controls::Orientation::Horizontal);
|
||||
|
||||
typeShortcut.as<Button>().Content(winrt::box_value(L"Type"));
|
||||
typeShortcut.as<Button>().Content(winrt::box_value(GET_RESOURCE_STRING(IDS_TYPE_BUTTON)));
|
||||
typeShortcut.as<Button>().Width(KeyboardManagerConstants::ShortcutTableDropDownWidth);
|
||||
typeShortcut.as<Button>().Click([&, table, colIndex, isHybridControl, targetApp](winrt::Windows::Foundation::IInspectable const& sender, RoutedEventArgs const&) {
|
||||
keyboardManagerState->SetUIState(KeyboardManagerUIState::DetectShortcutWindowActivated, EditShortcutsWindowHandle);
|
||||
@@ -210,7 +213,7 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
||||
|
||||
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
||||
detectShortcutBox.XamlRoot(xamlRoot);
|
||||
detectShortcutBox.Title(box_value(L"Press the keys in shortcut:"));
|
||||
detectShortcutBox.Title(box_value(GET_RESOURCE_STRING(IDS_TYPESHORTCUT_TITLE)));
|
||||
detectShortcutBox.IsPrimaryButtonEnabled(false);
|
||||
detectShortcutBox.IsSecondaryButtonEnabled(false);
|
||||
|
||||
@@ -280,7 +283,7 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
||||
};
|
||||
|
||||
TextBlock primaryButtonText;
|
||||
primaryButtonText.Text(L"OK");
|
||||
primaryButtonText.Text(GET_RESOURCE_STRING(IDS_OK_BUTTON));
|
||||
|
||||
Button primaryButton;
|
||||
primaryButton.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||
@@ -309,7 +312,7 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
||||
});
|
||||
|
||||
TextBlock cancelButtonText;
|
||||
cancelButtonText.Text(L"Cancel");
|
||||
cancelButtonText.Text(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON));
|
||||
|
||||
Button cancelButton;
|
||||
cancelButton.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||
@@ -364,7 +367,7 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
||||
|
||||
// Header textblock
|
||||
TextBlock text;
|
||||
text.Text(L"Keys Pressed:");
|
||||
text.Text(GET_RESOURCE_STRING(IDS_TYPESHORTCUT_HEADER));
|
||||
text.Margin({ 0, 0, 0, 10 });
|
||||
stackPanel.Children().Append(text);
|
||||
|
||||
@@ -381,13 +384,13 @@ void ShortcutControl::createDetectShortcutWindow(winrt::Windows::Foundation::IIn
|
||||
stackPanel.Children().Append(keyStackPanel2);
|
||||
|
||||
TextBlock holdEscInfo;
|
||||
holdEscInfo.Text(L"Hold Esc to discard");
|
||||
holdEscInfo.Text(GET_RESOURCE_STRING(IDS_TYPE_HOLDESC));
|
||||
holdEscInfo.FontSize(12);
|
||||
holdEscInfo.Margin({ 0, 20, 0, 0 });
|
||||
stackPanel.Children().Append(holdEscInfo);
|
||||
|
||||
TextBlock holdEnterInfo;
|
||||
holdEnterInfo.Text(L"Hold Enter to continue");
|
||||
holdEnterInfo.Text(GET_RESOURCE_STRING(IDS_TYPE_HOLDENTER));
|
||||
holdEnterInfo.FontSize(12);
|
||||
holdEnterInfo.Margin({ 0, 0, 0, 0 });
|
||||
stackPanel.Children().Append(holdEnterInfo);
|
||||
|
||||
@@ -4,6 +4,9 @@
|
||||
#include "keyboardmanager/common/KeyboardManagerConstants.h"
|
||||
#include "keyboardmanager/common/KeyboardManagerState.h"
|
||||
#include "ShortcutControl.h"
|
||||
#include "common/common.h"
|
||||
#include "keyboardmanager/dll/resource.h"
|
||||
extern "C" IMAGE_DOS_HEADER __ImageBase;
|
||||
|
||||
//Both static members are initialized to null
|
||||
HWND SingleKeyRemapControl::EditKeyboardWindowHandle = nullptr;
|
||||
@@ -15,7 +18,7 @@ SingleKeyRemapControl::SingleKeyRemapControl(Grid table, const int colIndex)
|
||||
{
|
||||
typeKey = Button();
|
||||
typeKey.as<Button>().Width(KeyboardManagerConstants::RemapTableDropDownWidth);
|
||||
typeKey.as<Button>().Content(winrt::box_value(L"Type"));
|
||||
typeKey.as<Button>().Content(winrt::box_value(GET_RESOURCE_STRING(IDS_TYPE_BUTTON)));
|
||||
|
||||
singleKeyRemapControlLayout = StackPanel();
|
||||
singleKeyRemapControlLayout.as<StackPanel>().Margin({ 0, 0, 0, 10 });
|
||||
@@ -176,7 +179,7 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
||||
|
||||
// ContentDialog requires manually setting the XamlRoot (https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.contentdialog#contentdialog-in-appwindow-or-xaml-islands)
|
||||
detectRemapKeyBox.XamlRoot(xamlRoot);
|
||||
detectRemapKeyBox.Title(box_value(L"Press a key on selected keyboard:"));
|
||||
detectRemapKeyBox.Title(box_value(GET_RESOURCE_STRING(IDS_TYPEKEY_TITLE)));
|
||||
detectRemapKeyBox.IsPrimaryButtonEnabled(false);
|
||||
detectRemapKeyBox.IsSecondaryButtonEnabled(false);
|
||||
|
||||
@@ -228,7 +231,7 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
||||
};
|
||||
|
||||
TextBlock primaryButtonText;
|
||||
primaryButtonText.Text(L"OK");
|
||||
primaryButtonText.Text(GET_RESOURCE_STRING(IDS_OK_BUTTON));
|
||||
|
||||
Button primaryButton;
|
||||
primaryButton.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||
@@ -255,7 +258,7 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
||||
});
|
||||
|
||||
TextBlock cancelButtonText;
|
||||
cancelButtonText.Text(L"Cancel");
|
||||
cancelButtonText.Text(GET_RESOURCE_STRING(IDS_CANCEL_BUTTON));
|
||||
|
||||
Button cancelButton;
|
||||
cancelButton.HorizontalAlignment(HorizontalAlignment::Stretch);
|
||||
@@ -294,7 +297,7 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
||||
|
||||
// Header textblock
|
||||
TextBlock text;
|
||||
text.Text(L"Key Pressed:");
|
||||
text.Text(GET_RESOURCE_STRING(IDS_TYPEKEY_HEADER));
|
||||
text.Margin({ 0, 0, 0, 10 });
|
||||
stackPanel.Children().Append(text);
|
||||
|
||||
@@ -304,13 +307,13 @@ void SingleKeyRemapControl::createDetectKeyWindow(winrt::Windows::Foundation::II
|
||||
stackPanel.Children().Append(keyStackPanel);
|
||||
|
||||
TextBlock holdEscInfo;
|
||||
holdEscInfo.Text(L"Hold Esc to discard");
|
||||
holdEscInfo.Text(GET_RESOURCE_STRING(IDS_TYPE_HOLDESC));
|
||||
holdEscInfo.FontSize(12);
|
||||
holdEscInfo.Margin({ 0, 20, 0, 0 });
|
||||
stackPanel.Children().Append(holdEscInfo);
|
||||
|
||||
TextBlock holdEnterInfo;
|
||||
holdEnterInfo.Text(L"Hold Enter to continue");
|
||||
holdEnterInfo.Text(GET_RESOURCE_STRING(IDS_TYPE_HOLDENTER));
|
||||
holdEnterInfo.FontSize(12);
|
||||
holdEnterInfo.Margin({ 0, 0, 0, 0 });
|
||||
stackPanel.Children().Append(holdEnterInfo);
|
||||
|
||||
Reference in New Issue
Block a user