Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find way to update versions in About dialog #4

Closed
geoffmcl opened this issue Dec 15, 2017 · 1 comment
Closed

Find way to update versions in About dialog #4

geoffmcl opened this issue Dec 15, 2017 · 1 comment

Comments

@geoffmcl
Copy link
Owner

One way would be to use cmake configure_file to copy a file, or files, substituting version values generated in cmake, from say a version.txt file...

The problem is the Tidy2/VersionAndAbout.rc, and its associated resource.h are encoded in MS Unicode (UTF-16), and it seems cmake does not support this character encoding. And searching around it seems it never will, despite its extensive use by MS Windows...

Additionally, since these files are in UTF-16, with a BOM, github treats the files as binary, thus to update the version strings manually each time would cause full file re-writes in the repository... also a no-no!

But that does not stop the Tidy2.dll generating and setting these dialog text strings, during the creation of the dialog...

Have created a set_vers branch to explore this for Tidy2.dll, and forked notepad-plus-plus, my hnppf.bat, and built with MSVC 14.x64, in a next1 branch, to be able to use MSVC to Debug the Plugins load and setup... and installed npp 64-bit release 7.5.3, my hnpp-7.5.3.bat, to test the new Tidy2.dll... quite a learning curve...

Seems to be working. Still to push these changes...

geoffmcl added a commit that referenced this issue Dec 15, 2017
	modified:   Tidy2/VersionAndAbout.rc
	modified:   Tidy2/resource.h

Added a resource ID to each control in the About dialog so the text can be
changed during dialog setup...

Also updated the versions, but this should be the last time for this since
these two files are in MS Unicode (UTF-16), with a BOM so git treats them
as binary files, with 100% rewrites each time.
@geoffmcl
Copy link
Owner Author

All changes now pushed to branch set-vers...

Now each control in the About dialog has an ID, so the handle for each can be obtained, and the control text updated to show both the Tidy2.dll version/date, exposed through cmake from the version.txt file in the source, and the library tidy version in use by using its APIs, tidyReleaseDate(), and tidyLibraryVersion()...

The libtidy versions presented a small wrinkle, in that this data is returned as ASCII/UTF-8, while the About dialog is in MS Unicode, UTF-16, but this was handled by using the WIN32 API MultiByteToWideChar to convert the strings appropriately...

I have added this dialog text setting code into void AboutDialog::doDialog(), but now see maybe it could have been put in the CALLBACK AboutDialog::run_dlgProc, in the case WM_INITDIALOG:, where I think normally such setup code would reside... but that can wait until next time...

Have now tested this in my fork of notepad-plus-plus github repo, built with MSVC14.x64, an install of release 7.5.3 64-bits notepad++, and my 32-bit install of older v5.9, my day-to-day working notepad++ - note to self - TODO: must get around to updating this, but so far in my usage have found no problems, but...

So this version 2.0.2 of Tidy2.dll, presently only in the set-vers branch, looks to be a good release candidate... will work on that as time permits...

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

No branches or pull requests

1 participant