Commit Graph

5848 Commits

Author SHA1 Message Date
Paul Cornett
49db2dc315 Add wxART_CLOSE to sample 2017-12-14 20:34:20 -08:00
Vadim Zeitlin
15d22aed82 Merge branch 'cmake'
Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-15 00:33:07 +01:00
Jouk
47c0aed322 Add samples/event/gestures.cpp for compilation on OpenVMS 2017-12-14 08:59:26 +01:00
Rafael Kitover
21776b16f5 regen bakefile/autoconf files based on 3559d83bc4
Run `bakefile_gen` and `sh autogen.sh` to regenerate all bakefile and
autoconf generated files with GTK+4 support from 3559d83bc4.
2017-12-12 08:48:36 -08:00
Vadim Zeitlin
c66c9c5ae6 Merge branch 'build_cmake' of https://github.com/TcT2k/wxWidgets
Add CMake-based build system.

Merge the original branch without any changes except for resolving the
conflict due to moving the contents of .travis.yml to a separate file by
propagating the changes done in this file since then to the new script
and rerunning ./build/update-setup-h and ./build/cmake/update_files.py
to update the file lists changed in the meanwhile.

Closes https://github.com/wxWidgets/wxWidgets/pull/330
2017-12-09 15:09:47 +01:00
Vadim Zeitlin
3e0adbf541 Merge branch 'gesture-events'
Integrate GSoC 2017 work by Prashant Kumar implementing support for
gesture events.

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

Closes https://github.com/wxWidgets/wxWidgets/pull/565
2017-12-02 18:46:53 +01:00
Vadim Zeitlin
9655ca9e68 Close the gestures frame too in the event sample
Make "Exit" menu item really exit the sample again instead of just
closing the main window, but possibly leaving the gestures testing
window still open and thus not really exiting the program.

Also avoid creating more than one gesture window, use the existing one
if we had already opened it.
2017-11-30 21:40:24 +01:00
Jouk
ba58172987 change max to max_ to avoid %CXX-E-AMBIGUOUSNAME, "max" is ambiguous on OpenVMS 2017-11-27 09:00:29 +01:00
Maarten Bent
a96171def4 Fix unused variable and parameter warnings in samples
These variables are only used in debug builds, causing warnings in release builds.
2017-11-25 17:52:08 +01:00
Maarten Bent
afc02a34ee More use of wxFALLTHROUGH in MSW code and samples 2017-11-25 17:52:08 +01:00
Maarten Bent
cbf13e68a2 Replace deprecated std::auto_ptr with wxScopedPtr 2017-11-25 17:00:18 +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
Vadim Zeitlin
5f5c5b8f29 Remove hard TAB from event sample bakefile
No real changes.
2017-11-22 03:05:03 +01:00
Vadim Zeitlin
7535854ec4 Embed the image into the event sample
Don't load it from the image sample directory, this doesn't necessarily
work under Unix if the image sample hadn't been built.

Just embed an XPM image directly into the sample, this is good enough
for demonstration purposes.
2017-11-22 03:05:03 +01:00
Vadim Zeitlin
842dd1cfd9 Add wxWindow::EnableTouchEvents()
Don't request touch event generation for all windows by default, this
has an inherent overhead and is not needed for 99% of the application
windows, so require calling EnableTouchEvents() explicitly to do it
instead.

Note that this requires properly initializing gesture recognizers in
wxOSX now that they're not always allocated, otherwise releasing them
when destroying the window would crash.
2017-11-22 02:24:24 +01:00
Vadim Zeitlin
bb2887930f Use wxPoint instead of (x,y) pair in wxPanGestureEvent
Using higher level objects makes the code generating and using this
event shorter and more clear.
2017-11-21 17:45:34 +01:00
prashantkn94
261b04b5a3 Merge multi-touch gestures event branch
This is a squashed commit of the SOC2017_GESTURES branch from
https://github.com/prashantkn94/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/551
2017-11-17 18:06:06 +01:00
Vadim Zeitlin
317470a39a Use "max" instead of 100 in the progress dialog sample code
No real changes, just don't hardcode 100 as we have a symbolic constant
for it here already.
2017-11-16 01:35:52 +01:00
Vadim Zeitlin
814a674531 Speed up the sample progress dialogs in the sample
Just make them finish faster, it's too boring to wait for them to do it
when testing when they take so long.
2017-11-16 01:35:50 +01:00
Vadim Zeitlin
3b4a71c4dc Allow testing wxGenericProgressDialog in the dialogs sample too
Add the possibility to test the generic implementation of the class when
we use the native one by default, this is useful to allow comparing the
behaviour of the two classes.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0473d14ef1 Make wxProgressDialog::Fit() work in native MSW version
This method is supposed to adjust the dialog size to its contents and
while the dialog increases automatically when using native
implementation under MSW, it doesn't shrink back on its own and so it's
still useful to allow Fit() to do it.

Update the sample to test Fit() too.
2017-11-16 01:35:49 +01:00
Vadim Zeitlin
0736bdfb28 Prevent constant size changes in native MSW wxProgressDialog
MSW implementation of wxProgressDialog adjusted the dialog size to the
size of the message shown in it on each update, resulting in visually
unpleasant constant jumping around (this is the same problem that we
used to have in wxGenericProgressDialog long time ago, see #10624).

Minimize this by using TDM_UPDATE_ELEMENT_TEXT instead of
TDM_SET_ELEMENT_TEXT for changing the element text. This still increases
the dialog size if the new element text is longer than the old value,
but at least doesn't shrink it back if it is shorter, which is already
quite an improvement.

Notice that this change requires using TDF_EXPAND_FOOTER_AREA style, as
otherwise the expanded information can't be updated without a re-layout.
But this doesn't seem to be a big loss and it's not really clear why did
we explicitly clear this flag before anyhow.

Update the dialogs sample to make it easy to test for this behaviour and
the documentation to mention MSW version peculiarities.
2017-11-16 01:35:48 +01:00
Paul Cornett
21620da3e5 Move GTK3 wxNO_BORDER handling to wxControl
So wxNO_BORDER works with other controls, such as wxBitmapButton.
Also use GTK prefix on ApplyCssStyle(), and add an overload that
creates the GtkCssProvider.
2017-11-15 10:51:38 -08:00
Vadim Zeitlin
d3b033f432 Allow webview sample to build without wxSTC
There doesn't seem to be any special reason to use wxStyledTextControl
in this sample and doing it unconditionally breaks the build with
--disable-stc, so use wxTextCtrl instead in this case.

Closes #17998.
2017-11-14 00:09:08 +01:00
Vadim Zeitlin
283f5a4d56 Remove useless wxFont::ActivatePrivateFonts()
Just "activate" the font immediately when adding it using
AddPrivateFont(), nothing seems to be gained from having two functions
and it just makes things more complicated both when implementing and
when using the API.
2017-11-13 22:29:30 +01:00
Vadim Zeitlin
5d134711a1 Add BUNDLE_FONT_RESOURCES and use it in font sample
Allow copying font files to the Fonts subdirectory of the app bundle,
private fonts can only be loaded from there under macOS currently.
2017-11-13 22:29:29 +01:00
Vadim Zeitlin
4145a30e06 Report errors if using private font fails in the font sample
Give more information instead of just silently not showing the
corresponding menu item.
2017-11-13 22:29:28 +01:00
Arthur Norman
547e40b114 Add support for loading fonts from files.
wxFont::AddPrivateFont() can now be used to load a font from a file for the
applications private use. Update the font sample to show this.

Closes #13568.
2017-11-13 22:29:28 +01:00
Vadim Zeitlin
b130595975 Remove accidental global variable from the font sample
This variable was never used and appears to have been created
accidentally, so just remove it and avoid variable shadowing warnings
from MSVS 2015 when building the sample.
2017-11-07 18:28:54 +01:00
Tim S
1c2e58cd85 Remove cp commands copying removed files from help sample
Just remove the commands copying files that were removed in
961a1c2b39 themselves too.

See #17962.
2017-11-05 16:47:25 +01:00
Vadim Zeitlin
7e0b6d4d81 Merge branch 'webview-js-retval'
Integrate GSoC 2017 work by Jose Lorenzo on allowing returning values
from JavaScript code via wxWebView::RunScript().
2017-11-04 16:07:51 +01:00
Vadim Zeitlin
e70fc11ef1 Replace CppUnit with Catch for unit tests
Drop the legacy CppUnit testing framework used for the unit tests.
Replacing it with Catch has the advantage of not requiring CppUnit
libraries to be installed on the system in order to be able to run
tests (Catch is header-only and a copy of it is now included in the
main repository itself) and, in the future, of being able to write
the tests in a much more natural way.

For now, however, avoid changing the existing tests code as much as
[reasonably] possible to avoid introducing bugs in them and provide
the CppUnit compatibility macros in the new wx/catch_cppunit.h header
which allow to preserve the 99% of the existing code unchanged. Some
of the required changes are:

 - Decompose asserts using "a && b" conditions into multiple asserts
   checking "a" and "b" independently. This would have been better
   even with CppUnit (to know which part of condition exactly failed)
   and is required with Catch.

 - Use extra parentheses around such conditions when they can't be
   easily decomposed in the arrays test, due to the use of macros.
   This is not ideal from the point of view of messages given when
   the tests fail but will do for now.

 - Rewrite asserts using "a || b" as a combination of condition
   checks and assert macros. Again, this is better anyhow, and is
   required with Catch. Incidentally, this allowed to fix a bug in
   the "exec" unit test which didn't leave enough time for the new
   process to be launched before trying to kill it.

 - Remove multiple CPPUNIT_TEST_SUITE_NAMED_REGISTRATION() macros,
   our emulation of this macro can be used only once.

 - Provide string conversions using Catch-specific StringMaker for
   a couple of types.

 - Replace custom wxImage comparison with a Catch-specific matcher
   class.

 - Remove most of test running logic from test.cpp, in particular don't
   parse command line ourselves any longer but use Catch built-in
   command line parser. This is a source of a minor regression:
   previously, both "Foo" and "FooTestCase" could be used as the name of
   the test to run, but now only the latter is accepted.
2017-11-02 01:53:16 +01:00
Vadim Zeitlin
46fa106b10 Demonstrate using wxWebView::SetPage() in the sample
This allows to verify, at least interactively, that the expected events
are generated when using SetPage() too, and not only LoadPage().
2017-10-22 23:38:12 +02:00
Vadim Zeitlin
49401c960c Use HTTPS by default in the webview sample
This allows the sample to load the initial page when built using macOS
10.11 or later SDK which enables "app transport security" (ATS), which
prevents HTTP connections by default.
2017-10-22 23:38:10 +02:00
Vadim Zeitlin
732cb97af3 Don't prompt before running canned JavaScript in the sample
This is more annoying than helpful, just run the script without
prompting and do remember the last snippet we ran to show it in the
interactive "Run Script" dialog later if necessary.
2017-10-22 23:37:38 +02:00
Vadim Zeitlin
b0d2375941 Revert "Changed url on webview sample"
This reverts commit 92ae25ec3c240217f5584372abadaabedd3952df.

There doesn't seem to be any good reason to use wiki.wxwidgets.org
instead of the main site.
2017-10-22 23:37:34 +02:00
Vadim Zeitlin
b66632fc6d Simplify RunScript()-related code in webview sample
There is no need to pass "result" to this function when it's never used
outside of it.

And it can use the correct message depending on the value of its input
instead of having to provide it in the caller.
2017-10-22 23:37:20 +02:00
Vadim Zeitlin
ce0de68f13 Fix recurring "messege" typo in webview sample 2017-10-22 23:37:16 +02:00
Jose Lorenzo
af8f7f33c3 Merge wxWebView JavaScript improvements branch
This is a squashed commit of the SOC2017_WEBVIEW_JS branch from
https://github.com/joseeloren/wxWidgets.git

Closes https://github.com/wxWidgets/wxWidgets/pull/538
2017-10-21 22:42:30 +02:00
Vadim Zeitlin
d5e1851a40 Merge branch 'remove-mac-res'
Remove all Mac resources and related stuff, see
https://github.com/wxWidgets/wxWidgets/pull/567
2017-10-21 22:11:42 +02:00
Vadim Zeitlin
e98d7181b5 Use wxDataViewCtrl::GetTopItem() and GetCountPerPage() in the sample
Demonstrate the use of these methods and also allow testing them easily.

See #17498.
2017-10-21 22:10:35 +02:00
Vadim Zeitlin
352a06ad22 Remove old Carbon Mac resource files themselves
They are not used any longer.
2017-10-21 17:49:34 +02:00
Vadim Zeitlin
0d394eec9c Update to bakefile 0.2.11 and rebake everything
The main/only change in this version is the removal of automatic rules
using old Carbon Rez/DeRez/SetFile tools.
2017-10-21 17:42:30 +02:00
Artur Wieczorek
2f3376c4c5 Allow changing wxPG_EX_ALWAYS_ALLOW_FOCUS in propgrid sample
Add wxPG_EX_ALWAYS_ALLOW_FOCUS to the list of flags which can be changed.
2017-10-18 22:57:39 +02:00
Artur Wieczorek
19dbdca53b Rely on native double buffering by default in propgrid sample
If the platform has native double-buffering, create wxPropertyGrid
relying on it by default.
2017-10-18 22:56:44 +02:00
Paul Cornett
ed8a541463 Use wxFALLTHROUGH 2017-10-17 09:21:45 -07:00
Vadim Zeitlin
961a1c2b39 Remove unused Java class files without sources from help sample
These files didn't have any sources, don't work in any modern browser
and seem to have been completely unused anyhow, so just drop them.

Closes #17962.
2017-10-04 19:15:44 +02:00
Paul Cornett
8c353236ac Fix ifdef for TGA 2017-10-01 09:38:47 -07:00
Paul Cornett
db29d5efba Fix incorrect pointer indirection in sort callback function 2017-10-01 09:11:45 -07:00