Commit Graph

65592 Commits

Author SHA1 Message Date
Artur Wieczorek
b3563b690c Access last element of wxVector with dedicated method
Use reference returned by back() method instead of referencing by the index of the last element.
2018-12-26 11:34:26 +01:00
Artur Wieczorek
7f29ab97df Optimize calculating column widths
Use iterative algorithm instead of recursive one to adjust column widths.
2018-12-26 11:33:10 +01:00
Artur Wieczorek
e74e345e04 Use dedicated function to check if array of selected properties is empty 2018-12-26 11:32:09 +01:00
Artur Wieczorek
d85a03b561 Don't make unnecessary calls to the member function
Use already obtained reference to the list of selected properties instead of retrieving the list by calling GetSelectedProperties() function.
2018-12-26 11:31:21 +01:00
Artur Wieczorek
6c36554ae1 Get rid of unnecessary variable in wxPropertyGrid 2018-12-26 11:30:29 +01:00
Artur Wieczorek
e9b45f19f9 Fix index of dragged splitter sent with EVT_PG_COL_DRAGGING
Re-centering the splitter with mouse double-click works only if we have two columns so only splitter 0 can be clicked.
2018-12-26 11:29:40 +01:00
Artur Wieczorek
1042521706 Refresh wxPropertGrid after resetting column sizes
Grid needs to be redrawn with new splitters positions.

Closes #18312.
2018-12-26 11:28:17 +01:00
Jeff Bland
2937369869 CMake: Fix monolithic build
Monolithic build regressed with commit
815d288c4fedba044a9863c883d6dd9f53526668 "Set wx-config base, gui and
built libraries".

The code queries each possible target name and creates lists of the
valid targets. In the monolithic build, none of the normal target names
exist, so the list is empty. The empty list is then passed to STRIP,
causing cmake to fail due to not having enough arguments.

By quoting the STRIP params we can pass an empty argument and thus
prevent the error of not-enough arguments.

See https://github.com/wxWidgets/wxWidgets/pull/1100
2018-12-25 18:50:06 +01:00
Cătălin Răceanu
a207862210 SetValue() on 'single' radio button must not reset others
Radio buttons with wxRB_SINGLE style are not set initially. When
getting set, the code attempts to unset other radio buttons that do not
have wxRB_GROUP | wxRB_SINGLE style.

Closes https://github.com/wxWidgets/wxWidgets/pull/1099
2018-12-24 16:14:49 +01:00
Richard Smith
0fbf87d11b Split single/multi line behaviour in Qt wxTextCtrl
Introduce wxQtEdit class and wxQtMultiLineEdit and wxQtSingleLineEdit
derived classes instead of using ifs in many wxTextCtrl methods, making
the code more clear and maintainable.

Also fix some wxTextCtrl-related unit test failures with wxQt and
disable some other ones which still don't pass.

Closes https://github.com/wxWidgets/wxWidgets/pull/1039
2018-12-24 01:52:07 +01:00
Vadim Zeitlin
c657fd3d61 Fix passing Unicode strings via wxIPC when using DDE
wxIPC API doesn't map well onto DDE, as we don't have wxIPCFormat
parameter in StartAdvise() but do allow specifying the format when
calling Advise() itself, whereas DDE requires specifying the format when
establishing the advise loop and the data always must use this format
later.

Because of this, we have to pass the actual format with the data itself
instead of relying on DDE formats support. This has the advantage of
allowing wxIPC_UTF8TEXT to work, while previously it didn't and
couldn't, as DDE only supports the standard (or custom, but registered)
clipboard formats and it wasn't one of them. Of course, this also has a
disadvantage of having to make another copy of the data, but this seems
unavoidable.

This change allow Advise() overload taking wxString to work, including
for non-ASCII strings, as shown by the update to the IPC sample. It also
makes wxDDEConnection::m_dataType unnecessary, as we must always use the
format passed to DDE callback anyhow when handling XTYP_ADVREQ.

Closes #17900.
2018-12-24 01:42:12 +01:00
Artur Wieczorek
3b6fcbab6d Update wxPGArrayEditorDialog docs 2018-12-24 00:05:23 +01:00
Artur Wieczorek
1e69a898c2 Use quotes and not angle brackets around the includes of wxWidgets itself 2018-12-24 00:01:31 +01:00
Artur Wieczorek
79b71cf4ff Scale bitmap to wxPropertyGrid's row height
By design only bitmaps lower than row height are displayed within the cells.
Because on every platform default row height can vary so bitmap has to be explicitly scaled to the row height to ensure that it will be initially displayed on every platform.

Closes #18310.
2018-12-24 00:00:14 +01:00
Vadim Zeitlin
b891fe1974 Remove misleading warning from the ipc sample
DDE code translates wxIPC_PRIVATE to wxIPC_TEXT internally since a
change done in 9d86099269, but same commit
also added a warning to the ipc sample stating that wxIPC_PRIVATE
doesn't work, which isn't really the case.

Remove the warning to avoid the confusion.

See #7470.
2018-12-23 22:01:50 +01:00
Vadim Zeitlin
270ad54abe Revert all recent changes to wxTranslations
The latest changes to wxTranslations::AddCatalog() behaviour were not
backwards-compatible and also had other problem, so revert them for now,
even if this means that #18227 has to be reopened.

This is a combination of the following commits:

----

Revert "Fix regression in wxTranslations::AddCatalog()"

This reverts commit 14e905858d.

See #18297.

----

Revert "Fix crash in translations code when no translations are found"

This reverts commit 80904d1bc7.

See #18299.

----

Revert "Rename new wxTranslations method to GetAcceptableTranslations()"

This reverts commit 20b02d6169.

----

Revert "Load catalogs for all preferred languages, if they exist"

This reverts commit 2d784da2ee.

----

Revert "Allow getting all usable translations languages"

This reverts commit 5d08e404c7.

----

See #18227, #18300.

Closes #18302.
2018-12-23 17:33:49 +01:00
Vadim Zeitlin
2c737bfbc0 Revert change to m_order assignment in wxRearrangeList::Create()
This partially reverts 7e1b64a2eb as it
broke wxRearrangeList because assigning to m_order[n] used an
out-of-range index.

Another possible fix would be to replace reserve() call added in that
commit with resize(), but there doesn't seem to be any advantage in
assigning elements one by one, rather than all at once, as it had been
done before, so just revert this change instead.

See #17836.
2018-12-23 17:12:26 +01:00
chris2oph
a6dc3c78ab Really add items to the listbox in wxQt wxListBox::Create()
The initial choices were just ignored, do add them to the Qt listbox
now.

Closes https://github.com/wxWidgets/wxWidgets/pull/1094
2018-12-23 17:09:59 +01:00
Sebastian Walderich
e9cbbede00 Implement wxAuiNotebook::GetBestSize()
Compute the best size of the notebook, taking into account all the
different layout possibilities, and add a test checking that this works
as expected.

Closes https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Vadim Zeitlin
d3eb5b38aa Don't crash when drawing 0-sized wxAuiTabContainer in debug build
Attempting to create a bitmap with 0 width or height results in an
assertion failure, which is fatal, as it happens in wxEVT_PAINT handler
and so quickly results in reentering it and asserting again and
recursive assert failures terminate the application.

Just avoid doing it, there is nothing to paint anyhow if the associated
rectangle is empty.

See https://github.com/wxWidgets/wxWidgets/pull/1085
2018-12-23 17:05:09 +01:00
Maarten Bent
db4c983881 CMake: Add missing stc and wxscintilla compile flags
This fixes absence of highlighting and folding in CMake builds.

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

Closes #18306.
2018-12-23 15:21:13 +01:00
Artur Wieczorek
7e297ee667 Compilation fix for PCH-less build
Include the header required by newly implemented
wxPGArrayEditorDialog::SetNewButtonText.
2018-12-23 11:28:40 +01:00
Artur Wieczorek
b252d1660d Cleanup wxPGArrayEditorDialog docs 2018-12-23 11:04:03 +01:00
Artur Wieczorek
0fbc4cd6ab Allow setting custom tooltip text for "New" button in wxPGArrayEditorDialog
Ability to change the tooltip can be useful if standard text "New item" is not descriptive enough.
2018-12-23 11:03:46 +01:00
Artur Wieczorek
686380c331 Initialize all wxPGArrayEditorDialog members in ctor
Initialize members of wxPGArrayEditorDialog class in its Init() method to have just created object in well-defined state.
2018-12-23 11:01:05 +01:00
Artur Wieczorek
8432726ba8 Make string literal wxChar* string
This macro parameter is passed to wxArrayStringProperty::OnButtonClick() parameter of wxChar* type. char* string interpreted in this function as a wxChar* string results in obtaining invalid Unicode characters.
This fixes a regression introduced in b70ed2d8c8.

Closes #18307.
2018-12-23 11:00:35 +01:00
Pavel Pimenov
9c77e0b2a5 Remove unused variables
This fixes PVS Studio static analyzer warnings:

V808 'errMsg' object of 'wxString' type was created but was not utilized. docview.cpp 1182
V808 'search' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697
V808 'filename' object of 'wxString' type was created but was not utilized. dirctrlg.cpp 697

(see full report at http://www.fly-server.ru/pvs-studio/wxWidgets-core/)

Closes https://github.com/wxWidgets/wxWidgets/pull/1096
2018-12-21 17:45:26 +01:00
Vadim Zeitlin
54f96392be Merge branch 'qt_fix_button_crash' of https://github.com/GeoTeric/wxWidgets
Fix crashes when loading wxButton from XRC in wxQt

See https://github.com/wxWidgets/wxWidgets/pull/1091
2018-12-21 17:44:49 +01:00
Graham Dawes
538cdc0841 Add missing RTTI to some wxQT classes 2018-12-21 15:56:46 +00:00
Graham Dawes
b890f59bc9 Call base class Show from wxRadioBox::Show 2018-12-21 08:18:17 +00:00
Vadim Zeitlin
622deec262 Replace wxSizer::RecalcSizes() with RepositionChildren()
The new method takes minimal size just computed by RecalcSizes() as its
argument making it unnecessary to store it as a member variable in the derived
classes such as wx{Box,FlexGrid}Sizer.

The old method can still be overridden for compatibility and by the derived
class that don't need minimal size when updating children.
2018-12-20 23:36:51 +01:00
Pavel Kalugin
7d9675472d Refine documentation related to wxTimePickerCtrl
Specify event types, corresponding to EVT_TIME_CHANGED and
EVT_DATE_CHANGED macros, and update 'see also' sections.
2018-12-20 19:00:42 +01:00
Vadim Zeitlin
9877f207d1 Merge branch 'dvc-last-col-resize'
Improve resizing of the last column in generic wxDataViewCtrl.

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

Closes #18295.
2018-12-20 18:57:48 +01:00
Cătălin Răceanu
f0df737326 Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 14:00:03 +00:00
Cătălin Răceanu
90165488f6 Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:49 +00:00
Cătălin Răceanu
f8110c1c27 Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:31 +00:00
Cătălin Răceanu
8f5acb341e Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:24 +00:00
Cătălin Răceanu
ae825ecd86 Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:18 +00:00
Cătălin Răceanu
c7425b8c64 Update src/qt/dc.cpp
Co-Authored-By: ffa-grahamdawes <graham.dawes@geoteric.com>
2018-12-20 13:59:11 +00:00
Graham Dawes
5c3ddb7a7f Prevent crash when attempting to clear a DC with not device under wxQT 2018-12-20 13:41:02 +00:00
Graham Dawes
172a97e411 Erase event now is now sent with a valid event object 2018-12-20 13:40:18 +00:00
Graham Dawes
bfb59228c1 Fix crashes due to unitialised fields 2018-12-20 10:51:03 +00:00
Graham Dawes
57b636b2d4 Fix for NULL pixmap when setting button icon in wxQT 2018-12-20 10:33:01 +00:00
Graham Dawes
bc4d3a4554 Initialise m_qtPushButton in wxAnyButton's constructor. 2018-12-20 08:06:46 +00:00
Vadim Zeitlin
b2cdd287bb Resolve change log conflict with master
Reapply the change log change manually to master version of the file to
let the CI builds merge this branch automatically.
2018-12-20 02:24:49 +01:00
Vadim Zeitlin
c922c95c96 Fix the just introduced signed/unsigned comparison warning
Cast to unsigned before comparing with an unsigned variable.
2018-12-20 02:21:53 +01:00
Jay Nabonne
c6d3b9c0b9 Fix background colour used by DrawEllipse() in wxQt
wxDC::DrawEllipse() used to use the text background for filling the
ellipses drawn with transparent pen, for some reason. According to
f9b28cd4325f42936d3122bfe7c847354bbbfee9 which changed this (this commit
was part of df13791078 merge done with
svn), this was done for compatibility with wxGTK, but wxGTK definitely
doesn't do it now and apparently never did, so there must have been some
mistake.

Simply remove the extra code using the text background for consistency
with this method behaviour in the other ports and also other methods
behaviour in the same port.

Closes https://github.com/wxWidgets/wxWidgets/pull/1087
2018-12-19 23:19:12 +01:00
jensgoe
12edcbccc8 clear height cache if model is cleared 2018-12-19 20:45:32 +01:00
jensgoe
7ab9e992b6 ensure row >= GetRowCount() if GetLineAt reaches invalid item
refactored method structure for better readability
2018-12-19 20:45:00 +01:00
Jay Nabonne
c47c7de5ea Allow overriding the label for stock buttons in wxQt
Stock label should only be used if passed label is empty. Otherwise,
passed label should override the default value.

Closes https://github.com/wxWidgets/wxWidgets/pull/1086
2018-12-19 13:46:20 +01:00