Commit Graph

18410 Commits

Author SHA1 Message Date
Vadim Zeitlin
0c90ea40c3 Don't auto-resize wxDataViewCtrl columns below their initial size
It's unexpected that decreasing the width of the control makes the last
column diminish in size until nothing (at least if it's minimum size was
not set), instead of showing horizontal scrollbar, so prevent this from
happening by considering the initial column width as being "manually
set", which prevents the code from making the column narrower than it
automatically.

This seems to make sense and is consistent with the handling of initial
size, which becomes "best", and hence "minimal", size of the control,
for wxWindow.

Closes #18343.
2019-10-03 02:04:36 +02:00
Artur Wieczorek
42ed52aec8 Don't use void for functions without arguments 2019-10-02 20:40:51 +02:00
Artur Wieczorek
a771da5623 Don’t use void for functions without arguments 2019-10-02 00:54:14 +02:00
Vadim Zeitlin
43e1066f10 Merge branch 'collpane-bestsize'
Fix generic collapsible pane best size determination.

See https://github.com/wxWidgets/wxWidgets/pull/1580
2019-10-01 20:28:21 +02:00
Vadim Zeitlin
ef7ab73206 Fix wxGenericCollapsiblePane best size calculation
DoGetBestSize() actually calculated the best client size and not the
full size, as it didn't take the pane border into account.

Fix this in the simplest possible way, by just renaming the function to
DoGetBestClientSize() instead.

This ensures that the pane is actually big enough to show its contents,
without cutting off the text shown in its header.

Closes #18515.
2019-09-30 23:36:58 +02:00
Vadim Zeitlin
0c1c13883c Merge branch 'per-monitor-dpi-aware-controls-2'
Improve Per-Monitor DPI awareness in more controls.

See https://github.com/wxWidgets/wxWidgets/pull/1572
2019-09-29 23:23:57 +02:00
Artur Wieczorek
90e4ceb1c6 Make wxMask::GetBitmap a public function
According to the documentation this function should be declared as public,
not protected.
2019-09-29 20:19:10 +02:00
Maarten Bent
2b41ba2702 Apply review comments 2019-09-29 19:30:39 +02:00
Artur Wieczorek
ac9c4d06e2 Fix creating wxMask image from raw data
In the function wxMask::OSXCreate() to create a mask image, data copying
from the supplied memory buffer was not actually implemented and therefore
created mask was invalid.

Closes #18513.
2019-09-29 16:21:45 +02:00
Maarten Bent
017978a139 Fix font of custom attributes in wxTreeCtrl on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
b075465645 Fix wxSearchCtrl buttons on DPI change 2019-09-28 23:37:01 +02:00
Maarten Bent
2c6d132efe Resize wxListCtrl columns on DPI change
Fix font of custom attributes in wxListCtrl on DPI change.
2019-09-28 23:37:01 +02:00
Maarten Bent
56fab0aabb Improve wxDataView on DPI change
Fix the row heights after a DPI change and adjust the column widths.
Use DPIChangedEvent instead of MSWUpdateFontOnDPIChange because the child
controls (m_clientArea, m_headerArea) need to update their font sizes first.
2019-09-28 23:37:01 +02:00
Maarten Bent
fd2cf1f4e2 Fix wx[Check]ListBox font and margin on DPI change
These control are drawn using a wxDC. When the DPI changes, call SetFont
to update the font of the wxDC. First call wxListBoxBase::SetFont() so
m_font is updated to the new DPI, then use this font in the wxDC.
For wxCheckListBox update the margins to fit the changed checkbox size.
2019-09-28 23:37:01 +02:00
Maarten Bent
123da53306 Fix wxBitmapComboBox size in high DPI
Convert hard-coded sizes to DPI depended size, remove unused size.
Implement MSWUpdateFontOnDPIChange() and update the control elements.
2019-09-28 23:37:01 +02:00
Vadim Zeitlin
37be4adec6 Don't change RICHEDIT control font on DPI change
The control seems to somehow react to DPI changes on its own (which is
rather mysterious as we don't forward WM_DPICHANGED to it, so it's not
really clear how does it do it, but it does) and changing its font is
worse than useless, as it's not just redundant, but also resets all the
styles used inside the control and so is really undesirable.

Hence override the just added MSWUpdateFontOnDPIChange() to do nothing
for rich edit controls, while still updating the font for the plain EDIT
ones (which is required as they don't scale correctly on their own).
2019-09-28 23:37:01 +02:00
Maarten Bent
32aabf7a41 Update font of wxSpinCtrl when DPI changes
Fix position of spin control in wxSpinCtrlDouble after DPI change
The old size of the control was used to determine the position. Use GetBestSize
instead, which will return the correct size.
2019-09-28 23:37:01 +02:00
Maarten Bent
8bff737438 Support DPI change in wxToolBar
Manually resize the embedded controls and Realize the toolbar again.
2019-09-28 23:37:01 +02:00
Maarten Bent
e57139bb21 Use system DPI for some native Windows dialogs
Some native dialogs do not scale correctly (color picker, font picker,
open file with custom controls). ALl other native dialogs do scale correctly
(open file, open directory, find replace, print).

Change the DPI Awareness Context temporarily to SystemAware, so Windows handles
the scaling.
2019-09-28 23:37:01 +02:00
New Pagodi
203074567c Regenerate wxSTC files after recent changes 2019-09-28 00:50:47 -05:00
Vadim Zeitlin
04949050b2 Merge branch 'qt-fixes'
A multitude of miscellaneous Qt fixes and improvements.

See https://github.com/wxWidgets/wxWidgets/pull/1552
2019-09-27 19:18:11 +02:00
Vadim Zeitlin
1dfdd93a2a Merge branch 'qt-listctrl'
New version of wxListCtrl for wxQt, supporting virtual list controls,
checkboxes, sorting and with other fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1551
2019-09-27 19:16:56 +02:00
Matthew Griffin
f608b340c2 Send set cursor events whenever there is mouse movement
This is required in order to allow application code to change the cursor
dynamically.

Closes https://github.com/wxWidgets/wxWidgets/pull/1549
2019-09-27 14:00:02 +02:00
Vadim Zeitlin
3a918864f9 Make accelerators work for menu items created in the code too
The previous commit fixed accelerators support in wxQt for the items
created in XRC, but not for those created directly in the code, as
wxMenuItem::SetItemLabel() is not called in this case.

Refactor the code to extract UpdateShortcutsFromLabel() from
SetItemLabel() and call the new function both from there and from
wxMenuItem ctor, to ensure that the accelerators are taken into account
in any case.

This commit is best viewed with "git diff --color-moved".

See https://github.com/wxWidgets/wxWidgets/pull/1544
2019-09-27 13:47:45 +02:00
Matthew Griffin
2c91463c81 Enable mouse tracking on construction of every wxQt widget
Not all controls use wxWindow::Create(), so move setMouseTracking() call
where it is always executed.

Closes https://github.com/wxWidgets/wxWidgets/pull/1528
2019-09-27 13:24:29 +02:00
Ilya Sinitsyn
7f91481294 Add XRC handler for wxInfoBar
Update the schema and the sample to show it in action.

Closes https://github.com/wxWidgets/wxWidgets/pull/1564
2019-09-27 12:57:01 +02:00
Vadim Zeitlin
68b36aed6d Only give messages about unsupported accelerators in wxGTK
Doing this under all platforms results in too many false positives,
which can't be avoided currently, e.g. even if an application uses "Tab"
as an accelerator only under MSW, these messages still appear (in debug
builds, but this is more than sufficient for them to be annoying).

For now, restrict the messages to wxGTK only. In the future we could
revert to giving them under all platforms if we provide some way of
disabling them, e.g. qualifying accelerators with "[port]" or "[!port]"
string before them.

This partially reverts 6596f5a98d, see
https://github.com/wxWidgets/wxWidgets/pull/1505

Closes https://github.com/wxWidgets/wxWidgets/pull/1566
2019-09-27 12:47:03 +02:00
Vadim Zeitlin
b0ff3bf3ea Ensure that wxGrid appearance always reflects its enabled state
Override DoEnable() in wxGrid instead of Enable() to ensure that the
grid is shown appropriately for its current state whenever either it or
its parent is disabled.

Note that this also fixes the bug with only the main grid window being
refreshed, but not the row/column headers, which also need to be.
2019-09-24 01:44:55 +02:00
Graham Dawes
cd7594e639 Don't include scrollbars in client area size
Return the size of just the viewport when using QScrollArea.

Closes https://github.com/wxWidgets/wxWidgets/pull/1418
2019-09-22 02:37:11 +02:00
David Roberts
18b87b2ab5 Send wxEVT_CHECKLISTBOX when a checkbox is clicked
Fix sending events from wxCheckListBox in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1403
2019-09-22 02:30:05 +02:00
Graham Dawes
cc1ec9e562 Show tooltip in wxTreeCtrl when item text doesn't fit on screen
This matches the behaviour of the native control in wxMSW and is
generally useful.

Closes https://github.com/wxWidgets/wxWidgets/pull/1397
2019-09-22 02:12:35 +02:00
Matthew Griffin
9434a443f5 Ensure that QCloseEvents can be vetoed by wx
These events use a different convention from all the other ones in Qt
and need to be ignored, rather than accepted, to prevent the default
action from occurring.

And these events are also sent to disabled windows, which are never
supposed to receive them in wx API.

Closes https://github.com/wxWidgets/wxWidgets/pull/1371
2019-09-22 02:05:32 +02:00
Artur Wieczorek
f7247086c2 Fix storing wxBitmap data in GdkPixbuf
Under wxGTK+2 bitmap data with mask and without it (raw) should be stored
in the separate GdkPixbuf buffers - just like it's done in wxGTK+3. These
two buffers are necessary because only GdkPixbuf with raw bitmap data
(original, non-masked) should be copied when wxBitmapRefData instance is
cloned e.g. in SetMask(). GdkPixbuf with masked data is not copied and is
created on first use in wxBitmap::GetPixbuf().

Closes #18508.
See #18498.
2019-09-18 23:34:35 +02:00
Vadim Zeitlin
bb1c3c4ebb Merge branch 'osx-dvc'
Some wxOSX wxDataViewCtrl fixes OSX.

See https://github.com/wxWidgets/wxWidgets/pull/1556
2019-09-18 14:34:10 +02:00
Vadim Zeitlin
da1944a5cc Merge branch 'grid-autosize-native-header'
Fix auto-sizing column labels when using native header in wxGrid.

See https://github.com/wxWidgets/wxWidgets/pull/1559
2019-09-18 14:32:02 +02:00
Vadim Zeitlin
8ed487923d Fix QT version in a comment for wxPORT_QT
No real changes.
2019-09-18 02:19:13 +02:00
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
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
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
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
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
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
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
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
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
Kvaz1r
3fffc0782c Make wxThread::OnExit() protected rather than private
This allows calling the base class version from the derived classes and
also, at least as importantly, make sure that the function is actually
documented as private functions are not extracted by Doxygen by default.

Closes #16749.

Closes https://github.com/wxWidgets/wxWidgets/pull/1543
2019-09-12 00:55:32 +02:00
Vadim Zeitlin
be53b3fb20 Fix infinite recursion if wxGrid is modified from event handler
Calling wxGrid::{Insert,Delete}{Rows,Cols}() from wxEVT_GRID_CELL_CHANGE
event handler resulted in infinite recursion because it tried to hide
the grid editor control again, which resulted in another CELL_CHANGE
event being generated and so on.

Break this infinite recursion in the usual way, i.e. by updating the
state of wxGrid before invoking the user-defined event handler.

This required separating SaveEditControlValue() in 2 functions, the main
one retaining IsCellEditControlEnabled() check for compatibility, and
the new DoSaveEditControlValue() that can be called even after disabling
the editor.

Closes #2287.

Closes https://github.com/wxWidgets/wxWidgets/pull/1540
2019-09-12 00:53:21 +02:00
Ilya Sinitsyn
e2bd6ec8f7 Fix clearing selection in a grid with reordered columns
Since the changes of 04f7f1fd32 (frozen
rows/columns implementation), RefreshBlock() could call GetColPos() with
an invalid index. This didn't matter most of the time as the function
simply returned the same index as long as the columns were using their
natural order, but resulted in a crash due to an out of bound access to
m_colAt array as soon as they were reordered.

Fix this by avoiding using invalid indices in RefreshBlock() and, more
generally, improving its precondition check and making the assumptions
about the input parameters more clear. Also add a defensive check to
GetColPos() itself.

Finally, add a unit test exercising this code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1536
2019-09-10 19:41:45 +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