Commit Graph

67102 Commits

Author SHA1 Message Date
Vadim Zeitlin
ad7fb7f4aa Merge branch 'warnings' of https://github.com/catalinr/wxWidgets
Fix MSVS analyzer warnings about int multiplication overflow and
uninitialized member variables.

See https://github.com/wxWidgets/wxWidgets/pull/1606
2019-10-15 22:50:17 +02:00
catalinr
67dd28619f Cast more int vars to double to avoid overflow warning 2019-10-14 22:20:37 +03:00
catalinr
62981e1561 Move member initialization in default ctor 2019-10-14 21:34:00 +03:00
Paul Cornett
cfdcc3c29d Remove unreachable code 2019-10-14 09:32:40 -07:00
Paul Cornett
29e0da97d1 Remove invalid flag from HDITEM mask
HDF_LEFT is zero, so it had no effect, but it doesn't belong there
2019-10-14 09:27:50 -07:00
Paul Cornett
2ece977ed7 Add copy ctor for wxUniCharRef
It just does the default, but C++11 deprecates having copy assignment operator
without copy ctor. Eliminates many GCC -Wdeprecated-copy warnings.
2019-10-14 09:08:13 -07:00
Paul Cornett
a3598ba33f Remove unnecessary copy ctors/copy assignment operators
C++11 deprecates having one without the other.
Eliminates many, many GCC -Wdeprecated-copy warnings.
2019-10-14 09:07:21 -07:00
Paul Cornett
764c01832d Use C++11 member-delete in NO_COPY_CLASS/NO_ASSIGN_CLASS macros 2019-10-14 09:06:48 -07:00
catalinr
0508764973 Initialize isLSB to avoid warning 2019-10-14 08:10:41 +03:00
catalinr
2fc569f0c2 Initialize member variables to avoid warnings 2019-10-14 08:09:47 +03:00
catalinr
c150ece20f Cast int to double to avoid arithmetic overflow warning 2019-10-14 07:49:28 +03:00
Maarten Bent
05e0fad687 Resolve some recently introduced warnings 2019-10-13 08:34:30 -07:00
Paul Cornett
127ec4dd7f Build fixes for various wxUSE_* macros ==0 2019-10-12 09:22:02 -07:00
Paul Cornett
0cced058d8 Fix linking when wxUSE_VALIDATORS==0
The changes from 25e9be6873 don't work, at least with GCC 9, as the compiler
seems to be removing the definition of the wxDefaultValidator variable.
2019-10-12 09:18:19 -07:00
Vadim Zeitlin
5e3ba81bbf Revert accidentally committed wxGrid changes
These changes were included in 18e05aeeee
accidentally, revert them for now (they will be recommitted later with a
proper commit message).

See https://github.com/wxWidgets/wxWidgets/pull/1601
2019-10-12 16:08:24 +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
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
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
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