Commit Graph

63727 Commits

Author SHA1 Message Date
Maarten Bent
db86112675 CMake: Disable crt and socket warnings from Windows headers 2018-01-11 22:09:38 +01:00
Maarten Bent
573e887a4c CMake: Fix building and running samples
Add missing header, source and resource files.
Add missing data files (font), remove deleted data files (help).
Fix specifying xrc sample data files.
Remove WXUSINGDLL check from dialogs sample, it is not defined in e.g. static gui build.
2018-01-11 22:09:37 +01:00
Maarten Bent
4d35e8e54d CMake: Copy demo and sample data files to correct directory
Instead of 'lib/', copy it to directory where the executables are (e.g. 'lib/vc_x64_lib/').
2018-01-11 22:09:28 +01:00
Vadim Zeitlin
6ec4489189 Merge branch 'upmake-cmake'
Generate CMake files list from upmake.

See https://github.com/wxWidgets/wxWidgets/pull/663
2018-01-08 17:33:57 +01:00
Vadim Zeitlin
5def115f28 Extract common type definitions from wx/defs.h to wx/types.h
Fix the problem with compiling user code including wx/debug.h as the
first wxWidgets header under MSW. This ought to work, but didn't,
because wx/debug.h included wx/chartype.h without including wx/defs.h
(because there is already an inclusion in the other direction), which
defines SIZEOF_WCHAR_T required by wx/chartype.h, first.

Notice that we repurpose the existing but completely unused (no mentions
of it or the symbols defined in it anywhere neither in wxWidgets nor in
any of the code search engines) wx/types.h header as it has a fitting
name and this avoids having to add a new header and remove the existing
one.
2018-01-07 22:43:24 +01:00
Vadim Zeitlin
267067aa8a Regenerate CMake files list from upmake too
Replace the specialized Python script used for it before (and which was
actually forgotten to run a couple of times already) with a newer
version of upmake, which can now update CMake variable definitions too.
2018-01-07 22:29:42 +01:00
Vadim Zeitlin
b2a8c2188f Remove duplicate wx/scrolbar.h from CMake files list
This will avoid warnings when regenerating it the next time.
2018-01-07 19:19:29 +01:00
Vadim Zeitlin
d7fbf1f820 Output the message about bakefile_gen by default in upmake
This message shouldn't be given only when --verbose is given, it's
useful as a reminder and you shouldn't have to remember to give a
special option to get this reminder.
2018-01-07 18:43:01 +01:00
Vadim Zeitlin
9a75103d9a Fix upmake bug with conditions in bakefile files
Don't strip the <if> tags from bakefile variables (this bug fix is
actually in Makefile::Update Perl module, but is incorporated here by
reference) and remove these tags which somehow made it into upmake input
file, as they make no sense there.

Note also that upmake was recreated using a different version of fatpack
(0.010007), which accounts for many other differences in this file.
2018-01-07 18:36:58 +01:00
Vadim Zeitlin
c1e097cc68 Update CMake files list
Regenerate the file that was forgotten before by the changes of
48a5d6c5f8 (see #18038) and
95b28abfdf (see
https://github.com/wxWidgets/wxWidgets/pull/541).
2018-01-07 17:03:46 +01:00
Vadim Zeitlin
a6d677a0fe Check for correct window in wxNumValidatorBase::SetWindow()
Override SetWindow() to check that the validator is being associated
with the window of the correct type, this allows to trigger an assert
immediately if this is not the case, making it simpler to find the error
as the call to SetValitator() on the wrong window will be in the call
stack when this happens, unlike before when the assert would happen only
at some later time.
2018-01-07 01:26:53 +01:00
Vadim Zeitlin
bfcd51cb6a Make wxValidator::SetWindow() virtual
Allow overriding the method called when the validator is associated with
the window, this can be convenient to perform some initialization on the
validator instance actually used as it can't be done on the initially
created object itself because it will be cloned by SetValidator(),
creating a new instance.

Also change SetWindow() to take wxWindow instead of wxWindowBase, this
still requires the cast in wxWindow::SetValidator(), but it's better to
have it there rather than in wxValidator and use the simpler type in the
public function signature.
2018-01-07 01:25:10 +01:00
Paul Cornett
572fe37898 Avoid calling default "key-press-event" handler
We have already done everything it does, and doing it again seems to
cause an infinite loop with WebKitGTK. See #17932
2018-01-06 11:07:11 -08:00
rmpowell77
af56ccd46f Use semicolons as statement separators in wxHTML code
This avoids (harmless in this, but not necessarily in the other, case)
clang warning: possible misuse of comma operator here [-Wcomma].

See https://github.com/wxWidgets/wxWidgets/pull/662
2018-01-06 17:37:20 +01:00
Tobias Taschner
c8b6ca308b Update year in copyright notices to 2018
Use 2018 instead of 2017 (mostly in version info files).

See https://github.com/wxWidgets/wxWidgets/pull/661
2018-01-05 19:51:47 +01:00
Paul Cornett
00d8434156 Avoid debug message when there is no session manager
See #16024
2018-01-05 10:01:38 -08:00
Vadim Zeitlin
a2ad7f9bf6 Merge branch 'dvc-sort-opt'
Optimize item sorting in generic wxDataViewCtrl and other minor
enhancements.

See https://github.com/wxWidgets/wxWidgets/pull/642
2018-01-04 21:42:42 +01:00
Vadim Zeitlin
48faeb65b3 Fix copy ctor in numeric validators classes
wxFloatingPointValidator and wxIntegerValidator copy ctor didn't copy
the associated window, so it was lost when the validator was Clone()'d.

Fix this by correctly using wxValidator copy ctor, instead of the
default one, in the copy ctor of the common wxNumValidatorBase base
class.
2018-01-04 21:39:57 +01:00
Mart Raudsepp
48a5d6c5f8 Move wx/evtloopsrc.h to BASE_CMN_HDR from GUI_CMN_HDR
This header ends up being included by wx/apptrait.h, which is in
BASE_CMN_HDR, so it needs itself to be there too in order for
compilation to work when using non-GUI library build.

Closes #18038.
2018-01-04 17:16:40 +01:00
Paul Cornett
5efba4ce47 Avoid invisible wxTextCtrl selection with GTK+3
See #18036
2018-01-03 20:22:12 -08:00
Paul Cornett
b02df5ea33 Remove unneeded init function
GObject instances are already zero-initialized
2018-01-03 09:26:12 -08:00
Paul Cornett
da186a0713 Avoid trying to override non-existent property with GTK+ < 2.20 2018-01-03 09:16:06 -08:00
Vadim Zeitlin
a9f6a42d38 Merge branch 'gtk-dvc-custom-edit'
Fix regression with custom wxDataViewCtrl editors in wxGTK.

See https://github.com/wxWidgets/wxWidgets/pull/660
2018-01-03 04:21:04 +01:00
Vadim Zeitlin
827e90e8de Use GtkHBox as GtkWxCellEditorBin parent with GTK+ < 4
Using GtkBin as widget parent didn't work without overriding its
size-related vfuncs until GTK+ 3.8 and, in particular, resulted in the
editor (which was the child of the bin) not being visible at all with
GTK+ 2.

Switch to using GtkHBox as parent, which does work with both GTK+ 2 and
any GTK+ 3 version, but keep using GtkBin with GTK+ 4 as GtkHBox is
removed in it.

This fixes bug introduced in c2821dcea0
since which custom wxDataViewCtrl editors were not visible any more.

Closes #17686.
2018-01-03 00:57:46 +01:00
Vadim Zeitlin
0a2dfc7959 Document wxClipboard::AddData() as synonym for SetData()
Don't pretend that AddData() allows to add multiple objects to the
clipboard because it doesn't work like this by default under any
platform and only MSW possibly supports this in the non-default build
with wxUSE_OLE==0 -- but mentioning it in the documentation would
arguably be more confusing than helpful.

See #17925.
2018-01-02 17:06:58 +01:00
Vadim Zeitlin
32fc7c368f Make it more clear that XRC version must be set
Omitting the version can result in difficult to diagnose problems, so
insist that it should be set in the format documentation.

See #18033.
2018-01-02 16:53:43 +01:00
Vadim Zeitlin
bde62ce981 Get rid of unused renderer rect in gtk_wx_cell_renderer_new()
No real changes, just don't call gtk_wx_cell_renderer_get_size()
unnecessarily as we never use its result: the code using the returned
rectangle was commented out ever since it was added (more than 10 years
ago) in 1e510b1e2d
2018-01-02 16:34:54 +01:00
Vadim Zeitlin
bf09ff2320 Remove unused GTK_IS_WX_CELL_EDITOR_BIN* macros
No real changes, just don't define macros that we never use and don't
plan on using it (why would we need to test whether something is of this
type when we already know it).
2017-12-31 02:27:19 +01:00
Vadim Zeitlin
0730236fa8 Merge branch 'parse-bad-wav'
Fix multiple problems with parsing untrusted input data in wxSound.

Closes #11855.
2017-12-30 22:52:14 +01:00
Vadim Zeitlin
c010efc172 Avoid integer overflow when computing the sample size
While it seems to be harmless in this particular case, it still prevents
testing this code with UBSAN by triggering it here, so check that
multiplication doesn't overflow.
2017-12-30 18:52:57 +01:00
Vadim Zeitlin
61c7cf9a9c Fix yet another division by 0 when parsing WAV data
Ensure that the size of one sample (including all the channels) is non
zero before dividing by it.
2017-12-30 18:52:57 +01:00
Vadim Zeitlin
932f384c87 Avoid division by 0 when parsing WAV data
Don't divide by waveformat.uiBlockAlign which could be 0, but rather
multiply by it and verify that we get the expected result. This is more
robust, as it prevents crashes on malformed input and also slightly more
efficient even for correct input.
2017-12-30 18:52:57 +01:00
Vadim Zeitlin
45e8d13e13 Add format sub-chunk size check to WAV parsing
This fixes a crash due to reading beyond the buffer bounds when checking
for "data" if WAVEFORMAT::uiSize was too big.
2017-12-30 18:52:57 +01:00
nowhere
69cd6039eb Make parsing WAV data more robust
Check that we have enough data in the input instead of happily reading
out of bounds memory.

This fixes the most common problem of crashing on bad data which doesn't
look like WAV at all, but doesn't fix problems with parsing input which
does look like WAV, but is incorrect -- this will be done in subsequent
commits.
2017-12-30 18:52:36 +01:00
Vadim Zeitlin
c65eaac529 Fix harmless warning about comparing values of different enums
This avoids a bunch of -Wenum-compare-switch warnings from clang 6.
2017-12-30 18:51:05 +01:00
adrian5
6c7aaa9e95 Improve wording and formatting in "Hello World" example
Minor fixes to the "Hello World" example in the manual to make its style
more consistent and the text more readable.

Closes https://github.com/wxWidgets/wxWidgets/pull/657
2017-12-29 20:13:29 +01:00
Frédéric Bron
f4b56f67ec Improve documentation of wxPropertyGrid::MakeColumnEditable()
Explain that column must be different from 1 in the documentation and in
the (already existing) assert checking it.

Closes https://github.com/wxWidgets/wxWidgets/pull/656
2017-12-29 20:06:04 +01:00
orbitcowboy
f423b88ded Replace post-increment on iterators with pre-increment
This is a micro-optimization, as pre-increment is at least as efficient
as post-increment and typically slightly more so because it doesn't need
to make a copy of the iterator, and better conforms to the prevailing
C++ style.

Closes https://github.com/wxWidgets/wxWidgets/pull/655
2017-12-29 19:59:24 +01:00
Vadim Zeitlin
f83d16aa46 Undefine min and max before using them in wx/valnum.h
Avoid problems when using this header in code also include <windows.h>
(and not doing it via wx/msw/wrapwin.h) by ensuring that min and max
used here are not defined as macros.
2017-12-26 04:29:42 +01:00
VZ
fdf2ee425f Use postfix operator when iterating over containers
No real changes, just avoid a micro-pessimization.

See https://github.com/wxWidgets/wxWidgets/pull/652
2017-12-26 04:25:44 +01:00
Vadim Zeitlin
c697b62d46 Compilation fix for PCH-less build after last commit
Include the headers required by the new code in src/msw/textentry.cpp.

See #12613.
2017-12-26 04:24:23 +01:00
orbitcowboy
0790698345 Use postfix operator when iterating over containers. 2017-12-26 00:25:52 +01:00
Vadim Zeitlin
5a949efc5c Fix sending wxEVT_TEXT_ENTER when using auto-completion in wxMSW
We need to explicitly generate this event from the char hook handler as
we don't get the normal WM_CHAR for it, it is apparently intercepted by
the window proc installed by the auto-completing code, so check if
wxTE_PROCESS_ENTER is used for the text entry and call a special new
MSWProcessSpecialKey() method to do the right thing if it is.

Similarly, handle Tab presses correctly if wxTE_PROCESS_TAB is used.

Closes #12613.
2017-12-25 19:29:25 +01:00
Vadim Zeitlin
f32edbe1fc Test wxTE_PROCESS_TAB support on text page of widgets sample too
Do it for completeness and symmetry with the already existing checkbox
enabling wxTE_PROCESS_ENTER.
2017-12-25 18:45:06 +01:00
Vadim Zeitlin
610c164988 Always let DefWndProc() process column resizing in wxListCtrl
If we don't pass these messages to it, the selected items highlight
rectangle doesn't get updated when the columns are resized when using
visual themes, as could be seen in the listctrl sample.

While this did work if the wxEVT_LIST_COL_DRAGGING event handler skipped
the event, prefer to not require doing this as things work without this
call to wxEvent::Skip() under the other platforms and even MSW with
themes disabled.

Closes #18032.
2017-12-25 17:14:56 +01:00
Vadim Zeitlin
0df05d5377 Merge branch 'msw-listctrl-painting'
Improve rules drawing in wxMSW wxListCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/643 and https://github.com/wxWidgets/wxWidgets/pull/278
2017-12-25 16:54:44 +01:00
Vadim Zeitlin
3e8d63d256 Merge branch 'gesturesamplefixes' of https://github.com/NewPagodi/wxWidgets
Several cosmetic improvements to the gesture demo in the events sample.

See https://github.com/wxWidgets/wxWidgets/pull/651
2017-12-25 16:50:51 +01:00
New Pagodi
a636141b56 Use consistent letter case in log message strings 2017-12-24 18:25:26 -06:00
New Pagodi
0fa033df61 Remove newline characters from log message strings 2017-12-24 18:24:45 -06:00
New Pagodi
d3fd17db04 Use wxAutoBufferedPaintDC to reduce flicker with wxMSW 2017-12-24 18:24:05 -06:00