Commit Graph

63403 Commits

Author SHA1 Message Date
Maarten Bent
2156d29801 Add FindOrCreateFont overload accepting wxFontInfo 2017-11-25 17:52:03 +01:00
Maarten Bent
cbf13e68a2 Replace deprecated std::auto_ptr with wxScopedPtr 2017-11-25 17:00:18 +01:00
Vadim Zeitlin
a065e98a22 Regenerate configure after recent files additions
Fix undefined variable in the makefile.
2017-11-25 00:32:55 +01:00
Vadim Zeitlin
7130b4c611 No real changes, just regenerate autoconf_inc.m4 from scratch
Get rid of outdated references in this file.
2017-11-25 00:28:29 +01:00
Vadim Zeitlin
99db923c2c Add more missing generic headers to wxQt headers list
See f5cdda7b8b (commitcomment-25822547)
2017-11-25 00:25:14 +01:00
Vadim Zeitlin
53bf5936f1 Rename QT_LOWLEVEL_{HDR,SRC} to just QT_{HDR,SRC}
These file lists contained files that were not low level (meaning "used
by wxQt/Univ" in this context) at all and it doesn't make much sense to
think about Qt-based wxUniv port anyhow, so instead of painstakingly
separating them in low level part and the rest, just rename the
variables to be less confusing.
2017-11-25 00:12:38 +01:00
Vadim Zeitlin
472bb3d6d2 Fix wxUSE_PRIVATE_FONTS definition in configure
Only define it unconditionally for wxMSW and wxOSX, not wxGTK where we
need to test that the required versions of FontConfig and Pango Fc are
available.

Also do all wxUSE_PRIVATE_FONTS-related checks in the same place, to
make things more clear and avoid similar blunders in the future.
2017-11-25 00:07:01 +01:00
Vadim Zeitlin
19c4172671 Correct example of using wxDataObjectComposite in the docs
Don't call base class pure virtual method, but do call GetData() before
using the data object. Also fix a typo in a variable name.
2017-11-24 23:10:47 +01:00
Vadim Zeitlin
778340a286 Merge branch 'private-fonts'
Add support for using application-private fonts.

Closes #13568.

Closes https://github.com/wxWidgets/wxWidgets/pull/591
2017-11-24 22:58:09 +01:00
Vadim Zeitlin
b040dab0ca Add wxUSE_PRIVATE_FONTS and drop wxHAS_PRIVATE_FONTS
Handle this feature as all the other ones and provide a configure switch
and a setup.h option to disable it if necessary, as it may be desirable
to do it, especially under Linux, to avoid extra dependency on pangoft2
if this functionality is unnecessary.
2017-11-24 22:56:17 +01:00
PB
a04782238d Update version in the examples used in docs/msw/install.txt
Update the version number contained in the library file names to 3.1, e.g.,
from "wxmsw30ud_core.lib" to "wxmsw31ud_core.lib".
2017-11-23 18:15:04 +01:00
Vadim Zeitlin
166f754973 Fix comparison of size_t values with -1 in base 64 unit test
This doesn't work correctly in Catch after reverting the commit that
broke compilation with MSVC 9, so we have to live with explicitly using
the values of the correct type.
2017-11-23 02:02:19 +01:00
Maarten
bb9cd7a912 Fix rescaling image with wxIMAGE_QUALITY_BOX_AVERAGE
Work around rounding errors caused by using doubles.

Update reference images.

Closes https://github.com/wxWidgets/wxWidgets/pull/615
2017-11-23 00:36:46 +01:00
Jake Nelson
a8671869e5 Fix wxButton::SetBitmapPosition() with GTK+ 3
Make the check for GTK+ >= 2.10 pass for GTK+ 3 too by simply not making
it in this case.

Closes #18004.
2017-11-22 23:23:42 +01:00
Vadim Zeitlin
0b8c4d54a8 Don't run FTP unit test by default any longer
ftp.wxwidgets.org seems to have gone, breaking the existing test (thanks
chris for all the fish...), so don't hardcode this URL in the test and,
without it, don't run the test by default any more and require
specifying a working FTP host (as well as an existing directory and a
file on it) when running it manually.

Rewrite the test using normal functions instead of Java-like structure
imposed by CppUnit to make it simple to skip it.
2017-11-22 22:48:05 +01:00
René J.V. Bertin
10201c2732 Add support for stock menu items to wxQt
Sets the new QAction's text and shortcut properties to the
values provided by the corresponding wxGetStockXXX() functions.

Closes https://github.com/wxWidgets/wxWidgets/pull/613
2017-11-22 22:08:07 +01:00
Vadim Zeitlin
04209e3a3e Remove GetStandardCmdLineOptions() from wxGTK
Unfortunately there is no reasonable way to implement this function for all
glibc versions as the information we need is stored in the private
_GOptionGroup struct whose layout has already changed once (in 2.44) and could
change again, so we can't rely on it.

We really need a g_option_group_get_entries() in glib itself, but the request
to add it at http://bugzilla.gnome.org/show_bug.cgi?id=431021 hasn't been
touched since 10 years, so it seems unlikely to happen.

See 99367a1530 (commitcomment-25789514)
2017-11-22 22:02:36 +01:00
Vadim Zeitlin
f5cdda7b8b Add missing qt/nonownedwnd.h to the list of headers
Also add the previously added src/qt/nonownedwnd.cpp to the master files
list.
2017-11-22 21:49:56 +01:00
Vadim Zeitlin
e82cdf4a1e Merge branch 'travis-gtk3'
Test wxGTK3 on Travis too.
2017-11-22 12:57:24 +01:00
Paul Cornett
135e3875e2 Hide wxSpinButton's underlying GtkEntry using CSS on GTK+ >= 3.20 2017-11-21 22:05:08 -08:00
Vadim Zeitlin
2ee40f8a60 Add a build using GTK+ 3 to Travis
We need to test both wxGTK2 and wxGTK3 builds.
2017-11-22 02:33:53 +01:00
Vadim Zeitlin
38e441bdd8 Don't install libcppunit-dev under Travis CI any more
It is not needed since the switch to Catch for unit tests.
2017-11-22 02:31:47 +01:00
Vadim Zeitlin
f7d9098f1f Fix building wxVector unit tests in STL build without C++11
There is no shrink_to_fit() in wxVector in this case.

Arguably, we shouldn't be building wxVector unit tests in STL build at
all as there is no point in testing the standard class, but OTOH it
could be useful for checking that the tests themselves are correct, so
keep them for now.
2017-11-21 14:44:06 +01:00
Vadim Zeitlin
4ccda3959e Show more information for wxImage::Scale() unit test failures
Output the maximal difference between the differing images pixels to
show just how far are they from each other, exactly. And show the image
file name as well, for convenience.

Also run all checks instead of stopping after the first failing one.
2017-11-21 14:27:29 +01:00
Vadim Zeitlin
c3dee8b0bc Merge branch 'vector-enhancements'
Make wxVector<> more compatible with std::vector<>.
2017-11-21 13:50:26 +01:00
Lauri Nurmi
f2a5fd303b Declare wxInvalidSize also in wx/dir.h
wxInvalidSize is a documented return value for wxDir::GetTotalSize(),
yet it was not available by including just wx/dir.h as it was declared
in wx/filename.h only.

Fix this by declaring it in wx/dir.h too.

Closes https://github.com/wxWidgets/wxWidgets/pull/609
2017-11-21 13:49:21 +01:00
Artur Wieczorek
1033a1636d Process HDN_ITEMCHANGING notifications only when column is being resized
When column resizing is finished, after HDN_ENDTRACK notification there is
also sent one (and last) HDN_ITEMCHANGING notification. We have to skip it
to prevent from sending EVT_HEADER_RESIZING after EVT_HEADER_END_RESIZE
because EVT_HEADER_END_RESIZE should be really the last one event
in the sequence of resizing events (like it's assumed in wxGrid).

Closes #16390.
2017-11-20 21:57:05 +01:00
Vadim Zeitlin
8f9c4470d7 Merge branch 'arrays-alloc-optimise'
Reduce the number of memory allocations in wxArrayString and wxVector.
2017-11-19 23:13:43 +01:00
Vadim Zeitlin
7ba4832c0f Merge branch 'sound-async-unix'
Minor fixes to Unix wxSound implementation, including async API and OSS
backend tweaks.
2017-11-19 22:59:14 +01:00
Vadim Zeitlin
3590273503 Document that osspd requirement for using OSS under Linux
Without SDL, wxSound doesn't work out of the box on most (all?)
contemporary Linux systems, so at least document this.

See #14899.
2017-11-19 22:51:51 +01:00
Vadim Zeitlin
2558c91ae8 Don't fail to okay all mono WAVs in OSS wxSound backend
Ever since the changes of 544c4a3bde
(almost 14 years ago), playing mono WAVs with wxSound completely failed
if setting the sound device to mono using SNDCTL_DSP_STEREO ioctl
failed. This doesn't look like a wise thing to do, so don't consider
this as a fatal failure, but just play mono as stereo (and even possibly
stereo as mono) instead.

This fixes the sound sample being broken out of the box on many (all?)
Linux systems.
2017-11-19 22:44:57 +01:00
Vadim Zeitlin
d788588cfc Use wxMutexLocker instead of manual Lock/Unlock() calls
This is safer and also makes the code simpler and shorter.
2017-11-19 22:37:36 +01:00
Vadim Zeitlin
6c1a557a0f Lock and unlock mutex in both wxSound threads using it
The code was completely broken as it locked the mutex in only one thread
and then tried to unlock it in another one, which made no sense, didn't
protect against anything and resulted in errors and assert failures.

Fix this by locking and unlocking the mutex in both threads before
accessing shared data or playing sound.

Closes #17990.
2017-11-19 22:37:36 +01:00
Vadim Zeitlin
6ebc56939f Acquire mutex before modifying variable in wxSoundSyncOnlyAdaptor
The mutex must be locked to avoid data races with the thread actually
playing the sound.
2017-11-19 22:37:36 +01:00
Vadim Zeitlin
f7e5fb61b1 Remove unused wxSoundSyncOnlyAdaptor::m_playing variable
It seems to have been replaced by wxSoundPlaybackStatus::m_playing a
long time ago but was still kept, resulting in confusion and always
returning false from IsPlaying() as it tested a wrong variable.

Fix this by removing this one completely and always using the other one
everywhere.
2017-11-19 22:37:36 +01:00
Vadim Zeitlin
53443b5370 Add wxVector::shrink_to_fit() for C++11 compatibility
Also use this for wxArray::Shrink() implementation as it's more
efficient than the old swap-based implementation which requires an extra
memory allocation instead of really shrinking the existing one.
2017-11-19 22:09:37 +01:00
Vadim Zeitlin
9e714fdb5e Fix wxVector::assign() for integer parameters
Using assign() with int (in fact, any integral type) should select the
(size_type count, const T& value) overload, but didn't, which was
incompatible with std::vector<>.

Fix this by adding the same tag-dispatching technique as used by the
real std::vector<> implementations themselves, except that we dispatch
on integer types because we can't be totally certain that
std::iterator_traits<> are specialized for whatever iterator-like object
could be used with wxVector.
2017-11-19 22:08:54 +01:00
Vadim Zeitlin
8246c922af Add wxVector::insert() overload taking count of items to insert
Generalize the existing insert() to be more compatible with std::vector.
2017-11-19 22:08:54 +01:00
Vadim Zeitlin
25a7c70631 Implement wxVector::reverse_iterator::operator-()
Make wxVector reverse iterators (and const versions of them) more
compatible with the std::vector ones.
2017-11-19 22:08:54 +01:00
Vadim Zeitlin
5669e8dbe9 Add wxVector::operator==() and !=()
Make this class more consistent with std::vector<>.
2017-11-19 22:08:54 +01:00
Vadim Zeitlin
abce2a9428 Use the same growth strategy in wxArrayString as in wxVector
Remove maximal reallocation size in wxArrayString too, as it was done
for wxVector a commit ago, and increase its size by 100% and not 50%
when it needs to grow.

There is no real reason to use different growth strategies in the two
classes and wxVector one seems to be better.
2017-11-19 22:02:26 +01:00
Vadim Zeitlin
d3132b114c Optimize memory allocation in wxArrayString ctors
Call assign() instead of Add() in a loop: this is not only shorter, but
also ensures that reserve() is called before starting the loop and all
the required memory is allocated at once.
2017-11-19 21:59:02 +01:00
Vadim Zeitlin
876090aeea Remove maximal reallocation size in wxVector
This dramatically pessimizes performance for large vector sizes and
doesn't actually save that much memory because all intermediate
allocations are still being used by the process, so follow stdlibc++
example and just double the allocated buffer size without limit.
2017-11-19 21:56:24 +01:00
Vadim Zeitlin
aef4edb969 Merge branch 'progress-dialog-fixes'
Make native MSW wxProgressDialog much more usable and some minor
improvements to the generic version.
2017-11-17 18:00:16 +01:00
Vadim Zeitlin
ca0557a6eb Merge branch 'release-scripts' 2017-11-17 17:56:41 +01:00
Vadim Zeitlin
dc751d3f33 Add a hint about making wxProgressDialog initially wide enough
Using unbreakable spaces to achieve this looks like a hack, but seems to
be the only thing working well in practice.
2017-11-16 23:52:36 +01:00
Vadim Zeitlin
d4d3222466 Split initial wxProgressDialog message consistently with updates
Native wxMSW dialog split the provided message into the title and body
in Update(), but didn't do it for the initial message specified when
constructing the dialog, resulting in weird jumps, due to the font size
change between the body and title dialog elements, if the updated
message differed just slightly from the initial one.

Fix this and refactor the code to reuse the same function for doing this
splitting in both places.
2017-11-16 23:52:33 +01:00
Vadim Zeitlin
602e2e6abb Avoid fitting wxProgressDialog to its contents on first update
Use TDM_UPDATE_ELEMENT_TEXT even for the initial update as this allows
to specify the message of roughly comparable (or greater) length than
the messages that will be subsequently used while the dialog is shown
and avoid size changes later, which is much more natural than having to
do it for the first call to Update().
2017-11-16 23:52:30 +01:00
Vadim Zeitlin
83b9fa3119 Get rid of unnecessary wxCriticalSectionLocker use
No real changes, just don't lock a critical section for a short time
only to lock it again almost immediately after unlocking -- just combine
both blocks for which it is locked into one, there is no reason to
release it for TASKDIALOGCONFIG and wxMSWTaskDialogConfig initialization
which are both trivial operations not involving any callbacks.
2017-11-16 23:52:27 +01:00
Vadim Zeitlin
3d98129b51 Further improve wxProgressDialog resizing behaviour documentation
Unfortunately it doesn't seem possible to prevent the native MSW dialog
from changing its size in both upper and lower direction vertically, so
at least mention this in the documentation and mention a possible
workaround of manually adjusting the text to always have the same number
of lines.
2017-11-16 23:52:25 +01:00