Commit Graph

6235 Commits

Author SHA1 Message Date
Vadim Zeitlin
06af121e9c Add wxObjectDataPtr::release()
This makes it possible to use wxObjectDataPtr inside functions returning
raw pointers owned by the caller, such as custom GetAttr() in the grid
sample.
2020-03-31 02:57:01 +02:00
Vadim Zeitlin
15b5a1865c Add a simple wxGrid::AssignTable() wrapper for SetTable()
In many case SetTable() is called with its takeOwnership parameter set
to true, as shown by the grid sample in which all 3 of the calls to
SetTable() set it to true, but calling it in this case is awkward, as
bare "true" in the caller is unreadable and almost invariably requires
an explanatory comment.

Improve the API by adding AssignTable(), which is the same to SetTable()
as the existing AssignImageList() to SetImageLabel(), which always takes
ownership of the table pointer.
2020-03-31 02:43:08 +02:00
Vadim Zeitlin
c6a4cc80fe Merge branch 'pmdpi-build' of git://github.com/MaartenBent/wxWidgets
Improve DPI aware builds with .vc and .vcproj files.

See https://github.com/wxWidgets/wxWidgets/pull/1769
2020-03-28 14:10:17 +01:00
Maarten Bent
343bd89b63 Rebake after changes 2020-03-27 23:15:03 +01:00
Vadim Zeitlin
bb489418b0 Number renderers using consecutive digits in the sample
This has the disadvantage of not using the same accelerators in
different wxWidgets builds, but the advantage of appearing logical to a
casual user when running the sample, while having "0, 1, 3, 4" sequence
was surprising.

Alternatively, we could always add all menu items, but disable the ones
that are not available in the current build. It could be surprising to
see "GDI+" under non-MSW systems too though.
2020-03-27 11:51:56 +01:00
Vadim Zeitlin
e7c8039d13 Simplify renderer selection in the drawing sample
Make "Use default wxGraphicsContext" part of the renderer selection
radio group and put it in correct order, as having "1, 0, 3, 4"
accelerators order in the menu was really surprising.

Remove wxEVT_UPDATE_UI handlers as they complicated things in the sample
code (which is supposed to be simple, after all) without much benefit
and arguably even added to the confusion during run-time as menu items
could both be manually selected and checked automatically.
2020-03-27 11:43:19 +01:00
Vadim Zeitlin
62bb47cfdb Use white background for drawing lines in the drawing sample
This makes the display more readable, black on red was really not ideal.

No real changes.
2020-03-27 11:39:03 +01:00
Vadim Zeitlin
c09fd8b59d Update copyright years to 2020
Just run misc/scripts/inc_year and commit the results.

Closes #18690.
2020-03-06 00:51:39 +01:00
Vadim Zeitlin
ec091c9f2b Don't override CFLAGS etc in configure-generated makefile
CPPFLAGS, CFLAGS, CXXFLAGS and LDFLAGS are supposed to be under
user-control and putting configure-determined options in them broke
something as simple as running "make CXXFLAGS=-Wno-some-extra-warning"
because this overrode the CXXFLAGS set by configure and required for
build.

Improve this by using WX_*FLAGS in the generated makefile and leaving
the user-controlled FLAGS alone. This is still not ideal as running
"configure CFLAGS=-DFOO" and then "make CFLAGS=-DBAR" will define both
FOO and BAR, as configure copies CFLAGS to WX_CFLAGS, and so setting it
on make command line won't override it, as it should, but this should be
a much more rare and also much less severe problem, so we should be able
to live with it for now.

Normally this commit shouldn't result in any user-visible changes, i.e.
it shouldn't break any previously working scenarios and only make some
previously broken ones work.
2020-02-11 23:19:31 +01:00
Vadim Zeitlin
5a454d373b Optionally return error message from wxSecretStore::IsOk()
This allows to give at least some explanation about why the secrets
can't be stored to the user, e.g. they could search for a message such
as

The name org.freedesktop.secrets was not provided by any .service files

to find out that gnome-keyring package needs to be installed on their
system.

Note that this change means that under Unix an attempt to connect to the
secret service is now made when wxSecretStore is constructed and not
just when it's used for the first time, as before.
2020-02-10 18:23:59 +01:00
Paul Cornett
6e52a70582 Build fix after 948ddc6e0f 2020-02-03 09:34:01 -08:00
Paul Cornett
948ddc6e0f Eliminate -Wcast-qual warnings with GCC and Clang
Use const_cast, mutable, and various other changes to avoid -Wcast-qual
2020-02-02 22:50:32 -08:00
Vadim Zeitlin
767c07c040 Merge branch 'webview-edge'
Add support for (optionally) using Edge-based wxWebView.

See https://github.com/wxWidgets/wxWidgets/pull/1700
2020-01-22 03:38:00 +01:00
Vadim Zeitlin
5d9e1ceb80 Show whether Edge backend is used in the webview sample
Allow to see at a glance whether Edge is being used or not.
2020-01-22 03:37:12 +01:00
Vadim Zeitlin
f6b79fdf8f Rebake gcc makefiles accidentally modified in this branch
Undo the changes due to the use of different version of bakefile 0.x.
2020-01-22 03:24:57 +01:00
Vadim Zeitlin
b9038a1e8c Merge branch 'msw-headerctrl' of https://github.com/MaartenBent/wxWidgets
Fix applying style of MSW wxHeaderCtrl and add tests for doing it to the
widgets sample.

See https://github.com/wxWidgets/wxWidgets/pull/1710
2020-01-19 17:49:40 +01:00
Maarten Bent
b3f259c99c Fix reverting to standard cursor in widgets sample
Don't set the cursor to wxSTANDARD_CURSOR, but set it to wxNullCursor so the
default system cursor is used.
2020-01-19 14:56:48 +01:00
Maarten Bent
a31cf55a8d Add more columns to Header control in widgets sample
Show column settings horizontally.
Fix binding to header control events after it is recreated.
2020-01-19 14:56:45 +01:00
Tobias Taschner
4ebde54d41
Only show IE specific menus in webview sample when using IE 2020-01-16 10:46:19 +01:00
Tobias Taschner
9f11abd8fc
Rename wxWebView::EnableDevTools() to EnableAccessToDevTools() 2020-01-16 09:38:35 +01:00
Tobias Taschner
bce0e65a80
Rename wxWebView::IsDevToolsEnabled() to IsAccessToDevToolsEnabled() 2020-01-15 16:22:43 +01:00
Vadim Zeitlin
41dcd9ecdb Add API for ellipsization support to wxGrid
This API is not implemented yet, i.e. ellipsization mode is not
respected for now. This commit just adds the API, documents it and adds
an example of using it in the sample.
2020-01-11 19:14:23 +01:00
Vadim Zeitlin
f13085441c Add wxGridFitMode and functions working with it
Replace "bool overflow" flag with a class allowing to specify the same
overflow/clipping behaviour currently, but also allowing to extend it,
notable to add ellipsization support, in the future.

Preserve the existing API by reimplementing it in terms of the new one.

Also update the same to demonstrate a cell which always overflows,
independently of the default cell behaviour.
2020-01-11 18:02:12 +01:00
Tobias Taschner
d72e5874eb
Add wxWebView methods to enable dev tools
Currently only implemented for the Edge (Chromium) backend.
2020-01-10 22:27:36 +01:00
Tobias Taschner
f2196abca3
Add wxWebViewEdgeChromium to other build systems 2020-01-10 22:22:30 +01:00
Markus Pingel
6a99e7e273
Add wxWebView Edge (Chromium) implementation
This backend requires WebView2 SDK and enables usage of Edge (Chromium)
on Windows 7 and newer
2020-01-10 22:22:28 +01:00
Vadim Zeitlin
9ec0511924 Add a test of catching wxEVT_CONTEXT_MENU to the grid sample
Verify that these events are seen as coming from the grid itself after
the changes of the previous commit.
2020-01-07 18:22:09 +01:00
Vadim Zeitlin
826cc882dc Merge branch 'gtk-srchctrl'
Add native wxSearchCtrl implementation for wxGTK.

Closes https://github.com/wxWidgets/wxWidgets/pull/1688
2020-01-07 03:16:02 +01:00
ali kettab
c904e27376 Update widgets sample 2020-01-07 03:15:39 +01:00
Kvaz1r
a23b3783b6 Add precondition checks to operations in the listctrl sample
Avoid showing assert failures in debug builds if a menu item not
applicable in the current state is selected and just show an error
instead.

Closes #18572.

Closes https://github.com/wxWidgets/wxWidgets/pull/1694
2020-01-06 00:47:26 +01:00
Artur Wieczorek
a5934f33e2 Fix building image sample with wxUSE_PALETTE==0 2019-12-28 23:31:51 +01:00
Artur Wieczorek
bb9c8b11de Add demonstration of affine transformations to drawing sample
This adds a demonstration of drawing with affine 2D transformation applied
to wxDC. Transformation paramaters (translation, scale, rotation angle)
can be set/reset with new menu "Transformation".
2019-12-27 20:17:19 +01:00
Vadim Zeitlin
334ff40716 Show wxDataViewCheckIconTextRenderer in the sample
Instead of using separate check and icon+text columns in the list model
page, use the combined check+icon+text column to verify that it works
(which is not the case current in the native Mac version).
2019-12-15 19:27:58 +01:00
Vadim Zeitlin
2e71e14dc4 Fix format specifier in an error message in dataview sample
Use "%zu" for a size_t value to avoid assert failures under LP64 (i.e.
all 64-bit Unix) systems.
2019-12-15 19:26:18 +01:00
Vadim Zeitlin
f3217573d7 Merge branch 'rc-manifest' of https://github.com/MaartenBent/wxWidgets
Fix using manifest from rc file with VC compiler.

See https://github.com/wxWidgets/wxWidgets/pull/1678
2019-12-15 03:44:39 +01:00
Maarten Bent
083f4b3c32 Rename manifests to use underscores 2019-12-13 21:44:26 +01:00
Artur Wieczorek
1d744026f2 Demonstrate drawing text with tab characters 2019-12-10 23:14:49 +01:00
Vadim Zeitlin
0425050ad8 Use native wxDragImage by default in the sample
There doesn't seem to be any reason to default to the generic version.

Closes https://github.com/wxWidgets/wxWidgets/pull/1671
2019-12-07 14:53:49 +01:00
catalinr
392e119bbe Fix dragimag sample compilation with modern compiler under MSW
Don't "override" UpdateBackingFromWindow() method of the base class
unless it really exists, which is only the case for the generic
wxDragImage implementation but not the native MSW one.

See https://github.com/wxWidgets/wxWidgets/pull/1671
2019-12-07 14:52:41 +01:00
Vadim Zeitlin
155885a3dd Reformat splitter sample to follow wx style guidelines
Put "{" and "}" on their own lines. Also use spaces around "if"
condition and omit unnecessary comparisons with NULL.

No real changes.

See https://github.com/wxWidgets/wxWidgets/pull/1672
2019-12-07 14:47:51 +01:00
Xiaofeng Wang
1222ac3d7f Fix crash in the splitter sample due to replacing null window
The sample could crash after the following sequence of actions:

1. Resize splitter to hide the right/left window.
2. Activate replace menu action.

Fix this by checking if the window being replaced is non-null.

Closes https://github.com/wxWidgets/wxWidgets/pull/1672
2019-12-07 14:45:38 +01:00
Vadim Zeitlin
7b36d72b44 Merge branch 'vc-pmdpi' of https://github.com/MaartenBent/wxWidgets
Add DPI Awareness option to nmake makefiles and MSVC projects.

See https://github.com/wxWidgets/wxWidgets/pull/1664
2019-12-03 02:29:25 +01:00
Vadim Zeitlin
7849d231d9 Merge branch 'build-option-fixes' of https://github.com/MaartenBent/wxWidgets
Miscellaneous build options fixes.

See https://github.com/wxWidgets/wxWidgets/pull/1661
2019-12-03 02:27:52 +01:00
Maarten Bent
067c192112 Add DPI aware manifest to minimal.vcxproj 2019-11-30 23:11:04 +01:00
Maarten Bent
bed8cd7b52 Rebake after adding DPI awareness option 2019-11-30 22:52:48 +01:00
Maarten Bent
016f00777e Fix 'declaration hides previous local declaration' warnings 2019-11-29 00:21:01 +01:00
Maarten Bent
7daabeb98b Rebake event sample 2019-11-28 22:05:00 +01:00
Vadim Zeitlin
04b6fc2f90 Add another cell with boolean renderer/editor to the sample
No real changes, just test the boolean cells appearance with the default
white background too.
2019-11-28 02:14:50 +01:00
Maarten Bent
3d1a8ef54e Fix 'switch label contains default but no case' warning 2019-11-27 21:25:13 +01:00
Maarten Bent
136a43f033 Fix building display sample without wxUSE_DISPLAY 2019-11-21 23:43:04 +01:00