Commit Graph

67209 Commits

Author SHA1 Message Date
Ilya Sinitsyn
0766283b2e Add wxHeaderCtrl::GetColumnTitleWidth() overload taking index
This makes it possible to get the appropriate column width from outside
the class, as GetColumn() itself is currently protected and so the
existing overload couldn't easily used.
2019-09-18 01:21:36 +02:00
Ilya Sinitsyn
d8c3c53f05 Make wxRendererMSW::GetHeaderButtonMargin() more accurate
Follow Wine in using 3*SM_CXEDGE as margins on each side.

This also has the advantage of working better in high DPI, as we don't
hardcode the value in pixels any longer.
2019-09-18 01:15:22 +02:00
PB
60dbb7d5bd Correct the tool path in docs/contributing/how-to-release.md
Correct the name and path of the batch file used to build
official MSVS binaries.
2019-09-17 19:53:06 +02:00
PB
87c1f2302f Fix typo in docs/msw/install.md 2019-09-17 19:45:53 +02:00
PB
698c0c09ae Update docs/contributing/binary-compatibility.md
Attempt to update the document, some parts of it are still
quite outdated (references to Sun/Solaris, ancient GCC and
wxWidgets version...).
2019-09-17 19:07:22 +02:00
Vadim Zeitlin
b9338b6130 Call wxDataViewCustomRenderer::ActivateCell() in Mac version too
Do this for consistency with the other ports.

Closes #17746.
2019-09-17 00:09:00 +02:00
Ilya Sinitsyn
e26d90028b Allow disabling hiding columns when using wxHeaderCtrl in wxGrid
Add wxGrid::DisableHidingColumns() method which can be used to prevent
wxHeaderCtrl from allowing the user to hide columns interactively, which
is something it allows to do by default, unlike the "built-in" wxGrid
header.

Also add EnableHidingColumns() and CanHideColumns() for consistency with
the other similar methods.

Closes https://github.com/wxWidgets/wxWidgets/pull/1554
2019-09-16 23:32:59 +02:00
Ilya Sinitsyn
4302c6b8ba Fix showing the popup menu in wxHeaderCtrl under Mac
wxOSX asserts if a menu item with id of 0 is created, so use 1-based IDs
to avoid this.

Using an explicit constant for the base instead of using 0 implicitly
also arguably makes the code more clear.

Closes https://github.com/wxWidgets/wxWidgets/pull/1555
2019-09-16 23:19:15 +02:00
Artur Wieczorek
0818e334fd Fix making a copy of wxBitmap
Because wxBitmap can have both alpha channel and mask, so the presence of the mask shouldn't prevent alpha channel from being enabled (if necessary).
2019-09-16 20:32:28 +02:00
Artur Wieczorek
992b594c15 Fix creating CGImage from bitmap data
Alpha channel values of created CGImage should be
a superposition of the actual alpha channel values
and bitmap mask (if exists).

See #18498.
2019-09-16 20:31:35 +02:00
Artur Wieczorek
64a08c0c9a Fix converting wxBitmap with alpha channel and mask to wxIcon
For bitmap with both alpha channel and mask we have to apply mask on our own because 32 bpp icons don't work properly with mask bitmaps. To do so we will create a temporary bitmap with copy of RGB data and with alpha channel being a superposition of the original alpha values and the mask.

See #18498.
2019-09-16 18:37:52 +02:00
Artur Wieczorek
2d15218c9d Fix drawing wxBitmap with both alpha channel and mask
For 32 bpp wxBitmap with both alpha channel and mask we have to apply mask on our own while drawing the bitmap because MaskBlt() API doesn't work properly with 32 bpp RGBA bitmaps. To do so we need to create a temporary bitmap with copy of original RGB data and with alpha channel being a superposition of the original alpha values and the mask.

See #18498.
2019-09-16 18:37:52 +02:00
Vadim Zeitlin
3a9869b4c4 Fix crash when deleting item being edited in wxOSX wxDataViewCtrl
Avoid touching the model while updating the control due to the items
being deleted from it, as doing this can easily result in dereferencing
pointers to the already deleted objects and crashing.

This is rather ugly, but the original code seems to have been written
with this approach in mind (see preexisting comments in ItemDeleted())
and, to be fair, there doesn't seem any other solution with the existing
API, as it allows (or maybe even requires?) deleting the items _before_
notifying the control about their removal and so not giving it any
opportunity to stop editing the item while it's still alive.

Closes #18337.
2019-09-16 18:04:44 +02:00
Vadim Zeitlin
c0df6ec475 Merge two wxDataViewWidgetImpl::Remove() overloads into one
Having 2 different overloads might have been useful for Carbon
implementation, but as they do exactly the same thing in the Cocoa
version, leave only one of them -- and don't pass it the item, or items,
being deleted as they're not used anyhow.

No real changes.
2019-09-16 17:48:00 +02:00
Jouk
b2cdcb6824 Include all objects in library on OpenVMS-AXP 2019-09-16 08:23:29 +02:00
Vadim Zeitlin
8a27b2e6bf Fix Backspace in wxTextCtrl with custom autocompleter in wxMSW
Pressing Backspace in controls with custom autocompleter previously
didn't do anything at all, as it didn't work correctly after backspacing
over the just inserted autocompletion, but this was clearly wrong, as it
didn't update the list of available completions even after erasing some
non-autocompleted characters.

Fix this by handling Backspace as any other key and just avoiding
refreshing the control contents needlessly if the completion prefix
didn't change.

Closes #18503.
2019-09-15 23:07:42 +02:00
Vadim Zeitlin
0146c47a7f Generate wxEVT_TEXT_ENTER for Enter key on Numpad too in wxMSW
Handle WXK_NUMPAD_ENTER in the same way as we already handle WXK_RETURN.

Closes #18504.
2019-09-15 14:31:42 +02:00
Liam Treacy
5a228ceb91 Show docking hint under wxQt too in wxAUI
See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Liam Treacy
4bfb3a5f01 Implement wxFrame::DoSetClientSize()
Resize the central widget to fit the new size.

See https://github.com/wxWidgets/wxWidgets/pull/1340
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
b8d5c85ecb Make Reparent() work for wxFrame in wxQt
Use the correct parent window, i.e. the one of the central widget and
not of the frame itself.
2019-09-15 01:35:54 +02:00
Vadim Zeitlin
616fc76173 Don't use default window style hints in wxFrame
Building on windowFlags() meant that we inherited a bunch of default
flags that were not affected by Qt::CustomizeWindowHint because we
explicitly specified them when calling setWindowFlags().

Instead of doing this, start with nothing and just add the styles that
we need.

This notably ensures that the frames created without wxCLOSE_BOX style
actually don't have any close button.

Closes https://github.com/wxWidgets/wxWidgets/pull/1335
2019-09-15 01:35:16 +02:00
Vadim Zeitlin
9a182d0982 Move assert for calling SetItemCount() without wxLC_VIRTUAL
This makes it more clear that the base class method is not supposed to
be called.
2019-09-15 00:56:36 +02:00
Vadim Zeitlin
409748be72 Consistently use InitListEvent() to initialize wxListEvents
This notably fixes missing item index and data for the CHECKED events,
and simplifies the code in the other places.
2019-09-15 00:42:41 +02:00
Vadim Zeitlin
d579b5760f Factor out InitListEvent() helper function
No real changes, this is just a refactoring in preparation for future
changes.
2019-09-15 00:42:19 +02:00
Vadim Zeitlin
7d6306ac10 Wrap some over long lines
No real changes.
2019-09-15 00:14:02 +02:00
Graham Dawes
7454fc151b Rewrite wxListCtrl to use QTreeView and a custom model
This notably allows to support wxLC_VIRTUAL style.

Also implement support for checkboxes, improve in-place editing and
implement many other methods and missing functionality (e.g. send the
expected events now).

Closes https://github.com/wxWidgets/wxWidgets/pull/1229
2019-09-15 00:14:02 +02:00
Vadim Zeitlin
95e5ed7395 Some whitespace only fixes
No real changes
2019-09-15 00:14:02 +02:00
Jay Nabonne
6fd2c3170a Reformat "if" statements to take 2 lines
No real changes.
2019-09-15 00:14:02 +02:00
Jay Nabonne
4e9c71bb2c Make some local variables const
No real changes.
2019-09-15 00:14:02 +02:00
Vadim Zeitlin
47e3813d91 Move wx<->Qt alignment conversion functions to the top
No real changes, this is just a refactoring in preparation for the
future changes (use "git show --color-moved" to view the diff).
2019-09-14 23:53:01 +02:00
Graham Dawes
8adcb899cb Remove commented out line copied from wxMSW
No real changes yet.
2019-09-14 23:48:24 +02:00
Jay Nabonne
d602afe5ec Fix several typos in comments
No real changes yet.
2019-09-14 23:46:41 +02:00
Vadim Zeitlin
dfc6cdc063 Emphasize that wxDC::Clear() used brush set by SetBackground()
Ensure that people don't get the impression that using SetBrush() is
supposed to affect Clears().

See #18463.
2019-09-14 23:08:20 +02:00
Paul Kulchenko
9d704706cb Respect AUI toolbar buttons sticky state in native MSW theme
Indicate that the items are sticky by always drawing them in a
hover-like state, as otherwise stickiness wasn't visible at all.

Closes #18496.
2019-09-14 20:20:05 +02:00
Vadim Zeitlin
93815ad2d2 Merge branch 'listctrl-itemrect'
Improve wxListCtrl::GetSubItemRect() and add a unit test for it.

See https://github.com/wxWidgets/wxWidgets/pull/1511
2019-09-14 16:37:57 +02:00
Lauri Nurmi
b42895345a Log a debug message when unloading a dynamic library fails on MSW
Logging (even non-debug logging) in similar situation already happens on
*nix.

Closes https://github.com/wxWidgets/wxWidgets/pull/1545
2019-09-13 14:45:09 +02:00
Jouk
c836ca7312 correction on Fix build after the last commit 2019-09-13 14:38:50 +02:00
Vadim Zeitlin
0ccfd9c0e9 Fix build after the last commit
Remove the extraneous parenthesis in the preprocessor test.
2019-09-13 14:15:39 +02:00
Jouk
9a271ab676 Switching on wxUSE_CAIRO for wxX11 on OpenVMS 2019-09-13 08:03:45 +02:00
Ilya Sinitsyn
dda6aa6bdc Fix assert with setting current cell in wxGrid::Redimension()
Avoid calling wxGrid::SetCurrentCell(0, 0) when the grid has no columns
or rows, as it doesn't have any cells then and doing this logically
fails the precondition assert in GetColPos().

Also refactor all 6 different snippets calling SetCurrentCell() in
Redimension() into a single function to simplify the code and make it
more maintainable.

Add a unit test verifying that this works as intended.

Closes https://github.com/wxWidgets/wxWidgets/pull/1546
2019-09-13 00:47:48 +02:00
Vadim Zeitlin
59e9da28f5 Improve wxDataViewModel::Cleared() documentation
Explain that this method can be useful not only when the model is
cleared.
2019-09-12 23:43:42 +02:00
Vadim Zeitlin
54a8d1d8f3 Don't send events when changing model in wxGTK wxDataViewCtrl
Sending events from e.g. AssociateModel(NULL) made the GTK version
inconsistent with the other ones, neither of which sent any events in
this case, and could result in a lot of grief in the user code if it
didn't expect the event handler to be called at this moment (e.g. during
the destruction).

Make wxGTK compatible with the other ports and safer by always disabling
the selection changed events before calling gtk_tree_view_set_model().

Note that it's still incompatible with the other ports because they also
preserve the selection even after the change of model, but wxGTK loses
it. Ideally this would be fixed too, but for now live with this as the
lesser evil.
2019-09-12 23:36:20 +02:00
Vadim Zeitlin
063b6edf68 Add a check for resetting the associated model to the sample
Verify that resetting the model doesn't result in selection change
events.
2019-09-12 23:20:20 +02:00
Vadim Zeitlin
18594afe76 Remove checks for model stamp validity not needed any longer
The code setting the model stamp to 0 was removed in the last commit, so
also remove the code checking for stamp being 0.
2019-09-12 23:13:11 +02:00
Vadim Zeitlin
5403ec4e08 Make Cleared() behave consistently with the other ports in wxGTK
Instead of actually deleting all the items from the control, just
refresh it by resetting the model, as this is what Cleared() does in
both the generic and native macOS versions of wxDataViewCtrl, so calling
it there resulted in very different results from doing it under wxGTK,
where instead of refreshing the control contents it raelly cleared it.

The name of this method is unfortunately confusing, but it seems better
to change its behaviour in wxGTK, even if this doesn't match the name,
rather than change it in the other ports to make them do the same thing,
as this could break some currently working code.

Also, this change results in a welcome code simplification.
2019-09-12 23:08:10 +02:00
Vadim Zeitlin
0d005bdf02 Add wxEVT_DATAVIEW_SELECTION_CHANGED test handler to the sample
Verify that the sample is not invoked unexpectedly.
2019-09-12 23:00:14 +02:00
Vadim Zeitlin
f99b80612a Add a simple test of wxDataViewIndexListModel to the sample
This is useful to investigate inconsistencies in its behaviour between
the generic and the native GTK versions that can't be easily checked in
the automatic unit tests.
2019-09-12 18:51:36 +02:00
Vadim Zeitlin
eca006da06 Indent "case Page_VarHeight" properly
No real changes, just reindent the code.
2019-09-12 18:31:42 +02:00
Vadim Zeitlin
c715bb750b Use symbolic page numbers in the dataview sample
Make the code a bit more readable.

No real changes.
2019-09-12 18:24:03 +02:00
Robin Dunn
41b444e011 Merge pull request #1455 from wxWidgets/gradient-pen
Add support for gradients in wxGraphicsPen
2019-09-11 20:17:34 -07:00