Commit Graph

65828 Commits

Author SHA1 Message Date
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
Paul Cornett
5771b371f2 Use memset rather than a loop to set memory to a fixed value 2019-02-02 11:01:05 -08:00
Paul Cornett
28010b51f0 Simplify memory allocation for PNG image data
Allocate one block for the whole image, rather than a block for each row
2019-02-02 10:56:33 -08:00
Vadim Zeitlin
9886c25645 Ensure that test notebook is destroyed after the end of its test
Don't let wxNotebook created in the recently added test for the events
generated when adding pages to it continue to live after the test end as
this breaks the subsequent tests using wxUIActionSimulator (but only
when using MinGW, for some reason).
2019-02-02 17:40:33 +01:00
Vadim Zeitlin
0a7b5a9879 Ensure that test windows are destroyed in TLW unit test
Don't leave the maximized frame created in the test case for getting
events from it lying around needlessly.
2019-02-02 17:31:05 +01:00
Vadim Zeitlin
2a907769fb Suppress all -Wmissing-field-initializers in the test suite
There were many dozens of such warnings given for the various arrays
used in the tests and it just doesn't seem feasible nor desirable to fix
them all, so just suppress the warnings for all these arrays to get rid
of them with recent (7+?) versions of gcc.
2019-02-02 17:25:37 +01:00
Vadim Zeitlin
9a7a89b7b2 Merge branch 'qt-convert-simplify'
Simplify Qt conversion functions and stop mapping wxPoint(-1,-1) and
wxSize(-1,-1) to QPoint(0,0) and QSize(0,0), respectively.

See https://github.com/wxWidgets/wxWidgets/pull/1206
2019-02-02 17:12:50 +01:00
chris2oph
f8c345ca95 Fix painting logic in wxQt wxClientDC implementation
The original drawing mechanism was generating lots of QWarning messages
when running samples (e.g. htlbox, caret, etc.) and in some cases was
not actually completely drawing every element of the sample. The issue
was that the QPicture was being shared incorrectly between wxWindow and
wxClientDC and attempts to start painting, update, etc. were generating
console warnings.

Closes https://github.com/wxWidgets/wxWidgets/pull/1152
2019-02-02 16:23:49 +01:00
Vadim Zeitlin
7d2e6e805f Add helper function to avoid code duplication in wxQt wxTextCtrl
No real changes, just a refactoring to avoid duplicating the code
handling wxTE_READONLY and the alignment styles between multi- and
single-line versions.

Also avoid testing for "style & wxTE_LEFT" as this will never be true
anyhow.

See https://github.com/wxWidgets/wxWidgets/pull/1211
2019-02-02 16:12:16 +01:00
Tristan
c8cbdc783a Implement support for more style flags in wxTextCtrl
Support wxTE_READONLY, wxTE_RICH[2], wxTE_{LEFT,CENTRE,RIGHT} as well as
wxNO_BORDER flags.

Closes https://github.com/wxWidgets/wxWidgets/pull/1211
2019-02-02 16:06:43 +01:00
ffa-benarmstrong
f930bd6740 Generate events when wxRadioButton is checked under wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1210
2019-02-02 16:03:02 +01:00
Vadim Zeitlin
36fc9b3e5a Merge branch 'wxslider' of https://github.com/MaartenBent/wxWidgets
wxSlider and widgets samples improvements:

- Document `wxSL_BOTH` style of `wxSlider`.
- Centre labels above and below vertical `wxSlider`. Improve label
  position for specific combinations of `wxSlider` styles.
- Improve `wxSlider` in high DPI. Make thumb and tick size DPI
  dependent.
- Better fix layout of `wxSlider` labels after changing value range.
  Commit 0b821ad did not (always) trigger a call to `DoMoveWindow`. See
  [#17093](https://trac.wxwidgets.org/ticket/17093).
- Fix `wxSlider::SetThumbLength()` on `wxMSW`. It requires
  `TBS_FIXEDLENGTH` style. Use `GetThumbLength()` instead of the
  arbitrary defined `THUMB` size.
- Improve guards in button pages of widgets sample.
- Use `wxSizerFlags` for slider page in widgets sample.
- Some fixes for `wxSlider` in widgets sample
  - Correctly save the slider value before recreating the slider.
  - Layout the entire page instead of only the slider sizer.
  - Update the text controls after recreating the slider.
  - Always enable 'both sides' checkbox. It has additional effects in
    `wxMSW`.
- Demonstrate `wxSlider::SetSelection()` in widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1208
2019-02-02 15:59:39 +01:00
Tristan
7de612dd92 Honour wxCB_READONLY flag in wxQt wxComboBox
Don't make the combobox unconditionally editable, but only do this if
wxCB_READONLY is not specified.

Closes https://github.com/wxWidgets/wxWidgets/pull/1207
2019-02-02 15:58:10 +01:00
Vadim Zeitlin
6370662cc8 Merge branch 'qt-dnd'
Initial drag-and-drop implementation for wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1205
2019-02-02 15:54:21 +01:00
Vadim Zeitlin
0145916fb6 Unindent contents of anonymous namespaces
No real changes, only formatting.
2019-02-02 15:50:13 +01:00
Graham Dawes
f2d20384a0 Implement wxListCtrl::GetEditControl() for wxQt
To get access to the control used for editing items, we need to create
it ourselves, which involves defining our own factory for doing this,
but seems to be the only way of achieving our goal.

Closes https://github.com/wxWidgets/wxWidgets/pull/1204
2019-02-02 15:35:26 +01:00
phowstan
89e5663a75 Handle calling wxWindow::Hide() before Create() in wxQt
Hide the window explicitly once it's created. This is not very useful,
as the real purpose of calling Hide() before Create() is to prevent the
window from being initially shown at all to avoid flicker, but better
than not hiding it at all.

Closes https://github.com/wxWidgets/wxWidgets/pull/1203
2019-02-02 15:11:42 +01:00
Vadim Zeitlin
27f1c8f445 Fix wxRadioButton grouping in wxQt
Create QButtonGroup as needed to honour wxRB_GROUP and wxRB_SINGLE
styles.

Co-Authored-By: Cătălin Răceanu <maildus@gmail.com>

Co-Authored-By: liamtreacy <liam.treacy@gmail.com>
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
a913393147 Test that controls between radio buttons don't break grouping
Add a test checking that even not directly consecutive radio buttons are
still treated as being part of the same radio group.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
d403c9ecce Slightly simplify radio buttons creation in the unit test
No real changes, just add a temporary variable for the parent and use
more useful (and shorter) labels for the buttons.
2019-02-02 15:06:14 +01:00
Vadim Zeitlin
10b35c22f5 Remove unnecessary "protected:" from wx/qt/radiobut.h
No real changes, just remove an empty protected section.
2019-02-02 15:06:11 +01:00
Vadim Zeitlin
481b29e6ce Stop mapping QSize(0,0) to wxSize(-1,-1) as well
Do this for consistency with a similar recent change to wxPoint.
2019-02-02 14:24:16 +01:00
Vadim Zeitlin
1a9f0f8b8d Make trivial Qt <-> wx conversion functions inline
No real changes, just make often used and trivial functions inline as
this like an obviously better thing to do.
2019-02-02 14:24:16 +01:00
phowstan
e831703aae Handled null cursor correctly in wxQt SetCursor()
Make passing invalid wxCursor object to SetCursor() work and reset any
previously specified cursor.

Closes https://github.com/wxWidgets/wxWidgets/pull/1197
2019-02-02 14:15:11 +01:00
Artur Wieczorek
0183b47a45 Fix build with wxUSE_CLIPBOARD==0 2019-02-01 23:36:48 +01:00
Jouk
cbbb9a28d9 Add src/generic/rowheightcache.cpp to the OpenVMS makefiles for compilation 2019-02-01 13:41:25 +01:00
Maarten Bent
4aeb941c4c Demonstrate wxSlider::SetSelection() in widgets sample 2019-01-31 21:16:07 +01:00
Maarten Bent
53af5cb251 Some fixes for wxSlider in widgets sample
Correctly save the slider value before recreating the slider.
Layout the entire page instead of only the slider sizer.
Update the text controls after recreating the slider.
Always enable 'both sides' checkbox. It has additional effects in wxMSW.
2019-01-31 21:16:07 +01:00
Maarten Bent
56c7eadc0a Use wxSizerFlags for slider page in widgets sample
Don't set minimum size of right panel.
2019-01-31 21:16:06 +01:00
Maarten Bent
bf0a8ffd74 Improve guards in button pages of widgets sample
Add guards for wxCommandLinkButton.
Move CheckBoxes outside wxHAS_BITMAPTOGGLEBUTTON guard.
Remove wxHAS_ANY_BUTTON check, this is always defined with wxUSE_TOGGLEBTN.
2019-01-31 21:16:06 +01:00
Maarten Bent
8f3b87dce7 Fix wxSlider::SetThumbLength() on wxMSW
It requires TBS_FIXEDLENGTH style.
Call InvalidateBestSize because the size of the control might change.
Call Layout in the widgets sample to adjust to the changed size.
Use GetThumbLength() instead of the arbitrary defined THUMB size.
2019-01-31 21:16:06 +01:00
Maarten Bent
9f9bc40f83 Better fix layout of wxSlider labels after changing value range
Commit 0b821adf did not (always) trigger a call to DoMoveWindow.
See #17093.
2019-01-31 21:16:05 +01:00
Maarten Bent
5eaea0e43f Improve wxSlider in high DPI
Make thumb and tick size DPI dependent.
2019-01-31 21:16:05 +01:00
Maarten Bent
94f3d567c8 Centre labels above and below vertical wxSlider
Improve label position for specific combinations of wxSlider styles.
2019-01-31 21:16:05 +01:00