Commit Graph

18430 Commits

Author SHA1 Message Date
Stefan Csomor
f83577df45
Changing datatransfer implementation from CFPasteboard to NSPasteboard API (#1264)
* changing datatransfer from CFPasteboard to NSPasteboard API

* factoring and cleaning up

* Switching back naming

* missed file

* getting wxCFStringRef to be independent of system headers

* add unichar include

* using wxCFStringRef in header

* moving to private headers, change method name

* adapting to lesser content in cfstring.h

* Removing malloc/free usage

* use wxScopedArray throughout

* using wxMemoryBuffer instead of char[]

* fixing nonprecomp headers

* missing forward decl in non-precomp builds
2019-10-08 06:32:44 +02:00
Vadim Zeitlin
654bfaea31 Add wxListCtrl::IsEmpty()
Add a simple accessor for consistency with the other controls.
2019-10-08 01:20:44 +02:00
Vadim Zeitlin
f95ce8d9d5 Add wxListCtrlBase::GetItemCount() pure virtual
No real changes, just ensure that all derived classes implement this
method (which already was the case).
2019-10-08 01:16:50 +02:00
Vadim Zeitlin
30dabbdf69 Merge branch 'grid-native-header-autosize'
Fixes for auto-sizing grid columns when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1579
2019-10-07 22:26:02 +02:00
Ilya Sinitsyn
b2194d9ad5 Fix the native header column minimal width determination
wxGrid::AutoSizeColumn can set per column minimal width and this values
must be used for native headers columns.
2019-10-07 22:25:10 +02:00
Ilya Sinitsyn
8971321542 Send the autosize column event for grid native header columns
Send wxEVT_GRID_COL_AUTO_SIZE on double clicking on a separator line of
the grid native header to allow override default behaviour.
2019-10-07 22:25:10 +02:00
Vadim Zeitlin
2c604863de Fix compilation after fpos_t change in with MinGW runtime 5.2
fpos_t is now a union and not just a simple typedef any more, so we
can't cast between it and long long. Unfortunately we still need to
convert between the two, so add an explicit version check and use the
private union field to make this work with the latest MinGW 32 versions.
2019-10-06 00:17:57 +02:00
Vadim Zeitlin
4c517dea40 Merge branch 'qt_clipboard_bitmap' of https://github.com/GeoTeric/wxWidgets
Implement copying bitmap to clipboard for wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1368
2019-10-05 15:04:47 +02:00
Vadim Zeitlin
4a1b1b6373 Merge branch 'fix-html-selection'
Improvements to wxHtmlWindow selection handling: use inactive background
for it when the window doesn't have focus; allow copying it with
Ctrl-Ins and fix annoying changes in layout while selecting.

Closes https://github.com/vadz/wxWidgets/pull/12
2019-10-05 14:58:38 +02:00
Pavel Kalugin
a7dc1c0e0f Fix text jumps during selection dragging on MSW
When selecting the text in wxHtmlWindow by dragging the mouse the text
to the right of the selection sometimes jumps horizontally. This happens
only on MSW and only for TrueType fonts. The reason is that
wxDC::GetPartialTextExtents() and wxDC::GetTextExtent() give different
results if the text contains characters with underhangs or overhangs.

Fix this by caching results of wxDC::GetPartialTextExtents() and using
them instead of calling wxDC::GetTextExtent().
2019-10-05 14:56:46 +02:00
Pavel Kalugin
65771f685b Add wxHtmlCell::GetRect() 2019-10-05 14:56:46 +02:00
Pavel Kalugin
3db142e58f Redraw selection in wxHtmlWindow on focus event 2019-10-05 14:56:46 +02:00
Pavel Kalugin
ef524931cc Fix selection background colour in wxHtmlWindow
Use inactive selection colour when the window doesn't have focus.
2019-10-05 14:56:46 +02:00
Vadim Zeitlin
c30daf10cc Explicitly cast -1 to fpos_t in our wxFtell() definition
Apparently in at least some gcc versions fpos_t is not the same thing as
long long int, resulting in compilation problems due to using different
types for the ternary operator arguments.
2019-10-05 14:43:06 +02:00
Robin Dunn
c49672691e CanHideColumns should be const 2019-10-04 16:36:10 -07:00
Vadim Zeitlin
878eb6af87 Remove unused return value of wxDataViewColumn::WXUpdateWidth()
The return value was never used, so just don't bother returning it.

No real changes.
2019-10-03 02:11:44 +02:00
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
Matthew Griffin
5c169c0cf2 Update function names, indentation and added comments 2019-10-02 15:40:16 +01:00
Matthew Griffin
531e988e5d Refactor to do custom qt clipboard actions without dynamic cast 2019-10-02 13:22:16 +01: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