Commit Graph

66977 Commits

Author SHA1 Message Date
Robin Dunn
a8a19e25ee Various typo and coding style fixes 2019-09-05 13:33:15 -07:00
Ilya Sinitsyn
120b33746a Implement scrolling for MSW wxHeaderCtrl correctly
Due to lack of support for horizontal scrolling in the native control,
scrolling it was implementing by offsetting the entire control window.
However this didn't work correctly when the window was not positioned
at the leftmost border of its parent window, as the part of it that was
scrolled off could still be visible in this case, and this is exactly
what happened when the native header was used in wxGrid: scrolling it
overwrote the corner part of wxGrid.

Fix this by embedding the actual native control inside an outer wxWindow,
to ensure that the scrolled off part is clipped by the parent window.

Note that this commit is best viewed with "git show --color-moved" as
most of the code was just moved from the header into the implementation
file and is not really new.
2019-09-05 20:11:09 +02:00
Ilya Sinitsyn
e5d59c6b7f Respect minimum grid column width when using native header too
Override wxHeaderColumn::GetMinWidth() to return the actual minimum
width instead of just returning 0.

Add a unit test verifying that this works as intended.
2019-09-05 20:11:09 +02:00
Ilya Sinitsyn
2290d97453 Fix dragging grid columns when using scrolled native header
Drag-resizing the columns didn't work correctly when using the native
header and scrolling it horizontally, as the wrong offset was used in
this case.

Fix the offset in wxGrid code and add a unit test checking that this
works as intended (at least under MSW, as wxUIActionSimulator just
doesn't work reliably enough to test for this under the other platforms,
and, besides, only MSW has the native header control implementation
anyhow).
2019-09-05 20:11:09 +02:00
Robin Dunn
1afb4afe25 Fix typo 2019-09-04 15:01:22 -07:00
Robin Dunn
df31204f98 Add example of using a gradient pen to the drawing sample 2019-09-04 14:21:30 -07:00
Robin Dunn
699f019c76 Add notes about gradient pens and gradient transforms to changes.txt 2019-09-04 14:21:30 -07:00
Robin Dunn
61a39165b8 documentation tweaks 2019-09-04 14:19:24 -07:00
Robin Dunn
f7896d4dff Use new parameter names in the existing CreateRadialGradientBrush methods too 2019-09-04 14:19:24 -07:00
Robin Dunn
c79085b54d (blind) compilation fix for wxQtGraphicsRenderer gradient brush methods 2019-09-04 14:19:24 -07:00
Robin Dunn
30dfe45759 undo incorrect search/replace 2019-09-04 14:19:24 -07:00
Robin Dunn
80f24d9e74 User more easily understandable names for the radial gradient coordinate parameters in wxGraphicsPenInfo 2019-09-04 14:19:24 -07:00
Robin Dunn
78c1c6ca6d Remove TODO 2019-09-04 14:19:24 -07:00
Robin Dunn
320acc1796 Only clone the gradient's matrix when there is one 2019-09-04 14:19:24 -07:00
Robin Dunn
222049f3ce Move wxMacCoreGraphicsMatrixData so it can be used in wxMacCoreGraphicsPenBrushDataBase 2019-09-04 14:19:24 -07:00
Robin Dunn
97b8d67984 Make section header comments a little more consistent 2019-09-04 14:19:24 -07:00
Robin Dunn
239b8a17b1 Add stroking a path with a gradient on OSX, and also gradient transforms 2019-09-04 14:19:24 -07:00
Robin Dunn
2738565c0d Just API updates to allow building to succeed 2019-09-04 14:19:24 -07:00
Robin Dunn
1e37cca162 Like Direct2D inverting the matrix is needed for gradient transforms 2019-09-04 14:19:24 -07:00
Robin Dunn
fc35d8b49b Comment out some asserts I think are incorrect. Needs verification. 2019-09-04 14:19:24 -07:00
Robin Dunn
2571f5962c Don't use a wxRect to hold floating point values!! 2019-09-04 14:19:24 -07:00
Robin Dunn
a8eeab3af2 Add support for setting the transform on Direct2D gradient brushes 2019-09-04 14:19:24 -07:00
Robin Dunn
6d85b566ce Create gradient brushes for pens in wxD2DRenderer 2019-09-04 14:19:24 -07:00
Robin Dunn
e2fbcf0650 API updates only, to allow building. 2019-09-04 14:19:24 -07:00
Robin Dunn
8478c97ecb Add support for gradient pens for GDI+. API also updated for gradient transforms, but that is not working yet. 2019-09-04 14:19:24 -07:00
Robin Dunn
2008d443a8 Set the wrap mode for linear gradient brushes,
so the areas beyond the end points are properly filled with the end point colors
2019-09-04 14:19:24 -07:00
Robin Dunn
d6060db6f1 Add cairo_pattern_set_matrix 2019-09-04 14:19:24 -07:00
Robin Dunn
177f5d4f2a tweak comments 2019-09-04 14:19:24 -07:00
Robin Dunn
62ea72e937 Adding a matrix to wxGraphicsPenInfo means the classes need reordered again 2019-09-04 14:19:23 -07:00
Robin Dunn
7c33d3f969 Gradients can have matrix transforms too. Updates for Cairo. 2019-09-04 14:19:23 -07:00
Robin Dunn
fd0b19f277 Add the rest of the accessors in wxPenInfo and wxGraphicsPenInfo,
so wxPython can see them.
2019-09-04 14:19:23 -07:00
Robin Dunn
b98ab8b56d Switch to a switch statement 2019-09-04 14:19:23 -07:00
Robin Dunn
c860d50888 Rename some *GradientBrush to *GradientPattern 2019-09-04 14:19:23 -07:00
Robin Dunn
e297b5ded9 Deindent inline code blocks 2019-09-04 14:19:23 -07:00
Robin Dunn
7367f1803d Reorder classes a bit to resolve ordering conflicts 2019-09-04 14:19:23 -07:00
Robin Dunn
0265312297 Update include/wx/graphics.h
fix style

Co-Authored-By: VZ <vadim@wxwidgets.org>
2019-09-04 14:19:23 -07:00
Robin Dunn
06bf8e0d41 Update include/wx/graphics.h
fix opening brace style

Co-Authored-By: VZ <vadim@wxwidgets.org>
2019-09-04 14:19:23 -07:00
Robin Dunn
694b7e11fc Move the new methods to the wxCairoPenBrushBaseData section of the file 2019-09-04 14:19:23 -07:00
Robin Dunn
59ce48924a Add gradient pen support for Cairo 2019-09-04 14:19:23 -07:00
Robin Dunn
4708d2539e Add gradient-related attributes to wxGraphicsPenInfo 2019-09-04 14:19:23 -07:00
Robin Dunn
1269b712bb Add wxEVT_DPI_CHANGED 2019-09-04 14:14:59 -07:00
Paul Cornett
92cbb02e9f Fix erroneous header click event after double click
See #18490
2019-09-04 11:41:28 -07:00
Maarten Bent
2c27f9851b Check if window is created before getting the display it is on
If it is not initialised, getting the screen rectangle will fail, so
don't even try doing it, but just return wxNOT_FOUND instead, so the
main display will be used -- this is the best we can do if the window
hasn't been created yet, as we don't know on which display it will
appear.

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

Closes #18481.
2019-09-04 00:33:32 +02:00
Vadim Zeitlin
3d73b30b56 Fix recently broken AUI layout
The changes of 5873ee7e4a completely broke
AUI layout as wxAUI code relies on Layout() still performing the layout
even when GetAutoLayout() returns false, but the new wxTLW::Layout()
didn't do anything in this case.

Fix the problem by checking whether we have a sizer or constraints in
this function instead of using GetAutoLayout(), which is supposed to
only be used by wxEVT_SIZE handler to determine if Layout() should be
called in the first place, but not by Layout() itself.

Closes #18486.
2019-09-04 00:28:22 +02:00
Paul Cornett
560c247feb Write PNG image data directly to wxImage buffer when possible
If there is no alpha or mask, copying from an intermediate buffer is not necessary.
2019-09-03 11:12:20 -07:00
Matthew Griffin
2780f1bde6 Added function to protect against null header when getting its height 2019-09-02 10:47:39 +01:00
Artur Wieczorek
991f11707f Convert wxImage with mask to wxBitmap with alpha channel
Since we always convert wxImage to 32 bpp wxBitmap, there is no reason to keep a separate mask for wxBitmap because alpha channel can be used directly.
2019-09-01 11:01:38 +02:00
Artur Wieczorek
9404dc2f9a Fix creating alternate bitmap for toggle wxToolBar button
We need to fill entire area of the alternate button to the transparent colour prior to drawing non-transparent grey background.

Closes #18468.
2019-08-30 00:05:56 +02:00
Artur Wieczorek
8403b79ad7 Fix colours of mask bitmap
Monochrome mask bitmap should have white pixels in the unmasked area and black pixels in the masked area, quite the opposite to what is implemented now.

Closes #10098.
2019-08-30 00:03:37 +02:00
Artur Wieczorek
0522587bcb Fix creating a bitmap representing wxMask
When bitmap data are accessed with wxNativePixelData, which is designed
to handle RGB bitmaps, Alpha() function cannot be used because in this
case alpha component index is set to the default value -1 and actually
the blue component of the "preceding" pixel is accessed.

Closes #18478.
2019-08-29 18:35:14 +02:00