Commit Graph

67405 Commits

Author SHA1 Message Date
Paul Kulchenko
dbc659f5b2 Disabled scaling for wxAui*TabArt on Mac/GTK3. 2019-10-11 22:32:49 -07:00
Paul Kulchenko
27dcd02dcf Updated bitmap scaling in wxAui{Generic,Simple}TabArt for better results. 2019-10-11 15:02:24 -07:00
Paul Kulchenko
ab439fcdee Updated to fix formatting style for multi-line if. 2019-10-11 15:01:21 -07:00
Maarten Bent
591136c7bc Improve button heights at high DPI on wxMSW
Don't use FromDIP together with ConvertDialogToPixels, because the font height
is already adjusted to the DPI.
Also limit the button height at higher DPI. Because the height determined by
ConvertDialogToPixels is higher than standard buttons use on Windows.

Closes #18528
2019-10-11 22:30:34 +02:00
Vadim Zeitlin
9e2ff111a4 Restore, but deprecate, default ctor of wxTimerEvent
Apparently some existing code still used it, even though it only created
an object that could never be used for anything, so undo its removal in
bd09b4132d and deprecate it instead.

Unfortunately, this also requires changing wxTimerEvent::m_timer type
back to pointer, even though it should be a reference.
2019-10-11 19:22:55 +02:00
Artur Wieczorek
92cab3d20a Use proper macros to translate logical to device y-coordinates
Fortunately these macros do nothing but invalid names here could be misleading.
2019-10-11 19:02:15 +02:00
Vadim Zeitlin
a668db8b64 Do nothing in wxListCtrl::SetDoubleBuffered() in wxMSW
Setting WS_EX_COMPOSITED, as the base class version does, just results
in visual artefacts and is useless, as we turn on LVS_EX_DOUBLEBUFFER
already, if it's supported, anyhow.

So don't break the display if people call SetDoubleBuffered() in the
mistaken belief that it does something useful in this case.
2019-10-11 15:34:49 +02:00
Olly Betts
18e05aeeee Remove no-op uses of wxNO_FULL_REPAINT_ON_RESIZE
This behaviour has been the default and this constant 0 since
e441e1f4e8 which was over 16 years ago.

Closes https://github.com/wxWidgets/wxWidgets/pull/1601
2019-10-11 14:12:43 +02:00
Paul Kulchenko
fc75497794 Update wxAuiGenericTabArt and wxAuiSimpleTabArt to properly handle scaled content. 2019-10-10 20:16:53 -07:00
Artur Wieczorek
bf4640f1d8 Fix drawing cross hair on wxDC
There is no need to draw cross hair lines within the entire viewport because only the part inside the current clipping region will be actually drawn. This way we can also avoid working with huge numeric values of coordinates (VIEWPORT_EXTENT = 2^27-1) which apparently are not handled properly by LineTo() API.

Closes #18526.
2019-10-10 20:34:17 +02:00
Maarten Bent
a0359a23ff Fix wxSTC compilation without precompilead headers
Get and release the HDC, instead of using WindowHDC. Because stc.cpp is used on
all platforms, don't include wxMSW specific wx/msw/private.h.

Also use const int for the variables.
2019-10-10 20:28:44 +02:00
Artur Wieczorek
07e9b82925 Add option to select pen style in graphics benchmarks
Since the performance of drawing lines with various pen styles can be the subject of examination it would be good to have the ability to select pen style with a command line option.
So, a new option "pen-style" is supported since now and with this new option "solid", "dot", "long_dash", "short_dash" styles can be explicitly selected.
2019-10-10 19:45:47 +02:00
Artur Wieczorek
7596bd41c2 Add benchmark of drawing cross hair
There is a special API to draw cross hair so it would be good have ability to test its performance.
2019-10-10 19:42:33 +02:00
Artur Wieczorek
4c6b12744c Demonstrate drawing cross hair in drawing sample
There is no such demonstration so far.
2019-10-10 19:37:52 +02:00
Vadim Zeitlin
9e8352b5cb Document in comments that wxAuiToolBarArt element sizes use DIPs
This is not as good as relying on the type system, but better than
nothing.
2019-10-10 14:00:51 +02:00
Paul Kulchenko
acd7ea6120 Fix AUI toolbar drop down width size in high DPI
Don't apply FromDIP() twice: GetElementSize() already returns the size
in DIPs.
2019-10-10 13:59:26 +02:00
Vadim Zeitlin
cc7c0bbd9c Merge branch 'msw-richedit-paste'
Fix pasting long strings into wxTextCtrl in wxMSW.
2019-10-10 13:56:00 +02:00
Vadim Zeitlin
fabf8d1e8a Revert "Never show tree lines when there are tree buttons under OS X and GTK+"
This reverts commit ec2f175241 because it
doesn't seem useful to forcefully turn off the connecting lines when
wxTR_HAS_BUTTONS is specified: they will still be off by default in
wxGTK and wxMac because wxTR_NO_LINES is part of wxTR_DEFAULT_STYLE, but
will be shown now (as they used to be back in 2.6 days) if a style
excluding wxTR_NO_LINES is explicitly specified.

Closes #11522.
2019-10-10 13:53:34 +02:00
Maarten Bent
5547473acd Remove wxGDIPlusPrintingContext::SetFont, override DPI instead 2019-10-09 22:40:44 +02:00
Maarten Bent
8ceadd3029 Improve wxD2DContext::GetDPI and wxGDIPlusContext::GetDPI
If there is a valid wxWindow, use its DPI. Otherwise use a dedicated function
of the context to get the DPI. Don't use the common wxGraphicsContext::GetDPI
because this will return hard-coded 72 when there is no valid wxWindow.
2019-10-09 22:25:08 +02:00
Maarten Bent
c538e8f9d6 Add wxGraphicsRenderer::CreateFontAtDPI to support font with fractional pixel-size 2019-10-09 22:24:28 +02:00
Ilya Sinitsyn
dc99faa096 Fix focus issue with composite grid editor windows
The grid editor window can be composite, so check whether it or one of
its children focus has focus when determining whether we should set the
focus to the grid when the grid editor is being hidden, otherwise the
focus was simply lost when such an editor was hidden.

Closes https://github.com/wxWidgets/wxWidgets/pull/1599
2019-10-09 19:53:19 +02:00
Vadim Zeitlin
280f80fdfd Update libtiff submodule to fix warnings in Win64 build 2019-10-09 17:03:39 +02:00
Ilya Sinitsyn
86f14a033c Fix the issue with the grid cell editor special chars handling
Some of the grid cell editors (all of them not based on wxTextCtrl
basically, i.e. wxGridCellBoolEditor, wxGridCellChoiceEditor,
wxGridCellEnumEditor) didn't process Esc, Enter and Tab under MSW,
making them inconvenient to use.

Fix this by adding wxWANTS_CHARS style flag to ensure the editors do get
these keys.

Closes https://github.com/wxWidgets/wxWidgets/pull/1598
2019-10-09 16:57:25 +02:00
Vadim Zeitlin
19c6e004ce Don't use g_thread_supported() with non-ancient glib versions
This is useless, as it always returns true (since 2.31), and just
results in warnings about using deprecated macro (since 2.62).

Also remove the now unnecessary warning suppression macros, as
g_thread_init() wasn't deprecated in 2.30 yet, so it shouldn't give any
warnings in glib versions in which it could be actually used.
2019-10-09 15:02:18 +02:00
Ilya Sinitsyn
85b37bea49 Fix GetBestSize() for hidden controls in wxGTK
gtk_widget_get_preferred_size() return zero size if the GTK widget is
hidden, so show it temporarily in order to find its real preferred size.

Add a unit test checking that the best size of a hidden wxChoice is now
determined correctly.

Closes https://github.com/wxWidgets/wxWidgets/pull/1587
2019-10-09 14:56:49 +02:00
Vadim Zeitlin
efc2a9da2d Fix pasting long strings in wxTextCtrl under MSW
Adjust the length limit before pasting to ensure that all text on
clipboard will be successfully pasted, instead of only pasting the part
of it which fits.

Add a unit test checking that this works.

Closes #4646.
2019-10-09 14:40:53 +02:00
Vadim Zeitlin
612634fffd Merge branch 'spinctrl-fixes'
Various improvements to wxSpinCtrl and wxGridCellNumberEditor, using it.

Closes https://github.com/wxWidgets/wxWidgets/pull/1588
2019-10-09 01:52:10 +02:00
Ilya Sinitsyn
d2776b2fba Invalidate wxSpinCtrl best size when needed in wxGTK
Also fix the initial min and best size.
2019-10-09 01:44:46 +02:00
Ilya Sinitsyn
f2286fc200 Allow processing Enter and Tab in wxGridCellNumberEditor
Add style flags to allow Tab and Enter works properly for the grid number
efitor with ranges (which uses wxSpinCtrl).
2019-10-09 01:44:40 +02:00
Ilya Sinitsyn
8dadc2e68c Improve wxGridCellNumberEditor placement in the grid
Use the best height and don't let the editor be smaller then min size.
Also align center vertically.
2019-10-09 01:44:32 +02:00
Ilya Sinitsyn
1be43ed67b Improve best size determination for wxSpinCtrl
Use the range and the base to determine the widest value string and use
it to calculate the best size.
2019-10-09 01:44:13 +02:00
Ilya Sinitsyn
9ef1b1529d Add wxControl::GetSizeFromText() helper function
Add the helper function that combines GetSizeFromTextSize() and
GetTextExtent() as they are often used together.
2019-10-09 01:43:50 +02:00
Vadim Zeitlin
7a9e969dca Send clipboard events for Ctrl/Shift-{Ins,Del} in rich edit too
The corresponding wxClipboardTextEvent was generated for Ctrl-{C,V,X}
key combinations, but not Shift-{Ins,Del} or Ctrl-Ins ones, which are
also handled by the native control by default.
2019-10-09 01:01:18 +02:00
Vadim Zeitlin
2f6cb20d2c Stop intercepting Alt-Fn keys in the text sample
This was annoying, especially under MSW, as Alt-F4 couldn't be used to
close the application quickly.
2019-10-09 00:26:26 +02:00
Olly Betts
e2b4cd9f77 Fix typos in comments and assertion messages
Closes https://github.com/wxWidgets/wxWidgets/pull/1596
2019-10-08 23:30:22 +02:00
Besnik Bleta
60bb1a356d Update Albanian translations 2019-10-08 19:03:36 +02:00
Vadim Zeitlin
321c1379df Fix focus after disabling the currently focused control in wxMSW
Fix a regression since 23ddf26571: initial
focus was wrong in a dialog with radio button if the focused control was
disabled. This happened because m_winLastFocused didn't correspond to
the actual focus when we tried to find the next control to focus in this
case, as m_winLastFocused was changed by wxRadioButton::SetValue().

Don't change m_winLastFocused for the window which already has focus to
avoid this problem, and also because it was useless to do this anyhow.

Closes #18521.

Closes https://github.com/wxWidgets/wxWidgets/pull/1590
2019-10-08 19:00:52 +02:00
Vadim Zeitlin
4e5095e5a5 Fix WebKit detection in configure under Mac after the last commit
The last commit accidentally removed not only the checks, but also the
actions executed when the check was successful -- restore the former
while still removing the latter.
2019-10-08 16:13:54 +02:00
Vadim Zeitlin
b8fbecc261 Remove configure tests for WebView headers under Mac
They shouldn't be necessary, as these headers should be always available
on all supported macOS versions, and they fail when using 10.15 SDK
which doesn't include Carbon headers at all any more.
2019-10-08 15:06:01 +02:00
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
9102da27ec Document that wxGLCanvas now uses physical pixels
Instruct people to use GetContentScaleFactor() to convert between
logical coordinates used by wxWindow and physical ones used by
wxGLCanvas.

See https://github.com/wxWidgets/wxWidgets/pull/1485
2019-10-08 02:23:15 +02:00
Scott Talbert
f5d02e6808 Enable Retina (HiDPI) support on OSX wxGLCanvas
Closes #15700.

Closes https://github.com/wxWidgets/wxWidgets/pull/1485
2019-10-08 02:15:11 +02:00
Scott Talbert
b134589cbb Fix OpenGL samples when using HiDPI displays
OpenGL seems to operate using physical pixels, so we need to factor in the
scale factor when setting the GL viewport.

Closes #17391.

Closes https://github.com/wxWidgets/wxWidgets/pull/1470
2019-10-08 02:14:21 +02:00
Vadim Zeitlin
0ff713c945 Merge branch 'msw-listctrl-image-fix'
Fix resetting images of wxMSW wxListCtrl columns.
2019-10-08 02:12:38 +02:00
followait
5d6f92d505 Fix clearing images of wxMSW wxListCtrl columns
Resetting LVCFMT_COL_HAS_IMAGES does work and removes the image shown
in the column without leaving any space for it, unlike the previously
used version.

Closes #18523.
2019-10-08 02:09:56 +02:00
Vadim Zeitlin
43e7536c87 Use correct mask for wxListCtrl column bitmaps in wxMSW
Do use LVCFMT_COL_HAS_IMAGES as it's the right flag to use according to
the documentation, unlike LVCFMT_IMAGE which seems to have worked only
accidentally.

See #18523.
2019-10-08 02:08:21 +02:00
mehmets
9c291ffbbc Optimize wrapping lines in wxRichTextCtrl
When wrapping long text into multiple lines, avoid unnecessary
GetFirstLineBreakPosition calls for each wrapped line, leading to
quadratic complexity.

Closes https://github.com/wxWidgets/wxWidgets/pull/1567
2019-10-08 01:38:31 +02:00
oneeyeman1
f46a5423ae Implement autosizing of columns in generic wxListCtrl
Autosize the column to fit its contents or its label width if there are
no items when its divider is double clicked.

This is consistent with wxMSW behaviour and is generally convenient.

Closes https://github.com/wxWidgets/wxWidgets/pull/1573
2019-10-08 01:33:26 +02:00
oneeyeman1
0e0ea2ad84 Fix autosizing empty columns in wxMSW wxListCtrl
Autosizing the column by double clicking on its separator line reset it
to the default width when the control was empty, which isn't especially
useful.

Set the column size to fit its header instead.

Closes #9926.

See https://github.com/wxWidgets/wxWidgets/pull/1573
2019-10-08 01:33:08 +02:00