Commit Graph

65690 Commits

Author SHA1 Message Date
Vadim Zeitlin
8fbca5cb70 Remove all trailing spaces
No real changes, just clean up sources by removing trailing spaces from
all the non-generated files.

This should hopefully avoid future commits mixing significant changes
with insignificant whitespace ones.
2019-01-30 17:35:54 +01:00
Matthew Griffin
ae94f4da9c Ensure that top level window is active when it's shown in wxQt
Under some (not totally clear) circumstances, a TLW can remain inactive
after being shown, which is undesirable, as it prevents setting focus to
its children from working.

Work around this by calling activateWindow() explicitly if necessary.

Closes https://github.com/wxWidgets/wxWidgets/pull/1179
2019-01-30 17:27:15 +01:00
Scott Talbert
aa22547b28 Document wxHtmlCellEvent::GetMouseEvent()
Closes https://github.com/wxWidgets/wxWidgets/pull/1195
2019-01-30 03:01:38 +01:00
Graham Dawes
3cb395a5a5 Implement wxNotebook::DeleteAllPages() for wxQt
See https://github.com/wxWidgets/wxWidgets/pull/1191
2019-01-28 19:07:28 +01:00
Graham Dawes
6b11c372a1 Fix recently introduced build error in widgets sample
Make it compile again when wxHAS_BITMAPTOGGLEBUTTON is not defined,
which is notably the case in wxQt.

Closes https://github.com/wxWidgets/wxWidgets/pull/1189
2019-01-28 12:41:31 +01:00
Vadim Zeitlin
2c7489fffe Merge branch 'widgets-sample-buttons' of https://github.com/MaartenBent/wxWidgets
Several improvements to the buttons pages of the widgets sample:

- Use a valid font when creating the bitmap.
- Create the bitmap with an DPI independent size.
- Use different images for different button states, as described by the
  checkbox options.
- Add a checkbox to disable the bitmap.
- Recreate the button when changing label, so the bitmap is updated.
- Implement the 'fit exactly' option on ToggleButton page.
- Use more wxSizerFlags in widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1188
2019-01-28 01:19:31 +01:00
Vadim Zeitlin
66727bf04b Merge branch 'wxradiobox' of https://github.com/MaartenBent/wxWidgets
Several wxRadioBox-related improvements:

- Fix its minimum width calculation to take the title into account.
- Remove unused nor useful wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM.
- Tidy up the radiobox page of the widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1187
2019-01-28 01:17:34 +01:00
Tomay
10eeb0b262 Improve drawing buttons in generic wxSearchCtrl
Several fixes:
* Clear the buttons background, which can be important if their (custom)
  bitmap is transparent.
* Only add margin before/after the corresponding button if it is
  actually visible.
* Select the bitmap out of wxMemoryDC before modifying it.
* Don't assume that the "Cancel" button is always square.

Closes https://github.com/wxWidgets/wxWidgets/pull/1142
2019-01-28 01:15:05 +01:00
New Pagodi
07f64c3b75 Add wxPU_CONTAINS_CONTROLS style for wxPopupWindow
This restores the default behavior of a popup window in MSW to the
behavior it had before 56c4191168. The new
flag added by this commit can be used to give the popup window the
behavior from after that commit, i.e. choose the implementation using a
WS_POPUP window rather than the default one using a WS_CHILD of the
desktop.

The old behavior kept the popup from taking focus from its parent window
but left some controls not working. The new behavior has the popup take
focus and lets all controls work.

Closes https://github.com/wxWidgets/wxWidgets/pull/1123
2019-01-28 00:48:16 +01:00
Tomay
8deb2cf0bb Add wxUSE_WINSOCK2 wxMSW option to include winsock2.h
Including <winsock.h> and <winsock2.h> is incompatible and if the
application wants to use the latter, it may be convenient to define
wxUSE_WINSOCK2 when building wxWidgets instead of having to work around
winsock.h implicit inclusion from include/wx/msw/wrapwin.h.

Closes https://github.com/wxWidgets/wxWidgets/pull/1122
2019-01-28 00:34:34 +01:00
Scott Talbert
eaee931011 Fix sending of EVT_KEY_DOWN on wxGTK for non-ASCII characters
Instead of returning early if the keycode is invalid, try setting the unicode
character first, and if neither are valid, return.

Fixes #18054
2019-01-27 09:01:05 -08:00
Maarten Bent
ee752e2439 Use more wxSizerFlags in widgets sample 2019-01-27 17:04:08 +01:00
Maarten Bent
a6fbfacc62 Improve wxButton and wxToggleButton with bitmap in widgets sample
Use a valid font when creating the bitmap.
Create the bitmap with a DPI independent size.
Use different images for different button states, as described by the checkbox
options.
Add a checkbox to disable the bitmap.
Recreate the button when changing label, so the bitmap is updated.
Implement the 'fit exactly' option on ToggleButton page.
2019-01-27 17:04:07 +01:00
Maarten Bent
0d5ed276a4 Update radio page in widgets sample
Make the reset button work by binding to OnUpdateUIReset.
Use wxSizerFlags based API.
Remove minimum size of right panel so the minimum size of wxRadioBox can be
verified.
Use wxArrayString instead of manually creating and deleting an array of
wxString pointers.
Reapply disabling and hiding the test button, and check if test button is
available.
Layout the entire page instead of only the sizer, see #18100.
2019-01-27 15:26:17 +01:00
Maarten Bent
a377f0e5f0 Get rid of wxRA_LEFTTORIGHT and wxRA_TOPTOBOTTOM styles
This was only used in wxUniv, wxRA_SPECIFY_[COLS/ROWS] can be used instead.
Do not remove them from the definitions, to not break user code.

Closes #18100.
2019-01-27 15:26:16 +01:00
Maarten Bent
4fc38bc2c7 Improve minimum width of wxRadioBox
Take the minimum width of the wxStaticBox into account, instead of only the
width of the label.
2019-01-27 15:26:14 +01:00
Graham Dawes
0265139c11 Track Qt tab widget selection when adding pages to wxNotebook
Ensure the selected state tracks the Qt selection: without this, if
no explicit selection is made after adding the pages,
wxNotebook::GetSelection() returns wxNOT_FOUND even though the first
page is selected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1182
2019-01-27 04:04:42 +01:00
chris2oph
b1594725c9 Use QWidget::update() rather than repaint() in wxClientDC
Qt documentation advises to avoid calling repaint() except when an
immediate update is required, i.e. it corresponds to wxWindow::Update().
Use update() instead to avoid many Qt warnings that appeared when
resizing the caret sample window, for example.

Closes https://github.com/wxWidgets/wxWidgets/pull/1178
2019-01-27 04:00:12 +01:00
Vadim Zeitlin
b38587c0ca Merge branch 'tests-wait-event' of https://github.com/vadz/wxWidgets
Refactor code waiting for events in the test suite.

See https://github.com/wxWidgets/wxWidgets/pull/1173
2019-01-27 03:58:23 +01:00
Vadim Zeitlin
c74727c20f Merge branch 'qt_more_event_loop_improvements' of https://github.com/GeoTeric/wxWidgets
Event loop and idle events improvements for wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1171
2019-01-27 03:55:38 +01:00
Vadim Zeitlin
d8348b0419 Merge branch 'master' of https://github.com/dghart/wxWidgets
Improve wxDateTime::SetToWeekDay documentation.

See https://github.com/wxWidgets/wxWidgets/pull/1185
2019-01-27 03:41:22 +01:00
dghart
8e4b492cf4 Clarify what happens if the wxDateTime::SetToWeekDay month and/or year parameters are left as the default Inv_Month/Inv_Year
This causes the month and/or year being set to their wxDateTime::Now values, even if the original values in the wxDateTime object were valid.
2019-01-26 21:12:07 +00:00
dghart
2716347f17 Correct the order of parameters in the wxDateTime::SetToWeekDay examples
e.g. "For example, SetToWeekDay(wxDateTime::Wed, 2)"
not  "For example, SetToWeekDay(2, wxDateTime::Wed)"
2019-01-26 20:55:20 +00:00
Scott Talbert
c68e5d0617 Fix some spelling/grammar errors in documentation
Mostly replace ungrammatical "allows to do" with correct "allows doing".

Closes https://github.com/wxWidgets/wxWidgets/pull/1183
2019-01-26 03:50:47 +01:00
Graham Dawes
e40323d312 Simplify shared timer reference counting in wxEventLoop for wxQT 2019-01-25 16:44:23 +00:00
ali kettab
84fc5c1714 Fix changing tooltip via wxToolTip::SetTip() in wxQt
Update the actual tool tip used by Qt and not just the internal variable
when SetTip() is called.

Also implement wxToolTip::SetWindow().

Closes https://github.com/wxWidgets/wxWidgets/pull/1175
2019-01-25 14:39:37 +01:00
ali kettab
3c369af2e6 Translate QFocusEvent to wxFocusEvent correctly
Set the ID, object and the associated window.

Closes https://github.com/wxWidgets/wxWidgets/pull/1177
2019-01-25 03:31:22 +01:00
Vadim Zeitlin
5811d541da Refactor code waiting for events in the test suite
We already had WX_ASSERT_EVENT_OCCURS_IN macro and a recent commit also
added code doing almost the same thing manually in wxTopLevelWindow unit
test, which was one version too many.

Replace both of them with the new EventCounter::WaitEvent().

No real changes, this is just a refactoring.
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
f4ea128007 Include wx/stopwatch.h explicitly from wxTextCtrl unit test
Don't rely on it being implicitly included from another header when we
use wxStopWatch in this file (with wxGTK only).
2019-01-24 22:52:46 +01:00
Vadim Zeitlin
7c831d25ee Group headers together in wxTextCtrl unit test
No real changes.
2019-01-24 22:52:46 +01:00
ali kettab
515031cf6b Set event object for wxKeyEvents generated in wxQt
Not setting the event object broke the code expecting it to be set,
notably in our own validators code.

Closes https://github.com/wxWidgets/wxWidgets/pull/1176
2019-01-24 22:47:26 +01:00
Vadim Zeitlin
7a42dbd83b Merge branch 'qt_listctrl_find_text' of https://github.com/GeoTeric/wxWidgets
Fix wxListCtrl::FindItem() and add support for columns to GetItemText()
in wxQt.

See https://github.com/wxWidgets/wxWidgets/pull/1174
2019-01-24 22:42:35 +01:00
Liam Treacy
f9280c8529 Now use the column index to retrieve the correct text in GetItemText 2019-01-24 14:38:38 +00:00
Liam Treacy
ca00251454 Fix in wxListCtrl::FindItem. Every item is now iterated through, rather than only the first 2019-01-24 14:35:47 +00:00
Liam Treacy
83f23cec89 Added virtual and override specifiers to derived method in ListCtrl 2019-01-24 14:31:17 +00:00
Maarten Bent
42c602bddf CMake: test installation with Travis CI
With wx-config working, test installing and building the minimal sample
with Travis CI.

Closes https://github.com/wxWidgets/wxWidgets/pull/1172
2019-01-24 13:20:38 +01:00
Graham Dawes
9cd566789d Added file missing from previous commit 2019-01-24 08:08:12 +00:00
Dummy
b0660cc87c Pass argument of proper type to wxPropertyGridInterface::SetPropertyBackgroundColour
The last argument passed to this function should be an int flag not a Boolean value.
Boolean value 'true' passed here is converted to int 1 so wxPG_RECURSE flag is never set and the background colour is never changed for sub-properties.

Closes #18333.
2019-01-23 20:08:57 +01:00
Richard Smith
537b2c3bb0 Reinstate wxTextCtrl unit test previously disabled for wxQt
This test was fixed by earlier changes to wxQt font styles and passes
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1169
2019-01-23 16:48:26 +01:00
Vadim Zeitlin
9c16a3748e Declare variable only needed inside an "if" inside it
No real changes, just make the code slightly more concise.
2019-01-23 16:47:05 +01:00
Vadim Zeitlin
6b3a0cc460 Make wxQtSpinBoxBase-derived valueChanged() methods inline
It seems better to have them in the class itself, near the connect()
call binding them.

This also resolves an inconsistency between wxQtSpinBox::valueChanged(),
which was defined elsewhere in the source file, and the same method of
wxQtDoubleSpinBox, which was defined directly after the class
declaration.

See https://github.com/wxWidgets/wxWidgets/pull/1168
2019-01-23 16:45:21 +01:00
Matthew Griffin
adee46d155 Send event when wxSpinCtrlDouble value changes in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1168
2019-01-23 16:44:46 +01:00
phowstan
7cfb5b91a5 Implement wxStaticBox::Set/GetLabel() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1167
2019-01-23 16:38:25 +01:00
Graham Dawes
6aecaa8845 Share a single idle timer for all event loops in wxQT 2019-01-23 13:55:20 +00:00
Graham Dawes
0c28952ff6 Make ScheduleIdleCheck take into account whether the loop is exiting 2019-01-23 12:04:42 +00:00
Graham Dawes
b8f71efc04 Implement filtering in wxEventLoop::DoYieldFor under wxQT 2019-01-23 11:57:16 +00:00
Artur Wieczorek
5d40d57218 Don't process last HDN_ITEMCHANGING notification
Just skipping last HDN_ITEMCHANGING arriving after HDN_ENDTRACK (to prevent emitting EVT_HEADER_RESIZING) when current column width is less than minimal value allowed is not enough because this notification will be handled by the native control in a standard way causing column width to resize below the limit.
When current width is below the limit this last HDN_ITEMCHANGING notification has to be explicitly "vetoed" to prevent default handling from happening.

Close #18335.
2019-01-23 00:04:37 +01:00
Vadim Zeitlin
2753bb2f50 Merge branch 'qt_event_loop' of https://github.com/GeoTeric/wxWidgets
Use QEventLoop for wxEventLoop implementation in wxQt to fix several
issues with wxEventLoop, notably avoid "QApplication::exec is already
running" errors.

See https://github.com/wxWidgets/wxWidgets/pull/1165
2019-01-22 19:05:53 +01:00
Graham Dawes
c2270f8a83 Don't generate events in wxChoice::SetSelection() under wxQt
This makes it consistent with the other ports and makes the
corresponding unit test pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1163
2019-01-22 19:03:41 +01:00
Liam Treacy
31c2bd7aa3 Add default parameter to wxDialog::Show() in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1164
2019-01-22 15:49:44 +01:00