Commit Graph

4406 Commits

Author SHA1 Message Date
PB
92deb92e29 Use doubled backslashes in examples in wxFileName documentation
Fix syntax of C strings in the examples.

Closes #22311.
2022-04-16 15:34:08 +02:00
Maarten Bent
9a255463f9 Fix wrong wxMenuItem::GetBitmap() return type documentation
This function returns wxBitmap by object, not by (const) reference since
wxBitmapBundle-related changes.

Also change signature of the other methods taking wxBitmapBundle instead
of wxBitmap now.

And some other minor improvements.

Closes #22306.
2022-04-14 23:22:41 +02:00
Vadim Zeitlin
24970061fa Add wxBitmap(wxImage, wxDC) ctor to all ports
This ctor was previously present only in wxMSW, make it available in all
ports to allow the same code to compile everywhere.

In most of them wxDC argument is simply ignored, but in wxGTK and wxOSX
it is used to assign the appropriate scale factor for the new bitmap.

Enable previously wxMSW-only unit test checking for this.
2022-04-12 19:08:56 +01:00
Vadim Zeitlin
d08498eb16 Add wxBitmap(size, dc) ctor to all ports
Previously this ctor was only available in wxMSW and wxOSX, which was
especially strange as the equivalent Create() overload, taking wxDC, was
already available in all ports.
2022-04-10 17:17:02 +01:00
Artur Wieczorek
04bad7a720 Preserve original image in wxImageFileProperty
Rescale only the copy of the original image to preserve image quality.
2022-04-10 13:34:03 +02:00
Artur Wieczorek
9542e86770 Don't store wxImage/wxBitmap objects on the heap in wxImageFileProperty
To simplify managing the life cycle of the objects.
2022-04-10 13:31:14 +02:00
Artur Wieczorek
fd11c4e50a Remove from documentation reference to not implemented function 2022-04-10 13:27:58 +02:00
Vadim Zeitlin
717e851225 Allow to leave another window enabled in wxWindowDisabler
Allow specifying another window to "skip", i.e. not to disable, in
wxWindowDisabler.

This is not used yet, but will be in the upcoming commit.
2022-04-07 23:38:16 +01:00
Vadim Zeitlin
53844108dd Make wxWindowDisabler ctors explicit
Implicitly converting a bool or a wxWindow pointer to this class makes
no sense and shouldn't be allowed, so don't allow it.
2022-04-07 23:22:55 +01:00
DietmarSchwertberger
3719ab3725 Add support for rearranging wxGrid rows order interactively
Add EnableDragRowMove() function and wxEVT_GRID_ROW_MOVE, similarly to
the existing column function and event.

Closes #22260.
2022-04-07 17:39:56 +02:00
Scott Talbert
5614f73b2b Document missing wxGridStringTable parent class
See https://github.com/wxWidgets/Phoenix/issues/2131

Closes #22258.
2022-04-02 16:48:54 +02:00
utelle
b507c97b92 Handle Windows CRT locale names in wxLocaleIdent::FromTag() too
Recognize strings returned by setlocale() when using MSVC under MSW too,
if only because it was possible to construct wxLocale using them in the
previous versions and so doing this avoids breaking the existing code.

Also don't assert in FromTag(), even if the input is incorrect, as it is
potentially user-defined (e.g. can come from environment variables under
Unix).

Closes #22247, #22252.
2022-04-02 16:45:20 +02:00
utelle
280cb68887 Add wxLanguageInfo::GetCanonicalWithRegion() helper
This simple function allows to simplify the code by avoid to test for
CanonicalRef before using either it or CanonicalName in multiple places.

No real changes.

See #22252.
2022-04-02 16:45:20 +02:00
Tobias Fleischer
e8872b335c Allow using multiple lines in single line wxTextCtrl under Mac
Add new OSX specific OSXEnableNewLineReplacement(bool enable) function
to control if new lines should be replaced with spaces (which is still
done by default) in a single-line wxTextCtrl.

Closes #22245.
2022-03-30 17:59:49 +02:00
Vadim Zeitlin
0dac661468 Fix wxDC::SetFont() documentation
Don't say that passing wxNullFont to it is allowed because it isn't
neither in wxGTK nor in wxOSX and also remove the part about destroying
the previous font because we hadn't had to destroy the fonts explicitly
since 25 years.

Still document that setting an invalid font works in wxMSW, but explain
that doing this is not a good idea.
2022-03-29 22:57:45 +01:00
Vadim Zeitlin
79f6a2a158 Fix wxUILocale documentation formatting
Fix a few problems:

- Don't indent lists, as this makes them appear as code.
- Prefer using inline `...` to @code ... @endcode.
- Escape '<' and '>' characters.
2022-03-28 11:10:31 +02:00
Vadim Zeitlin
70e119140c Merge branch 'win-transparency'
Improve shaped sample and its documentation.

See #22230.
2022-03-28 00:16:31 +01:00
utelle
6d6e5cde21 Enhance wxUILocale and wxLocaleIdent
Many improvements and fixes to wxUILocale:

- Add wxUILocale method for retrieving wxLocaleIdent identifier,
  localized names, layout direction.
- Add wxLocaleIdent attributes, getter, and setter for
  platform-dependent tags under Windows: extension, sort order.
- Modify method wxLocaleIdent::FromTag to support not only BCP 47-like
  tags, but also platform-dependent syntax.
- Modify method wxLocaleIdent::GetTag to allow specifying the tag type.
- Update internat sample to better show using wxUILocale.
- Update German and French message catalogs for internat sample (German
  fully translated, French msgIds only).
- Introduced wxUILocaleImplStdC under Windows, because locale "en-US" is
  not equivalent to the C locale.
- Adjust wxLocale class to restore previous wxUILocale in the
  destructor.
- Implement wxLocale::GetInfo method through wxUILocale methods.
- Removed LCID dependency in wxLocale.
- Move the implementation of some static wxUILocale methods from
  intl.cpp to uilocale.cpp.

Co-authored-by: Vadim Zeitlin <vadim@wxwidgets.org>

Closes #2615.
2022-03-28 01:11:40 +02:00
Vadim Zeitlin
05612989f0 Fix escaping of new lines in wxRegEx documentation
There doesn't seem to be any way to use backslashes with @c: with a
single backslash, it's interpreted as a command, but a double backslash
appears in the output. So use `\b` instead of @c \b and also use `...`
elsewhere for consistency.

Also fix wxRE_NEWLINE description formatting.
2022-03-28 00:19:05 +02:00
Vadim Zeitlin
c6b5070083 Don't use non-existent "@this" command in wxUILocale docs
Just use `this` instead.
2022-03-28 00:18:39 +02:00
Vadim Zeitlin
19d477aabf Consistently escape "@" in wxRichTextCtrl documentation
The first occurrence of it was escaped, but the second one in each line
was not, resulting in warnings about "unknown command @:".
2022-03-28 00:18:02 +02:00
Vadim Zeitlin
7a269df2bf Document all parameters of wxImage::Paste()
As long as one parameter of a function is documented, all the other ones
should be documented too, as otherwise Doxygen complains about it not
being the case.
2022-03-28 00:17:26 +02:00
Gerhard Gruber
9dc7248b1d Add conversion to signed/unsigned int to wxString
Add wxString::ToInt() and ToUInt() for convenience and consistency with
the existing ToLong() and ToULong().

Closes #22068.
2022-03-26 00:46:58 +01:00
Vadim Zeitlin
80a056a58b Improve "shaped" sample documentation
Also link to it from the functions shown in this sample.
2022-03-25 01:54:11 +01:00
Vadim Zeitlin
fffe5af903 Document SetTransparent() limitation under wxGTK
The first call to this function must happen before showing the window.
2022-03-25 01:48:16 +01:00
Vadim Zeitlin
108108e54e Add wxArtProvider::Get[Native]DIPSizeHint()
Also add "wxWindow* win = NULL" argument to the existing functions to
convert from DIPs using the given window instead of the default DPI
scaling factor.

Closes #22022.
2022-03-24 21:35:26 +01:00
Vadim Zeitlin
506f292be2 Deprecate wxArtProvider::GetSizeHint(bool) overload
This was confusing and completely unnecessary as the version with the
non-default value of the bool argument was just equivalent to calling
GetNativeSizeHint() directly, so why even bother having it.
2022-03-24 00:10:08 +01:00
Vadim Zeitlin
ca4131faac Document wxArtProvider::DoGetSizeHint()
This virtual function seems to be meant to be overridden in the derived
classes and so part of the public API and hence should be documented.
2022-03-24 00:02:53 +01:00
Vadim Zeitlin
83daf02f35 Update wxImageList documentation to mention high DPI concerns
First of all, document that this class is (informally) deprecated.

Also document that the various sizes are expressed in logical pixels.
2022-03-22 23:02:25 +01:00
Vadim Zeitlin
28605bfcfb Make wxDumpWindow() take const wxWindow pointer
There is no reason not to allow calling this function with const window,
so do allow it, notably to make it possible to use it with "this" from
const wxWindow methods.
2022-03-19 22:56:06 +01:00
PB
dc770deab0 Fix typos and wording in docs and comments
Closes #22191.
2022-03-17 23:53:52 +01:00
Tobias Taschner
0a8bba971c macOS: Allow setting some fullscreen style options
When using the native fullscreen API by enabling EnableFullScrenView()
allow using hiding (or showing) menu and/or toolbar. An additional style
parameter has been added to EnableFullScrenView() to allow customizing
which style is applied when the user presses the fullscreen button
instead of a call to ShowFullScreen().

Closes #22180.
2022-03-17 23:50:32 +01:00
Vadim Zeitlin
9b2f55833e Add wxPreferencesPage::GetIcon() returning wxBitmapBundle
Allow returning a wxBitmapBundle rather than an individual wxBitmap.

Also make GetLargeIcon() non-pure even in wxOSX, as it now doesn't need
to be overridden if GetIcon() is -- but don't make GetIcon() pure
virtual neither to allow the existing code overriding GetLargeIcon() to
keep working.

This incidentally fixes the icons for the standard pages under macOS
broken by 388d322b68 (carry changes to toolbar over to prefs on osx,
2021-09-28), which replaced return statements with assignments,
resulting in the icon being set to the last value assigned to it instead
of the correct one -- this commit restores the previous control flow in
wxStockPreferencesPage::GetLargeIcon() (now called GetIcon()).

Closes #22187.
2022-03-17 23:49:18 +01:00
Vadim Zeitlin
0d37f733b5 Mention that bug affecting wxLocale under macOS is fixed in 12.3
Apple seems to have fixed the bug with SVG display (notably affecting
menu items check marks) in the latest macOS version, so update the
documentation to say that only the versions between 11.0 and 12.2 are
affected.
2022-03-17 23:47:33 +01:00
Vadim Zeitlin
3fa634677c Merge branch 'headercol-bmp-bundle'
Use wxBitmapBundle in wxHeaderColumn.

See #22137.
2022-03-04 03:37:37 +01:00
Alexander Koshelev
33d8510d41 Use wxBitmapBundle in wxHeaderColumn 2022-03-04 03:37:20 +01:00
Vadim Zeitlin
9a3d3156ab Merge branch 'better-bitmap-resize'
Use "nearest" algorithm for resizing bitmaps.

See #22152.
2022-02-27 22:44:50 +00:00
Lauri Nurmi
1ad25bdd5c Demonstrate how to interrupt closing an application
Add a menu item to the dialogs sample for simulating having unsaved
documents in the application. Then demonstrate how to do something
when the user attempts to close the application, e.g. show a dialog,
and possibly cancel closing.

This code was originally written for debugging some issue related to
closing an application, but besides that it serves as an example of a
very common pattern a lot of real world applications need in some form.

Mention the example in samples/dialogs in wxCloseEvent documentation
2022-02-25 00:37:58 +01:00
Vadim Zeitlin
84cb293e71 Make wxBitmap::Rescale() less horrible for commonly used icons
Make the results look somewhat better by using wxIMAGE_QUALITY_NEAREST
which preserves sharp horizontal and vertical edges in the images which
are common in the icons, with which this function is often used, instead
of blurring them as wxIMAGE_QUALITY_HIGH does.

This is also much (factor of ~40) faster, which shouldn't hurt neither.
2022-02-23 00:04:02 +00:00
Vadim Zeitlin
34facd225a Add wxXmlResourceHandler::GetBitmapBundle(wxXmlNode) overload
Do it for consistency with the existing GetBitmap() overload and also
because this can be useful when we need to test for the bitmap bundle
presence before using it.

Also document both the new overload and the original one, which was
mistakenly left undocumented when it was added.
2022-02-20 18:06:09 +01:00
Alexander Koshelev
1278aae752 Use wxBitmapBundle in wxTaskBarIcon
Update the sample to use wxBitmapBundle too.

Closes #22138.
2022-02-19 21:44:27 +00:00
Mehmet Soyturk
8aa5c55f61 Change wxRichTextParagraph::m_cachedLines data type to vector
Now wxRichTextParagraph::m_cachedLines is stored as a wxVector instead
of a wxList.

See #2523, closes #2577.
2022-02-17 01:20:01 +01:00
Blake-Madden
4c5f39426e Add example of using wxString::ToCDouble() to the documentation
Add an example showing the meaning of the return value.

Also, a couple other small edits.

Closes #22129.
2022-02-16 22:42:58 +00:00
Vadim Zeitlin
c08c539d18 Merge branch 'ak_wizard' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxWizard.

See #22124.
2022-02-13 00:30:26 +01:00
Vadim Zeitlin
9dc34611c7 Merge branch 'ak_htmllistbox' of https://github.com/kosh543/wxWidgets
Use wxBitmapBundle in wxHtmlWindow.

See #22123.
2022-02-13 00:29:39 +01:00
Vadim Zeitlin
f0e6a8b15a Merge branch 'bitmap-scale-fixes'
Really fix setting wxBitmap scale factor in wxMSW and rename
wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize().

See #22118.
2022-02-13 00:27:24 +01:00
Blake-Madden
ddf90dc3e0 Fix comment in example for banner window
Should say top edge, not left.

Closes #22122.
2022-02-11 18:48:03 +01:00
Vadim Zeitlin
74424cbeb2 Rename wxBitmap::CreateWithLogicalSize() to CreateWithDIPSize()
The new name, recently introduced in 94716fd801 (Add
wxBitmap::CreateWithLogicalSize(), 2022-01-22), was perhaps more clear,
but also misleading and confusing because the postcondition

	CreateWithLogicalSize(size, 2).GetLogicalSize() == size

was not satisfied under MSW, so rename it once again, and hopefully
finally, because the new name is consistent with GetDIPSize() returning
the same size.

Also try to improve the documentation a bit more.
2022-02-11 17:30:57 +00:00
Alexander Koshelev
429b5561ff Use wxBitmapBundle in wxWizard 2022-02-11 18:04:56 +03:00
Alexander Koshelev
7a2a1e9074 Use wxBitmapBundle in wxHtmlWindow 2022-02-11 16:16:45 +03:00