Commit graph

6766 commits

Author SHA1 Message Date
Artur Wieczorek
48d226bb84 Adjust scrolled contents only for wxPaintDC (drawing sample)
Adjust scrolled contents for screen drawing directly in EVT_PAINT
handler instead of doing so conditionally for generic wxDC.
This also helps demonstrating if wxPaintDC transformations
are transferred properly to wxGCDC.
2022-11-29 18:41:08 +01:00
Vadim Zeitlin
f8ce99bf66 Merge branch 'more-cxx11-fixes'
More simplifications that are possible now that C++11 is required.

No real changes to the behaviour.

See #22962.

Closes #22684.
2022-11-12 18:03:12 +01:00
Vadim Zeitlin
699042a272 Remove EnterHandlingTextCtrl class from the dialogs sample
This code was simplified by 16473d9b19 (Make class used as template
parameter local now that we can, 2022-11-11) but we can simplify it even
more by just getting rid of this class completely and using a small
lambda as the event handler.

No real changes.
2022-11-11 13:58:18 +01:00
Vadim Zeitlin
0f6c54cdb6 Define __WXFUNCTION__ as __func__ and don't use it any more
Use __func__ without checking if the compiler supports it, it's part of
C++11 and so should be supported by all compilers.

Also use __func__ instead of __WXFUNCTION__ in our own code.

No real changes.
2022-11-11 01:24:13 +01:00
Vadim Zeitlin
16473d9b19 Make class used as template parameter local now that we can
Address a minor TODO-C++11 comment in the dialogs sample by moving the
class declaration into the function using it, now that we don't have to
keep it outside it.

This commit is best viewed with Git --color-moved option.
2022-11-11 00:34:40 +01:00
Vadim Zeitlin
616586f301 Remove wxStaticBox custom drawing code entirely
Get rid of a big amount of non-trivial drawing code at the price of
having to switch to using a control label if the foreground colour is
changed, as we can't change the label colour otherwise now.

The only known drawback of this change is that the box will flicker now
if doubler buffering is disabled. But as long as we do use double
buffering, it shouldn't be a problem.
2022-11-09 15:50:43 +00:00
Vadim Zeitlin
fec8c06a53 Merge branch 'drop-ansi'
Remove support for "ANSI" build not using Unicode.

See #22920.
2022-10-29 18:09:00 +02:00
Vadim Zeitlin
0d6f2f2b85 Remove wxSuffix from MSBuild files, it's always "u" now
This doesn't change the library names, but just removes the now
unnecessary (and somewhat confusing when used alongside wxSuffixDebug)
build variable.
2022-10-28 18:26:15 +01:00
Blake Madden
9c76bc27c0 Use wxID_HIGHEST instead of wxID_HIGHEST+1 in samples
There is no need to add 1 any more since the changes of 99c52403f9 (Use
usual half-open interval for wxID_LOWEST..wxID_HIGHEST, 2022-10-23), so
don't.

Closes #22923.
2022-10-28 01:43:46 +02:00
Vadim Zeitlin
c78b0d652b Remove UNICODE build option, hardcode its value as 1
Also hardcode "u" suffix for the library names -- it doesn't make sense
any longer, but we need to keep it for compatibility.
2022-10-27 19:43:59 +02:00
Vadim Zeitlin
6e8290a9ce Stop defining _UNICODE in makefiles
This shouldn't be necessary any longer, so don't do it.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
53b3b979fe Remove tests for _UNICODE too
It is now always defined, so testing for it is useless.

Give an error in MSVC-specific header if it is not defined as it should
be.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
4519d8e08a Remove wxUSE_UNICODE checks as they're always true now
Also remove all code guarded by "#if !wxUSE_UNICODE".
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
5c49448c75 Remove bakefile UNICODE_DEFINE variable, always define _UNICODE
It might be unnecessary to define it on command line at all, as it's
done in wx/setup.h, but keep doing it for now.

However stop using a variable for this, as setting wxUSE_UNICODE to 0 is
not supported any longer.
2022-10-27 19:43:30 +02:00
Vadim Zeitlin
4f4c5fcfdf Use nullptr instead of NULL in the code and documentation
This is a combination of running clang-tidy with modernize-use-nullptr
check for some ports (GTK, X11, OSX) and manual changes to the ports for
which it couldn't be used easily (MSW, DFB) and also manually updating
the docs.

Also replace NULL with null or nullptr in the comments as this is more
consistent with the use of nullptr in the code and makes it simpler to
grep for the remaining occurrences of NULL itself.

And also use null in the assert messages.

Only a few occurrences of "NULL" are still left in non-C files, mostly
corresponding to unclear comments or string output which it might not be
safe to change.
2022-10-18 01:25:25 +02:00
Vadim Zeitlin
fb4f0b590c Remove wxGTK1 port and GPE support
Remove the port files and references to it from the common headers and
elsewhere.

Also remove GPE (GNOME PDA Environment) support as libgpewidget is
unmaintained since 2006 or so and has never been really used.

Use __WXGTK__ to test for any version of wxGTK now. Still define
__WXGTK20__ for compatibility, but always define it now and don't test
for it in the library code.
2022-10-16 22:01:02 +02:00
Vadim Zeitlin
0ef1cdcc21 Remove support for wxMotif
This port hasn't been updated for ages and is not used by anybody any
longer, so remove its code to facilitate maintenance.

Also remove references to this port from the documentation and most of
the other places (VMS-specific descrip.vms files still check for it
because it's not clear how to update them all), including configure.

Regenerate the latter and rebake all makefiles.

Finally document that this port is not available any longer.
2022-10-16 16:39:56 +02:00
PB
88d526660f Replace wxOVERRIDE and wxNOEXCEPT with override and noexcept
Don't use deprecated macros in wxWidgets itself.
2022-10-15 18:10:45 +02:00
Vadim Zeitlin
d517a48c31 Require C++11 in the minimal sample CMakefile too
We could, and probably should, set target-level property on wx libraries
instead, but we'll have to increase the minimum required CMake version
to 3.8 in order to be able to do it.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
1cf49f9909 Remove MSVS 2005 and 2008 project files
These compilers are not supported any longer.

Also disable their regeneration in Bakefiles.bkgen.
2022-10-11 00:02:29 +02:00
Vadim Zeitlin
d05e4b6616 Rebake webview sample makefiles after recent changes
This corresponds to the changes done in samples/webview/webview.bkl in
0adf31169d (Add advanced handler to webview sample, 2022-09-14).

See #22797.
2022-10-09 23:54:38 +02:00
Vadim Zeitlin
a818e505c4 Add "Process Enter" checkbox to bitmap combo widgets sample page
Allow toggling wxTE_PROCESS_ENTER and even set it by default -- and turn
off wxCB_READONLY which was set by default for some reason.
2022-10-05 19:44:09 +01:00
Vadim Zeitlin
ffbcbd78b1 Show details of key events in the control in dataview sample
This is just to make it more obvious that we get these events.

See #15377.
2022-10-03 20:02:58 +02:00
Vadim Zeitlin
99f5ea62f9 Allow checking wxDataViewCtrl::HitTest() result in the sample
Call HitTest() for the current mouse position when Ctrl-M is pressed to
allow testing whether this function works correctly.
2022-10-03 02:42:38 +02:00
Tobias Taschner
0adf31169d
Add advanced handler to webview sample
Demonstrate how to implement and use wxWebViewHandler::StartRequest()
2022-09-16 21:00:52 +02:00
Jouk
966ebcc93d Do not call GTKAllowDiagnosticsControl() for gtk<2.0 2022-09-02 12:28:17 +02:00
Vadim Zeitlin
ef6ee28876 Merge branch 'gtk-log'
Fix crash when using wxNotebook in applications calling
g_log_set_writer_func() with glib 2.73+

See #22753.
2022-08-30 12:19:31 +02:00
Vadim Zeitlin
de345d33b2 Merge branch 'docview-onclosedoc'
Improvements to closing wxDocument: don't call OnCloseDocument() twice.

See #22627.
2022-08-30 11:12:58 +01:00
Vadim Zeitlin
8af645ed22 Fix crash when using wxNotebook with glib 2.73 or later
Make GTK notebook log suppression opt-in to avoid a fatal error when the
application calls g_log_set_writer_func() itself, as doing it more than
once immediately kills the application with glib 2.73 and there is no
way to check if it had been already done or not (you have to admire the
purity of the API design here).

This is unfortunate as 99% of the wxWidgets applications that do _not_
call g_log_set_writer_func() would now show the spurious diagnostics by
default again, but preferable to making the remaining 1% crash, and
there doesn't seem to be any other solution.

Call the new GTKAllowDiagnosticsControl() function in the notebook
sample to at least still avoid getting the spurious diagnostic messages
described in #22176 there.

See #22717,.
2022-08-29 18:10:15 +02:00
Vadim Zeitlin
82cb8aa859 Fix harmless gcc 12 warning about adding enums
Add a cast to avoid -Wdeprecated-enum-enum-conversion from gcc 12.

No real changes.
2022-08-29 15:37:13 +02:00
Kenneth Porter
974a7658da Add wxColourDatabase::GetAllNames()
Return all known colour names from this function and show them in the
drawing sample.

Closes #9264.

Closes #22724.
2022-08-29 00:44:49 +02:00
Lauri Nurmi
66916c74a3 Fix double negatives used with 'neither' in docs and comments
In many cases it should be 'either', and 'nor' should be 'or'
accordingly.

No changes to actual code.

Closes #22723.
2022-08-19 16:22:21 +02:00
Vadim Zeitlin
6886fb3aa7 Allow setting and clearing indicators in the STC sample
Show another Scintilla feature and allow experimenting with it.
2022-08-15 17:38:51 +01:00
Vadim Zeitlin
d0e4aa761c Show modifier keys state in the keyboard sample
Demonstrate wxGetKeyState() behaviour.
2022-08-06 18:43:20 +02:00
Vadim Zeitlin
fe6302dd8d Revert "adding a standard edit menu"
This reverts commit 203b78563f.

See #22711.
2022-08-06 18:32:30 +02:00
Stefan Csomor
203b78563f adding a standard edit menu
otherwise the file open dialog box does not support copy/paste etc. on mac
2022-08-06 15:19:39 +02:00
Artur Wieczorek
5e2da5a106 Get rid of v2.8 code 2022-08-02 08:26:29 +02:00
Vadim Zeitlin
3cdcee26c2 Merge branch 'tdmgcc-textctrl-fix'
Fix crash when using wxTextCtrl with TDM-GCC.

See #22641.
2022-07-24 15:29:00 +01:00
Tim Stahlhut
c69ee439d9 Stop using wxWidgets 1.xx wxString compatibility functions
Replace them with std::string-like equivalents when possible (i.e.
replace Length() with length(), IsNull() with empty()) or, at least,
with wx 2 functions if not (e.g. Remove() with Truncate(), First() with
Find(), LowerCase() with MakeLower() etc).

Closes #22638.
2022-07-24 16:25:29 +02:00
Vadim Zeitlin
6fdfe98157 Merge branch 'filedialog-add-dir'
Add wxFileDialog::AddShortcut().

See #22543.

See #22635.
2022-07-24 15:11:13 +01:00
Vadim Zeitlin
7a16275b57 Fix text sample build with wxUSE_LOG==0
Add missing preprocessor checks around the use of m_log.
2022-07-18 20:49:16 +01:00
Vadim Zeitlin
854599c0bd Add wxFileDialog::AddShortcut() documentation
Also add a comment to the sample explaining the default behaviour.
2022-07-17 22:24:56 +01:00
Vadim Zeitlin
5d3ebf9457 Add wxFileDialog::AddShortcut()
This allows to add application-specific directories to the file dialog.

This commit only contains the implementation for wxMSW and a change
showing the new function in the sample.
2022-07-17 22:24:56 +01:00
Vadim Zeitlin
af4ad43824 Rebake and rerun autoconf after the version update 2022-07-17 17:03:39 +02:00
Vadim Zeitlin
67c261b944 Update library version to 3.3
Manually change the minor version value everywhere.

Reset the contents of the README in preparation for the future 3.3.0
release.
2022-07-16 17:02:56 +02:00
Vadim Zeitlin
dcee1cd025 Improve behaviour of "force closing" wxDocuments
When the document was forced to close, OnSaveModified() was still called
and allowed the user to cancel closing the document -- but it was still
closed after OnSaveModified() returned.

Be more upfront about it and tell the user that the document will be
closed anyhow, but still propose them to save it if necessary.

An alternative solution might be to just deprecate "force closing"
entirely, as this seems very user-unfriendly.
2022-07-15 00:41:58 +01:00
Vadim Zeitlin
8666131acf Remove inexistent USE_HELP.html from samples/help makefile
This file was removed back in 961a1c2b39 (Remove unused Java class files
without sources from help sample, 2017-10-04) but was left in the bake-
and make-files.

Somehow this didn't create any problems with GNU make, where cp exited
with an error, but make recipe succeeded nevertheless, but it results in
a build error with BSD make.
2022-06-23 22:41:09 +01:00
Vadim Zeitlin
cb7cefcc87 Update the required wx versions in the sample CMakefile
Also add this file to the list of files to update.
2022-06-21 00:55:25 +02:00
Vadim Zeitlin
2a2308d5ed Update version to 3.2.0 and rebake and rerun autoconf
Update all make/project files to use 3.2.0.
2022-06-21 00:54:26 +02:00
Vadim Zeitlin
b20d69685a Merge branch 'cmake-config-file' of github.com:MaartenBent/wxWidgets
CMake: Create a config file for use with find_package and use it for
building our own sample, as the config file has the advantage of working
with wx 3.2.0 too, unlike the existing FindwxWidgets.cmake.

See #22536.
2022-06-21 00:07:11 +02:00