-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Focus to Type button in new row on Adding a remap (#7586)
- Loading branch information
1 parent
6e2191a
commit 06cd940
Showing
6 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "pch.h" | ||
#include "UIHelpers.h" | ||
|
||
namespace UIHelpers | ||
{ | ||
// This method sets focus to the first Type button on the last row of the Grid | ||
void SetFocusOnTypeButtonInLastRow(Grid& parent, long colCount) | ||
{ | ||
// First element in the last row (StackPanel) | ||
StackPanel firstElementInLastRow = parent.Children().GetAt(parent.Children().Size() - colCount).as<StackPanel>(); | ||
|
||
// Type button is the first child in the StackPanel | ||
Button firstTypeButtonInLastRow = firstElementInLastRow.Children().GetAt(0).as<Button>(); | ||
|
||
// Set programmatic focus on the button | ||
firstTypeButtonInLastRow.Focus(FocusState::Programmatic); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
// This namespace contains UI methods that are to be used for both KBM windows | ||
namespace UIHelpers | ||
{ | ||
// This method sets focus to the first Type button on the last row of the Grid | ||
void SetFocusOnTypeButtonInLastRow(Grid& parent, long colCount); | ||
} |