Commit Graph

66225 Commits

Author SHA1 Message Date
Vadim Zeitlin
58d4b0e209 Fix for showing multiple popups in a row in wxMSW
There were at least 2 problems when showing a transient popup while
another one was already shown in wxMSW, as could be seen by showing
several wxRichToolTips in a row from a timer event handler, for example:

First problem was that wxCurrentPopupWindow was incorrectly reset in
this case by the old popup window when it was hidden, even though it
should have been remaining set to the new popup window. Fix this by
checking that we only reset wxCurrentPopupWindow when hiding the popup
if it still points to this popup, but not if it has been changed to
point to another one in the meanwhile.

Second problem was more mysterious and resulted in simply not receiving
the activation events for the new popup when showing it resulted in
hiding the previous one. The working hypothesis is that hiding a window,
which changes activation on its own, from WM_NCACTIVATE handler in our
code confused ShowWindow(), which handles switching activation, which
didn't expect this to happen, so the fix is to avoid doing anything
immediately from this handler and wait until the next idle event to do
it instead.

These fixes ensure that showing several popups in a row works correctly,
i.e. hides the previous popup when a new one is shown and also keeps the
parent window appearing active during all the time and deactivates it if
the focus switches to another top level window at the end.
2019-03-30 04:11:46 +01:00
New Pagodi
211b81f459 Restore handling of XPMs with a mask in wxStyledTextCtrl
Fix XPM to RGBA conversion code for Scintilla markers to handle mask
correctly.

Closes #18374.
2019-03-30 03:44:09 +01:00
dasimx
a15004fc5f Fix handling display disconnection under wxMSW
Information about display cached in wxDisplayFactory::m_impls and in
wxDisplayFactoryMSW::m_displays could get out of sync after removing a
display from the system, resulting in failures when calling various
wxDisplay functions later.

To fix this, reuse InvalidateCache() to invalidate the cache in
wxDisplayFactoryMSW too, making it virtual in order to allow overriding
it there. Also call InvalidateCache() from wxDisplayFactoryMSW itself
instead of doing it from wxWindow, as this works even when the
application isn't showing any windows (and also keeps all
display-related code together).

Closes https://github.com/wxWidgets/wxWidgets/pull/1246
2019-03-29 23:19:59 +01:00
PB
15a68c9916 Add basic information to wxDisplayChangedEvent documentation
The event had no description at all, so at least the very basic
information has been added.

Closes https://github.com/wxWidgets/wxWidgets/pull/1280
2019-03-29 22:17:48 +01:00
PB
198a1efee5 Correct wxListCtrl::InsertColumn() documentation
In InsertColumn(long, const wxListItem&) a line was split inside a
referred overloaded method signature which prevented doxygen to
recognize and link the referred method.

In InsertColumn(long, const wxString&, int, int) non-existing
Insert(long, const wxListItem&) overload was referenced instead of
InsertColumn(long, const wxListItem&).

Clsoes https://github.com/wxWidgets/wxWidgets/pull/1279
2019-03-29 21:32:49 +01:00
Vadim Zeitlin
7f39e4ab88 Merge branch 'gtk-mnemonics'
Fixes for association of controls with their mnemonics in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/1278

Closes #15776.
2019-03-29 19:22:05 +01:00
Vadim Zeitlin
e81c738694 Fix spurious assert in wxMSW when destroying a TLW with buttons
This commit partially reverts 17055fb8c6
which resulted in asserts when destroying dialogs with buttons, one of
which had focus, see https://github.com/wxWidgets/wxWidgets/pull/1245

This happened because wxGetTopLevelParent() returns NULL when the parent
TLW was already half-destructed, resulting in an assert, while the
original code still returned NULL in this case, but did it silently,
which is the right thing to do here as we can't avoid being called
during the parent TLW destruction.

Closes https://github.com/wxWidgets/wxWidgets/pull/1268
2019-03-29 19:20:19 +01:00
Vadim Zeitlin
9cbc1a5fbf Merge branch 'msw-tbar-resize'
Many fixes for wxToolBar (re)sizing in wxMSW, partially addressing
toolbar size changes since the previous wxWidgets versions.

See https://github.com/wxWidgets/wxWidgets/pull/1241

Closes #18294.
2019-03-29 19:16:40 +01:00
Vadim Zeitlin
6b6fee8685 Avoid TB_DELETEBUTTON errors when recreating wxMSW wxToolBar
Reset the number of buttons to skip deleting the old buttons in
wxToolBar::Recreate() as these buttons don't exist any more (having been
created in the old control) and trying to delete them just results in
debug error messages from TB_DELETEBUTTON.
2019-03-29 19:13:45 +01:00
Vadim Zeitlin
876d0f293f Avoid querying wxToolBar size in wxMSW while it's being recreated
Recreating the toolbar tried to offset the new toolbar window being
created by the size of the existing toolbar, when it was set up as the
main frame toolbar. Luckily, this didn't work because getting the size
of a wxWindow without a valid HWND failed, but it resulted in debug
warning messages and was a wrong thing to do in the first place.

Fix this by hiding the old toolbar before destroying it, this suffices
for the parent frame not to use it for the client area calculations.
2019-03-29 19:09:49 +01:00
Vadim Zeitlin
b0133392b7 Fall back on the main widget if connect one isn't focusable
If neither main widget nor connect widget is focusable (which notably
happens when they're the same anyhow, as is the case for wxChoice, for
example), still use the main widget as mnemonic instead of not using any
mnemonic at all.

This fixes activation of a wxChoice preceded by wxStaticText by pressing
the key combination corresponding to the label mnemonic, which didn't
work previously.
2019-03-27 15:41:53 +01:00
Vadim Zeitlin
01ed0842ff Set mnemonics for the closest preceding label
Due to a wrong "else" in RealizeTabOrder() implementation, we could set
the mnemonic widget for a previous widget using mnemonics (i.e.
wxStaticText or wxStaticBox) rather than the one closest to the actual
control activated by the mnemonic.
2019-03-27 15:39:39 +01:00
Paul Cornett
b8789b9d6f Fix drag move of wxMiniFrame under Wayland
Use gtk_window_begin_move_drag() instead of trying to do it manually
See #18372
2019-03-26 10:04:35 -07:00
Vadim Zeitlin
82290bfd10 Merge branch 'donovan6000_wxdataviewitem_fix' of https://github.com/donovan6000/wxWidgets
Render disabled items as greyed out in wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1277
2019-03-26 15:05:59 +01:00
Vadim Zeitlin
9926619adf Don't use hard-coded size for wxSpinCtrl in the dialogs sample
This truncates the control with GTK+ 3 where 40 or 60 pixels is never
enough for its width (even without speaking about high DPI displays) and
results in tons of GTK+ warnings.
2019-03-26 13:57:21 +01:00
donovan6000
7cd48f7db1 Fixes how disabled wxDataViewToggle columns are displayed when control is disabled 2019-03-25 18:02:41 -07:00
donovan6000
e292de4bb0 Disabling also checks if control is disabled 2019-03-25 17:59:56 -07:00
Paul Cornett
8ddf484d3e Improve appearance of wxToolBar default disabled bitmaps on GTK3 with HiDPI
If normal bitmap is HiDPI, use it to create default disabled bitmap
See #18225
2019-03-25 09:02:09 -07:00
oneeyeman1
a9a0305758 Do nothing in wxGrid::SetCellValue() if value doesn't change
This is a minor optimization and can significantly reduce flicker in a
not uncommon case when SetCellValue() is used to refresh all or many of
the grid cells if only few of them actually change.

See #9717.

Closes https://github.com/wxWidgets/wxWidgets/pull/1276
2019-03-25 11:51:20 +01:00
donovan6000
d7f3f96cac Fixes displaying disabled wxDataViewItem with native appearance
Causes the wxCONTROL_DISABLED flag to be set based on the results of the wxDataViewModel's IsEnabled() method.
2019-03-24 23:32:55 -07:00
Vadim Zeitlin
3d45374200 Merge branch 'box-sizer-asserts'
Avoid unwanted asserts in wxBoxSizer when wxSHAPED is used.

See https://github.com/wxWidgets/wxWidgets/pull/1274
2019-03-24 21:43:37 +01:00
Vadim Zeitlin
999d78a3bc Allow using alignment with wxEXPAND and wxSHAPED in wxBoxSizer
Don't assert in wxBoxSizer when both alignment flags and wxEXPAND are
used together if wxSHAPED is also used, as such flag combinations may
make sense and so shouldn't be forbidden.

Add a unit test checking that this is allowed.
2019-03-23 17:18:48 +01:00
Vadim Zeitlin
20db193332 Replace CPPUNIT_ASSERT_EQUAL() with CHECK() in wxBoxSizer test
No real changes, just get rid of the last traces of CppUnit in this
test.
2019-03-23 17:13:06 +01:00
Vadim Zeitlin
8fdb5a7982 Rewrite wxBoxSizer unit test without CppUnit::TestCase
No real changes, just get rid of the old CppUnit-compatible machinery in
this unit test.
2019-03-23 17:10:26 +01:00
Scott Talbert
ac18cfe7cc Fix inconsistent function declarations in documentation
Mostly remove the virtual keyword where the actual implementation isn't
virtual.
2019-03-22 00:29:40 -04:00
Vadim Zeitlin
6ad5aee8ac Document the change in wxMSW wxToolBar height determination
Since 0185d61a2c wxToolBar height is
increased if the controls don't fit in it rather than decreasing the
size of the controls, which results in different appearance than in the
previous versions, so document this as well as the advice for restoring
the old behaviour.
2019-03-21 14:27:53 +01:00
Vadim Zeitlin
d24f6f7916 Reduce the margins around toolbar controls by half
This wastes less space in the toolbar and looks better and is more
compatible with 3.0 (although not totally so, but this is intentional
as 3.0 didn't use any margins at all, which looked bad).
2019-03-21 14:20:48 +01:00
Vadim Zeitlin
07673fdb97 Fix toolbar size calculations in wxTB_NODIVIDER case
There is no 2px border separating the toolbar from the rest of the
window in this case, so don't overcompensate by accounting for it.
2019-03-21 04:45:49 +01:00
Vadim Zeitlin
8042648c73 Don't move wxTextCtrl insertion point if it doesn't really change
Resetting the insertion point position to 0 after calling
wxTextCtrl::SetValue() or ChangeValue() which didn't really change the
control contents was unexpected, as such calls are supposed to be
"optimized away", and this was indeed the case under wxMSW and wxOSX,
but not in wxGTK.

So change wxGTK to follow the other ports, add a unit test checking for
this behaviour and officially document it.

As a side effect, this ensures that the numeric validator classes don't
reset the insertion point position to 0 on every focus loss under wxGTK,
as happened before.
2019-03-21 02:44:45 +01:00
Vadim Zeitlin
39380847da Avoid redundant declarations for wxQsort()
This works around gcc -Wredundant-decls warning that was given (if
explicitly enabled) when both wx/vector.h and wx/utils.h were included.

The workaround is ugly, but it doesn't seem worth it to introduce a
separate wx/qsort.h header just for this single function, which seems to
be the only other way to fix this.

Closes https://github.com/wxWidgets/wxWidgets/pull/1271
2019-03-21 02:44:27 +01:00
Vadim Zeitlin
f5f912efa1 Merge branch 'clang-no-rtti'
Fix wxGTK compilation without RTTI and clang-related no-rtti fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1266
2019-03-21 02:43:22 +01:00
Vadim Zeitlin
a1bc4131a6 Avoid modifying the text unnecessarily in wxNumValidatorBase
Even if it's not supposed to do anything, avoid calling
wxTextCtrl::ChangeValue() completely if the text contents doesn't
actually change. This should be slightly more efficient and avoids any
chance of bugs such as the one resulting in the insertion point being
still moved to the beginning of the text even if it doesn't change in
wxGTK currently (see https://github.com/wxWidgets/wxWidgets/pull/1270).
2019-03-21 02:41:16 +01:00
New Pagodi
5f39bb4157 Update other test build files by hand for the new STC test 2019-03-20 17:07:56 -05:00
New Pagodi
a4b688cb45 Regenerate the test make files to include the new STC test 2019-03-20 17:07:47 -05:00
New Pagodi
7b0c7495e3 Add gui test for STC popup items
With wxSTC, popup autocompletion lists and call tips need to be able to
show their information and respond to mouse clicks, but should never
take focus from their parent STC. This test verifies that these popups
function in this manner.
2019-03-20 17:07:39 -05:00
New Pagodi
fe7b332b7b Regenerate STC files after recent changes 2019-03-20 00:15:44 -05:00
New Pagodi
267540d233 Add AutoCompUseListCtrl method to STC
The AutoCompUseListCtrl method can be used to make an autocompletion
list look like it's being shown with a wxListCtrl instead of a
wxListBox. When this style is used, the list will have hot tracking.
On MSW, the colours will also be slightly different.
2019-03-20 00:15:38 -05:00
New Pagodi
3900cfec27 Add AutoCompSetColours method to stc
With some system themes, the default colors used for a list box can be
hard to read or otherwise unsuitable for use with an autocompletion
popup. This method lets a user manually specify colours for the list
box’s background, text, selection background, and selected text.
2019-03-20 00:15:31 -05:00
New Pagodi
f0ba9f0ef1 Reduce flicker with STC call tips in MSW
When switching between call tips in MSW, there can be a bit of flicker
when the first is closed and the new one is opened. To reduce the
flicker, store the call tip background in a bitmap and use a very brief
fade-in animation when showing the new call tip.
2019-03-20 00:15:24 -05:00
New Pagodi
0f7552cdb0 Hide popup when STC app is minimized on macos and GTK+ 2019-03-20 00:15:13 -05:00
New Pagodi
0c953308de Allow wxSTCPopupWindow to move when its parent wxSTC moves 2019-03-20 00:15:05 -05:00
New Pagodi
de0992ea3d Implement wxSTCListBox using wxVListBox
Previously wxSTCListBox was a class derived from wxListView and required
several extra steps to make the control look correct when it lacked
focus. This commit changes wxSTCListBox so that it is a wxVListBox and
is built to always draw itself looking as though it has focus.

In addition this splits the work previously done by ListBoxImpl class
among wxSTCListBox and a newly defined wxSTCListBoxVisualData class.
wxSTCListBox manages the work done by a specific list and
wxSTCListBoxVisualData manages the data common to all lists. All
ListBoxImpl methods now simply forward to a method of one of those 2
classes.
2019-03-20 00:14:58 -05:00
New Pagodi
59190ffc06 Use wxSTCPopupWindow for call tips in wxSTC
This class has been built to have the features needed for showing popups
with wxSTC and so provides a much shorter implementation for calltips.
2019-03-20 00:14:50 -05:00
New Pagodi
891f541397 Use wxSTCPopupWindow for showing autocompletion lists
The newly defined wxSTCPopupWindow class has been built to have the
behavior necessary for showing the popup windows used by wxSTC. This
commit uses it as the base class of the window that shows autocompletion
lists.
2019-03-20 00:14:43 -05:00
New Pagodi
06a7433e76 Modify xcode project to use PlatWXcocoa.mm 2019-03-20 00:14:36 -05:00
New Pagodi
10bbd4009a Regenerate build files after recent changes 2019-03-20 00:14:08 -05:00
New Pagodi
f2e1aa46fe Modify build system files to use PlatWXcocoa.mm
A recent commit added the file src/stc/PlatWXcocoa.mm needed for wxSTC
with the cocoa port. This commit modifies the build system files to
use this new file when it is needed.
2019-03-20 00:12:41 -05:00
New Pagodi
66d340ae15 Define the wxSTCPopupBase for wxCocoa
With the cocoa port, wxSTCPopupBase is defined by creating a floating
window using the cocoa api and then wrapping that window in a
wxNonOwnedWindow for use with wxWidgets.
2019-03-18 22:25:10 -05:00
New Pagodi
75656067ae Add wxSTCPopupWindow for wxSTC
The wxSTCPopupWindow is intended to serve as a popup window for showing
call tips and popup lists with wxSTC. This class is designed to show its
content and respond to mouse clicks, but it should never take focus from
its parent wxSTC. It is built with customizations for wxMSW, wxCocoa,
and wxGTK+ to function in that way.
2019-03-18 22:25:02 -05:00
New Pagodi
79e16c78bc Demonstrate call tip clicks in the stc sample
This adds a demonstration of handling call tip clicks to the stc sample.
Instead of showing a single call tip, 3 different call tips can be
shown. The sample demonstrates how to move between the call tips
depending on if the up or down button was clicked in the call tip
window.
2019-03-18 22:24:43 -05:00