Commit Graph

65861 Commits

Author SHA1 Message Date
Paul Cornett
e08a1d38e1 Use const reference parameter 2019-02-17 22:58:42 -08:00
Paul Cornett
34a3f0512d Remove redundant condtional/unreachable code 2019-02-17 22:55:56 -08:00
Paul Cornett
ff5d764b63 Simplify conditional expression
!A || (A && B) --> !A || B
2019-02-17 22:49:58 -08:00
Paul Cornett
7c75f46098 wxOVERRIDE 2019-02-17 22:42:26 -08:00
Paul Cornett
3b8404ce48 Avoid potential buffer overrun
Need to allow for terminating nul
2019-02-17 22:32:40 -08:00
Paul Cornett
36f742e2e7 Avoid pointless bitwise operation on a bool 2019-02-17 22:28:44 -08:00
Paul Cornett
66f88e401e Avoid potential memory leaks 2019-02-17 22:26:36 -08:00
Paul Cornett
123b96e214 Avoid potential 31-bit shift of signed 32-bit value 2019-02-17 22:22:08 -08:00
Paul Cornett
0cb9231720 Avoid shifting negative value 2019-02-17 22:20:50 -08:00
Paul Cornett
71972a5265 Use pre-increment operator with iterators 2019-02-17 18:48:40 -08:00
Paul Cornett
360342659b Remove unimplemented wxListBase ctor declaration 2019-02-17 18:26:17 -08:00
Paul Cornett
ad59df7355 Remove unuseable wxListBase ctor
It calls Append(void*), which calls the pure virtual CreateNode(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:19:16 -08:00
Paul Cornett
c41ff4e694 Remove unuseable wxPGArrayEditorDialog ctor
It calls Create(), which calls the pure virtual ArrayGetCount(), which will
crash, as the required override can't be called from the base class ctor.
2019-02-17 18:00:26 -08:00
Paul Cornett
9ea2ac92ef Fix wxCriticalSectionLocker usage
A temporary object will not hold the lock
2019-02-17 17:24:36 -08:00
Pavel Kalugin
be12bc6a8a Fix selection in generic wxDataViewCtrl after adding an item
Notify m_selection about the new item in all cases, not just when using
a virtual list model.

This was broken back in 36a5983f64 and
only fixed for virtual list controls, but not all the other ones, in
9f5af0a494.
2019-02-15 14:39:13 +01:00
Cătălin Răceanu
be9c18cbd6 Reuse Qt implementation of normal button for toggle buttons 2019-02-13 01:23:20 +02:00
Cătălin Răceanu
7be9c8c670 Remove functions that are identical with the ones in base classes 2019-02-13 01:15:19 +02:00
Cătălin Răceanu
50edbf24cc Change the base class of wxBitmapToggleButton 2019-02-13 01:09:16 +02:00
Cătălin Răceanu
39c9992ec9 Remove declaration already present in common code 2019-02-13 00:58:54 +02:00
Cătălin Răceanu
193cf3fee9 Change the order of class declarations only 2019-02-13 00:55:00 +02:00
Tim Kosse
dd56499fe9 Fix crashes when pasting non-text data in wxOSX
Check that conversions succeed before using their results to avoid
crashing if the data on clipboard is in an unexpected format.

Closes #18344.
2019-02-12 16:19:18 +01:00
Catalin Raceanu
fb00507fb5 Implement image support for button states in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1224
2019-02-11 19:34:26 +01:00
Vadim Zeitlin
bf515d769a Fix size of text drawing using wxGraphicsContext when printing
When using both wxEnhMetaFileDC (used for print preview) and
wxPrinterDC, a global scale factor was applied to the graphics context
in wxGDIPlusPrintingContext ctor and this changes size of the text
rendered using size specified in point units.

To prevent this from happening, stop applying this scale factor in the
base class GetTextExtent() and apply it instead when setting fonts in
the derived wxGDIPlusPrintingContext only. This ensures that the results
are consistent between GetTextExtent() and DrawText() and also keeps
the font scale hack entirely in wxGDIPlusPrintingContext without
affecting the base class.

It's still not totally clear why do we have to do this at all even
although we specify the font sizes in UnitPoint units which ought to be
DPI-independent -- but somehow are not. But at least the output is
correct now and the code is arguably more clear than before.

This fixes a regression with text size when printing or previewing
introduced by d5020362ff

Closes #18338.
2019-02-08 16:49:38 +01:00
Vadim Zeitlin
21661d51d8 Remove unnecessary wxGDIPlusPrintingContext dtor
No real changes.
2019-02-08 16:16:02 +01:00
Vadim Zeitlin
9a9ff29098 Remove redundant wxUSE_XXX checks from wx/filesys.h
These checks are already performed in wx/chkconf.h and don't need to be
redone here, especially incorrectly (testing for "!wxUSE_FILESYSTEM"
inside "#if wxUSE_FILESYSTEM" is useless).
2019-02-05 21:03:27 +01:00
Graham Dawes
5ec25fe755 Implement support for wxFrame style flags for wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1222
2019-02-05 03:06:05 +01:00
Vadim Zeitlin
153b5e85fb Merge branch 'qt_combobox_crash' of https://github.com/GeoTeric/wxWidgets
Fix crashes when using wxCB_READONLY in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1221
2019-02-05 03:04:21 +01:00
Vadim Zeitlin
ddc550105e Merge branch 'qt-radio-groups'
Fix radio button grouping in Qt.

See https://github.com/wxWidgets/wxWidgets/pull/1212
2019-02-05 03:03:10 +01:00
Vadim Zeitlin
33998fb7eb Merge branch 'ci-sample' of https://github.com/MaartenBent/wxWidgets
Improve building samples with CI.

See https://github.com/wxWidgets/wxWidgets/pull/1218
2019-02-04 11:24:28 +01:00
Scott Talbert
cdb7241995 Document wxLocaleInitFlags
Closes https://github.com/wxWidgets/wxWidgets/pull/1216
2019-02-04 11:23:18 +01:00
Vadim Zeitlin
47c5eacc93 Merge branch 'gc-get-text-extent'
Micro-optimization in wxGDIPlusContext::GetTextExtent() and minor
printing sample cleanup.

See https://github.com/wxWidgets/wxWidgets/pull/1220
2019-02-04 11:20:59 +01:00
Graham Dawes
a60c2470b5 Dedupe wxCB_READONLY check 2019-02-04 09:26:10 +00:00
Graham Dawes
1472b2f8ef Fix crashes with readonly combobox under wxQT 2019-02-04 09:23:08 +00:00
Vadim Zeitlin
679decd81d Merge branch 'disable-sdl-macos'
Disable the use of SDL under macOS, it doesn't compile nor is needed
there.

See https://github.com/wxWidgets/wxWidgets/pull/1217
2019-02-03 22:54:32 +01:00
Vadim Zeitlin
606659d27c De-TAB-ify configure
No real changes, just remove the hard TABs.
2019-02-03 22:52:43 +01:00
Vadim Zeitlin
b1057cad05 Also disable SDL under macOS for configure-based builds
SDL-based wxSound backend doesn't currently compile under macOS and is
probably not very useful there anyhow.
2019-02-03 22:51:10 +01:00
Vadim Zeitlin
c08ea68b4a Avoid unnecessary calls in wxGDIPlusContext::GetTextExtent()
Don't always call several GDI+ functions when we often don't need their
results: only retrieve the cell descent, ascent and the line spacing if
we are going to really use any of these values.
2019-02-03 22:46:02 +01:00
Vadim Zeitlin
21a7ff2aa3 Use wxScopedPtr instead of explicit delete in printing sample
No real changes, just make the code a bit safer.
2019-02-03 22:45:46 +01:00
Vadim Zeitlin
7a05aa6dc0 Don't pass unused arguments to GetTextExtent() in printing sample
No real changes, just remove the completely unused local variables and
parameters to wxGraphicsContext::GetTextExtent() call.
2019-02-03 22:42:55 +01:00
Vadim Zeitlin
efa1e8f4ff Merge branch 'gc-from-unknown-dc'
Add wxGraphicsRenderer::CreateContextFromUnknownDC().

See https://github.com/wxWidgets/wxWidgets/pull/1213
2019-02-03 22:14:01 +01:00
Maarten Bent
d111053151 Use CMake script to check Travis installation 2019-02-03 21:51:50 +01:00
Maarten Bent
6be0e7749c CMake: don't search SDL on macOS
It doesn't compile when enabled.
2019-02-03 19:01:00 +01:00
Maarten Bent
ea2c8543d3 Build some samples on AppVeyor with CMake
Remove unused toolsets.
Remove extra popd.
2019-02-03 19:00:03 +01:00
Dan Gudmundsson
22fc3cff8f Use base implementation of dragAcceptFiles in wxOSX
As is done in wxGTK implementation.

Closes https://github.com/wxWidgets/wxWidgets/pull/1116
2019-02-02 22:43:14 +01:00
Paul Cornett
eaafd0cb1d Fix some grammatical errors 2019-02-02 13:21:46 -08:00
Vadim Zeitlin
356e0725d8 Move wxGraphicsRenderer::CreateContextFromUnknownDC() around
No real changes, just move this method to the implementation section of
its class.
2019-02-02 21:23:35 +01:00
Vadim Zeitlin
8bbac921f3 Add wxGraphicsRenderer::CreateContextFromUnknownDC()
It seems wrong to have this function in wxGraphicsContext only and not
in wxGraphicsRenderer, as this makes it impossible to create a context
associated with a non-default renderer while it doesn't cost us anything
to allow doing this.
2019-02-02 21:22:19 +01:00
Vadim Zeitlin
46188ff56f Remove dynamic_cast-based implementation of CreateFromUnknownDC()
There doesn't seem to be any point to have both wxRTTI-based
implementation and the standard RTTI-based one, so leave the former one
only.
2019-02-02 21:17:37 +01:00
Paul Cornett
fb89d7b225 Minor cleanup, no real changes
Remove unneeded forward declaration, unused variable
2019-02-02 11:27:37 -08:00
Paul Cornett
10d1954832 Simplify converting gray PNG data to RGB
libpng can do that for us
2019-02-02 11:15:36 -08:00