Commit Graph

5818 Commits

Author SHA1 Message Date
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
Artur Wieczorek
53718ac4af Change alignment style dynamically for wxTextCtrl in widgets sample also under wxOSX 2017-09-25 15:51:43 +02:00
Vadim Zeitlin
f19012c62c Merge branch 'firstweekday' of https://github.com/lanurmi/wxWidgets
Add API for determining the first day of the week and use it in
wxCalendarCtrl.

Closes https://github.com/wxWidgets/wxWidgets/pull/522
2017-09-10 21:41:36 +02:00
Lauri Nurmi
e6a7a09d9d Use automatically selected first weekday by default in calendar sample
Also create a wxLocale object with wxLANGUAGE_DEFAULT so that automatic
selection has a better chance of doing the right thing across different
platforms.
2017-09-02 17:24:10 +03:00
Vadim Zeitlin
de9b6fdc9e Show the exact wxTextCtrlHitTestResult in the text sample too
In addition to showing the position returned by HitTest(), also show its
return value which is not necessarily wxTE_HT_ON_TEXT if it is not
wxTE_HT_UNKNOWN under MSW.
2017-08-25 01:03:36 +02:00
Vadim Zeitlin
0873abb836 Replace wxEVT_SIZE handler with sizers in the listctrl sample
Just simplify the code, no real changes.
2017-08-24 22:11:53 +02:00
Vadim Zeitlin
741dd542f2 Fix assert in the text sample when logging char events
Passing long argument to "%c" printf format specifier was correctly
flagged as invalid in 64 bit Unix builds where long != int.

Fix this by just making the "keycode" variable int in the first place,
there doesn't seem to be any reason whatsoever for it to be long and
this allows us to get rid of a couple of existing casts instead of
adding yet another one.
2017-08-24 14:17:33 +02:00
VZ
c93b88af39 Build samples in parallel with "make -jN"
Building samples one by one has become a significant pessimization
nowadays, when multicore machines are much more common than single core
ones, so get rid of the shell loop which built the samples one by one
and use make targets to let make build as many targets at once as
desired.

Closes https://github.com/wxWidgets/wxWidgets/pull/536
2017-08-15 19:16:27 +02:00
Vadim Zeitlin
3654a12d6a Fix xrc sample build with wxUSE_GIF==0
Also check for wxUSE_XPM for consistency.
2017-08-14 01:23:08 +02:00
Vadim Zeitlin
7e80ff4ed8 Merge branch 'i18n-context'
Closes https://github.com/wxWidgets/wxWidgets/pull/530
2017-08-09 20:47:41 +02:00
Vadim Zeitlin
91385acd5d Rename context-specific translation macros and document them
Try to use more clear names for the macros and also try to make the
sample more self-explanatory.
2017-08-09 14:21:47 +02:00
Artur Wieczorek
111ff4e618 Add presentation of text alignment in wxTextCtrl to widgets sample
Added an option to choose text alignment styles for wxTextCtrl presented
in the sample.
2017-08-03 21:09:40 +02:00
Artur Wieczorek
e426411e34 Allow setting wrap styles only for multi-line wxTextCtrl (widgets sample)
Wrap styles are not applicable to the single-line control and radio box
to select these styles should be disabled when single-line control is
active.
It looks that it was intended to implement this feature with
TextPage_WrapLines constant and OnUpdateUIWrapLinesCheckbox handler so we
can reuse these elements.
2017-08-02 23:41:40 +02:00
Artur Wieczorek
794e1b275b Add presentation of wxTextCtrl's wxTE_NO_VSCROLL style in widgets sample
Added an option to set/unset wxTE_NO_VSCROLL style for wxTextCtrl presented
in the sample.
2017-08-02 23:06:25 +02:00
RickS
205841d6c4 Test sample for context-sensitive translations 2017-07-27 13:23:19 +02:00
Cătălin Răceanu
305ff51314 Add check for wxUSE_EXTENDED_RTTI to the xti sample header
The sample requires wxUSE_EXTENDED_RTTI to be enabled, and that is correctly signalled
in the source files. Just avoid the header flooding the output with errors.

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

* Removed BOM.
2017-07-20 00:20:25 +02:00
Vadim Zeitlin
ca96abd119 Remove more hard-coded wxSpinCtrl sizes from the aui sample
This should have been part of 672cf7d199
and is done for the same reason: hard-coding control width to 50
truncates it under wxGTK3 as it's much wider than this there.

Closes #17919.
2017-07-19 21:04:20 +02:00
Vadim Zeitlin
2fffbde096 Change wxSecretStore API to allow retrieving the username
The old API didn't make any sense for the most common case when both the
user name and password need to be stored, as it required providing the
user name as input, which couldn't work (but somehow this went
unnoticed for more than a year...).

Fix this by returning the username, and not only the password, from
Load() instead of taking it as parameter and removing this parameter
from Delete() as well.

Also improve the documentation, notably include a simple example of
using this class.

Notice that this is a backwards-incompatible change, but the old API was
really badly broken and didn't appear in 3.1.0 yet, so the breakage is
both unavoidable and, hopefully, shouldn't affect much code.
Nevertheless, a special wxHAS_SECRETSTORE_LOAD_USERNAME symbol is added
to allow testing for it if necessary.
2017-07-17 18:26:20 +02:00
Artur Wieczorek
afdb7eca87 Use quotes and not angle brackets around the includes of wxWidgets itself 2017-07-16 18:31:54 +02:00
Vadim Zeitlin
101509eb4b Simplify platform differences handling in the preferences sample
Use an alternative and arguably simpler (at least with real-life
applications, where settings are somewhat more complex) way of handling
the differences between platforms in the preferences sample: instead of
executing completely different code under different platforms, always
update the local copy of the settings immediately and just propagate, or
not, it to the application-level settings depending on the current
platform.

This costs an extra copy of the settings object on each change, but this
shouldn't be a problem in practice, and OTOH results in using mostly the
same code under all platforms, reducing the probability of
platform-specific bugs and avoiding any code duplication between the
event handlers and TransferDataFromWindow().
2017-07-11 23:46:27 +02:00
Vadim Zeitlin
552c942a76 Actually show settings changing in the preferences sample
Make the sample slightly more realistic by adding a MySettings struct whose
fields are updated the dialog and also make it more visual by showing the
current values of (some) settings on the screen.
2017-07-11 23:23:32 +02:00
Vadim Zeitlin
6de9a284a7 Use Bind() instead of Connect() in preferences sample
This makes the code shorter and more clear.
2017-07-11 23:23:32 +02:00
Vadim Zeitlin
18f3992801 Just fix a typo in the preferences sample
"Use" and not "User".
2017-07-11 23:23:32 +02:00
Stefan Csomor
a6ba2245ef Redo Use implicit wxColour to wxBrush conversion 2017-06-28 07:22:54 +02:00
Stefan Csomor
526889dc57 Properly initialize newly created wxGraphicsContext with window background color 2017-06-26 08:40:09 +02:00
Dimitri Schoolwerth
07c8f15e43 Fix 'destionation' typos
Rename relatively new enum value wxTASKBAR_JUMP_LIST_DESTIONATION to
wxTASKBAR_JUMP_LIST_DESTINATION as well as a private function containing
the same typo.
2017-06-21 22:51:57 +04:00
Artur Wieczorek
528c559953 Fix pagination in stc sample
1. Fix setting page size if printing is done in the landscape mode.
2. Store ranges of printed characters for all pages (not only recent page)
while doing pagination (in GetPageInfo) to allow printing pages (with
OnPrintPage) in any order (not only sequentially).

Closes #17107.
2017-05-26 00:29:05 +02:00
Artur Wieczorek
8f8534361c Set default print data in stc sample
Basic paper parameters should be initialized with default values to allow
paginating a document even if paper settings are not yet explicitly set by
invoking "Print Setup" dialog.

See #17107.
2017-05-26 00:28:33 +02:00
VZ
d2c2274baa Merge pull request #478 from stahta01/staging
Fix wxGTK/Win32 build with "--disable-wxdib".
2017-05-22 00:25:03 +02:00
Prashantkn
bf5a564c9a Remove unused variables in svgtest.cpp Sample 2017-05-09 21:41:57 +02:00