Commit Graph

68603 Commits

Author SHA1 Message Date
Maarten Bent
5166ddea2b Create cursors with correct size when DPI changes
GetIconInfo does not return DPI aware results.
Adjust it to the DPI of the display that shows the cursor.
2020-06-01 16:07:48 +02:00
Vadim Zeitlin
66c8437952 Add notes about standard threading classes to the documentation
There is no reason to use wxMutex and wxCondition in C++11 programs as
they have about the same API as the corresponding standard classes but
are, well, non-standard.

wxThread API is different from std::thread, so it's a less obvious
replacement, but still at least mention the standard class in its
documentation.
2020-06-01 15:10:24 +02:00
Vadim Zeitlin
192e8befb8 Fix example showing wxMutex usage in documentation
Fix wrong use of pointer and wrong variable name.

Closes #18778.
2020-06-01 15:04:45 +02:00
Vadim Zeitlin
123e21c181 Refactor wxGrid::SetOrCalcColumnSizes() and SetOrCalcRowSizes()
Get rid of the unnecessarily complicated functions doing two quite
different things depending on whether their first boolean parameter was
true of false.

Instead, split their body between AutoSize{Columns,Rows}() (which used
to call them) and DoGetBestSize(), keeping just the part needed in each
case.

This is much simpler and even more efficient, as it avoids a completely
unnecessary call to CalcDimensions() and Refresh() from DoGetBestSize(),
which doesn't change the current size at all and so doesn't need to
refresh anything, but previously did it and not only once, but twice,
because both of SetOrCalc{Column,Row}Sizes() did it.
2020-05-31 17:51:12 +02:00
Vadim Zeitlin
eac58e7f87 Simplify wxGrid best size computations
Remove needless subtraction of row/column label size before adding it
back again, as this seems completely unnecessary.

No real changes, this is just a simplification.
2020-05-31 16:12:26 +02:00
Vadim Zeitlin
68feb3e7ff Fix linking monolithic wxMSW DLL after STC IME changes
Link wxMSW monolithic library with imm32.lib as it's not required by
wxscintilla.lib.

This should have been been part of f730da3c14 (Add imm32.lib to
wxStyledTextCtrl, 2020-05-10).

See https://github.com/wxWidgets/wxWidgets/pull/1852

Closes #18776.
2020-05-31 14:33:30 +02:00
Vadim Zeitlin
789c7cec7b Merge branch 'grid-col-row-sel'
Fix returning duplicates from Get{Row,Col}Selection(); add more tests.

See https://github.com/wxWidgets/wxWidgets/pull/1874
2020-05-31 00:43:23 +02:00
Jouk
e59a5d17da Make gtk1.x happy again 2020-05-29 09:16:25 +02:00
Lauri Nurmi
fa16bc05da Test DESELECTED events in both virtual and non-virtual listctrls. 2020-05-28 10:51:58 +03:00
Lauri Nurmi
96b83a1523 Make virtual lists send DESELECTED events consistently on both implementations
In the case when a listctrl is clicked outside of any item, the item is
visually deselected, and it is logical that a DESELECTED is sent.

For non-virtual lists this would happen, but for virtual lists it would
either happen or not happen depending on implementation (MSW/generic)
and mode (single/multi). From now on the DESELECTED event is always sent.
2020-05-28 10:51:58 +03:00
Lauri Nurmi
9d9b0c51c8 A test button to the listctrl sample 2020-05-28 10:51:58 +03:00
Vadim Zeitlin
27495c5484 Merge branch 'textctrl-getsizefromtextsize'
Improve wxTextCtrl and wxSpinCtrl sizing under macOS.

See https://github.com/wxWidgets/wxWidgets/pull/1861
2020-05-28 02:21:35 +02:00
Vadim Zeitlin
316bbd2189 Use the same code in generic wxSpinCtrl in all ports
Use Mac version for the other ports too, instead of the weird hardcoded
numbers introduced back in 40aa1a7e60 (Implement GetSizeFromTextSize()
for wxSpinCtrl., 2012-11-20) which don't make much sense, as they use
vertical text control size to determine the horizontal size of the spin
control.

Do not use the max of spin button height and text control height,
however, as we really want to have the same height as just a normal text
control.
2020-05-28 02:13:43 +02:00
Vadim Zeitlin
8189ce89ed Improve wxTextCtrl::DoGetSizeFromTextSize() in wxOSX
Always return fully initialized wxSize value, even if one of the input
values is unspecified.

Also use TEXTCTRL_BORDER_SIZE to make it slightly more clear what's
going on.
2020-05-28 02:13:43 +02:00
Vadim Zeitlin
43c9b9f658 Use TEXTCTRL_BORDER_SIZE symbolic constant in wxTextCtrl code
This is more readable than hardcoded 5.

No real changes.
2020-05-28 01:34:59 +02:00
Vadim Zeitlin
52eec83245 Merge branch 'pr_fix_macos_hotlight_color' of https://github.com/obfuscated/wxWidgets
Implement wxSYS_COLOUR_HOTLIGHT on macOS.

See https://github.com/wxWidgets/wxWidgets/pull/1841
2020-05-28 01:24:56 +02:00
Vadim Zeitlin
07e36f9bbf Fix error message for failure to load PNG from resources
Remove the extraneous comma which replaced the resource name with the
second part of the error message, resulting in confusing output.

See #18773.
2020-05-27 14:15:15 +02:00
Vadim Zeitlin
5a5ed51528 Merge branch 'aui-repaint-optimize'
Optimize AUI repainting under MSW and always use live resize mode with
GTK3.

See https://github.com/wxWidgets/wxWidgets/pull/1869
2020-05-27 13:40:04 +02:00
Vadim Zeitlin
3307000baa Add wxGrid::GetSelectedRowBlocks() and GetSelectedColBlocks()
These functions are much simpler to use in the application code using
wxGrid in row- or column-only selection mode than GetSelectedBlocks()
itself because they take care of deduplicating, ordering and squashing
together the adjacent ranges, so that the application can use their
results directly, unlike with GetSelectedBlocks().
2020-05-27 03:19:34 +02:00
Tomay
9990d91dfc Fix generated documentation for wxZipEntry::GetInternalName()
Remove the group around it to avoid problems due to the existence of
another overload.

This completes the changes of ca59d38cfd (Add missing static to
wxZipEntry::GetInternalName() documentation, 2020-05-25).

Closes https://github.com/wxWidgets/wxWidgets/pull/1876
2020-05-27 01:46:59 +02:00
Vadim Zeitlin
d48013a322 Disable OpenGL functions deprecation warnings in wxOSX
Don't generate dozens of deprecation warnings (one for each OpenGL
function used in the code) for any program using wxGLCanvas being built
using macOS 10.14 or later SDK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1875
2020-05-27 00:28:21 +02:00
Vadim Zeitlin
445ccb23cc Simplify using wxIntSortedArray in wxGridSelection code
There is no need to specify the comparison function when defining the
variables of this type when we can just specify it once when defining
the array type itself.

No real changes.
2020-05-26 16:37:26 +02:00
Vadim Zeitlin
340a86b3de Use more efficient storage for wxIntSortedArray
As this array contains ints, store them in wxVector<int> instead of
taking twice as much memory (in 64 bit builds) by storing them in
wxVector<void*>.
2020-05-26 16:34:02 +02:00
Vadim Zeitlin
92b6a55fd6 Fix returning duplicates from Get{Row,Col}Selection()
The "unique" rows/columns arrays used in the implementation of these
functions were not unique at all, as we happily added duplicates of the
existing items into them. Fix this by checking that a row/column is not
already present before adding it.

Add a (previously failing) unit test checking that this works correctly
with overlapping selected blocks.
2020-05-26 16:32:05 +02:00
Vadim Zeitlin
f268c02c19 Use "uniqueCols" for an array containing column indices
No real changes, just don't use misleading "Rows" in the name of a
variable containing column indices.
2020-05-26 16:31:34 +02:00
Vadim Zeitlin
f1425dad13 Don't hard code grid lines colour in wxGrid
Use wxSYS_COLOUR_BTNFACE instead of the hardcoded value of this colour
in "Windows Classic" theme, which was probably used back when the commit
73145b0ed1 (Applied patches by Scott Pleiter:, 2002-12-09), which was
supposed to change wxGrid to use system colours (among other things),
was done.

Nowadays wxSYS_COLOUR_BTNFACE is 0xF0F0F0 rather than 0xC0C0C0, which is
quite different visually, but it still seems better to use the system
colour rather than the fixed value, especially for platforms with dark
mode support.

Closes https://github.com/wxWidgets/wxWidgets/pull/1866
2020-05-26 15:11:02 +02:00
Vadim Zeitlin
37b2918c9c Don't consume all 'C'/Insert key presses in wxGrid
Skip the key events other than Ctrl-C/Ins which are used for copying
grid contents to the clipboard, notably Alt-C which should still be
usable for opening the menus.

This fixes a problems introduced in 67c1c412c6 (Implement support for
copying wxGrid cells to clipboard, 2020-04-26), see #13562.
2020-05-26 02:00:18 +02:00
Tomay
ca59d38cfd Add missing static to wxZipEntry::GetInternalName() documentation
Closes https://github.com/wxWidgets/wxWidgets/pull/1872
2020-05-25 22:46:15 +02:00
Vadim Zeitlin
e2562b08a4 Explain that wxApp::OnInitCmdLine() must not call Parse()
Make it clear that this method should only set up the command line
options to recognize, but not actually parse them.

See #18771.
2020-05-25 22:40:11 +02:00
PB
824b36fdc5 Really close the <Import> tag in the comment in wxwidgets.props
Corrects a mistake introduced in a supposed fix in commit a27a7e0,
where the XML-tag-closing slash was wrongly places inside the quotes.

Closes https://github.com/wxWidgets/wxWidgets/pull/1870
2020-05-25 19:12:53 +02:00
Vadim Zeitlin
faea4da8ff Force enable live resizing in wxAUI for GTK 3 too
Do for GTK 3 the same thing as was already done for macOS in 68030cae69
(Added wxAUI_MGR_LIVE_RESIZE flag for live sash sizing, the default on
wxOSX, 2009-01-07) and for the same reasons: sash feedback is simply
invisible with this port and so can't be used.
2020-05-25 18:02:14 +02:00
Vadim Zeitlin
f6727a17a2 Add wxAuiManager::AlwaysUsesLiveResize()
This allows to check if it's worth specifying wxAUI_MGR_LIVE_RESIZE or
not and allows to get rid of the corresponding menu item in the sample
if it doesn't do anything anyhow.
2020-05-25 18:01:09 +02:00
Vadim Zeitlin
4f7eb2b145 Freeze frame using AUI during wxAuiManager::Update() under MSW
Disable unnecessary intermediate repaints and redraw everything at once
at the end when the window is thawed.
2020-05-25 17:52:08 +02:00
Vadim Zeitlin
74bc08535b Replace wxAuiManager_HasLiveResize() hack with normal accessor
For some unknown reason a free function taking "*this" was used instead
of just an accessor. Add the latter to make this code less unusual.
2020-05-25 17:52:08 +02:00
Vadim Zeitlin
758a81bc89 Allow using wxWindowUpdateLocker conditionally
This can be useful if the window needs to be frozen only if some
run-time condition holds true.
2020-05-25 17:52:08 +02:00
Vadim Zeitlin
152f3154be Make wxWindowUpdateLocker ctor explicit
No real changes, just avoid using ctor allowing implicit conversions
when none are desired.
2020-05-25 17:52:08 +02:00
valid-ptr
b9a3d528c0 Remove redundant Repaint() calls in wxAuiManager
There is no need to call Repaint() immediately after calling Update()
which already calls it.
2020-05-25 17:52:08 +02:00
PB
a27a7e084e Close the <Import> tag in the comment in wxwidgets.props
Closes https://github.com/wxWidgets/wxWidgets/pull/1868
2020-05-25 16:19:46 +02:00
Vadim Zeitlin
7338f30167 Document wxDataViewEvent::GetProposedDropIndex()
This method was added back in d3e8d3f271 (Support or disable "insert"
for drag/drop wxDataViewCtrl on OSX, 2018-07-16) but didn't appear in
the documentation at all, so describe it, at least minimally.

See #18167.
2020-05-25 01:52:32 +02:00
Vadim Zeitlin
3dd91d24c2 Slightly simplify proposed drop index determination
No real changes, just reorganize the code in a way that should hopefully
be more clear to understand.
2020-05-25 01:52:32 +02:00
Vadim Zeitlin
60e0e9a8fc Make RefreshDropHint() code slightly shorter and simpler
Use an alias instead of typing the same long m_dropItemInfo.m_row
multiple times.

Remove unnecessary use of std::max().
2020-05-25 01:52:32 +02:00
Vadim Zeitlin
155e2beafd Use symbolic constant instead of hardcoded 15/85%
It's still hardcoded, but now it has a name, which explains what it is
and can be searched for.

No real changes.
2020-05-25 01:52:32 +02:00
Vadim Zeitlin
64374fba59 Use consistent name for Konstantin S. Matveyev in git log
Map the existing emails/user names to a single combination.
2020-05-25 01:48:43 +02:00
valid-ptr
74a60516b9 Respect border styles for text part of generic wxSpinCtrlDouble
Specifying e.g. wxBORDER_NONE for wxSpinCtrlDouble should work, i.e.
remove the border from the wxTextCtrl used by it internally in the
generic version, so add wxBORDER_MASK to the list of styles respected by
this wxTextCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/1864
2020-05-25 01:48:43 +02:00
Vadim Zeitlin
2665c024c8 Merge branch 'cmake-project-version-warning' of https://github.com/MaartenBent/wxWidgets
CMake: set the project version.

See https://github.com/wxWidgets/wxWidgets/pull/1867
2020-05-25 01:34:52 +02:00
Vadim Zeitlin
a087d7c8da Merge branch 'fix-stc-ime' of https://github.com/wangqr/wxWidgets
Fix position of IME in wxSTC in wxMSW.

See https://github.com/wxWidgets/wxWidgets/pull/1852
2020-05-25 01:33:00 +02:00
Vadim Zeitlin
0ce6ce1a8f Merge branch 'wx-props'
Make props file work for builds using any prefix/DLL combinations.

See https://github.com/wxWidgets/wxWidgets/pull/1860
2020-05-25 01:02:16 +02:00
Vadim Zeitlin
56be52b841 Explain in more details how to use wxWidgets.props
Also describe a manual change which needs to be done at the project
level when creating a new empty project in MSVS.
2020-05-25 01:01:57 +02:00
Vadim Zeitlin
7de85d7470 Restore correct best width of wxDatePickerCtrl in MSW
This partially reverts the changes of a98d8448fa (Fix size of
wxDateTimePickerCtrl after DPI change, 2019-01-13) to still use
DTM_GETIDEALSIZE, even if it returns wrong height value after a DPI
change, because it still computes the best width more precisely than we
do and using our code could result in the date being partially truncated
when using some date formats.
2020-05-24 22:47:28 +02:00
Vadim Zeitlin
e9e14063f2 Account for the extra border around the thumb in wxMSW wxSlider
Without the extra margin, part of the thumb was truncated when
wxSL_TICKS was not used, but wxSL_BOTH (which makes the thumb bigger
than without it) was.
2020-05-24 22:47:28 +02:00