convert CPlayBoardView to wx#139
Conversation
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.
|
Hi Bill, Great to hear from you again! I see the work and will get through it this week. Thanks! -Dale |
|
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... 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. |
|
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. |
|
Based on your hint, I have updated the batch file. I don't understand what's wrong with |
Good to hear!
Yikes. I haven't run into that, but my machine is ~5 years old.
I'm not thrilled, but when even Notepad++ gets hijacked, I can understand the attraction of "security theatre".
Bizarre.
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. |
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 |
DLLarson
left a comment
There was a problem hiding this comment.
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.
| // 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. |
| // 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. |
| // 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. |
| @@ -1,3 +1,3 @@ | |||
| // VwPrjga1.cpp : Game Project View Support Routines | |||
| // | |||
| // Copyright (c) 1994-2023 By Dale L. Larson & William Su, All Rights Reserved. | |||
| @@ -1,3 +1,3 @@ | |||
| // VwPrjgs1.cpp : Scenario View Support Routines | |||
| // | |||
| // Copyright (c) 1994-2025 By Dale L. Larson & William Su, All Rights Reserved. | |||
| // 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. |
| // 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. |
| // 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. |
| // 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. |
| // 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. |
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 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? |
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.
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 |
I updated a bunch files to copyright 2016.
As far as I know this is ready to merge, but that could change if your testing uncovers bugs I overlooked.
You're welcome |
|
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 |
I have reproduced this, and have found a workaround. I will submit it shortly.
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. |


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