Skip to content

convert CPlayBoardView to wx#139

Merged
DLLarson merged 80 commits intoCyberBoardPBEM:masterfrom
wsu-cb:wx-vwpbrd
Mar 29, 2026
Merged

convert CPlayBoardView to wx#139
DLLarson merged 80 commits intoCyberBoardPBEM:masterfrom
wsu-cb:wx-vwpbrd

Conversation

@wsu-cb
Copy link
Copy Markdown
Contributor

@wsu-cb wsu-cb commented Mar 21, 2026

I haven't given up working on CyberBoard; it just took a lot of work to convert CPlayBoardView to wxWidgets. Unfortunately, correspondingly, this is a very large Pull Request. One reason this is so large is that, after converting CPlayBoardView, I found that it was impossible to play a game because I couldn't use the MFC Marker and Piece palettes with the wx CPlayBoardView, so I also converted those palettes in this PR.

wsu-cb added 30 commits March 18, 2026 22:34
wxTipWindow fixes
wxScrolled<> improvements
MFC default -1 means unlimited width
(https://learn.microsoft.com/en-us/windows/win32/controls/ttm-setmaxtipwidth),
but wxWidgets interprets -1 as -1.  For compatibility with CB3.1,
convert -1 to max int when passing to wx.
the tile palette works now, so tile tool can as well
Closing palettes may trigger repaints of other palettes, so
close palettes before deleting data members
CB::ToolTip:  tool rect should be non-empty
MFC manages doc/frame/view objects, so split CTinyBoardView into a
parent window that MFC can manage and a child window that has the
main implementation.  That way we can convert the main
implementation to wx while still letting MFC's doc/frame/view
code work.
MFC manages doc/frame/view objects, so split CSelectedPieceView into a
parent window that MFC can manage and a child window that has the
main implementation.  That way we can convert the main
implementation to wx while still letting MFC's doc/frame/view
code work.
@wsu-cb wsu-cb requested a review from DLLarson March 21, 2026 21:36
@DLLarson
Copy link
Copy Markdown
Member

Hi Bill, Great to hear from you again!

I see the work and will get through it this week.

Thanks!

-Dale

@DLLarson
Copy link
Copy Markdown
Member

Hi Bill,

I did a full clone of the code and attempted a build using the README's instructions (it's been a while!) and I got a breaking message...

Make Error at CMakeLists.txt:3 (cmake_minimum_required):
  Compatibility with CMake < 3.5 has been removed from CMake.

  Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
  to tell CMake that the project requires at least <min> but has been updated
  to work with policies introduced by <max> or earlier.

  Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

Note that I had to reinstall VS because a couple months ago my Windows was unbootable after a driver install. Windows required a full reinstall. My VS may not be the same as yours. But I installed what MSoft had available for the community version.

@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 23, 2026

I am still using MSVS 2022, and I suspect your recent download is MSVS 2026. I updated the CMake version specification to match what wxWidgets is using. Please see if that solves your problem.

@DLLarson
Copy link
Copy Markdown
Member

That worked. Thanks!

The next step failed:

D:\Dev\CBoard\G\cbwindows>cmake --build out/build/x64-Debug
ninja: error: 'GHelp/CBoard.chm', needed by 'GHelp/CMakeFiles/CBHelp', missing and no known rule to make it

D:\Dev\CBoard\G\cbwindows>

The batch file fails as well because it's trying to define the path to VS 2022.

I changed the test for VS to look like this and it got past that problem but still fails with the error shown above:

call %VSROOTDIR%"\2022\Community\VC\Auxiliary\Build\vcvars64.bat"
if errorlevel 1 (
   call %VSROOTDIR%"\18\Community\VC\Auxiliary\Build\vcvars64.bat"
   if errorlevel 1 goto fail_vc_x64
)
echo on

You're right about the VS version. They also renamed the VS command console (x64 Native Tools Command Prompt for VS 2022) shortcuts to drop the VS version. So the README will need to be changed.

An aside...

They are sure pushing the Copilot stuff! It's all over the VS UI now. The first line in the Copilot panel:

image

At least they're upfront about it.

-Dale

@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 24, 2026

Based on your hint, I have updated the batch file.

I don't understand what's wrong with GHelp/CBoard.chm, but let's see if ba64557 helps.

@DLLarson
Copy link
Copy Markdown
Member

That fixed both forms of command line builds. Thank you!

You'll enjoy this...Here's what I get when I run the app:

image

Following the "Learn More" link:

https://support.microsoft.com/en-us/windows/smart-app-control-frequently-asked-questions-285ea03d-fa88-4d56-882e-6698afdb7003#bkmk_unknown

When you try to run an app on Windows, Smart App Control will check to see if our 
intelligent cloud-powered security service can make a confident prediction about 
its safety. If the service believes the app to be safe, Smart App Control will let 
it run. If the app is believed to be malicious or potentially unwanted, then 
Smart App Control will block it.

If the security service is unable to make a confident prediction about the app, then 
Smart App Control checks to see if the app has a valid signature. If the app has 
a valid signature, Smart App Control will let it run. If the app is unsigned, or 
the signature is invalid, Smart App Control will consider it untrusted and block 
it for your protection.

Remember I said I did a fresh install of Windows? Well this is why that matters:

Smart App Control is only available on clean installs of Windows 11. Also, there 
are other reasons why Smart App Control could be turned off.

I fear we'll get this thing ready and M$ will block it for folks who have nice shiny new installs. They're trying to force code signing down people's throats.

I turned the "feature" off so I can do some work. The way I read it, it should never allow itself to be turned back on again but a registry tweak can turn on.

The weird thing is it allowed the CBPlay app to run without issue but CBDesign is rejected and not allowed to run. Both were debug builds.

Oh, well... Forward we go.

@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 24, 2026

That fixed both forms of command line builds. Thank you!

Good to hear!

When you try to run an app on Windows, Smart App Control will check to see if our 
intelligent cloud-powered security service can make a confident prediction about 
its safety. If the service believes the app to be safe, Smart App Control will let 
it run. If the app is believed to be malicious or potentially unwanted, then 
Smart App Control will block it.

Yikes. I haven't run into that, but my machine is ~5 years old.

I fear we'll get this thing ready and M$ will block it for folks who have nice shiny new installs. They're trying to force code signing down people's throats.

I'm not thrilled, but when even Notepad++ gets hijacked, I can understand the attraction of "security theatre".

The weird thing is it allowed the CBPlay app to run without issue but CBDesign is rejected and not allowed to run. Both were debug builds.

Bizarre.

Oh, well... Forward we go.

And code signing certificates have recently been limited to validity periods of ~15 months, so in practice they need to be updated annually. Nevertheless, it looks like we will have to go down that path eventually if CB is to continue as a viable project.

@DLLarson
Copy link
Copy Markdown
Member

I'm not thrilled, but when even Notepad++ gets hijacked, I can understand the attraction of "security theatre".

I use Notepad++ all the time. I hadn't heard about this. Quite a hack...

https://notepad-plus-plus.org/news/hijacked-incident-info-update/

Pretty sophisticated stuff! Thanks for bringing it up.

Oh... The FCC just banned all new foreign wireless routers:

https://www.fcc.gov/document/fcc-updates-covered-list-include-foreign-made-consumer-routers

Just because suddenly they say they are a threat. Truth is all this stuff is a threat. Always has been. US hardware is no better...Oh wait...There are no consumer router manufacturers in the US. So now we can't have the newest secure hardware. We gotta trust the old stuff which they already said is a risk. A pretty bonkers policy.

Oh well... Time to get back to the PR.

-Dale

Copy link
Copy Markdown
Member

@DLLarson DLLarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a large set of changes. Many are access changes (ref vs ptr vs...) but there is a lot of logic mapped to the wx equivalent calls. I hope this is an accurate assessment of what I see.

I gave the code a cursory review. It's pretty large and as such, very tough to detect logic issues and the like. I did put in a bunch of notes to make the Copyrights 2026. I think if a module has a code change it should update the (C). I probably missed a bunch of these since the deltas may not show the copyright. I'm still need to run the code with various text gameboxes, etc. for a sanity check.

Comment thread GP/LBoxSlct.h Outdated
// LBoxSlct.h
//
// Copyright (c) 1994-2020 By Dale L. Larson, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026?

Comment thread GP/SelOPlay.h Outdated
// in concert with the selection tool.
//
// Copyright (c) 1994-2020 By Dale L. Larson, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GP/ToolPlay.h Outdated
// ToolPlay.h
//
// Copyright (c) 1994-2020 By Dale L. Larson, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GP/VwPrjga1.cpp
@@ -1,3 +1,3 @@
// VwPrjga1.cpp : Game Project View Support Routines
//
// Copyright (c) 1994-2023 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GP/VwPrjgs1.cpp
@@ -1,3 +1,3 @@
// VwPrjgs1.cpp : Scenario View Support Routines
//
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GP/VwTbrd.h Outdated
// VwTbrd.h : header file
//
// Copyright (c) 1994-2020 By Dale L. Larson, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GShr/LBoxGfx2.cpp Outdated
// LBoxGfx2.cpp
//
// Copyright (c) 1994-2023 By Dale L. Larson & William Su, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GShr/LBoxGfx2.h Outdated
// LBoxGfx2.h
//
// Copyright (c) 1994-2020 By Dale L. Larson, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GShr/LBoxTileBase2.cpp
// listbox functions.
//
// Copyright (c) 1994-2023 By Dale L. Larson & William Su, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

Comment thread GP/VwTbrd.cpp Outdated
// VwTbrd.cpp : Small scale playing board view.
//
// Copyright (c) 1994-2023 By Dale L. Larson & William Su, All Rights Reserved.
// Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2026

@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 26, 2026

This is a large set of changes. Many are access changes (ref vs ptr vs...) but there is a lot of logic mapped to the wx equivalent calls. I hope this is an accurate assessment of what I see.

This work spanned several months, so I don't remember it all, but I think it is largely true that the code is mostly relatively straightforward changes. The autoscrolling is now almost entirely managed by wxWidgets, not CB. (I actually made some wx submissions to make the autoscrolling suitable, but what wx originally provided was good enough that I thought improving it was better than converting the CB-specific autoscroll code.)

I gave the code a cursory review. It's pretty large and as such, very tough to detect logic issues and the like. I did put in a bunch of notes to make the Copyrights 2026. I think if a module has a code change it should update the (C).

I tried to update the file copyrights when I worked on them. I won't swear I that I didn't miss any, but, as stated above, this work spanned several months, so some of these files were in fact last modified in 2025, not 2026. Or are you saying the merge date, not the commit date, is what should be represented by the copyright?

@DLLarson
Copy link
Copy Markdown
Member

DLLarson commented Mar 26, 2026

The autoscrolling is now almost entirely managed by wxWidgets, not CB. (I actually made some wx submissions to make the autoscrolling suitable, but what wx originally provided was good enough that I thought improving it was better than converting the CB-specific autoscroll code.)

Very cool! The CB code actually started life in Win16 (Borland C++ w/OWL) days so lots of stuff had to be hand rolled then to just work or for other performance issues.

For example all the specialized font redundancy handling was because Win16 was very slow realizing fonts in the early days plus you couldn't have tons of HFONT's laying around. So it maintained a single font realization (logical font -> rendering font) per font instance. It was modeled on Windows atom strings where a single string was registered as an atom and an atom's handle was passed around for speed. DDE is full of those. That wouldn't be an issue in current times. Win16 memory was cramped plus CPU's were so much slower.

Or are you saying the merge date, not the commit date, is what should be represented by the copyright?

Yes. I'm looking at it from the perspective of when it was merged. I think this is when it was published. I believe the law says it was copyrighted upon creation. But my way of thinking it is that a book writer doesn't copyright the text as each page is written or edited but when it was made available for outside consumption.

It's not a huge deal either way but just something that I noticed. I pretty much figured that you updated them at the moment you edited them and time passed into the new year.

Regardless, I'll merge when you give a thumbs up and I give the code some run time.

Thanks for all your work!

-Dale

@wsu-cb wsu-cb marked this pull request as draft March 26, 2026 22:29
@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 27, 2026

Yes. I'm looking at it from the perspective of when it was merged. I think this is when it was published. I believe the law says it was copyrighted upon creation. But my way of thinking it is that a book writer doesn't copyright the text as each page is written or edited but when it was made available for outside consumption.

It's not a huge deal either way but just something that I noticed. I pretty much figured that you updated them at the moment you edited them and time passed into the new year.

I updated a bunch files to copyright 2016.

Regardless, I'll merge when you give a thumbs up and I give the code some run time.

As far as I know this is ready to merge, but that could change if your testing uncovers bugs I overlooked.

Thanks for all your work!

You're welcome

@wsu-cb wsu-cb marked this pull request as ready for review March 27, 2026 00:36
@DLLarson
Copy link
Copy Markdown
Member

DLLarson commented Mar 29, 2026

Hi Bill,

I've run both CBDesign and CBPlay (which still has the old look with views that are properly scaled) and both run nicely. The only odd artifact I observed is double repaints of the board view in CBDesign. This is very visible with complex boards like PoG with lots of rendered graphical elements. The board is drawn, then erased, and re-rendered.

An easy way to see this to tab away to the project page and then reselect the board tab.

The palettes operate very cleanly and look great. In fact the whole CBDesign program looks very crisp. The only issues (other the double renders mentioned above) are what we already know--the HighDPI view and tiles stuff.

I also did discover that if I change the display scaling after running CBDesign and rerun the program the UI sizes of some stuff is wonky. I have to delete the registry settings to get it to look right. So some display scaling information is being stored in the program's registry.

I'm going to merge.

Thanks again for the great work. CBDesign is really starting to feel polished!

-Dale

Copy link
Copy Markdown
Member

@DLLarson DLLarson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ready to rock...

@DLLarson DLLarson merged commit b28178f into CyberBoardPBEM:master Mar 29, 2026
5 of 12 checks passed
@wsu-cb
Copy link
Copy Markdown
Contributor Author

wsu-cb commented Mar 31, 2026

The only odd artifact I observed is double repaints of the board view in CBDesign. This is very visible with complex boards like PoG with lots of rendered graphical elements. The board is drawn, then erased, and re-rendered.

An easy way to see this to tab away to the project page and then reselect the board tab.

I have reproduced this, and have found a workaround. I will submit it shortly.

Thanks again for the great work. CBDesign is really starting to feel polished!

I did fix a couple CBDesign bugs in this PR, but I want to double-check that you understood that this PR mainly affects CBPlay.

@DLLarson
Copy link
Copy Markdown
Member

I did fix a couple CBDesign bugs in this PR, but I want to double-check that you understood that this PR mainly affects CBPlay.

Actually I did miss that part. Thanks for pointing that out. I did exercise the CBPlay program as well--including stepping through some move histories--but saw the whole PR as more spread out file-wise once I started looking through it. No matter.

As bonus we discovered and corrected some issues with using the current Visual Studio Community drop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants