Commit Graph

65400 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
Graham Dawes
ae20edb539 Fix several problem with wxMemoryDC in wxQt
Under wxQT, wxMemoryDC was previously rendering to a temporary image
which was only being blitted back to the original wxBitmap when either
the DC wx destroyed or a new bitmap was selected (via SelectObject).

With these change wxMemoryDCImpl now draws directly to the bitmap
managed by wxBitmap, this makes the behaviour more consistent with the
MSW and GTK implementations.

Closes https://github.com/wxWidgets/wxWidgets/pull/1083
2018-12-19 13:44:52 +01:00
Tomasz Słodkowicz
80904d1bc7 Fix crash in translations code when no translations are found
Fix another regression in wxTranslations in 3.1.2 and check that the
vector of acceptable translations is not empty before using its first
element.

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

Closes #18299.
2018-12-18 04:50:47 +01:00
Tomasz Słodkowicz
14e905858d Fix regression in wxTranslations::AddCatalog()
Do load the catalog corresponding to the language of "msgid" strings in
the source code, only skip the languages strictly less preferred than
it.

This avoids incompatibilities with pre-3.1.2 behaviour and avoids
breaking existing applications relying on the old behaviour.

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

Closes #18297.
2018-12-18 04:50:07 +01:00
Graham Dawes
b0eca3bdde Fix some more uninitialised wxCairoContext fields in wxQt
Closes https://github.com/wxWidgets/wxWidgets/pull/1084
2018-12-17 17:46:38 +01:00
Vadim Zeitlin
50e098437d Document lack of custom editors in Mac wxDataViewCtrl
wxDataViewCustomRenderer::CreateEditorCtrl() is currently never called
there.
2018-12-17 14:07:12 +01:00
Vadim Zeitlin
f9028845d8 Merge branch 'cmake-install' of https://github.com/MaartenBent/wxWidgets
Install wxrc on all platforms and other fixes, including better support
for external libraries.

See https://github.com/wxWidgets/wxWidgets/pull/1072
2018-12-16 23:58:04 +01:00
Vadim Zeitlin
5b2e992947 Document wxThread::Delete() behaviour more precisely
Delete() doesn't (and can't, under Unix) wait for the detached threads,
although it does do it under MSW (but arguably shouldn't), so it can't
retrieve the thread exit code there.

Document that its "rc" argument is only useful with joinable threads.

Closes #18240.
2018-12-16 00:02:07 +01:00
Vadim Zeitlin
8856715d2d Use wxVector instead of wxList for wxDataViewCtrl columns storage
As wxDataViewColumnList was never public, it should be fine to not
define it any more and use a vector instead.

This makes the code more clear and also marginally more efficient.
2018-12-15 14:43:47 +01:00
Vadim Zeitlin
2340a16d18 Allow increasing the size of the last column in wxDataViewCtrl
Previously, the last column couldn't be effectively resized at all, as
its size was always automatically set to the remaining width of the
window after subtracting the widths of all the previous columns. Now
this is only done if this remaining width is greater than the width
given to the column by the user or by the program.

Effectively, this means that the user can now drag-resize the column to
increase its size (at the price of showing the horizontal scrollbar).

See #18295.
2018-12-15 14:27:52 +01:00
Graham Dawes
8fa32a40a9 Fix m_qtPainter not being initialised in wxCairoContext ctor
For some reason one of the overloads of the c'tor left the m_qtPainter
field set to NULL rather than asking the wxDC for it's painter.

The rest of the class assumes the painter is not NULL.

Closes https://github.com/wxWidgets/wxWidgets/pull/1075
2018-12-14 17:41:55 +01:00
Vadim Zeitlin
68bb67c009 Revert "Prevent the user from resizing the last wxDataViewCtrl column"
This reverts commit 24054c95d8 as it
actually should be possible to increase the size of the last column,
even if this shows the horizontal scroll bar.
2018-12-13 23:46:25 +01:00
Vadim Zeitlin
24054c95d8 Prevent the user from resizing the last wxDataViewCtrl column
This is useless as this column will be automatically expanded to fill
all the available space anyhow.

See #18295.
2018-12-13 23:42:15 +01:00
Vadim Zeitlin
841c14c37c Fix expanding last wxDataViewCtrl column in the generic version
The code added in 4156e1a5c9 didn't quite
work correctly because it used the old size of the window, before it was
resized, and not the new size. This was almost unnoticeable when
drag-resizing the window, but very noticeable when maximizing the
containing TLW, as could be seen on the 3rd page of the dataview sample,
for example, where the last column kept its size instead of expanding.

See #13904, #18295.
2018-12-13 18:50:18 +01:00
Graham Dawes
db15e99884 Fix wxBitmap::GetRawData() in wxQt
This method used to return a dangling pointer to a temporary buffer,
which resulted in a crash when using it, e.g. in the unit test.

Fix this by keeping a QImage as a member in wxBitmapRefData, so that the
pointer to its data remain valid until UngetRawData() is called.

Also check that GetRawData() returns a non-null pointer in the test.

Closes https://github.com/wxWidgets/wxWidgets/pull/1067
2018-12-13 15:24:54 +01:00
Vadim Zeitlin
013c6a6b6a Speed up inserting many items in sorted wxChoice in wxQt
Only sort the combobox once instead of doing it for every item.

See https://github.com/wxWidgets/wxWidgets/pull/1054
2018-12-13 15:17:18 +01:00
chris2oph
89e4ee1ec0 Ensure items are sorted when added to wxChoice in wxQt
Call sort() to resort the model after inserting a new item.

Closes https://github.com/wxWidgets/wxWidgets/pull/1054
2018-12-13 15:10:59 +01:00
Vadim Zeitlin
5189781072 Move wxDataViewCtrl incompatibility note to the correct section
3a24beca62 added this in a wrong place, as
this change does not result in any build errors.

See #18295.
2018-12-13 15:09:13 +01:00
Vadim Zeitlin
b9fe8ca10c Try to use pkg-config for detecting libtiff in configure
This is more reliable than checking whether we can link with the library
manually and may work even if it's installed in a non-standard location.

It also allows the user to specify PKG_CONFIG_PATH='pkg-config --static'
when running configure to link with all transitional dependencies when
linking statically.

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

See #18293.
2018-12-13 03:53:44 +01:00
Vadim Zeitlin
c95f668b21 Fix use of dangling pointer in ButtonTestCase::Disabled()
Fix the test added in dfec7aa0c0 which
deleted the button pointer used by EventCounter by simply moving
EventCounter initialization after the button re-creation.

See #16385.
2018-12-13 00:39:25 +01:00
Vadim Zeitlin
141f0cb0e4 Suppress harmless gcc missing initializers warnings in a test
Suppressing the warnings is ugly but less ugly than explicitly
specifying all the omitted elements in the array.
2018-12-12 23:45:09 +01:00
Maarten Bent
c1013d9bfc CMake: Add more option validity checks 2018-12-12 21:28:01 +01:00
Maarten Bent
5348b4fa3b CMake: Improve layout of third party libraries summary
Add more external libraries to the summary, like configure does.
2018-12-12 21:28:00 +01:00
Maarten Bent
91b6305dcd CMake: Improve checking for external libraries
Do not abort when libLZMA or libSecret can not be found, just show a warning.
Do not search for libSecret on macOS.
Disable libraries internally (not in cache) when not searching for them.
2018-12-12 21:28:00 +01:00
Maarten Bent
042b17512e CMake: Check for libSDL only on Unix 2018-12-12 21:28:00 +01:00
Maarten Bent
b9d31dffc5 CMake: Improve finding Iconv
Continue when Iconv can not be found.
Silence warnings when testing if second argument for iconv() is const.
Use correct include dir.
2018-12-12 21:27:57 +01:00
Maarten Bent
14570b4fa3 CMake: Find more external libraries
Check for LibNotify, MSpack, XTest and GnomeVFS2.
2018-12-12 21:27:56 +01:00