Commit Graph

68241 Commits

Author SHA1 Message Date
Vadim Zeitlin
13b6b9ef18 Merge branch 'd2d-drawbitmap' of https://github.com/MaartenBent/wxWidgets
Fix DrawBitmap() in Direct2D renderer to resize the bitmap if necessary.

See https://github.com/wxWidgets/wxWidgets/pull/1752
2020-03-11 23:20:56 +01:00
Yuri D'Elia
f9b793f8d1 Check for valid entry in wxTextEntry::EnableTextChangedEvents()
GetTextObject() might return null, e.g. it does it for read-only
wxBitmapComboBox, so EnableTextChangedEvents() must account for this
possibility, as it's not really possible to avoid calling it in this
case, as it's called indirectly from e.g. SetSelection().

Check that the entry is valid before enabling or disabling events for it
to avoid several GLib assertion failures every time when e.g.
wxBitmapComboBox::SetValue() is called.

Closes https://github.com/wxWidgets/wxWidgets/pull/1756
2020-03-11 22:30:55 +01:00
Vadim Zeitlin
d60f5484a9 Turn off a wxGrid sub-test on AppVeyor
Somehow emulating the column resizing doesn't work there, even though it
works perfectly reliably locally. This might be due to some display
optimization options used in this environment, but it's difficult to
debug what's going on there, so just disable the test when running under
AppVeyor for now.
2020-03-11 22:00:11 +01:00
Vadim Zeitlin
8b2237cd2d Make row/column drag-resizing in wxGrid "live"
Update the column width immediately, as it's being dragged, instead of
drawing a temporary line showing the new column boundary using wxINVERT.

This results in better user experience, as it the effect of changing the
column width can be immediately seen (especially important for non-left
aligned columns or columns using ellipsizition) and, equally if not more
importantly, fixes wxGrid drag-resize not showing any visible UI at all
with wxGTK3 and wxOSX where wxINVERT is not implemented.
2020-03-11 22:00:01 +01:00
Vadim Zeitlin
3d1de5c31b Make interface between wxGridHeaderCtrl and wxGrid more explicit
Rename the functions used from wxGridHeaderCtrl event handlers to start
with DoHeader prefix to make it clear that they're (only) used by it in
an attempt to make things more clear and more uniform.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
5986584fc0 Fix position in dummy wxMouseEvent used by wxGridHeaderCtrl
This probably doesn't matter much, but use the correct mouse position in
this event, expressed in wxGrid coordinate system instead of using
screen coordinates.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
52b7267aac Add wxGrid::m_dragMoveCol field separate from m_dragRowOrCol
Don't reuse the same m_dragRowOrCol variable for both the index of the
row or column being drag-resized and for the index of the column being
drag-moved. Reusing it was confusing and made it more difficult what the
code was doing and what invariants were preserved in it, and just wasn't
worth saving a few bytes per wxGrid object.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
05c5891bf6 Slightly simplify wxGrid refresh logic
Use new ShouldRefresh() helper instead of testing for !GetBatchCount()
before calling Refresh().

Also check for GetBatchCount() inside CalcDimensions() itself, which
means that it can now be called unconditionally.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
586d0e6ee6 Make wxGrid::GetBatchCount() const
There is really no reason for this simple accessor not to be const.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
15de1a4cf4 Optimize refresh when resizing grid rows or columns
This avoids visible flickering of column/row labels when row/column is
interactively resized.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
a004b8ba24 Remove unnecessary Refresh() from wxGrid::DoEndDragResizeLine()
The grid is completely refreshed by the call to SetLineSize(), so doing
it again here is completely unnecessary.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
ebbadae09a Double buffer wxGridWindow drawing
This eliminates noticeable flicker under MSW when changing selection,
for example.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
c2b0edefbd Also remove unused wxGrid wxEVT_ERASE_BACKGROUND handler
It is never used anyhow, as wxGrid is entirely covered by its children
windows.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
e671386d1a Use wxBG_STYLE_PAINT for wxGridWindow
This is more explicit, efficient and simpler than defining an empty
wxEVT_ERASE_BACKGROUND handler, which is not needed any longer.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
a5807b8fcf Remove unnecessary wxGrid::OnPaint()
This method was explicitly defined to do nothing, so just remove it.

No real changes.
2020-03-11 21:59:15 +01:00
Vadim Zeitlin
b08b697665 Merge branch 'grid-tests-refactor'
Refactor wxGrid tests to make it easier to run individual ones.

See https://github.com/wxWidgets/wxWidgets/pull/1759
2020-03-11 21:56:29 +01:00
Maarten Bent
977e9df630 Add test case for wxGraphicsContext DrawBitmap
Test if the bitmap is scaled correctly.
2020-03-11 20:00:09 +01:00
Vadim Zeitlin
9203f685ee Check the expected WebView2 interface is defined
This results in a single intelligible error instead of a hundred of less
clear ones in case our code is compiled against an out of date SDK
version.

There doesn't seem to be any way to check the version directly, so just
check that the interface which hadn't been defined in the previous
version is defined now to check for it indirectly.
2020-03-11 19:26:39 +01:00
Vadim Zeitlin
702ba58590 Replace legacy CppUnit assertions with CATCH ones in grid test
Get rid of compatibility macros and use CATCH macros directly.

Also remove the now unnecessary casts.
2020-03-11 18:42:14 +01:00
Vadim Zeitlin
29d890867c Rewrite grid unit tests to use individual test cases
Instead of using a single test case, with multiple sections, generated
by CppUnit compatibility macros, use multiple independent test cases.

This makes it more convenient to run individual tests, simplifies the
code and allows to get rid of ugly "pseudo tests".
2020-03-11 18:41:16 +01:00
Vadim Zeitlin
8802657490 Add wxGrid::IsUsingNativeHeader()
It is convenient to have this function if only in order to be able to
call GetGridColHeader() safely, i.e. without triggering an assert if
native header is not being used.
2020-03-11 18:41:16 +01:00
Anton Triest
e1dcfc73d1 Don't show selected tree item when using multiple selection
This is appropriate for single selection, where the selected item is
also always the focused one, but not in the multiple selection case.

And wxMSW native version already behaves like this, so this makes the
generic one consistent with it.

Closes #18691.
2020-03-11 00:01:47 +01:00
Vadim Zeitlin
95b1f7b7ea Document wxAuiToolBar::DeleteTool() and DeleteByIndex()
The behaviour of these functions for the tools containing controls is
counter-intuitive but changing it now would silently break existing code
working around the current semantics, so just document it instead.

See #16552.
2020-03-10 23:34:06 +01:00
Vadim Zeitlin
931f4b8d20 Rename local variable in wxAUI to not have "m_" prefix
This was just confusing, as only member variables are supposed to use
this prefix.

No real changes.
2020-03-10 23:18:48 +01:00
Vadim Zeitlin
ec36eb990b Avoid code duplication in wxAuiToolBar::DeleteTool()
Delegate to the existing DeleteByIndex() instead of repeating its code
in DeleteTool().

No real changes, this is just a refactoring.
2020-03-10 22:32:05 +01:00
Maarten Bent
38008cd8d5 Add macro to compare colours in bitmap test suite 2020-03-10 21:04:15 +01:00
Maarten Bent
c85da7e06f Fix DrawBitmap in Direct2D renderer
When the bitmap is larger than the draw area, it should be resized. Do this by
providing the correct size parameters for ID2D1RenderTarget::DrawBitmap.

Also update DrawBitmap code guarded with wxD2D_DEVICE_CONTEXT_SUPPORTED so it
will compile successfully when enabled. However, the drawing behaviour is,
and was, different from the normal behaviour. It does not resize the bitmap.

Closes #18686
2020-03-10 21:04:15 +01:00
Artur Wieczorek
7c6d816d4a Add support for private fonts in Direct2D renderer
Since it appears it's not possible to create DirectWrite fonts with
IDWriteGdiInterop::CreateFontFromLOGFONT() for fonts registered with
AddFontResourceEx() as private ones (with FR_PRIVATE flag), we need to
maintain a custom DirectWrite font collection and use it as source of
font data if call to CreateFontFromLOGFONT() fails. This collection
consists of IDWriteFontFileEnumerator and IDWriteFontCollectionLoader
objects which are seeded with font data based on the private fonts list
taken from wxGetPrivateFontFileNames().

Closes https://github.com/wxWidgets/wxWidgets/pull/1753

Closes #18687.
2020-03-10 02:43:32 +01:00
Vadim Zeitlin
ab9115e0a0 Use correct warning option for older gcc in wxLog test
-Wdangling-else is only available since gcc 7.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
71ed744c76 Simplify wxLogXXX() macros implementation at some cost of brevity
Avoid using plenty of intermediate macros, which made the code quite
difficult to understand and just wxDO_IF() helper directly instead.

This makes individual macros definitions slightly longer, but allows to
get rid of several helper macros, so the total number of lines is
actually smaller but, more importantly, the new code is much easier to
parse for a human reader.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
8c378b44e2 Add wxDO_IF() helper macro
This will be used for wxLogXXX() macros reimplementation in the next
commit.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
ea2bff0b50 Remove code guarded with wxUSE_GUI from wxLog unit test
This file is never compiled with wxUSE_GUI==1, so having these tests
here is not really useful.

It's unfortunately that the absence of warnings from wxLogStatus() is
not checked currently, but it doesn't seem worth recompiling the entire
test case or adding a new one just for this.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
57111b83c9 Minor fixes to new wxLog functions test case
Only use the diagnostic pragma for the compilers that understand it.

Also don't use hard TABs.
2020-03-10 02:42:08 +01:00
Lauri Nurmi
32ead5a0ff Fix dangling else warnings at all wx(V)LogXXX calls
Earlier this was fixed for some but not all variants of wx(V)LogXXX.

See #11829.
2020-03-10 02:42:08 +01:00
Vadim Zeitlin
1e7c2c8254 Benchmark GetTextExtent() and GetPartialTextExtents()
Add very simple benchmark of these 2 functions to allow (roughly)
comparing the advantage of using one compared to the other.
2020-03-07 19:25:03 +01:00
Artur Wieczorek
c124a43fc1 Fix disposing private fonts in GDI+ renderer
PrivateFontCollection with installed private fonts has to be deleted when
GDI+ is still active, otherwise access violation exception is thrown.
2020-03-07 11:29:14 +01:00
Lauri Nurmi
bf6dae2151 Remove outdated and wrong comment about making functions const
The comment suggested Get{First,Next,Prev,Last}Line() should be changed
to const functions once compilers understand the 'mutable' keyword.

Hopefully now, after 19 years, compilers do understand the 'mutable'
keyword, but regardless of that the functions should not be const, as
they very clearly modify the state of the object that is observable
through the public interface.

Closes https://github.com/wxWidgets/wxWidgets/pull/1750
2020-03-06 01:08:19 +01:00
Vadim Zeitlin
61277424d7 Merge branch 'brush-transparency-wxsvgfiledc' of https://github.com/MaartenBent/wxWidgets
Improve brush transparency in wxSVGFileDC.

See #1275, #1748.
2020-03-06 01:03:40 +01:00
Dummy
64be790fb2 Add new wxTempFFile[OutputStream] classes to the overview
See #18673.
2020-03-06 00:57:15 +01:00
Vadim Zeitlin
28d738e44a Ensure that updating the file preserves its mode
Preserve the file mode when replacing it, this notably keeps
docs/doxygen/regen.sh executable when running misc/scripts/inc_year.

This uses GNU chmod --reference option which is not available on all
systems, but it shouldn't be a problem in practice.
2020-03-06 00:54:46 +01:00
Vadim Zeitlin
c09fd8b59d Update copyright years to 2020
Just run misc/scripts/inc_year and commit the results.

Closes #18690.
2020-03-06 00:51:39 +01:00
Jouk
c42715f0c9 define WXBUILDING when compiling the library on OpenVMS 2020-03-05 08:15:04 +01:00
Maarten Bent
759723795e Support transparency for brush patterns in wxSVGFileDC
Include the alpha value in the pattern name.
2020-03-01 22:29:18 +01:00
Maarten Bent
7d2f6b4608 Fix brush pattern when transparent pen is set in wxSVGFileDC
Use the default stroke settings when defining the brush pattern.
2020-03-01 22:12:03 +01:00
Maarten Bent
811f916dae Reduce Xcode output in Travis CI CMake build
This should fix builds that terminate due to: job exceeded the maximum
log length and generally make Xcode build logs more readable and useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/1747
2020-02-29 15:47:30 +01:00
oneeyeman1
bdceda3c6d Adjust columns widths when adding rows to wxOSX wxDataViewCtrl
Call AdjustAutosizedColumns(), just as it was already done when updating
or deleting the rows.

Closes https://github.com/wxWidgets/wxWidgets/pull/1746
2020-02-29 15:47:30 +01:00
PB
e22ab23216 Fix wxWindow::GetThemeEnabled() documentation
The method description was for some reason the
same as for ClearBackground().

Closes https://github.com/wxWidgets/wxWidgets/pull/1745
2020-02-29 15:43:21 +01:00
Lauri Nurmi
109fd955a9 Fix wrong indentation in OSX wxPowerResource code
No real changes, just reindent power.mm correctly.

Closes https://github.com/wxWidgets/wxWidgets/pull/1744
2020-02-29 15:41:29 +01:00
Tobias Taschner
613687ecb5 Updated wxWebViewEdge for SDK 0.9.430
This first beta release of the WebView2 SDK has many identifiers
renamed and webview interfaces split to Host and WebView.

Closes https://github.com/wxWidgets/wxWidgets/pull/1743
2020-02-29 15:40:45 +01:00
Kvaz1r
acff8466a7 Hide page removed from wxAuiNotebook
It doesn't make sense to leave the page shown, and overlapping the
remaining pages, after removing it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1742
2020-02-29 15:38:50 +01:00