It is not necessary (nor beneficial) to derive these classes: wxQtActionGroup,
wxQtAction and wxQtShortcutHandler from wxQtSignalHandler ( which is intended
for use exclusively with wxWindow handlers only ).
We can't rely on file /sys/power/state always existing, so just skip the
test (with a warning) instead of failing it if it does not exist, as is
the case at least under s390x and seemingly other non-desktop platforms.
Closes#24197.
Co-authored-by: Cliff Zhao <qzhao@suse.com>
Add the errors logged by various file functions called from this
function to the returned error message instead of letting wxLog show
them as usual because it may be necessary to show an interactive message
box, asking the user about the action to take, if migrating the existing
file failed, and it is poor UI to show both the message box from wxLog
and this message box at the same time -- so avoid showing the former.
Instead of deferring creation of wxPropertyGrid and other controls
to EVT_SIZE handler we can create them when wxPropertyGridManager
is created and its initial size is known.
This way we can avoid using a trick with magic number used as a flag
to determine when to create all controls in OnResize().
Closes#24171.
Passing window size divided by "scale" to CreateWithDIPSize() was wrong
as the resulting bitmap could be too small to cover the entire window
due to rounding errors, e.g. at 200% DPI the right and bottom row/column
was never drawn on if the window size in the corresponding direction was
odd.
This notably fixes their (dis)appearance in dark mode, where we always
draw them ourselves (otherwise we mostly only do it when using
non-default colour).
This was supposed to be "common part of all ctors" but there is just a
single ctor in this class and even this one doesn't really need to call
Bind(), which was the only thing done in Init() since the last commit,
as it can, and should be, called by Create() after successfully creating
the window instead.
No real changes, just a simplification.
Make memory leaks, such as the one fixed by the previous commit,
impossible by making a smart pointer instead of a raw one for this
object.
No real changes.
The pointer may have been already allocated when the code initializing
it in Create() when using dark mode is executed, so unconditionally
reassigning to it leaked memory.
Use the compiler default C++ dialect if it is C++11 or higher and only
explicitly request C++11 if the compiler can't compile a small test
using C++11 features by default.
This prevents from unnecessarily adding -std=c++11 to the compiler flags
under Unix, even with compilers using e.g. C++17 by default.
Unary minus of wxPoint and multiplication with double are implemented
but undocumented. Many of operators that use integers types other
than int remain undocumented though.
The arithmetic operators for wxPoint and wxRealPoint are quite
repetitive and were made by copy-paste from the wxSize operators.
Because of that, some of the names are a bit misleading which this
commit changes. The changes are:
1. replace s/sz with p/pt for point variables (likely 's' comes from
copied code used for wxSize variables)
2. replace 'i' with 'f' for floating point types (likely 'i' comes
from copied code used for integer types)
3. replace 'factor' with 'divisor' for division operations (factors
are the multiplication operands, not division)