Commit Graph

66410 Commits

Author SHA1 Message Date
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
New Pagodi
518cdc5790 Demonstrate autocompletion in the stc sample
This adds a demonstration of autocompletion for C preprocessor
directives to the stc sample. It also shows how to register and use
small images with the autocompletion popup.
2019-03-18 22:24:34 -05:00
Vadim Zeitlin
fc4242a906 Add a hack to allow building wxGTK without RTTI
Add a not really used, but required default ctor to fix compilation
without RTTI.

Closes #18364.
2019-03-19 02:25:44 +01:00
Vadim Zeitlin
626a96058f Fix clang -Winconsistent-missing-override when not using RTTI
In this case wx-specific RTTI is used and GetWxTypeId() method was
overridden without using wxOVERRIDE, which resulted in dozens of
warnings for each translation unit.
2019-03-19 02:12:01 +01:00
Vadim Zeitlin
6e949961ef Detect wxNO_RTTI automatically for clang too
This has been already done for gcc and MSVC, add clang-specific check as
well.
2019-03-19 02:10:53 +01:00
Vadim Zeitlin
1cdc0acfbe Merge branch 'stcxpm' of https://github.com/NewPagodi/wxWidgets
Improve XPM images handling in wxStyledTextCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1215
2019-03-18 22:36:25 +01:00
VZ
fb8c4bda29 Update src/stc/ScintillaWX.cpp
Co-Authored-By: NewPagodi <NewPagodi@users.noreply.github.com>
2019-03-18 15:43:39 -05:00
VZ
12749d1a59 Update src/stc/PlatWX.cpp
Co-Authored-By: NewPagodi <NewPagodi@users.noreply.github.com>
2019-03-18 15:43:30 -05:00
Vadim Zeitlin
23ddf26571 Fix bug with wxRadioButton state changing unexpectedly in wxMSW
In wxMSW, a focused wxRadioButton is always checked, which meant that
checking a wxRadioButton while focus was not in the window containing it
and later giving the focus to that window could uncheck it by giving
focus to another wxRadioButton that had had it previously.

Fix this by adding WXSetPendingFocus() to wxMSW wxWindow and calling it
from wxRadioButton::SetValue() to ensure that when the focus is
regained, it goes to the newly checked radio button and not some other
one.

This replaces the previously used, for the same purpose, wxMSW-specific
wxTopLevelWindow::SetLastFocus(), so while this solution is not exactly
pretty, it's not worse than we had before, while being more generic.

Also add a unit test checking that things work correctly in the scenario
described above.

Closes https://github.com/wxWidgets/wxWidgets/pull/1257

Closes #18341.
2019-03-18 18:29:19 +01:00
Ilya Sinitsyn
324c58d9e2 Do not set focus to the window when its rich tooltip is shown
Don't set the focus to the window the rich tooltip refers to in its
ShowFor() method because this was inconsistent with plain tooltips and
also could result in infinite recursion if the window decided to show
its tooltip when it got focus.

Closes https://github.com/wxWidgets/wxWidgets/pull/1265
2019-03-18 18:25:09 +01:00
Vadim Zeitlin
3e0238e089 Merge branch 'wrapsizer' of https://github.com/thesiv/wxWidgets
Fix wxWrapSizer min size calculation in the secondary direction and
improve its unit tests.

See https://github.com/wxWidgets/wxWidgets/pull/1258
2019-03-18 18:22:07 +01:00
Vadim Zeitlin
2531780c3b Avoid division by 0 in generic wxDataViewCtrl scrolling code
Apparently, ScrollTo() can be called when processing keyboard input in
the control before its initial resize and hence before scrolling is
initialized and in this case per-unit scroll units are still 0, so
dividing by them is not a good idea.

Just avoid scrolling in this case.

Closes https://github.com/wxWidgets/wxWidgets/pull/1262
2019-03-18 18:18:47 +01:00
exprosic
7a2d9d0d10 Fix compilation of MFC support code in MSVS conformance mode
Allow the code to be compilable with /permissive-, which is on by
default in VS2017.

Closes https://github.com/wxWidgets/wxWidgets/pull/1263
2019-03-18 18:11:42 +01:00
Ilya Sinitsyn
f65153a843 Fix overlay initialization
Fix the size used for a device context initialization, this fixes a
regression from 18472ea8b1 which used
right/bottom coordinate instead of width/height as Init() arguments.

See #14415.

Closes https://github.com/wxWidgets/wxWidgets/pull/1261
2019-03-17 15:25:52 +01:00
Stefan Csomor
cfded96627 fixing truncation error in GetSubBitmap
fixes #18362
2019-03-17 12:19:53 +01:00