Fix build for VS 16.10 (#11557)

This commit is contained in:
Mykhailo Pylyp
2021-06-01 19:15:16 +03:00
committed by GitHub
parent 8e24e07e81
commit 3b32116d36
11 changed files with 144 additions and 144 deletions

View File

@@ -56,17 +56,17 @@ namespace BufferValidationHelpers
// If there is no error, set the buffer
if (errorType == ShortcutErrorType::NoError)
{
remapBuffer[rowIndex].first[colIndex] = selectedKeyCode;
remapBuffer[rowIndex].first[colIndex] = (DWORD)selectedKeyCode;
}
else
{
remapBuffer[rowIndex].first[colIndex] = NULL;
remapBuffer[rowIndex].first[colIndex] = (DWORD)0;
}
}
else
{
// Reset to null if the key is not found
remapBuffer[rowIndex].first[colIndex] = NULL;
remapBuffer[rowIndex].first[colIndex] = (DWORD)0;
}
return errorType;
@@ -214,7 +214,7 @@ namespace BufferValidationHelpers
KeyShortcutUnion tempShortcut;
if (isHybridControl && KeyDropDownControl::GetNumberOfSelectedKeys(selectedCodes) == 1)
{
tempShortcut = *std::find_if(selectedCodes.begin(), selectedCodes.end(), [](int32_t a) { return a != -1 && a != 0; });
tempShortcut = (DWORD)*std::find_if(selectedCodes.begin(), selectedCodes.end(), [](int32_t a) { return a != -1 && a != 0; });
}
else
{

View File

@@ -255,7 +255,7 @@ void KeyDropDownControl::SetSelectionHandler(StackPanel& table, StackPanel row,
// If exactly one key is selected consider it to be a key remap
if (GetNumberOfSelectedKeys(selectedKeyCodes) == 1)
{
shortcutRemapBuffer[validationResult.second].first[colIndex] = selectedKeyCodes[0];
shortcutRemapBuffer[validationResult.second].first[colIndex] = (DWORD)selectedKeyCodes[0];
}
else
{
@@ -357,7 +357,7 @@ void KeyDropDownControl::ValidateShortcutFromDropDownList(StackPanel table, Stac
KeyShortcutUnion currentShortcut;
if (GetNumberOfSelectedKeys(selectedKeyCodes) == 1 && isHybridControl)
{
currentShortcut = selectedKeyCodes[0];
currentShortcut = (DWORD)selectedKeyCodes[0];
}
else
{

View File

@@ -148,7 +148,7 @@ void ShortcutControl::AddNewShortcutControlRow(StackPanel& parent, std::vector<s
// If exactly one key is selected consider it to be a key remap
if (selectedKeyCodes.size() == 1)
{
shortcutRemapBuffer[rowIndex].first[1] = selectedKeyCodes[0];
shortcutRemapBuffer[rowIndex].first[1] = (DWORD)selectedKeyCodes[0];
}
else
{

View File

@@ -124,7 +124,7 @@ void SingleKeyRemapControl::AddNewControlKeyRemapRow(StackPanel& parent, std::ve
else
{
// Initialize both keys to NULL
singleKeyRemapBuffer.push_back(std::make_pair<RemapBufferItem, std::wstring>(RemapBufferItem{ NULL, NULL }, L""));
singleKeyRemapBuffer.push_back(std::make_pair<RemapBufferItem, std::wstring>(RemapBufferItem{ (DWORD)0, (DWORD)0 }, L""));
}
// Delete row button

View File

@@ -52,7 +52,7 @@ public:
SingleKeyRemapControl(StackPanel table, StackPanel row, const int colIndex);
// Function to add a new row to the remap keys table. If the originalKey and newKey args are provided, then the displayed remap keys are set to those values.
static void AddNewControlKeyRemapRow(StackPanel& parent, std::vector<std::vector<std::unique_ptr<SingleKeyRemapControl>>>& keyboardRemapControlObjects, const DWORD originalKey = NULL, const KeyShortcutUnion newKey = NULL);
static void AddNewControlKeyRemapRow(StackPanel& parent, std::vector<std::vector<std::unique_ptr<SingleKeyRemapControl>>>& keyboardRemapControlObjects, const DWORD originalKey = 0, const KeyShortcutUnion newKey = (DWORD)0);
// Function to return the stack panel element of the SingleKeyRemapControl. This is the externally visible UI element which can be used to add it to other layouts
winrt::Windows::UI::Xaml::Controls::StackPanel getSingleKeyRemapControl();