Commit graph

6748 commits

Author SHA1 Message Date
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
Vadim Zeitlin
dbd211dbc2 Don't require overriding wxDataViewModel::GetColumn{Count,Type}()
Neither of these methods was actually ever used after the changes of the
last two commits (and they hadn't been used when not using wxGTK even
before), so don't force the user-defined model classes to override them.

Also stop using them, as the stub versions don't return correct values
any longer.

Still keep the virtual functions in the base class for compatibility
however as it doesn't cost us much and avoids breaking the existing code
using "override".
2022-06-18 19:19:16 +02:00
Maarten Bent
629866d71b CMake: Use find_package with CONFIG mode in the minimal sample 2022-06-18 17:06:15 +02:00
Vadim Zeitlin
475c2ca201 Add an example of customizing "Save" file dialog too
Show doing it in the sample and also add a missing line to the example
in the documentation.
2022-06-12 00:51:31 +01:00
Vadim Zeitlin
56e4bb8bb4 Merge branch 'custom-file-dialog-controls'
Implement support for custom file dialog controls in new style MSW
dialogs.

See #22476.

Closes #14770.
2022-06-05 13:13:28 +01:00
Vadim Zeitlin
c18486e81f Add support for custom comboboxes in wxFileDialogCustomize
Allow using simple (i.e. not editable) comboboxes, known as wxChoice in
wx API, in the dialog too.

Demonstrate their use in the dialogs sample.
2022-06-04 00:50:54 +01:00
Vadim Zeitlin
5e7b104248 Change the meaning of the radio buttons in the file dialog
No real changes, just rename the buttons to use paper size for
demonstrating something else.
2022-06-03 23:07:47 +01:00
Vadim Zeitlin
76ff441bf2 Demonstrate disabling radio buttons in the sample
Radio buttons are different from the other controls internally in
IFileDialogCustomize-based implementation, so check that disabling them
also works correctly.
2022-06-03 23:00:23 +01:00
Vadim Zeitlin
07d7dd19f8 Add support for custom radio button controls in wxFileDialog
Update the dialogs sample to show using them too.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
bf5ddc200b Improve extra controls support in wxGenericFileDialog
Update the extra controls whenever anything changes in the dialog to
make the example in the dialogs sample actually work with the generic
dialog (previously nothing was updated at all).

Also delete the extra controls earlier to make the behaviour more
consistent with the native dialogs.

Use the new customization API for the generic dialogs in the sample too.
2022-06-03 01:35:31 +01:00
Vadim Zeitlin
751a73a2ca Add optional label to wxFileDialogCustomize::AddTextCtrl()
Creating a text with a label is a common operation and can be
implemented to look slightly better than AddStaticText() followed by
AddTextCtrl() without a label when using IFileDialog.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
095c4dfc94 Add event generation to MSW IFileDialog-based implementation
Inherit wxFileDialogCustomControl from wxEvtHandler to allow Bind()ing
to events on it and use this to handle wxEVT_BUTTON and wxEVT_CHECKBOX
in the sample.

And inherit from IFileDialogControlEvents in wxMSW code to actually
generate these events when they happen.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
359ab98cb2 Start adding new API for wxFileDialog customization
wxFileDialog::SetCustomizeHook() can be implemented in terms of
IFileDialogCustomize in wxMSW, which means that it can be used with the
new style dialogs shown by IFileDialog, unlike SetExtraControlCreator(),
which could only be supported when using older style common dialogs.

Add support for a few different controls and wxMSW implementation, more
controls, generic implementation and the documentation will be updated
later.

Also update the sample to show the new API in action and allow toggling
between using it and the old API for testing.
2022-06-03 01:35:30 +01:00
Vadim Zeitlin
63f44b5bfa Call MSWOnInitDone() when using IFileDialog too
This allows to use the new style dialog for the file dialogs for which
Centre() or SetSize() had been called, as we can now position the window
even when not using a hook function.

As there is no IFileDialogEvents function corresponding to CDN_INITDONE
notification, use the first call to OnTypeChange() instead.
2022-06-03 01:35:30 +01:00
Artur Wieczorek
b72a742b21 Decouple wxPropertyGridPageState from wxDC
Reimplement functions to calculate column widths to do that without
referring to wxClientDC.
2022-05-30 19:17:37 +02:00
Maarten Bent
b646f9d58e Fix crash in ribbon sample
m_mutable_button_bar was used on multiple pages. When one of those pages
is deleted, the pointer becomes invalid. Use the ButtonBar associated
with the event instead.

Closes #22459.

Closes #22464.
2022-05-30 17:49:21 +02:00
Artur Wieczorek
502ede23ab Don't expose internal wxPropertyGridPageState functions
Functions designed for internal use shouldn't be exposed as public ones
to avoid calling them directly from the user code by mistake.
2022-05-27 19:13:42 +02:00
taler21
4b9721536c Center the print preview frame after fully creating it
Center the frame correctly in the sample and demonstrate the right way
to do it in the documentation.
2022-05-23 15:07:06 +01:00
Vadim Zeitlin
f0de5a93f8 Use reasonable size for wxPreviewFrame by default
Give a reasonable default size to wxPreviewCanvas and fit wxPreviewFrame
to its contents.

Remove the useless call to Fit() from SizerWithButtons: the size set
inside it was just ignored anyhow.

This also allows to stop hardcoding the size in the sample, so don't do
this any more.

See #22439.
2022-05-19 17:04:32 +01:00