Commit Graph

65613 Commits

Author SHA1 Message Date
Artur Wieczorek
76ff4ab2b6 Use dedicated method to move rectangle 2018-12-28 14:02:02 +01:00
Artur Wieczorek
18e03af068 Use conditional operator instead of conditional statement 2018-12-28 14:02:01 +01:00
Artur Wieczorek
9d2fbef751 Only render columns that are within update region 2018-12-28 14:02:01 +01:00
Artur Wieczorek
95461c566d Fix repositioning editors for horizontally scrolled grid
Closes #18313.
2018-12-28 14:01:34 +01:00
Artur Wieczorek
9b7c281e6b Move repeating code to the dedicated template wxVector function 2018-12-27 14:25:00 +01:00
Artur Wieczorek
7d43ed0fb6 Iterate over all items of wxVector with column proportions with iterator 2018-12-27 14:23:54 +01:00
Artur Wieczorek
831a81fb90 Fix positioning property editor
Account scrolled horizontal position.

See #18313.
2018-12-27 14:22:18 +01:00
Artur Wieczorek
de6469610a Fix determining width of the entire row
See #18313.
2018-12-27 14:20:13 +01:00
Artur Wieczorek
9ad19622fd Fix drawing horizontal lines between the rows of the grid
See #18313.
2018-12-27 14:18:04 +01:00
Artur Wieczorek
2f918abf3a Clear empty space beyond the right edge of the grid
See #18313.
2018-12-27 14:15:44 +01:00
Artur Wieczorek
48c71a5f04 Fix calculating width of the first cell
See #18313.
2018-12-27 14:14:19 +01:00
Artur Wieczorek
73b5d3420e Fix determining shift of the drawn scrolled contents
Position of the visible portion of the window should be taken as a drawing offset.

See #18313.
2018-12-27 14:12:32 +01:00
Artur Wieczorek
cc32ebc979 Adjust scroll bar and refresh the grid after changing virtual width 2018-12-27 13:18:06 +01:00
Artur Wieczorek
8dbe6ec69d Add to propgrid sample an option to change virtual width of the grid 2018-12-27 13:16:41 +01:00
Vadim Zeitlin
20cb47c1c4 Send Unicode data as UTF-8 text when using DDE-based IPC
This is a more hackish but more compatible solution to the problem of
data sent using wxIPC_UTF8TEXT format being simply lost when using DDE
for IPC classes. We must use CF_TEXT for the DDE to pass our data, but
we can try to decode it as UTF-8 in the client and assume it was sent in
this format if it worked. This obviously suffers from false positives as
any ASCII string will still be assumed to be UTF-8, but there shouldn't
be any real harm coming from this.

This change also makes sending data in wxIPC_UTF{16,32}TEXT formats work
as well by converting it to UTF-8.

Update the sample to call Advise() with both wxIPC_UTF{8,16}TEXT formats
and remove the now unnecessary wxDDEConnection::m_dataType member.

Closes #17900.
2018-12-27 00:26:29 +01:00
Vadim Zeitlin
09bf235a59 Revert "Fix passing Unicode strings via wxIPC when using DDE"
This reverts commit c657fd3d61 because
changing the format of DDE advise requests/replies is not a good idea:
other applications (those using previous versions of wxWidgets or even
not using wxWidgets at all) may rely on getting data in real CF_TEXT
format rather than in one of text formats preceded by the extra byte
containing the actual format and the previous commit would have silently
broken this.

Another fix for #17900 will be implemented instead.
2018-12-26 23:20:52 +01:00
Artur Wieczorek
311e5e8414 Use conditional operator instead of conditional statement 2018-12-26 11:38:52 +01:00
Artur Wieczorek
a57aacd5af Calculate splitter positions once
Column widths are the same for all rows so there is no need to calculate splitters positions for each drawn row.
2018-12-26 11:38:10 +01:00
Artur Wieczorek
c112c20d5f Optimize calculating position of the right edge of the last cell
Cell widths are invariant during the drawing so calculation can be done once, not on every loop.
2018-12-26 11:37:31 +01:00
Artur Wieczorek
5c0acce694 Hide editor button while column splitter is being dragged
Main editor and its button (secondary editor) should be both hidden while dragging the splitter because it's misleading when one part of the property editor disappears and another part remains visible.
2018-12-26 11:36:12 +01:00
Artur Wieczorek
5366a1dfbb Iterate over all items of wxVector with column widths with iterator 2018-12-26 11:35:19 +01:00
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