Commit Graph

63788 Commits

Author SHA1 Message Date
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
3357d46ccc Make it simpler to use mnemonics for wxRadioBox items in XRC
Allow specifying label="1" attribute in wxRadioBox <item> tags to
indicate that the usual translation of "_" to "&" should be done, as for
all the other labels.

This is still not the default behaviour to avoid breaking any existing
XRC files using "_", even though using labels="1" by default would make
more sense.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
bc2c9ce2a3 Fix misspelling of a label in XRC docs and example
It was spelt in 2 different ways, neither of which was actually correct.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
52635cfc10 Reuse the same XRC function for all translations
Translate all strings in the new GetNodeText() function replacing the
old GetText() which was mostly used for translatable strings before --
except that <item> tag contents didn't use it because it also performed
string unescaping, not wanted for the control items, in addition to
translation.

Replace the old GetText() (while still keeping it for compatibility,
i.e. to avoid breaking any custom XRC handlers using it) with the new
function which is more flexible and can be used for all tags.

No real changes, this is just a refactoring.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
689704119a Fix handling of underscores in <item> tags in "wxrc -g" output
Unlike all the other nodes containing translatable text, the contents of
the <item> tags, used for wxChoice, wxListBox etc items, is not escaped
(because it can't contain mnemonics), so don't unescape it when
outputting it from "wxrc --gettext" neither.

See #18033.
2018-01-11 01:19:16 +01:00
Vadim Zeitlin
6bd8cb964b Really remove removed files from the help sample
This does what 1c2e58cd85 tried to do
manually correctly, by updating bakefile and rebaking, and so finally
completing the changes of 961a1c2b39.

See #17962.
2018-01-10 23:44:08 +01:00
Vadim Zeitlin
f0d946a38d Merge branch 'xrc-spinctrldouble'
Add XRC handler for wxSpinCtrlDouble.

Closes https://github.com/wxWidgets/wxWidgets/pull/665
2018-01-10 17:45:08 +01:00
Vadim Zeitlin
c3c8a2198d Document the recently added wxSpinCtrlDouble XRC handler
Update XRC reference documentation after adding a new handler too.
2018-01-10 17:44:42 +01:00
Vadim Zeitlin
74cf8370ce Avoid code duplication between wxSpinCtrl XRC handlers
Extract styles initialization into a function reused by both
wxSpinCtrlXmlHandler and wxSpinCtrlDoubleXmlHandler.

No real changes, this is a pure refactoring.
2018-01-10 17:44:37 +01:00
Trylz
80f4c8cde3 Add XRC handler for wxSpinCtrlDouble
Create wxSpinCtrlDoubleXmlHandler class similar to the existing
wxSpinCtrlXmlHandler and update the XRC schema to account for it.
2018-01-10 17:44:32 +01:00
Vadim Zeitlin
e2a31ef3db Merge branch 'grid-clip'
See https://github.com/wxWidgets/wxWidgets/pull/648
2018-01-10 17:19:03 +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