Commit Graph

66946 Commits

Author SHA1 Message Date
Vadim Zeitlin
4c075c2128 Replace Bind() call with an event table in Enter handling tests
For once, using the event table macros is preferable because this
bypasses the (generally helpful, but not here) test done by Bind()
verifying that wxEVT_TEXT_ENTER handler is bound to a window with
wxTE_PROCESS_ENTER style.

Doing it like this will allow to check that controls without this style
really do not receive the corresponding event.
2019-09-10 18:48:20 +02:00
Vadim Zeitlin
e85b5e5261 Replace a single function with a class in Enter processing tests
No real changes yet, this is a pure refactoring before the upcoming
changes.
2019-09-10 18:48:20 +02:00
Vadim Zeitlin
ba2ea837de Actually make wxTE_PROCESS_ENTER example in dialogs sample work
This didn't work any more since the changes done in the branch merged by
fb2c17c193 as using wxTE_PROCESS_ENTER
without actually handling the resulting event doesn't prevent Enter from
activating the default button any longer.
2019-09-10 18:48:20 +02:00
Kvaz1r
16b08c6ef9 Allow updating wxBusyInfo text while it's shown
Add UpdateText() and UpdateLabel() updating the text (i.e. possibly
containing markup) or the label (just plain text) shown in the window.

Closes #14743.

Closes https://github.com/Kvaz1r/wxWidgets.git BusyInfoUpdateText14743
2019-09-08 23:13:00 +02:00
Vadim Zeitlin
5f635db3bf Minor cleanup of a dialog in the dialogs sample
Use wxSizerFlags()-based API for clarity high DPI-friendliness, i.e.
don't hard code 5px as border/margin sizes.

No real changes.
2019-09-08 22:18:19 +02:00
Vadim Zeitlin
32eb6f1a2c Remove explicit "ProgramDataBaseFileName" from test MSVS projects
This is not really necessary and triggers a bug with a spurious error
C2859 when building the project with MSVS 2019, see

https://developercommunity.visualstudio.com/content/problem/592262/error-c2859-is-not-the-pdb-file-that-was-used-when.html

(which was closed as "not a bug", after acknowledging the bug...).
2019-09-08 22:17:55 +02:00
Vadim Zeitlin
7811d1a833 Merge branch 'per-monitor-dpi-aware-controls-1' of https://github.com/MaartenBent/wxWidgets
Update the font of some buddy controls when the DPI changes. Fix the
position of the statusbar after a DPI change. Add some changes that were
suggested in https://github.com/wxWidgets/wxWidgets/pull/1499 but left
out from it.

Some sizes are cached to improve the speed of the library. These sizes
become incorrect when the DPI changes. And are incorrect when a window
is created on a display with a different DPI. Fix this by checking if
the current DPI is the same as the DPI that was used when calculating
the size, otherwise recalculate the size.

Closes https://github.com/wxWidgets/wxWidgets/pull/1530
2019-09-07 14:57:54 +02:00
Maarten Bent
462f2a4686 Add optional wxWindow parameter to wxButtonBase::GetDefaultSize()
When per-monitor DPI is used, the default button size depends on the DPI of the
display. Use the window to determine this DPI.
2019-09-06 20:59:59 +02:00
Maarten Bent
fa2242a0a6 Reset static sizes when DPI changes 2019-09-06 20:59:59 +02:00
Maarten Bent
e312569b94 Fix wxStatusBar font and position after DPI changes
Update the font of the associated wxDC so ellipsization uses the correct font
size.
2019-09-06 20:59:56 +02:00
Dan-Korn
b82f7f1c0e Fix wxPOPUP_WINDOW to work as documented (Cocoa): (#1535)
Ensure that wxPOPUP_WINDOW on Mac always sets the window level
to NSPopupWindowLevel, regardless of the wxSTAY_ON_TOP and
wxFRAME_TOOL_WINDOW flags.

As the comment for wxPOPUP_WINDOW in defs.h says,
"set this flag to create a special popup window:
it will be always shown on top of other windows"

So, that should *always* be true, even in relation to other
Windows with wxSTAY_ON_TOP, since NSPopUpMenuWindowLevel
is greater (higher) than NSModalPanelWindowLevel.

It should also *always* be true even if the window has both
wxPOPUP_WINDOW and wxFRAME_TOOL_WINDOW styles, since there's
no reason why we can't have a panel with NSUtilityWindowMask
and NSPopUpMenuWindowLevel.
2019-09-06 08:58:33 +02:00
Robin Dunn
53d3888180 Add another missed wxOVERRIDE 2019-09-05 17:51:51 -07:00
Robin Dunn
f705cb3087 Another typo fix 2019-09-05 17:47:33 -07:00
Artur Wieczorek
a7cc686853 Initialize flag with actual value
There is no need to pre-initialize alpha flag with default value.
2019-09-06 00:15:38 +02:00
Artur Wieczorek
f5a589180f Fix converting wxImage with mask to wxBitmap with alpha channel
For wxImage having both mask and alpha channel (it is technically possible), mask cannot be converted to alpha values and in this case resulting wxBitmap will also have both mask and alpha channel.
2019-09-06 00:15:23 +02:00
Vadim Zeitlin
c12b0e8509 Merge branch 'grid-fixes'
Fixes for wxGrid when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1529
2019-09-05 23:36:50 +02:00
Maarten Bent
4713301cf5 Fix font and thumb size of wxSlider after DPI change 2019-09-05 23:14:25 +02:00
Maarten Bent
587f894f96 Fix font of wxRadioBox after DPI change 2019-09-05 23:14:25 +02:00
Maarten Bent
13cb9d41d8 Require wxWindow parameter for wxNativeFontInfo constructor in MSW
Use the DPI of the window to determine the correct font pointSize.

To not break user code, add a default argument when not building the library.
2019-09-05 23:14:25 +02:00
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