Commit Graph

6719 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
6268b5c619 Fix building font sample in STL mode after recent breakage
The changes of adb8bbab4d (Sort font names in the dialog showing them in
the font sample, 2022-05-12) didn't compile with wxUSE_STL==1 because
wxSortedArrayString doesn't inherit from wxArrayString in this case.

Fix this by using wxArrayString and its Sort() method instead.
2022-05-12 21:00:01 +02:00
Vadim Zeitlin
adb8bbab4d Sort font names in the dialog showing them in the font sample
This makes the list of the fonts much more readable, compared to listing
them in essentially random order.

Incidentally stop using manual memory allocation to avoid giving a bad
example.
2022-05-12 16:31:40 +01:00
Vadim Zeitlin
d456f87321 Use appropriate initial size for the wrapsizer sample frame
Ensure the frame is big enough to show its contents, otherwise some
controls were truncated and not visible at all initially, at least under
MSW.
2022-05-11 15:24:34 +01:00
Vadim Zeitlin
84e15a8fd2 Merge branch 'wxsvg-mac' of https://github.com/MaartenBent/wxWidgets
Improve wxSVGFileDC on macOS: use correct scaling.

See #22390.
2022-05-05 17:29:20 +02:00
Vadim Zeitlin
bf0f9cf55b Merge branch 'msw-scroll-beyond-2_27'
Increase usable scrolling range in wxMSW by a factor of 10,000 by
switching to handling the device origin in wxWidgets itself instead of
letting GDI handle it.

See #22382.
2022-05-05 17:24:58 +02:00
DietmarSchwertberger
ec737396d8 Unify wxGrid code for processing row and column mouse events
Reuse the same code for handling mouse events for both rows and columns
instead of duplicating almost (but not quite) the same code for both of
them.

As part of resolving the inconsistencies between the two versions, add
wxEVT_GRID_ROW_AUTO_SIZE corresponding to the existing event with the
same name for the columns.

Closes #22380.
2022-05-05 17:23:45 +02:00
Maarten Bent
1d6c366f14 Make all pages in the drawing sample DPI aware 2022-05-03 22:56:07 +02:00
Vadim Zeitlin
c6e45280d7 Increase maximum allowed size of test virtual grid in the sample
This allows to see that the grid is currently not redrawn correctly
under MSW when it has more than ~6,000,000 rows due to overflowing the
device space span of 2^27.
2022-05-01 02:12:50 +01:00
Vadim Zeitlin
9a36e26d4a Merge remote-tracking branch 'MaartenBent/wxdc-dpi'
Make wxDC and wxGraphicsContext DPI aware, i.e. add {From,To}DIP() to
them too and make the values returned from Get{DPI,PPI}() consistent
with wxWindow.

Also improve CMake build: add support for finding Cairo when not using
GTK, fix a warning when creating the inplace-config, and mark some
variables as advanced.

See #22346.
2022-05-01 02:53:12 +02:00
Maarten Bent
8665960c55 Simplify printing and drawing sample constructors
Don't use FromDIP for 0.
Include DIP in drawing sample variable and function names to make it clear these sizes are in DIP.
Show both logical and DIP coordinates in statusbar.
2022-04-26 21:25:55 +02:00
Vadim Zeitlin
5d5591816d Update to bakefile 0.2.13 to fix DLL directory creation
Fix the bug introduced in ec0734f96f (Install DLLs in bindir, not
libdir, when using MSW toolchains, 2021-01-09): the directory where the
DLLs were installed wasn't created any more, resulting in errors if it
didn't exist.

Update to latest bakefile version adding the missing mkdir command to
fix this and also use a released bakefile version for the wx makefiles.

Regenerate configure to match the new version.

See #14601.
2022-04-23 23:11:31 +02:00
Maarten Bent
b50633f440 Fix bitmap size when saving image in drawing sample
wxBitmap::CreateWithDIPSize expects an DPI independent size.
And when saving as SVG, it also expects a DPI independent size.

Also show DPI independent coordinates in the status bar.
2022-04-21 22:04:10 +02:00
Maarten Bent
e97926e555 Don't override wxUSE_DPI_AWARE_MANIFEST in resource file 2022-04-21 22:04:10 +02:00
Maarten Bent
5b5275c388 Make the printing sample DPI aware 2022-04-21 22:04:09 +02:00
Maarten Bent
3587b3469f Make the polygon page in the drawing sample DPI aware
Remove unneeded wxGCDC constructor argument.

Make showing a clipping region, textured background, and changing
origin DPI aware.
2022-04-21 21:55:50 +02:00
Maarten Bent
fda41cdd1b Remove GetDPIScaleFactor from wxDC and wxGraphicsContext
This reverts most of the changes from ee2b02614e (Add GetDPIScaleFactor to wxDC
and wxGraphicsContext, 2022-04-16).

This is not supposed to be used to scale pixels, FromDIP will be added instead.

Temporary use scale=1 in the drawing sample until FromDIP is added.
2022-04-20 20:33:29 +02:00
Vadim Zeitlin
eb6506e677 Make wxToolBar::SetToolBitmapSize() take size in logical pixels
Previously it interpreted its argument as being in DIPs, which was
perhaps more convenient, but inconsistent with most of the other
functions and broke the general rule that FromDIP() should be used with
all hard-coded sizes.

Update the sample to use FromDIP() when calling it now, improve the
documentation and fix a bug in AdjustToolBitmapSize() which resulted in
not increasing the bitmap size when moving toolbar sample using "large"
toolbar size from a standard DPI display to a high DPI one: the old code
considered that the new size was the same as the old one and returned
before comparing it with m_requestedBitmapSize, which resulted in the
bitmaps not changing size at all instead of doubling their size as they
were expected to.
2022-04-19 23:36:02 +01:00
Vadim Zeitlin
bf3b653492 Merge branch 'auibook-help'
Fix infinite recursion when processing wxEVT_HELP for wxAuiNotebook
pages.

See #22323.

Closes #22309.
2022-04-19 00:38:39 +02:00
Vadim Zeitlin
3439087685 Merge branch 'fontdlg-dpi'
Fix font sizes in MSW font dialog in high DPI.

See #22322.
2022-04-19 00:35:20 +02:00
Vadim Zeitlin
4d163de84e Merge branch 'dc-content-scale-factor'
Add GetDPIScaleFactor() to wxDC and wxGraphicsContext to allow scaling
the coordinates and sizes depending on the DPI.

See #22314.
2022-04-19 00:28:09 +02:00
utelle
8ab635b451 Improve wxLocale backwards compatibility and enhance wxUILocale
Restore the old behaviour of wxLocale, which is supposed to use the
default locale and not the preferred language, which may not be the same
(see #22281).

Also apply the following fixes and improvements to wxUILocale:

- Add new GetSystemLocale() method.
- Change the MSW implementation to use the default locale instead of the
  preferred UI language for Windows versions below Windows 10.
- Change the Unix implementation to respect LANGUAGE environment
  variable and use it for determining the preferred UI languages.
- Use wxUILocale in wxTranslations to determine the preferred UI
  languages.
- Use wxUILocale during initialization of internat sample.

Closes #22281.

Closes #22318.
2022-04-17 18:04:21 +02:00
Vadim Zeitlin
9be821c71a Create a full page text, rather than a button, in notebook sample
This is much more realistic and looks less weirdly.

Also add the text directly as a page, without wrapping it in a panel,
just to show that this is possible and works too.

No real changes.
2022-04-16 20:01:23 +01:00
Vadim Zeitlin
9b25ed038a Add an accelerator for the font dialog in the dialogs sample
No real changes, just make it faster to bring up the font dialog for
testing.
2022-04-16 16:40:49 +01:00
Vadim Zeitlin
a47382f95d Revert accidental changes to the samples
This reverts parts of 533958be10 (recreating Xcode project files with
new script, 2022-04-16) that seem to have been committed accidentally
and are now preventing CI builds from passing.
2022-04-16 15:33:05 +02:00
Stefan Csomor
533958be10 recreating Xcode project files with new script 2022-04-16 14:27:24 +02:00
Maarten Bent
48fe7725c4 Make the polygon page in the drawing sample DPI aware
Use wxDC::GetDPIScaleFactor to scale the coordinates.

Initialize wxGCDC with a wxWindow, so it can infer the scale from the window.
2022-04-16 01:11:34 +02:00
Maarten Bent
5bea1dc18a Fix static build using extended RTTI
Fix declaration of 'o' hides previous local declaration warnings.

Change two wxCONSTRUCTOR_5 definitions using wxBitmapBundle instead of
wxBitmap (this does not give build errors).

wxGenericCalendarCtrl is missing all XTI implementations, so just use
RTTI. And fix building the xti sample.

Note the shared build still fails due to WXDLLIMPEXP related issues.

Closes #22300.

Closes #22301.
2022-04-14 23:17:05 +02:00
Vadim Zeitlin
85daadd659 Merge branch 'cmake-improvements' of https://github.com/MaartenBent/wxWidgets
Use newer CMake PCH support instead of cotire and many other
improvements to CMake build system.

See #22295.
2022-04-13 15:56:09 +02:00
Maarten Bent
87465898f3 Fix unused variable warnings 2022-04-10 23:41:44 +02:00