Commit Graph

39762 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Artur Wieczorek
93318b2628 Use dedicated function to round values 2020-05-24 19:11:22 +02:00
Paul Cornett
2c62ac41c1 Set WM_CLASS class name as app display name
Gnome seems to use it as a fallback display name with X11. By default, it will
be the capitalized program name, which is what GTK would set it to anyway.
2020-05-23 11:14:00 -07:00
Artur Wieczorek
39d586421b Don't call GetSizeFromText() under wxOSX
We cannot use GetSizeFromText() to calculate
numeric box size under wxOSX because this function
calls GetSizeFromTextSize() which is implemented
only in wxMSW and wxGTK.
2020-05-21 22:50:54 +02:00
Vadim Zeitlin
53a35d15bc Merge branch 'dynlib-simplify'
Enhance wxDynamicLibrary error logging and simplify code by not checking
for dlopen() and dlerror() that are always available nowadays.

See https://github.com/wxWidgets/wxWidgets/pull/1849
2020-05-21 02:13:10 +02:00
Artur Wieczorek
6c64f4994e Fix calculation of the size of wxSpinCtrlDouble numeric box
Every time spin control precision, minimal or maximal value changes there
is necessary to adjust numeric box size to the new dimension of displayed
number.

See #18734.
2020-05-20 22:33:10 +02:00
Stefan Csomor
250e211d7f re-adding lost assignement 2020-05-20 07:33:46 +02:00
ali kettab
a3e264e8a3 Make wxSetInputFocusToXWindow a member instead of free function
Also add a couple of workarounds for problems when using Xvfb.

See https://github.com/wxWidgets/wxWidgets/pull/1845
2020-05-20 00:02:40 +02:00
Jouk
e6938de551 Make gtk1.x happy 2020-05-19 15:00:30 +02:00
Stefan Csomor
ced68e3efa switching implementation because of problems under 10.15 2020-05-19 14:15:35 +02:00
wangqr
a06fb27f21 Implement wxSpinCtrl::GetSizeFromTextSize for wxOSX/Cocoa
The value is calculated based on size of wxTextCtrl
2020-05-19 00:24:31 -04:00
wangqr
dad9a02a40 Remeasure magic values for wxTextCtrl's border width on wxOSX/Cocoa
Measured on macOS Catalina. Also implements GetSizeFromTextSize
2020-05-19 00:18:51 -04:00
Artur Wieczorek
c963c60a0f Determine initial wxSpinCtrlDouble precision
For native wxGTK implementation default spin control precision is derived
from the precision of the increment value. Fot the sake of consistency the
same should be done in the generic implementation.

Closes #18764.
2020-05-18 18:52:41 +02:00
wangqr
2f74942eca Improve IME related comments in ScintillaWX 2020-05-14 20:36:05 -04:00
Vadim Zeitlin
a2a3897124 Simplify wxWindowID definition
Define it in wx/defs.h directly instead of conditionally including
wx/windowid.h from there just in order to get this type definition.

This has several advantages:

- wxWindowIDRef is not defined in (maybe) non-GUI code including
  wx/defs.h, as it should be the case for this class defined in
  core library only.
- wx/windowid.h becomes a normal header, including wx/defs.h as
  (almost) all the other ones instead of being exceptional.
- wx/windowid.h doesn't need to be included by wx/utils.h at all
  just to get wxWindowID definition.

Closes https://github.com/wxWidgets/wxWidgets/pull/1850
2020-05-15 00:02:14 +02:00
Vadim Zeitlin
2e6fec3601 Remove unnecessary c_str() call
No real changes.
2020-05-14 23:53:45 +02:00
Vadim Zeitlin
9df975f2a9 Merge branch 'gcc10-cxx20'
Compilation fixes for g++10 in C++20 mode.

See https://github.com/wxWidgets/wxWidgets/pull/1851
2020-05-14 23:50:29 +02:00
ali kettab
59ad9f46e6 Make wxUIActionSimulator works more reliably on GTK/X11
Add wxXSync class which adds delays between the synthesized events
sufficient for them to be processed by the higher layers (X, GTK).

This makes it possible to run the UI tests by default with wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1845
2020-05-15 00:36:00 +02:00
Lauri Nurmi
e289eb07e1 Get rid of non-POSIX code for loading dynlibs on *nix
The alternative, (non-POSIX) shl_xxx() API is/was apparently available on
HP-UX, but even there the POSIX dlxxx() functions have been the preferred
way to load libraries since the past ~20 years.
2020-05-13 10:07:48 +03:00
Lauri Nurmi
c50784ba0b Use the same function for logging dynlib errors on all platforms
Reduces the amount of #ifdefs scattered all over the code, thereby
simplifying the code.

The function was renamed from Error() to ReportError() to emphasize what
its purpose is.

Error messages logged on *nix are now a bit more verbose, as they are
prefixed with our own description text, which were earlier omitted on
platforms using the dlxxx() API.
2020-05-13 10:07:47 +03:00
wangqr
f730da3c14 Add imm32.lib to wxStyledTextCtrl 2020-05-11 00:37:56 -04:00
wangqr
e07640fb75 Forward IME messages to ScintillaWX and handle them
The handling code is copied from ScintillaWin

Closes #18759
2020-05-11 00:37:49 -04:00
Vadim Zeitlin
63626acbe4 Fix std::ostream::operator<<(wxScopedWCharBuffer)
This never worked correctly as using operator<<() with wchar_t pointer
just fell back to the overload for void pointers, i.e. printed out the
address of the wide string, which wasn't especially useful, but with
C++20 it doesn't even compile, as this overload is explicitly deleted.

Fix both problems at once by actually doing something useful for it
instead and printing out data in either current encoding or UTF-8 if
converting it to the current encoding failed.
2020-05-10 23:00:00 +02:00
Vadim Zeitlin
3e724ffa96 Merge branch 'memoryfs-iter' into window-id
Fix bug in wxMemoryFSHandler iteration.

See https://github.com/wxWidgets/wxWidgets/pull/1833
2020-05-09 23:37:14 +02:00
Vadim Zeitlin
d3b9686099 Take number of digits into account in GTK wxSpinCtrlDouble
When determining the entry width in wxSpinCtrlDouble, we need to account
not only for the width of the integer part, but also for the number of
digits that determines the width of the fractional part.

Do it in the overridden version of (now virtual) GtkSetEntryWidth().

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

Closes #18734.
2020-05-09 23:36:25 +02:00
Stefan Csomor
0edda02847 removing register keyword
needed for c++17 compatibility, this file is only used in iOS builds
2020-05-07 10:36:51 +02:00
Vadim Zeitlin
7466681607 Merge branch 'grid-event-delete'
Handle deleting grid rows/columns in event handlers gracefully.

See https://github.com/wxWidgets/wxWidgets/pull/1834
2020-05-06 18:45:16 +02:00
Vadim Zeitlin
6a084e799e Merge branch 'dvc-colsize-vert-scroll'
Fix issues with generic wxDVC last column size when using
wxPersistentDVC.

See https://github.com/wxWidgets/wxWidgets/pull/1832
2020-05-06 18:44:28 +02:00