Build XCUI splitter foundation and test harness
This commit is contained in:
@@ -0,0 +1,35 @@
|
||||
set(EDITOR_UI_INPUT_KEYBOARD_FOCUS_RESOURCES
|
||||
View.xcui
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Editor/integration/shared/themes/editor_validation.xctheme
|
||||
)
|
||||
|
||||
add_executable(editor_ui_input_keyboard_focus_validation WIN32
|
||||
main.cpp
|
||||
${EDITOR_UI_INPUT_KEYBOARD_FOCUS_RESOURCES}
|
||||
)
|
||||
|
||||
target_include_directories(editor_ui_input_keyboard_focus_validation PRIVATE
|
||||
${CMAKE_SOURCE_DIR}/tests/UI/Editor/integration/shared/src
|
||||
${CMAKE_SOURCE_DIR}/engine/include
|
||||
)
|
||||
|
||||
target_compile_definitions(editor_ui_input_keyboard_focus_validation PRIVATE
|
||||
UNICODE
|
||||
_UNICODE
|
||||
)
|
||||
|
||||
if(MSVC)
|
||||
target_compile_options(editor_ui_input_keyboard_focus_validation PRIVATE /utf-8 /FS)
|
||||
set_property(TARGET editor_ui_input_keyboard_focus_validation PROPERTY
|
||||
MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>DLL")
|
||||
endif()
|
||||
|
||||
target_link_libraries(editor_ui_input_keyboard_focus_validation PRIVATE
|
||||
editor_ui_integration_host
|
||||
)
|
||||
|
||||
set_target_properties(editor_ui_input_keyboard_focus_validation PROPERTIES
|
||||
OUTPUT_NAME "XCUIEditorInputKeyboardFocusValidation"
|
||||
)
|
||||
|
||||
source_group(TREE "${CMAKE_CURRENT_SOURCE_DIR}" FILES View.xcui)
|
||||
18
tests/UI/Editor/integration/input/keyboard_focus/README.md
Normal file
18
tests/UI/Editor/integration/input/keyboard_focus/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Keyboard Focus Validation
|
||||
|
||||
可执行 target:
|
||||
|
||||
- `editor_ui_input_keyboard_focus_validation`
|
||||
|
||||
运行:
|
||||
|
||||
```bash
|
||||
build\tests\UI\Editor\integration\input\keyboard_focus\Debug\XCUIEditorInputKeyboardFocusValidation.exe
|
||||
```
|
||||
|
||||
检查点:
|
||||
|
||||
1. 按 `Tab`,焦点依次切换三个按钮
|
||||
2. 按 `Shift+Tab`,焦点反向切换
|
||||
3. 按 `Enter` 或 `Space`,当前 `focus` 按钮进入 `active`
|
||||
4. 松开按键后,`active` 清空
|
||||
30
tests/UI/Editor/integration/input/keyboard_focus/View.xcui
Normal file
30
tests/UI/Editor/integration/input/keyboard_focus/View.xcui
Normal file
@@ -0,0 +1,30 @@
|
||||
<View
|
||||
name="EditorInputKeyboardFocus"
|
||||
theme="../../shared/themes/editor_validation.xctheme">
|
||||
<Column padding="24" gap="16">
|
||||
<Card
|
||||
title="Editor Validation | Keyboard Focus"
|
||||
subtitle="当前批次:Tab 焦点遍历 | Enter / Space 激活"
|
||||
tone="accent"
|
||||
height="90">
|
||||
<Column gap="8">
|
||||
<Text text="这是 editor 侧验证场景,不承载 runtime 游戏 UI。" />
|
||||
<Text text="这一轮只检查键盘焦点和激活,不混入复杂 editor 面板。" />
|
||||
</Column>
|
||||
</Card>
|
||||
|
||||
<Card title="Keyboard Focus" subtitle="tab focus active" height="214">
|
||||
<Column gap="12">
|
||||
<Text text="只检查下面三个可聚焦按钮和右下角状态叠层。" />
|
||||
<Row gap="12">
|
||||
<Button id="focus-first" text="First Focus" />
|
||||
<Button id="focus-second" text="Second Focus" />
|
||||
<Button id="focus-third" text="Third Focus" />
|
||||
</Row>
|
||||
<Text text="1. 按 Tab:focus 应依次切到 First / Second / Third。" />
|
||||
<Text text="2. 按 Shift+Tab:focus 应反向切换。" />
|
||||
<Text text="3. focus 停在任一按钮后,按 Enter 或 Space:active 应出现;松开后 active 清空。" />
|
||||
</Column>
|
||||
</Card>
|
||||
</Column>
|
||||
</View>
|
||||
@@ -0,0 +1,8 @@
|
||||
#include "Application.h"
|
||||
|
||||
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR, int nCmdShow) {
|
||||
return XCEngine::Tests::EditorUI::RunEditorUIValidationApp(
|
||||
hInstance,
|
||||
nCmdShow,
|
||||
"editor.input.keyboard_focus");
|
||||
}
|
||||
Reference in New Issue
Block a user