Use the same art provider for a floating frame detached from an existing
wxAuiManager as was used by the original wxAuiManager itself, to ensure
that the appearance of this frame is consistent with the appearance of
its parent.
Implementing this required adding wxAuiDockArt::Clone() to allow copying
it in the new frame and this patch also adds GetAuiManager() to
wxAuiFloatingFrame, similar to the existing method in wxAuiNotebook, in
order to allow changing the dock art from the application code if
desired.
Closes https://github.com/wxWidgets/wxWidgets/pull/2022Closes#18882.
Make the wxART_* constants const wxStrings to improve compatibility with
pre-3.1.4 code and, in particular, allow taking the address of these
constants.
See https://github.com/wxWidgets/wxWidgets/pull/1996
This is similar to CreatePopupMenu(), but the menu pointer returned by
the new function won't be deleted by wxWidgets, allowing it to return
the same pointer every time it is called.
Closes#18886.
Using wxRegEx in wxCmpNaturalGeneric() introduced a dependency of the
base library on the regex library.
Replace wxRegEx with character classification functions wxIsspace(),
wxIspunct(), and wxIsdigit() to remove this rather unnecessary
dependency.
Closes https://github.com/wxWidgets/wxWidgets/pull/2014
Use wxBRUSHSTYLE_SOLID/TRANSPARENT constants instead of wxPENSTYLE_XXX
ones, as even though they have the same values, using brush style for
the background makes more sense.
Also document that the default background mode is transparent.
This method is implemented in the generic version used under the other
platforms as well, but was documented as being MSW-only in 89bb3f0244
(interface revisions, 2008-10-17) for some reason.
Just remove the note added by that commit.
The pre-3.1.4 definitions of the constants were just string literals,
while the type were wxString typedefs. To avoid implicit conversion
these were converted to actual wxStrings.
While the interface now matched the implementation, this has several
drawbacks:
- every use of the "constant" now is a string construction at runtime
- the constant now is an rvalue, i.e. it is impossible to take its
address.
The latter breaks its use from wxPython.
The IDs are moved to a separate file which can be included multiple
times, once from the header to have the declarations in place, and once
to instantiate the wxStrings. Using a common file avoids the declaration
and definition going out of sync.
Use the same 100 DIPs as in wxMSW, to make the default behaviour more
useful.
Also update documentation to explain which size component should, and
should not, be specified when creating the slider.
Closes https://github.com/wxWidgets/wxWidgets/pull/2012
It has become unnecessary after the previous commit, as now the generic
GetContentScaleFactor() can be used instead of it on all platforms, so
revert the changes of f6cc8ff52c (Add GetOpenGLScaleFactor() to abstract
OpenGL coordinates scaling, 2020-07-10).
See https://github.com/wxWidgets/wxWidgets/pull/1944
See #17391.
This reverts bc492a9e6e (Make wxWindow::GetContentScaleFactor() useful
for non-OSX platforms., 2015-03-18) and restores the old behaviour from
wxWidgets 3.0, which consisted in only returning factor different from 1
from this function for the platforms distinguishing logical and physical
pixels.
After this change, the return value of this function can be portably
used on all platforms to convert between logical and physical pixels,
independently of the current DPI.
This function replaces some uses of GetContentScaleFactor(), where a
factor greater than 1 must be used even under the platforms not doing
any logical/physical pixel mapping, such as MSW.
For now GetContentScaleFactor() is still unchanged, but it will return 1
for such platforms in the future and adding GetDPIScaleFactor() allows
to avoid changing the behaviour of the code which relied on its current
behaviour.
This completes the changes of the previous commit and should ensure that
UnInit() is always called, whoever is destroyed first -- the managed
window or the manager itself.
Also update the documentation to mention that calling UnInit()
explicitly is not necessary any longer.
This restores the previous behaviour inadvertently changed by bfeae1922d
(Minor optimizations in GetMultiLineTextExtent(), 2020-06-10) and makes
it official by documenting it and adding tests checking for it.
It wasn't completely obviously if this was intentional or accidental
before, but at least wxStaticText itself relied on the old behaviour,
and chances are that so did some code outside the library, so make this
part of the API now.
See #18825.
This seems more logical and is compatible with wxDC in wxMSW and wxGTK2,
as well as other kinds of DC, e.g. wxPostScriptDC.
It also looks like the current behaviour was unintentional as it
happened only because wxGCDCImpl::DoGetTextExtent() always passed all
non-null parameters to wxGraphicsContext::GetTextExtent(), even if it
didn't need the values for all of them, and thus bypassed the special
case for the empty string which was already present in the latter
function.
Fix this, making DoGetTextExtent() more efficient as a side effect (we
now avoid unnecessary calls to pango_layout_iter_get_baseline() in the
most common case), and also add another test for empty string to
wxGraphicsContext itself, for non-GTK case.
Also document this behaviour and add a test checking for it.
The fix for OpenGL coordinates when using high DPI in b134589cbb (Fix
OpenGL samples when using HiDPI displays, 2019-08-06) did fix it for GTK
3 and macOS, but broke it for MSW and other platforms not using pixel
scaling, as window coordinates are the same as OpenGL ones there, while
GetContentScaleFactor() can still return values > 1 even on these
platforms.
Provide new GetOpenGLScaleFactor() function abstracting this platform
difference and use it in all OpenGL samples to make them work correctly
in high DPI under all platforms.
Closes https://github.com/wxWidgets/wxWidgets/pull/1944Closes#17391.
For the sake of consistency with another ports only unsigned
hexadecimal numbers should be supported. To do so we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.
Closes#18805.
Hexadecimal numbers are always unsigned in the native wxSpinCtrl
implementation under wxMSW so for the sake of consistency we need
to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.
See #18805.
In a native up-down control hexadecimal numbers are always unsigned (see
UDM_SETBASE message documentation) so we need to prevent:
- Setting a range including negative values if base == 16.
- Setting base != 10 if current range includes negative values.
See #18805.
GTK needs to be told the data on the clipboard can be stored
before the store is attempted.
Also, document that the clipboard behavior on GTK is very
dependent on the configuration of the user's machine.
Closes#10515
This is consistent with wxToString(wxColour) and seems more useful than
either returning black string representation (as wxMSW used to do) or
asserting (as wxGTK did).
Document this behaviour and add a test checking for it.
Closes#18623.
OSX 10.11+ doesn't actually display the title, so update documentation
to reference SetMessage instead. For pre-10.11 override the SetTitle
method to set the title of the NSOpenPanel instead of the window.
Also change so the directory is not updated unless it is provided.
Closes#15143.
Add wxDirDialog::GetPaths() similar to the existing member of
wxFileDialog with the same name and also taking, for consistency,
wxArrayString as the output parameter.
Add a new string fragment type for whitespace and punctuation which needs
to be assessed separately from letters and symbols.
Use wxUint64 instead of long for storing the value for numeric fragment.
Use collate instead of compare for non-numeric fragments.
Change names for the public comparison functions: wxWidgets provided function
is now named wxCmpGenericNatural() and for common public use is wxCmpNatural()
which calls a native function in wxMSW and wxCmpGenericNatural() elsewhere.
Try harder in wxCmpNaturalGeneric() if wxRegEx is unavailable: do not
just make a simple string comparison, but perform a case-insensitive
collation.
Make some other changes to simplify and possibly speed up the code.
Since OS X 10.12 it has been named macOS so it makes sense
to reference it in documentation as such, even when it
sometimes refers to older versions which were called (Mac) OS X.
Under MSW it is possible to restrict the native font dialog to showing
only scalable fonts only, disallowing the raster fonts, so add a method
to wxFontDialog exposing this functionality in wxWidgets API.
Closes https://github.com/wxWidgets/wxWidgets/pull/1926Closes#16988.
Add a helper class making it easier to define activation-only editors
and use it to implement MyGridStarEditor in the sample, showing a
typical example of using such editor.
This is useful for editors which don't really need to show any control
as they can change their value directly and will be used to reimplement
wxGridCellBoolEditor in the upcoming commits.
It doesn't make sense to perform the checks in ShowCellEditControl()
when it's called from EnableCellEditControl() and this makes the code
unnecessarily fragile as m_cellEditCtrlEnabled needs to be set at just
the right moment for it to work correctly.
Call the new DoShowCellEditControl() instead and perform the checks only
in the public function, for compatibility.
Also note in a comment and the documentation that ShowCellEditControl()
is not very useful anyhow and that EnableCellEditControl() should most
often be used instead.
No real changes (the commit is best viewed ignoring whitespace changes).
This check was introduced back in 283b7808d8 (added support for readonly
cells and 3d border drawing, 2000-02-16), but was wrong even then and
remained wrong ever since: we must not set m_cellEditCtrlEnabled to true
when the current cell is read-only, so there is no need to check for the
latter condition if m_cellEditCtrlEnabled is indeed true.
Ensure that we really never erroneously set m_cellEditCtrlEnabled for
the read-only cells by replacing an wxASSERT_MSG checking for this in
EnableCellEditControl() with wxCHECK_RET().
Also explicitly document this function precondition, also added back in
b54ba67107 ([...] added CanEnableCellControl() and use it before calling
EnableEC, 2000-02-17) but never documented so far.
Apply the utility from https://github.com/codespell-project/codespell/
to fix spelling issues in the headers under both include and interface
directories and add a file with a couple of exceptions.
The exact command line used was:
$ codespell -w -I misc/scripts/codespell.ignore -i 3 in*