Commit graph

75704 commits

Author SHA1 Message Date
ali kettab
05ebdb7ebd Emphasize that wxQtSignalHandler is for wxWindow handlers only under wxQt
There is no change in behaviour because this has already been the case since its inception.
2024-01-14 14:23:41 +01:00
ali kettab
90d56e52a3 Fix creating wxMenuItem with nullptr parent under wxQt
This is documented and is already the case for the other ports.
2024-01-14 14:23:41 +01:00
ali kettab
03ad7039d6 Don't expose implementation only class to public under wxQt
No real changes
2024-01-11 23:42:36 +01:00
ali kettab
4682d5606d Stop deriving some internal classes from wxQtSignalHandler under wxQt
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 ).
2024-01-11 23:42:36 +01:00
Vadim Zeitlin
5dac42edc0 Merge branch 'datetime-f-fmt'
Add support for %F (ISO 8601 date) format specifier to wxDateTime.

See #24175.
2024-01-10 18:44:30 +01:00
Vadim Zeitlin
afc635f845 Merge branch 'aui-repaint'
Fix some wxAUI repaint problems and switch to using live resize
everywhere by default.

See #24166.
2024-01-10 18:43:24 +01:00
Vadim Zeitlin
4f666c227a Merge branches 'aui-close-on-all-fix', 'aui-current-after-drag', 'aui-hint', 'aui-tbar-realize' and 'aui-book-rm-current'
Merge miscellaneous AUI fixes and improvements.

See #24159, #24160, #24161, #24164, #24184.
2024-01-10 18:39:41 +01:00
Vadim Zeitlin
78a8da7142 Fix a typo in comment in wxGCDC::DoStretchBlit()
No real changes.
2024-01-10 18:15:47 +01:00
Vadim Zeitlin
340bbea71d Remove irrelevant mentions of encoding from wxXmlDocument docs
The corresponding parameter was removed in cc8fbeed56 (Merge branch
'xml-conv-simplify', 2024-01-07) but it was still mentioned in the
description.
2024-01-10 18:07:36 +01:00
mcorino
c1b7ce5932 Fix typing error in interface def.
missing whitespace between arg type and name
2024-01-10 17:56:08 +01:00
Vadim Zeitlin
8967bed190 Merge branch 'log-collect'
Add wxLogCollector helper and use it to improve error reporting in
wxFileConfig::MigrateLocalFile().

See #24194.
2024-01-09 02:42:20 +01:00
Vadim Zeitlin
e2cc16ef9c Fix test suite on Linux/s390x and maybe other architectures
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>
2024-01-09 02:38:43 +01:00
Vadim Zeitlin
e717ac5a86 Return more detailed errors from wxFileConfig::MigrateLocalFile()
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.
2024-01-07 22:44:09 +01:00
Vadim Zeitlin
4fc2281286 Add wxLogCollector
This class is more convenient than wxLogBuffer that it uses and can be
used to collect all the logged messages in a string during its lifetime.
2024-01-07 22:43:55 +01:00
Vadim Zeitlin
2566a1abf5 Add wxLogFormatterNone
This trivial class allows to easily disable all log formatting,
including time stamping and level-dependent prefixes.
2024-01-07 22:31:52 +01:00
Vadim Zeitlin
30dd7e9095 Add wxLogBuffer::Clear()
This can be used to prevent the log buffer contents from being flushed
when replacing it with another logger, which is typically undesirable.
2024-01-07 22:12:52 +01:00
Vadim Zeitlin
e38a61a09b Merge branch 'cmake-cxx-std'
Improve C++ standard handling in CMake.

See #24188.
2024-01-07 16:14:53 +01:00
Vadim Zeitlin
b294a6b2bc Merge branch 'config-xdg'
Make it easier to use wxFileConfig in XDG-compliant way.

See #24180.
2024-01-07 16:13:15 +01:00
Vadim Zeitlin
cc8fbeed56 Merge branch 'xml-conv-simplify'
Simplify and modernize wxXmlDocument code.

See #24179.
2024-01-07 16:12:31 +01:00
Vadim Zeitlin
d36fd5822d Add MSVS 2022 solutions files for building tests
They're almost identical to MSVS 2019 ones but still convenient to have.
2024-01-07 00:43:48 +01:00
Vadim Zeitlin
cfdfd14c59 Improve frame size in the listctrl sample
Make it bigger on high DPI displays and smaller on normal ones.
2024-01-07 00:35:39 +01:00
Artur Wieczorek
dc627da250 Use std::array instead of raw array in wxCursorProperty 2024-01-06 22:43:28 +01:00
Artur Wieczorek
084d70fbe2 Use std::array instead of raw array in wxFontProperty 2024-01-06 22:43:22 +01:00
Artur Wieczorek
8095672309 Use std::array instead of raw array in wxSystemColourProperty 2024-01-06 22:43:16 +01:00
Artur Wieczorek
080b778d17 Use std::array instead of raw array in wxColourProperty 2024-01-06 22:43:11 +01:00
Artur Wieczorek
72a909c971 Use std::array instead of raw array in wxUIntProperty 2024-01-06 22:43:06 +01:00
Artur Wieczorek
e2dcdb275b Use wxString() rather than wxEmptyString in propgrid sample 2024-01-06 22:43:01 +01:00
Artur Wieczorek
efa2870cb4 Rename wxPGKeyboardActions type to wxPGKeyboardAction
For regular enumeration singular name is more appropriate.
2024-01-06 22:42:55 +01:00
Artur Wieczorek
3cb3d62212 Use enum class to represent NumericType
This is for better type safety.
2024-01-06 22:42:49 +01:00
Artur Wieczorek
e7ab6a6d53 Use enum class to represent wxPGNumericValidationConstants
This is for better type safety.
2024-01-06 22:42:43 +01:00
Artur Wieczorek
ca3acd7a03 Use enum class to implement wxPGPropValFormatFlags as bitmask
This is for better type safety of the flags.
2024-01-06 22:42:38 +01:00
Artur Wieczorek
031435bd39 Use dedicated function to obtain decimal separator in propgrid sample 2024-01-06 22:42:30 +01:00
Artur Wieczorek
b681a80b96 Explicitly create all sub-controls in wxPropertyGridManager::Create()
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.
2024-01-06 22:42:23 +01:00
Vadim Zeitlin
94252d84b1 Merge branch 'msw-fix-hdr-memleak'
Fix memory leak in wxMSWHeaderCtrl in dark mode and some cleanup.

See #24192.
2024-01-06 17:40:01 +01:00
Vadim Zeitlin
97468661c7 Fix drawing right and bottom wxMSW wxStaticBox edges in high DPI
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).
2024-01-06 17:36:29 +01:00
Vadim Zeitlin
a3fc9283f7 Remove useless wxMSWHeaderCtrl::Init()
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.
2024-01-06 15:35:50 +01:00
Vadim Zeitlin
735fe67182 Initialize wxMSWHeaderCtrl members in their declarations
No real changes, just prefer initializing members directly when
declaring them instead of doing it in a separate Init() function.
2024-01-06 15:35:50 +01:00
Vadim Zeitlin
c1754d4033 Also use std::unique_ptr<wxImageList> instead of raw pointer
Similar to the previous commit and done for consistency and safety.
2024-01-06 15:35:50 +01:00
Vadim Zeitlin
069ffbeaff Use std::unique_ptr<wxMSWHeaderCtrlCustomDraw> and not raw pointer
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.
2024-01-06 15:35:50 +01:00
Vadim Zeitlin
9d21630069 Don't leak wxMSWHeaderCtrlCustomDraw in dark mode
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.
2024-01-06 15:35:50 +01:00
Vadim Zeitlin
3b06ab65ff Don't set CMAKE_CXX_STANDARD to 11 by default
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.
2024-01-06 13:59:09 +01:00
Vadim Zeitlin
e97d27165a Merge branch 'point-cleanup-and-new-operators'
Clean up wxPoint and wxRealPoint arithmetic operators: add missing ones,
fix parameter names,

See #24191.
2024-01-05 19:35:48 +01:00
David Miguel Susano Pinto
68bef2fbf3 Add compound operators * and / to wxPoint and wxRealPoint
Also add unit tests for them as well as for the existing additive
compound operators.
2024-01-05 19:34:43 +01:00
David Miguel Susano Pinto
1300c56f0d Put wxRealPoint operators in the same order as wxPoint ones 2024-01-05 19:31:14 +01:00
David Miguel Susano Pinto
11c3034177 Implement unary minus for wxRealPoint, same as wxPoint. 2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
b9b0cce41b include/wx/gdicmn.h: reorder to match the order in interface/wx/gdicmn.h. 2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
8638db50da Document a series of undocumented wxPoint and wxRealPoint operators.
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.
2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
66e7d0bce8 Implement + and - between wxRealPoint and wxSize.
These operators are part of the documented interface for wxRealPoint
but were never implemented.  This commit implements them.
2024-01-05 12:44:11 +00:00
David Miguel Susano Pinto
8ccbd7e95d Implement operator/=(int) and operator*=(int) for wxPoint and wxRealPoint.
These operators are part of the documented interface but were never
implemented.  This commit implements them.
2024-01-05 12:43:57 +00:00
David Miguel Susano Pinto
9a5d2ffade Correct names of variables in wxPoint and wxRealPoint arithmetic operators.
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)
2024-01-05 11:28:11 +00:00