News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

FromDIP need in the wxSmith generated code?

Started by ollydbg, December 05, 2023, 09:09:13 AM

Previous topic - Next topic

ollydbg

Hi, it looks like there are so many monitors which has DPI scaling such as 150% or 200%.

I found that some wxSmith generated GUI works OK in one PC, but works badly on another PC. My guess is that the code generated by wxSmith is not using the FromDIP function call, so it can't handle the DPI issue.

Any ideas?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Miguel Gimenez

#1
A search for FromDIP() in wxSmith returned nothing.

Fortunately, code generation for wxSize and wxPoint is centralized in wxspositionsizeproperty.cpp and wxsdimensionproperty.cpp. On the other side, wxSmith does not use FromDIP() itself, so it must be heavily edited.

Adding the FromDIP() may break existing wxSmith dialogs, but HiDPI in wxwidgets is so new that IMHO they will not be a lot.

EDIT: FromDIP() was added in wx3.1.0, but we still support wx3.0.x for C::B itself and code generated by wxSmith.

ollydbg

OK, I think we can wait until wxSmith drops the wx 3.0 support.  ;)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.