Fix CMake build of wxWebView when using non MSVS generators Replace MSBuild-specific LibrariesArchitecture with WEBVIEW2_ARCH to fix CMake build with Ninja. Closes #25533. Closes #25526.
Avoid warning about possibly uninitialized variable in a test MSVS warns about "width" being possibly uninitialized, so do initialize it and also initialize "height" for consistency.
Stop on warnings in MSVS CI jobs Somewhat confusingly, using /WX compiler switch doesn't work, but using MSBuild /WarnAsError one does.
Leave only MSVS 2022 CI jobs MSVS 2019 is only available in windows-2019 image which is being retired by GitHub, see https://github.com/actions/runner-images/issues/12045
Remove MSVS 2022 builds from AppVeyor CI GitHub Actions CI still has those, but doesn't have MSVS 2019 ones any more, so build wxMSW using this compiler under AppVeyor. Leave just one build instead of 2 we had before in an attempt to reduce the total AppVeyor build time.
Move wxQt/MSVS CI job from AppVeyor to GitHub Actions It should run faster there, reducing total CI run time.
Add MSVS wxMSW build using C++20 It seems useful to test the latest support C++ standard version too. Add cxx20.props which can also be used locally in a similar way, i.e. after copying it to wx_local.props.
Use better names for the other MSW CI jobs Make them more consistent with wxMSW MSVS job.
Avoid warning about combining enum values form different enums Cast border style to int explicitly.
Use more consistent CMake wxMSW CI job name wxQt job uses wxQt in its name, so use wxMSW for this one.
Don't install Qt in CMake wxMSW CI job It's only needed for wxQt, so don't waste time doing it in wxMSW job.
Document wxMSW date/time picker controls behaviour change They use different format now than in the previous versions. Closes #25511.
Fix wxPersistent(CheckBox|RadioButton) version availability in docs wxPersistentCheckBox and wxPersistentRadioButton did not make it into wxWidgets 3.3.0, they are available only since 3.3.1. Closes #25539.
Only use "-jN" with make-based CMake generators Don't use this option with e.g. MSBuild which doesn't understand it.
Move wxMSW/clang CI job to the workflow using CMake This job uses CMake and not MSBuild, so move it to the appropriate workflow.
Move wxQt5 CI job to CMake workflow too For the same reasons as in the parent commit message, this job belongs to the workflow in ci_cmake.yml rather than MSBuild one in ci_msw.yml.
Don't unnecessarily make MSWFindMenuFromHMENU() member function This function doesn't need to be virtual as it's not meant to be overridden and doesn't even need to be a member function, so remove it from the header and define it as a static function in the implementation. No real changes.
Search menu items only in menus belonging to wx We can't assume that all menus contain wxMenuItems, as this is not the case for at least the per-window menu in the MDI applications and interpreting its items user data as wxMenuItem pointers resulted in a crash, which not searching in this menu fixes. Having the right menu to search in also avoids the need for recursion, which simplifies the code even further. Closes #25522.
Inline MSWFindMenuItemFromHMENU() into the caller This function is so simple now that we don't really need to have it as a function at all any more, so just inline it into HandleMenuSelect(). No real changes.
Simplify statbar sample by defining the frame base class once Avoid multiple USE_MDI_PARENT_FRAME checks and just define BaseFrame as wxMDIParentFrame (instead of the default wxFrame) once when using this. Also don't pass hardcoded position and size to the frame ctor, we don't need to do this at all and it's actually harmful in high DPI as the hardcoded size was too small. No real changes, just simplify the code.
Fix searching for submenus when looking for the selected item Use "item" sent by Windows as the position, not ID, for the submenus as they don't have any IDs at Windows level. This really fixes showing help string for the submenu items. Closes #25505.
Make wxAUI sash wider in high DPI This was changed in 43b55cf0db (Avoid scaling small metrics by DPI in wxAuiDockArt, 2025-02-22) but it finally seems that it's better to scale the sash width with DPI, even if it is small, so revert to doing this again. See #25006.
Merge branch 'msvc-ci' MSVS CI jobs reorganization: notably, remove MSVS 2019 CI jobs from GitHub Actions as windows-2019 image is being retired. See #25495.
Merge branch 'msw-find-menu-item' Fix searching for the menu items in wxMSW. See #24842, #24874, #25505 and #25522.
Enable MSW dark mode support for Windows v1809 Change the minimum required Windows version from 20H1 to v1809 (which Windows 10 LTSC 2019 is based on), and fix dark title bar support for v1809. Also update the doc to note that dark mode support for versions before Windows 10 20H1 is not fully tested. Closes #25541.
Revert "Fix wxDataViewCtrl border in dark mode under MSW" This reverts commit 9e1b62779757a83acd75304e7c3defb40bd6a99a which fixed wxDataViewCtrl border in dark mode (see #24624), but broke it in light mode. It is possible to revert it now because the original bug was fixed in a more general way in a later fbc76d6 (Don't use themed borders in dark mode in wxMSW, 2024-09-25), so this doesn't break dark mode again. Closes #25532.
Improve wxTreeListCtrl styles documentation Fix mismatching styles descriptions and make them more informative. Closes #25534.
Loading
|
Loading
|
@@ -85,7 +85,7 @@ jobs: |
85 | 85 | cmake_samples: OFF
|
86 | 86 | cmake_tests: OFF
|
87 | 87 | cmake_build_toolkit: osx_iphone
|
88 | - - name: Windows MSVC
|
|
88 | + - name: MSW/MSVC wxMSW
|
|
89 | 89 | runner: windows-latest
|
90 | 90 | no_sudo: 1
|
91 | 91 | cmake_defines: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
|
Loading
|
Loading
|
@@ -93,7 +93,18 @@ jobs: |
93 | 93 | cmake_samples: SOME
|
94 | 94 | cmake_tests: CONSOLE_ONLY
|
95 | 95 | cmake_build_toolkit: msw
|
96 | - - name: Windows wxQt 6.8
|
|
96 | + - name: MSW/MSVC wxQt 5.15
|
|
97 | + runner: windows-latest
|
|
98 | + no_sudo: 1
|
|
99 | + cmake_generator: 'Visual Studio 17 2022'
|
|
100 | + cmake_defines: -DCMAKE_BUILD_TYPE=Debug -DwxBUILD_SHARED=ON
|
|
101 | + cmake_samples: SOME
|
|
102 | + cmake_tests: ALL
|
|
103 | + cmake_build_toolkit: qt
|
|
104 | + cmake_qt_version: '5.15.*'
|
|
105 | + skip_installation: true
|
|
106 | + test_gui: 1
|
|
107 | + - name: MSW/MSVC wxQt 6.8
|
|
97 | 108 | runner: windows-latest
|
98 | 109 | no_sudo: 1
|
99 | 110 | cmake_defines: -DCMAKE_C_COMPILER=cl.exe -DCMAKE_CXX_COMPILER=cl.exe
|
Loading
|
Loading
|
@@ -101,15 +112,28 @@ jobs: |
101 | 112 | cmake_samples: SOME
|
102 | 113 | cmake_tests: ALL
|
103 | 114 | cmake_build_toolkit: qt
|
115 | + cmake_qt_version: '6.8.*'
|
|
116 | + skip_installation: true
|
|
117 | + - name: MSW/Clang wxMSW
|
|
118 | + shell: msys2 {0}
|
|
119 | + runner: windows-latest
|
|
120 | + no_sudo: 1
|
|
121 | + cmake_defines: -DCMAKE_C_COMPILER=clang.exe -DCMAKE_CXX_COMPILER=clang++.exe -DCMAKE_CXX_FLAGS="-DwxENABLE_EXTRA_WARNINGS -Werror -Wsuggest-override" -DCMAKE_BUILD_TYPE=Release -DwxBUILD_DEMOS=ON -DwxUSE_WEBVIEW_EDGE=ON
|
|
122 | + cmake_generator: MinGW Makefiles
|
|
123 | + cmake_samples: ALL
|
|
124 | + cmake_tests: OFF
|
|
125 | + cmake_build_toolkit: msw
|
|
104 | 126 | skip_installation: true
|
105 | 127 | |
106 | 128 | env:
|
107 | 129 | wxGTK_VERSION: ${{ matrix.gtk_version && matrix.gtk_version || 3 }}
|
108 | 130 | |
109 | 131 | # Use bash as the shell, even under MSW where the default is PowerShell.
|
132 | + # Except for the MSYS2 shell, which must be used to find MSYS2 clang
|
|
133 | + # instead of native clang.
|
|
110 | 134 | defaults:
|
111 | 135 | run:
|
112 | - shell: bash
|
|
136 | + shell: ${{ matrix.shell || 'bash' }}
|
|
113 | 137 | |
114 | 138 | steps:
|
115 | 139 | - name: Checkout
|
Loading
|
Loading
|
@@ -117,15 +141,19 @@ jobs: |
117 | 141 | with:
|
118 | 142 | submodules: 'recursive'
|
119 | 143 | |
120 | - - name: Install Qt6
|
|
121 | - if: runner.os == 'Windows'
|
|
144 | + - name: Setup MSYS2
|
|
145 | + if: matrix.cmake_generator == 'MinGW Makefiles'
|
|
146 | + uses: msys2/setup-msys2@v2
|
|
147 | + with:
|
|
148 | + msystem: mingw64
|
|
149 | + update: true
|
|
150 | + install: mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang
|
|
151 | + |
|
152 | + - name: Install Qt
|
|
153 | + if: matrix.cmake_build_toolkit == 'qt'
|
|
122 | 154 | uses: jurplel/install-qt-action@v4
|
123 | 155 | with:
|
124 | - version: '6.8.*'
|
|
125 | - host: 'windows'
|
|
126 | - target: 'desktop'
|
|
127 | - arch: 'win64_msvc2022_64'
|
|
128 | - archives: 'qtbase qtsvg qtimageformats'
|
|
156 | + version: ${{ matrix.cmake_qt_version }}
|
|
129 | 157 | cache: 'true'
|
130 | 158 | aqtversion: '==3.1.*'
|
131 | 159 | setup-python: 'false'
|
Loading
|
Loading
|
@@ -133,13 +161,20 @@ jobs: |
133 | 161 | - name: Set environment variables
|
134 | 162 | run: |
|
135 | 163 | wxPROC_COUNT=`./build/tools/proc_count.sh`
|
136 | - if [ "${{ matrix.cmake_generator }}" == "Xcode" ]; then
|
|
164 | + case "${{ matrix.cmake_generator }}" in
|
|
165 | + Xcode)
|
|
137 | 166 | # Xcode generates a lot of output, suppress it so only warnings and errors are visible
|
138 | 167 | wxBUILD_ARGS="-jobs $wxPROC_COUNT -quiet"
|
139 | - else
|
|
168 | + ;;
|
|
169 | + |
|
170 | + *Makefiles)
|
|
140 | 171 | wxBUILD_ARGS=-j$wxPROC_COUNT
|
172 | + ;;
|
|
173 | + esac
|
|
174 | + |
|
175 | + if [ -n "$wxBUILD_ARGS" ]; then
|
|
176 | + echo wxBUILD_ARGS=$wxBUILD_ARGS >> $GITHUB_ENV
|
|
141 | 177 | fi
|
142 | - echo wxBUILD_ARGS=$wxBUILD_ARGS >> $GITHUB_ENV
|
|
143 | 178 | |
144 | 179 | cmake_tests=${{ matrix.cmake_tests }}
|
145 | 180 | if [ -z $cmake_tests ]; then cmake_tests=CONSOLE_ONLY; fi
|
Loading
|
Loading
|
@@ -163,9 +198,10 @@ jobs: |
163 | 198 | run: |
|
164 | 199 | ./build/tools/before_install.sh
|
165 | 200 | |
166 | - # required for CMake to find Ninja
|
|
167 | - - name: "[Windows] Set up MSVC Developer Command Prompt"
|
|
168 | - if: runner.os == 'Windows'
|
|
201 | + # required for CMake to find Ninja but shouldn't be used when using
|
|
202 | + # MSYS2, or we'd end up using MSVC clang instead of its own.
|
|
203 | + - name: Setup MSVC Environment
|
|
204 | + if: ${{ runner.os == 'Windows' && matrix.cmake_generator != 'MinGW Makefiles' }}
|
|
169 | 205 | uses: wxWidgets/gha-setup-vsdevenv@wx
|
170 | 206 | |
171 | 207 | - name: Configuring
|
Loading
|
Loading
|
@@ -210,6 +246,12 @@ jobs: |
210 | 246 | exit $rc
|
211 | 247 | fi
|
212 | 248 | |
249 | + - name: Testing GUI
|
|
250 | + if: matrix.test_gui == '1'
|
|
251 | + working-directory: build_cmake\lib\vc_x64_dll
|
|
252 | + run: |
|
|
253 | + ./test_gui.exe
|
|
254 | + |
|
213 | 255 | - name: Testing installation
|
214 | 256 | if: matrix.skip_installation != true
|
215 | 257 | run: |
|
Loading
|
Loading
|
@@ -56,25 +56,22 @@ permissions: |
56 | 56 | |
57 | 57 | jobs:
|
58 | 58 | msw-msvs:
|
59 | - runs-on: windows-${{ matrix.vsversion }}
|
|
60 | - name: wxMSW vs${{ matrix.vsversion }} ${{ matrix.configuration }} ${{ matrix.platform }}
|
|
59 | + runs-on: windows-2022
|
|
60 | + name: wxMSW vs2022 ${{ matrix.configuration }} ${{ matrix.platform }}
|
|
61 | 61 | strategy:
|
62 | 62 | fail-fast: false
|
63 | 63 | matrix:
|
64 | 64 | include:
|
65 | 65 | - configuration: 'DLL Debug'
|
66 | 66 | platform: 'x64'
|
67 | - vsversion: 2022
|
|
68 | 67 | use_utf8: true
|
69 | 68 | - configuration: 'Release'
|
70 | 69 | platform: 'arm64'
|
71 | - vsversion: 2022
|
|
72 | 70 | - configuration: 'Debug'
|
73 | 71 | platform: 'Win32'
|
74 | - vsversion: 2019
|
|
72 | + use_cxx20: true
|
|
75 | 73 | - configuration: 'DLL Release'
|
76 | 74 | platform: 'x64'
|
77 | - vsversion: 2019
|
|
78 | 75 | |
79 | 76 | steps:
|
80 | 77 | - name: Checkout
|
Loading
|
Loading
|
@@ -92,6 +89,11 @@ jobs: |
92 | 89 | %{$_ -replace "define wxUSE_UNICODE_UTF8 0", "define wxUSE_UNICODE_UTF8 $use_utf8"} |
|
93 | 90 | Set-Content setup.h
|
94 | 91 | }
|
92 | + $use_cxx20 = "${{ matrix.use_cxx20 }}" ? 1 : 0
|
|
93 | + if ( $use_cxx20 ) {
|
|
94 | + cd ..\..\..\build\msw
|
|
95 | + cp cxx20.props wx_local.props
|
|
96 | + }
|
|
95 | 97 | |
96 | 98 | - name: Add MSBuild to PATH
|
97 | 99 | uses: microsoft/setup-msbuild@v2
|
Loading
|
Loading
|
@@ -100,7 +102,7 @@ jobs: |
100 | 102 | |
101 | 103 | - name: Build
|
102 | 104 | run: |
|
103 | - msbuild /noLogo /m '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} build\msw\wx_vc16.sln
|
|
105 | + msbuild /noLogo /m /warnaserror '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} build\msw\wx_vc17.sln
|
|
104 | 106 | if ( '${{ matrix.configuration }}'.IndexOf('DLL') -ne -1 ) {
|
105 | 107 | $dlldir = Join-Path (Get-Location) 'lib\vc_${{ matrix.platform }}_dll'
|
106 | 108 | Write-Output "Adding $dlldir to the PATH"
|
Loading
|
Loading
|
@@ -110,11 +112,11 @@ jobs: |
110 | 112 | - name: Build samples
|
111 | 113 | if: matrix.platform != 'arm64'
|
112 | 114 | run: |
|
113 | - msbuild /noLogo /m '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} samples\samples_vc16.sln
|
|
115 | + msbuild /noLogo /m /warnaserror '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} samples\samples_vc17.sln
|
|
114 | 116 | |
115 | 117 | - name: Build tests
|
116 | 118 | run: |
|
117 | - msbuild /noLogo /m '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} tests\test_vc16.sln
|
|
119 | + msbuild /noLogo /m /warnaserror '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} tests\test_vc17.sln
|
|
118 | 120 | |
119 | 121 | - name: Run tests
|
120 | 122 | if: ${{ !contains(matrix.platform, 'arm64') }}
|
Loading
|
Loading
|
@@ -139,53 +141,10 @@ jobs: |
139 | 141 | |
140 | 142 | - name: Build GUI tests
|
141 | 143 | run: |
|
142 | - msbuild /noLogo /m '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} tests\test_gui_vc16.sln
|
|
144 | + msbuild /noLogo /m /warnaserror '/p:Configuration=${{ matrix.configuration }}' /p:Platform=${{ matrix.platform }} tests\test_gui_vc17.sln
|
|
143 | 145 | |
144 | 146 | - name: Run GUI tests
|
145 | 147 | if: ${{ !contains(matrix.platform, 'arm64') }}
|
146 | 148 | working-directory: tests
|
147 | 149 | run: |
|
148 | 150 | .\vc*msw*\test_gui.exe |
149 | - |
|
150 | - msw-msys2-clang:
|
|
151 | - runs-on: windows-latest
|
|
152 | - |
|
153 | - defaults:
|
|
154 | - run:
|
|
155 | - shell: msys2 {0}
|
|
156 | - |
|
157 | - steps:
|
|
158 | - - name: Checkout
|
|
159 | - uses: actions/checkout@v4
|
|
160 | - with:
|
|
161 | - submodules: 'recursive'
|
|
162 | - |
|
163 | - - name: Setup MSYS2
|
|
164 | - uses: msys2/setup-msys2@v2
|
|
165 | - with:
|
|
166 | - msystem: mingw64
|
|
167 | - update: true
|
|
168 | - install: mingw-w64-x86_64-cmake mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang
|
|
169 | - |
|
170 | - - name: Configuring
|
|
171 | - run: |
|
|
172 | - clang --version
|
|
173 | - cmake --version
|
|
174 | - mkdir build_cmake
|
|
175 | - pushd build_cmake
|
|
176 | - cmake -G "MinGW Makefiles" \
|
|
177 | - -DCMAKE_C_COMPILER=clang.exe \
|
|
178 | - -DCMAKE_CXX_COMPILER=clang++.exe \
|
|
179 | - -DCMAKE_CXX_FLAGS="-DwxENABLE_EXTRA_WARNINGS -Werror -Wsuggest-override" \
|
|
180 | - -DCMAKE_BUILD_TYPE=Release \
|
|
181 | - -DwxBUILD_SAMPLES=ALL \
|
|
182 | - -DwxBUILD_TESTS=ALL \
|
|
183 | - -DwxBUILD_DEMOS=ON \
|
|
184 | - -DwxUSE_WEBVIEW_EDGE=ON \
|
|
185 | - ..
|
|
186 | - |
|
187 | - - name: Building
|
|
188 | - working-directory: build_cmake
|
|
189 | - run: |
|
|
190 | - wxPROC_COUNT=`../build/tools/proc_count.sh`
|
|
191 | - cmake --build . -- -j$wxPROC_COUNT |
Loading
|
Loading
|
@@ -32,17 +32,12 @@ environment: |
32 | 32 | GOVERSION: "1.22.1"
|
33 | 33 | GOPATH: c:\gopath
|
34 | 34 | matrix:
|
35 | - - TOOLSET: msbuild
|
|
36 | - CONFIGURATION: DLL Release
|
|
37 | - ARCH: x64
|
|
38 | - VSVER: 17
|
|
39 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
|
40 | 35 | - TOOLSET: msbuild
|
41 | 36 | CONFIGURATION: Debug
|
42 | 37 | ARCH: x64
|
43 | - VSVER: 17
|
|
44 | - wxUSE_UNICODE_UTF8: 1
|
|
45 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
|
|
38 | + SHARED: ON
|
|
39 | + VSVER: 16
|
|
40 | + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
46 | 41 | - TOOLSET: nmake
|
47 | 42 | VS: '14.0'
|
48 | 43 | BUILD: debug
|
Loading
|
Loading
|
@@ -54,12 +49,6 @@ environment: |
54 | 49 | SHARED: ON
|
55 | 50 | CONFIGURATION: Release
|
56 | 51 | APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
|
57 | - - TOOLSET: cmake_qt
|
|
58 | - GENERATOR: 'Visual Studio 16 2019'
|
|
59 | - ARCH: x64
|
|
60 | - SHARED: ON
|
|
61 | - CONFIGURATION: Release
|
|
62 | - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
|
|
63 | 52 | |
64 | 53 | clone_depth: 1
|
65 | 54 |
Loading
|
Loading
|
@@ -12,12 +12,6 @@ function(wx_webview_copy_webview2_loader target) |
12 | 12 | return()
|
13 | 13 | endif()
|
14 | 14 | |
15 | - if(wxPLATFORM_ARCH)
|
|
16 | - set(WEBVIEW2_ARCH ${wxPLATFORM_ARCH})
|
|
17 | - else()
|
|
18 | - set(WEBVIEW2_ARCH x86)
|
|
19 | - endif()
|
|
20 | - |
|
21 | 15 | add_custom_command(TARGET ${target} POST_BUILD
|
22 | 16 | COMMAND ${CMAKE_COMMAND} -E copy
|
23 | 17 | "${WEBVIEW2_PACKAGE_DIR}/build/native/${WEBVIEW2_ARCH}/WebView2Loader.dll"
|
Loading
|
Loading
|
@@ -87,9 +81,14 @@ elseif(WXMSW) |
87 | 81 | endif()
|
88 | 82 | endif()
|
89 | 83 | |
84 | + if(wxPLATFORM_ARCH)
|
|
85 | + set(WEBVIEW2_ARCH ${wxPLATFORM_ARCH})
|
|
86 | + else()
|
|
87 | + set(WEBVIEW2_ARCH x86)
|
|
88 | + endif()
|
|
90 | 89 | if (wxUSE_WEBVIEW_EDGE_STATIC)
|
91 | 90 | wx_lib_link_directories(wxwebview PUBLIC
|
92 | - $<BUILD_INTERFACE:${WEBVIEW2_PACKAGE_DIR}/build/native/$(LibrariesArchitecture)/>
|
|
91 | + $<BUILD_INTERFACE:${WEBVIEW2_PACKAGE_DIR}/build/native/${WEBVIEW2_ARCH}/>
|
|
93 | 92 | )
|
94 | 93 | else()
|
95 | 94 | wx_webview_copy_webview2_loader(wxwebview)
|
1 | +<?xml version="1.0" encoding="utf-8"?>
|
|
2 | +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
3 | + <ItemDefinitionGroup>
|
|
4 | + <ClCompile>
|
|
5 | + <LanguageStandard>stdcpp20</LanguageStandard>
|
|
6 | + </ClCompile>
|
|
7 | + </ItemDefinitionGroup>
|
|
8 | +</Project> |
Loading
|
Loading
|
@@ -85,6 +85,10 @@ Changes in behaviour not resulting in compilation errors |
85 | 85 | mode under MSW, use the new AreAppsDark() or IsSystemDark() to check if the
|
86 | 86 | other applications or the system are using dark mode.
|
87 | 87 | |
88 | +- Date/time picker controls are now locale-aware by default in wxMSW, which
|
|
89 | + means that they do _not_ use OS default date/time format any longer unless
|
|
90 | + wxUILocale::UseDefault() is called.
|
|
91 | + |
|
88 | 92 | - wxUILocale::IsSupported() now returns false for unavailable locales under
|
89 | 93 | Unix systems without trying to fall back on another locale using the same
|
90 | 94 | language in a different region, e.g. it doesn't use fr_FR if fr_BE is not
|
Loading
|
Loading
|
@@ -576,10 +576,6 @@ public: |
576 | 576 | |
577 | 577 | // Find the menu corresponding to the given handle.
|
578 | 578 | virtual wxMenu* MSWFindMenuFromHMENU(WXHMENU hMenu);
|
579 | - |
|
580 | - // Find the the current menu item using the given handle and the item id
|
|
581 | - virtual wxMenuItem* MSWFindMenuItemFromHMENU(WXHMENU hMenu, int nItem);
|
|
582 | - |
|
583 | 579 | #endif // wxUSE_MENUS && !__WXUNIVERSAL__
|
584 | 580 | |
585 | 581 | // Return the default button for the TLW containing this window or nullptr if
|
Loading
|
Loading
|
@@ -72,9 +72,6 @@ public: |
72 | 72 | DoEnableSystemTheme(enable, this);
|
73 | 73 | }
|
74 | 74 | |
75 | - // Using wxBORDER_THEME is unnecessary and looks bad for these controls.
|
|
76 | - virtual bool CanApplyThemeBorder() const override { return false; }
|
|
77 | - |
|
78 | 75 | protected:
|
79 | 76 | void EnableSystemThemeByDefault()
|
80 | 77 | {
|
Loading
|
Loading
|
@@ -1371,7 +1371,11 @@ public: |
1371 | 1371 | |
1372 | 1372 | This function uses @e undocumented, and unsupported by Microsoft,
|
1373 | 1373 | functions to enable dark mode support for the desktop applications
|
1374 | - under Windows 10 20H1 or later (including all Windows 11 versions).
|
|
1374 | + under Windows 10 versions later than v1809 (which includes Windows 10
|
|
1375 | + LTSC 2019) and all Windows 11 versions. Please note that dark mode
|
|
1376 | + testing under versions of Windows earlier than 20H1 (i.e. v2004) has
|
|
1377 | + been limited, make sure to test your application especially carefully
|
|
1378 | + if you target these versions and want to enable dark mode support.
|
|
1375 | 1379 | |
1376 | 1380 | Note that dark mode can also be enabled by setting the "msw.dark-mode"
|
1377 | 1381 | @ref wxSystemOptions "system option" via an environment variable from
|
Loading
|
Loading
|
@@ -22,7 +22,7 @@ |
22 | 22 | If the checkbox is checked, it will be checked again after the application
|
23 | 23 | restart.
|
24 | 24 | |
25 | - @since 3.3.0
|
|
25 | + @since 3.3.1
|
|
26 | 26 | */
|
27 | 27 | class wxPersistentCheckBox : public wxPersistentWindow<wxCheckBox>
|
28 | 28 | {
|
Loading
|
Loading
|
@@ -34,7 +34,7 @@ |
34 | 34 | the user selects white pieces, this selection will be restored during the
|
35 | 35 | subsequent run.
|
36 | 36 | |
37 | - @since 3.3.0
|
|
37 | + @since 3.3.1
|
|
38 | 38 | */
|
39 | 39 | class wxPersistentRadioButton : public wxPersistentWindow<wxRadioButton>
|
40 | 40 | {
|
Loading
|
Loading
|
@@ -15,11 +15,37 @@ |
15 | 15 | */
|
16 | 16 | enum
|
17 | 17 | {
|
18 | - wxTL_SINGLE = 0x0000, /// This is the default anyhow.
|
|
19 | - wxTL_MULTIPLE = 0x0001, /// Allow multiple selection.
|
|
20 | - wxTL_CHECKBOX = 0x0002, /// Show checkboxes in the first column.
|
|
21 | - wxTL_3STATE = 0x0004, /// Allow 3rd state in checkboxes.
|
|
22 | - wxTL_USER_3STATE = 0x0008, /// Allow user to set 3rd state.
|
|
18 | + /// Only allow single selection (this is the default).
|
|
19 | + wxTL_SINGLE = 0x0000,
|
|
20 | + |
|
21 | + /// Allow multiple selections.
|
|
22 | + wxTL_MULTIPLE = 0x0001,
|
|
23 | + |
|
24 | + /**
|
|
25 | + Show checkboxes in the first column.
|
|
26 | + |
|
27 | + Without any additional styles, checkboxes may be only in checked or
|
|
28 | + unchecked state.
|
|
29 | + */
|
|
30 | + wxTL_CHECKBOX = 0x0002,
|
|
31 | + |
|
32 | + /**
|
|
33 | + Allow 3rd state in checkboxes.
|
|
34 | + |
|
35 | + Specifying this style turns on ::wxTL_CHECKBOX too.
|
|
36 | + |
|
37 | + Unless ::wxTL_USER_3STATE is also specified, the 3rd state
|
|
38 | + ("undetermined") can only be set by the program but not by the user.
|
|
39 | + */
|
|
40 | + wxTL_3STATE = 0x0004,
|
|
41 | + |
|
42 | + /**
|
|
43 | + Allow user to set 3rd state in the checkboxes.
|
|
44 | + |
|
45 | + Specifying this style turns on ::wxTL_3STATE and ::wxTL_CHECKBOX too.
|
|
46 | + */
|
|
47 | + wxTL_USER_3STATE = 0x0008,
|
|
48 | + |
|
23 | 49 | /**
|
24 | 50 | Don't show the column headers.
|
25 | 51 | |
Loading
|
Loading
|
@@ -30,12 +56,8 @@ enum |
30 | 56 | */
|
31 | 57 | wxTL_NO_HEADER = 0x0010,
|
32 | 58 | |
33 | - wxTL_DEFAULT_STYLE = wxTL_SINGLE,
|
|
34 | - wxTL_STYLE_MASK = wxTL_SINGLE |
|
|
35 | - wxTL_MULTIPLE |
|
|
36 | - wxTL_CHECKBOX |
|
|
37 | - wxTL_3STATE |
|
|
38 | - wxTL_USER_3STATE
|
|
59 | + /// Style used by the control by default.
|
|
60 | + wxTL_DEFAULT_STYLE = wxTL_SINGLE
|
|
39 | 61 | };
|
40 | 62 | |
41 | 63 |
Loading
|
Loading
|
@@ -53,6 +53,10 @@ |
53 | 53 | //#define USE_MDI_PARENT_FRAME 1
|
54 | 54 | #ifdef USE_MDI_PARENT_FRAME
|
55 | 55 | #include "wx/mdi.h"
|
56 | + |
|
57 | + using BaseFrame = wxMDIParentFrame;
|
|
58 | +#else
|
|
59 | + using BaseFrame = wxFrame;
|
|
56 | 60 | #endif // USE_MDI_PARENT_FRAME
|
57 | 61 | |
58 | 62 | static const char *SAMPLE_DIALOGS_TITLE = "wxWidgets statbar sample";
|
Loading
|
Loading
|
@@ -125,15 +129,11 @@ private: |
125 | 129 | };
|
126 | 130 | |
127 | 131 | // Define a new frame type: this is going to be our main frame
|
128 | -#ifdef USE_MDI_PARENT_FRAME
|
|
129 | -class MyFrame : public wxMDIParentFrame
|
|
130 | -#else
|
|
131 | -class MyFrame : public wxFrame
|
|
132 | -#endif
|
|
132 | +class MyFrame : public BaseFrame
|
|
133 | 133 | {
|
134 | 134 | public:
|
135 | 135 | // ctor(s)
|
136 | - MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
|
|
136 | + explicit MyFrame(const wxString& title);
|
|
137 | 137 | |
138 | 138 | // event handlers (these functions should _not_ be virtual)
|
139 | 139 | void OnQuit(wxCommandEvent& event);
|
Loading
|
Loading
|
@@ -230,11 +230,7 @@ enum |
230 | 230 | // the event tables connect the wxWidgets events with the functions (event
|
231 | 231 | // handlers) which process them. It can be also done at run-time, but for the
|
232 | 232 | // simple menu events like this the static method is much simpler.
|
233 | -#ifdef USE_MDI_PARENT_FRAME
|
|
234 | -wxBEGIN_EVENT_TABLE(MyFrame, wxMDIParentFrame)
|
|
235 | -#else
|
|
236 | -wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
|
237 | -#endif
|
|
233 | +wxBEGIN_EVENT_TABLE(MyFrame, BaseFrame)
|
|
238 | 234 | EVT_MENU(StatusBar_Quit, MyFrame::OnQuit)
|
239 | 235 | EVT_MENU(StatusBar_SetFields, MyFrame::OnSetStatusFields)
|
240 | 236 | EVT_MENU(StatusBar_SetField, MyFrame::OnSetStatusField)
|
Loading
|
Loading
|
@@ -300,8 +296,7 @@ bool MyApp::OnInit() |
300 | 296 | return false;
|
301 | 297 | |
302 | 298 | // create the main application window
|
303 | - MyFrame *frame = new MyFrame("wxStatusBar sample",
|
|
304 | - wxPoint(50, 50), wxSize(450, 340));
|
|
299 | + MyFrame *frame = new MyFrame("wxStatusBar sample");
|
|
305 | 300 | |
306 | 301 | // and show it (the frames, unlike simple controls, are not shown when
|
307 | 302 | // created initially)
|
Loading
|
Loading
|
@@ -318,12 +313,8 @@ bool MyApp::OnInit() |
318 | 313 | // ----------------------------------------------------------------------------
|
319 | 314 | |
320 | 315 | // frame constructor
|
321 | -MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
|
|
322 | -#ifdef USE_MDI_PARENT_FRAME
|
|
323 | - : wxMDIParentFrame(nullptr, wxID_ANY, title, pos, size)
|
|
324 | -#else
|
|
325 | - : wxFrame(nullptr, wxID_ANY, title, pos, size)
|
|
326 | -#endif
|
|
316 | +MyFrame::MyFrame(const wxString& title)
|
|
317 | + : BaseFrame(nullptr, wxID_ANY, title)
|
|
327 | 318 | {
|
328 | 319 | SetIcon(wxICON(sample));
|
329 | 320 | |
Loading
|
Loading
|
@@ -353,7 +344,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) |
353 | 344 | "wxSTB_ELLIPSIZE_END",
|
354 | 345 | "Toggle wxSTB_ELLIPSIZE_END style");
|
355 | 346 | statbarMenu->Append(StatusBar_SetPaneStyle, "Status bar style",
|
356 | - statbarStyleMenu);
|
|
347 | + statbarStyleMenu, "Status bar choices");
|
|
357 | 348 | statbarMenu->AppendSeparator();
|
358 | 349 | |
359 | 350 | statbarMenu->Append(StatusBar_SetField, "Set active field &number\tCtrl-N",
|
Loading
|
Loading
|
@@ -397,7 +388,7 @@ MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) |
397 | 388 | "Sets the style of the first field to sunken look"
|
398 | 389 | );
|
399 | 390 | statbarMenu->Append(StatusBar_SetPaneStyle, "Field style",
|
400 | - statbarPaneStyleMenu);
|
|
391 | + statbarPaneStyleMenu, "Field style choices");
|
|
401 | 392 | |
402 | 393 | statbarMenu->Append(StatusBar_ResetFieldsWidth, "Reset field widths",
|
403 | 394 | "Sets all fields to the same width");
|
Loading
|
Loading
|
@@ -202,12 +202,12 @@ int wxAuiDockArt::GetMetricForWindow(int id, wxWindow* window) |
202 | 202 | bool scale = false;
|
203 | 203 | switch (id)
|
204 | 204 | {
|
205 | - case wxAUI_DOCKART_SASH_SIZE:
|
|
206 | 205 | case wxAUI_DOCKART_PANE_BORDER_SIZE:
|
207 | - // These sizes are typically small values and we don't scale them
|
|
206 | + // The border sizes are typically small and we don't scale them
|
|
208 | 207 | // by default to allow setting them to 1 pixel even in high DPI.
|
209 | 208 | break;
|
210 | 209 | |
210 | + case wxAUI_DOCKART_SASH_SIZE:
|
|
211 | 211 | case wxAUI_DOCKART_CAPTION_SIZE:
|
212 | 212 | case wxAUI_DOCKART_GRIPPER_SIZE:
|
213 | 213 | case wxAUI_DOCKART_PANE_BUTTON_SIZE:
|
Loading
|
Loading
|
@@ -117,7 +117,8 @@ bool wxGenericDirDialog::Create(wxWindow* parent, |
117 | 117 | // 1) dir ctrl
|
118 | 118 | m_dirCtrl = nullptr; // this is necessary, event handler called from
|
119 | 119 | // wxGenericDirCtrl would crash otherwise!
|
120 | - long dirStyle = wxDIRCTRL_DIR_ONLY | wxDEFAULT_CONTROL_BORDER;
|
|
120 | + long dirStyle = wxDIRCTRL_DIR_ONLY |
|
|
121 | + static_cast<long>(wxDEFAULT_CONTROL_BORDER);
|
|
121 | 122 | |
122 | 123 | #ifdef __WXMSW__
|
123 | 124 | if (!HasFlag(wxDD_DIR_MUST_EXIST))
|
Loading
|
Loading
|
@@ -107,11 +107,10 @@ DWORD (WINAPI *SetPreferredAppMode)(DWORD) = nullptr; |
107 | 107 | |
108 | 108 | bool InitDarkMode()
|
109 | 109 | {
|
110 | - // Note: for simplicity, we support dark mode only in Windows 10 v2004
|
|
111 | - // ("20H1", build number 19041) and later, even if, in principle, it could
|
|
112 | - // be supported as far back as v1809 (build 17763) -- but very few people
|
|
113 | - // must still use it by now and so it just doesn't seem to be worth it.
|
|
114 | - if ( !wxCheckOsVersion(10, 0, 19041) )
|
|
110 | + // In theory, dark mode support was added in v1809 (build 17763), so enable
|
|
111 | + // it for all later versions, even though in practice this code has been
|
|
112 | + // mostly tested under v2004 ("20H1", build number 19041) and later ones.
|
|
113 | + if ( !wxCheckOsVersion(10, 0, 17763) )
|
|
115 | 114 | {
|
116 | 115 | wxLogTrace(TRACE_DARKMODE, "Unsupported due to OS version");
|
117 | 116 | return false;
|
Loading
|
Loading
|
@@ -415,6 +414,11 @@ void EnableForTLW(HWND hwnd) |
415 | 414 | return;
|
416 | 415 | |
417 | 416 | BOOL useDarkMode = TRUE;
|
417 | + |
|
418 | + // DWMWA_USE_IMMERSIVE_DARK_MODE is 19 for v1809, but is 20 for later
|
|
419 | + // versions, so to set title bar black for both v1809 and later versions,
|
|
420 | + // we try to call GetDwmSetWindowAttribute() with the current value first,
|
|
421 | + // but if it fails, we also retry with the old one.
|
|
418 | 422 | HRESULT hr = wxDarkModeModule::GetDwmSetWindowAttribute()
|
419 | 423 | (
|
420 | 424 | hwnd,
|
Loading
|
Loading
|
@@ -422,6 +426,16 @@ void EnableForTLW(HWND hwnd) |
422 | 426 | &useDarkMode,
|
423 | 427 | sizeof(useDarkMode)
|
424 | 428 | );
|
429 | + if ( FAILED(hr) )
|
|
430 | + {
|
|
431 | + hr = wxDarkModeModule::GetDwmSetWindowAttribute()
|
|
432 | + (
|
|
433 | + hwnd,
|
|
434 | + 19,
|
|
435 | + &useDarkMode,
|
|
436 | + sizeof(useDarkMode)
|
|
437 | + );
|
|
438 | + }
|
|
425 | 439 | if ( FAILED(hr) )
|
426 | 440 | wxLogApiError("DwmSetWindowAttribute(USE_IMMERSIVE_DARK_MODE)", hr);
|
427 | 441 |
Loading
|
Loading
|
@@ -2475,7 +2475,35 @@ wxWindowMSW::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu) |
2475 | 2475 | item = wxID_NONE;
|
2476 | 2476 | |
2477 | 2477 | wxMenu* menu = MSWFindMenuFromHMENU(hMenu);
|
2478 | - wxMenuItem* menuItem = MSWFindMenuItemFromHMENU(hMenu, item);
|
|
2478 | + |
|
2479 | + // Don't try to look for the menu item if it's not our menu at all, e.g. if
|
|
2480 | + // it's the per-window system menu in MDI applications.
|
|
2481 | + wxMenuItem* menuItem = nullptr;
|
|
2482 | + if ( menu )
|
|
2483 | + {
|
|
2484 | + int pos = 0;
|
|
2485 | + for ( auto& mi : menu->GetMenuItems() )
|
|
2486 | + {
|
|
2487 | + // If there is a normal menu item with the same ID as the position
|
|
2488 | + // of a submenu we give precedence to the normal item, as this
|
|
2489 | + // seems more useful.
|
|
2490 | + if ( mi->GetId() == item )
|
|
2491 | + {
|
|
2492 | + menuItem = mi;
|
|
2493 | + break;
|
|
2494 | + }
|
|
2495 | + |
|
2496 | + // We don't get the ID for submenus, but their position in the
|
|
2497 | + // parent window, so this is how we identify them.
|
|
2498 | + if ( mi->IsSubMenu() && item == pos )
|
|
2499 | + {
|
|
2500 | + menuItem = mi;
|
|
2501 | + break;
|
|
2502 | + }
|
|
2503 | + |
|
2504 | + ++pos;
|
|
2505 | + }
|
|
2506 | + }
|
|
2479 | 2507 | |
2480 | 2508 | wxMenuEvent event(wxEVT_MENU_HIGHLIGHT, item, menu, menuItem);
|
2481 | 2509 | if ( wxMenu::ProcessMenuEvent(menu, event, this) )
|
Loading
|
Loading
|
@@ -2526,37 +2554,6 @@ wxMenu* wxWindowMSW::MSWFindMenuFromHMENU(WXHMENU hMenu) |
2526 | 2554 | return nullptr;
|
2527 | 2555 | }
|
2528 | 2556 | |
2529 | -wxMenuItem* wxWindowMSW::MSWFindMenuItemFromHMENU(WXHMENU hMenu, int item)
|
|
2530 | -{
|
|
2531 | - WinStruct<MENUITEMINFO> mii;
|
|
2532 | - mii.fMask = MIIM_ID | MIIM_DATA; // Include MIIM_DATA to access dwItemData
|
|
2533 | - |
|
2534 | - const int count = ::GetMenuItemCount(hMenu);
|
|
2535 | - for ( int i = 0; i < count; i++ )
|
|
2536 | - {
|
|
2537 | - if ( ::GetMenuItemInfo(hMenu, i, TRUE, &mii) )
|
|
2538 | - {
|
|
2539 | - wxMenuItem* menuItem = (wxMenuItem*)mii.dwItemData;
|
|
2540 | - if ( mii.wID == (unsigned int)item && menuItem )
|
|
2541 | - {
|
|
2542 | - return menuItem;
|
|
2543 | - }
|
|
2544 | - |
|
2545 | - // Check for submenus
|
|
2546 | - if ( mii.hSubMenu )
|
|
2547 | - {
|
|
2548 | - wxMenuItem* foundInSubmenu = MSWFindMenuItemFromHMENU(mii.hSubMenu, item);
|
|
2549 | - if ( foundInSubmenu )
|
|
2550 | - {
|
|
2551 | - return foundInSubmenu;
|
|
2552 | - }
|
|
2553 | - }
|
|
2554 | - }
|
|
2555 | - }
|
|
2556 | - |
|
2557 | - return nullptr; // Not found
|
|
2558 | -}
|
|
2559 | - |
|
2560 | 2557 | #endif // wxUSE_MENUS && !defined(__WXUNIVERSAL__)
|
2561 | 2558 | |
2562 | 2559 | // ===========================================================================
|
Loading
|
Loading
|
@@ -2506,10 +2506,10 @@ static wxSize ParseEnvVarAsSize(const wxString& varname) |
2506 | 2506 | REQUIRE( wxGetEnv(varname, &sizeStr) );
|
2507 | 2507 | |
2508 | 2508 | wxString heightStr;
|
2509 | - unsigned width;
|
|
2509 | + unsigned width = 0;
|
|
2510 | 2510 | REQUIRE( sizeStr.BeforeFirst(',', &heightStr).ToUInt(&width) );
|
2511 | 2511 | |
2512 | - unsigned height;
|
|
2512 | + unsigned height = 0;
|
|
2513 | 2513 | if ( !heightStr.empty() )
|
2514 | 2514 | {
|
2515 | 2515 | REQUIRE( heightStr.ToUInt(&height) );
|
—
View it on GitLab.
You're receiving this email because of your account on gitlab.com. Manage all notifications · Help