Commit Graph

65953 Commits

Author SHA1 Message Date
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
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
New Pagodi
f4e0c1aaee Regenerate wxSTC files after recent changes 2019-03-17 01:49:30 -05:00
New Pagodi
8be4f7dde6 Change wxSTC mapping for SCI_REGISTERIMAGE
Currently the Scintilla message SCI_REGISTERIMAGE is mapped to
wxStyledTextCtrl::RegisterImage(int, const wxBitmap&). This makes
RegisterImage a manually defined method and passes the bitmap directly
to the listbox instead of first converting to an XPM.

To backfill the message map, SCI_REGISTERIMAGE is now mapped to a new
method overload RegisterImage(int, const char* const*). The new method
accepts XPM data instead of a wxBitmap.
2019-03-17 01:48:51 -05:00
New Pagodi
f50b18000a Change wxSTC mapping for SCI_MARKERDEFINEPIXMAP
Currently the Scintilla message SCI_MARKERDEFINEPIXMAP is mapped to the
wxStyledTextCtrl::MarkerDefineBitmap method. This has two
drawbacks. First this requires the XPM image handler be loaded before
this method can be called. Second, any alpha data except for opaque and
transparent is lost in the conversion to XPM format.

Instead have MarkerDefineBitmap be a manually declared method but
reimplemented it in a way similar to how the SCI_MARKERDEFINERGBAIMAGE
message works. The new implementation preserves alpha data if it exists.

To backfill the message map, the SCI_MARKERDEFINEPIXMAP is now mapped to
a new method MarkerDefinePixmap(int, const char* const*). The new method
accepts XPM data instead of a wxBitmap.
2019-03-17 01:48:19 -05:00
New Pagodi
8c180ee7b5 Change the implementation of ListBoxImpl::RegisterImage
The ListBoxImpl::RegisterImage in PlatWX.cpp is supposed to accept an
XPM and convert it into a useable form. For wxWidgets, the useable form
is obviously a wxBitmap. According to the Scintilla specification, the
function should accept both a copy of an XPM file and a set of XPM data.

Currently RegisterImage uses the the wxWidgets XPM image handler. This
has 2 drawbacks. First it requires that the XPM handler is loaded before
the function can be called. Second, the function only accepts a copy of
an XPM file and does not work with XPM data.

Instead use wxXPMDecoder. This class can be decode both types of input
and can be used to build a wxBitmap.
2019-03-17 01:47:36 -05:00
Vadim Zeitlin
cbaab700d0 Merge branch 'milotype-wx-02' of https://github.com/milotype/wxWidgets
German and Croatian translations updates.

See https://github.com/wxWidgets/wxWidgets/pull/1260
2019-03-16 22:14:48 +01:00
milotype
433f307a27 Update hr.po
Minor translation corrections, typgraphic corrections
2019-03-16 21:52:55 +01:00
milotype
cbf3a826da Update de.po
File completion (100%), minor translation corrections, typgraphic corrections
2019-03-16 21:52:05 +01:00
Ilya Sinitsyn
d5a6a5a627 Add unit test for wxWrapSizer::CalcMinFromMinor
Add a unit test for a special case of a wrap sizer min size caclulation.
Test wxWrapSizer::CalcMinFromMinor function for this case, when a wrap
sizer used inside a sizer with the same alignment.
2019-03-15 04:16:41 +07:00