Ensure that wxPOPUP_WINDOW on Mac always sets the window level
to NSPopupWindowLevel, regardless of the wxSTAY_ON_TOP and
wxFRAME_TOOL_WINDOW flags.
As the comment for wxPOPUP_WINDOW in defs.h says,
"set this flag to create a special popup window:
it will be always shown on top of other windows"
So, that should *always* be true, even in relation to other
Windows with wxSTAY_ON_TOP, since NSPopUpMenuWindowLevel
is greater (higher) than NSModalPanelWindowLevel.
It should also *always* be true even if the window has both
wxPOPUP_WINDOW and wxFRAME_TOOL_WINDOW styles, since there's
no reason why we can't have a panel with NSUtilityWindowMask
and NSPopUpMenuWindowLevel.
For wxImage having both mask and alpha channel (it is technically possible), mask cannot be converted to alpha values and in this case resulting wxBitmap will also have both mask and alpha channel.
Due to lack of support for horizontal scrolling in the native control,
scrolling it was implementing by offsetting the entire control window.
However this didn't work correctly when the window was not positioned
at the leftmost border of its parent window, as the part of it that was
scrolled off could still be visible in this case, and this is exactly
what happened when the native header was used in wxGrid: scrolling it
overwrote the corner part of wxGrid.
Fix this by embedding the actual native control inside an outer wxWindow,
to ensure that the scrolled off part is clipped by the parent window.
Note that this commit is best viewed with "git show --color-moved" as
most of the code was just moved from the header into the implementation
file and is not really new.
Override wxHeaderColumn::GetMinWidth() to return the actual minimum
width instead of just returning 0.
Add a unit test verifying that this works as intended.
Drag-resizing the columns didn't work correctly when using the native
header and scrolling it horizontally, as the wrong offset was used in
this case.
Fix the offset in wxGrid code and add a unit test checking that this
works as intended (at least under MSW, as wxUIActionSimulator just
doesn't work reliably enough to test for this under the other platforms,
and, besides, only MSW has the native header control implementation
anyhow).
If it is not initialised, getting the screen rectangle will fail, so
don't even try doing it, but just return wxNOT_FOUND instead, so the
main display will be used -- this is the best we can do if the window
hasn't been created yet, as we don't know on which display it will
appear.
Closes https://github.com/wxWidgets/wxWidgets/pull/1527Closes#18481.
The changes of 5873ee7e4a completely broke
AUI layout as wxAUI code relies on Layout() still performing the layout
even when GetAutoLayout() returns false, but the new wxTLW::Layout()
didn't do anything in this case.
Fix the problem by checking whether we have a sizer or constraints in
this function instead of using GetAutoLayout(), which is supposed to
only be used by wxEVT_SIZE handler to determine if Layout() should be
called in the first place, but not by Layout() itself.
Closes#18486.
Since we always convert wxImage to 32 bpp wxBitmap, there is no reason to keep a separate mask for wxBitmap because alpha channel can be used directly.
Monochrome mask bitmap should have white pixels in the unmasked area and black pixels in the masked area, quite the opposite to what is implemented now.
Closes#10098.
When bitmap data are accessed with wxNativePixelData, which is designed
to handle RGB bitmaps, Alpha() function cannot be used because in this
case alpha component index is set to the default value -1 and actually
the blue component of the "preceding" pixel is accessed.
Closes#18478.
It's generally wxWidgets policy not to include platform-specific headers from our own
to avoid namespace pollution issues, in this case with names like "None" and "Window".
Getting the warnings about deprecated macros when building the library
itself is not useful, as it must continue to use them as long as
WXWIN_COMPATIBILITY_3_0 exists.
Closes https://github.com/wxWidgets/wxWidgets/pull/1510
While feacaf8714 changed the API to allow
using any wxWindow (and not only a window of a wxControl-derived class)
as the associated window of the grid editor, actually doing resulted in
an immediate crash due to dereferencing a null pointer in wxGrid code
which still expected to have a wxControl.
Fix this by replacing all calls to wxGridCellEditor::GetControl() inside
wxGrid with wxGridCellEditor::GetWindow(), to ensure that a non-null
editor window is used even in this case.
Closes https://github.com/wxWidgets/wxWidgets/pull/1509
In 8f386265dc, the width of a tree
expander is changed to the native value on the platform. But some
calculations still use guessed value (m_lineHeight) as the width. This
fixes the value, by retrieving the width using the same method as in
OnPaint().
Closes https://github.com/wxWidgets/wxWidgets/pull/1508Closes#18473.
Add preliminary support for per-monitor DPI awareness to wxMSW.
Individual controls still need to be fixed, so this support is still
experimental/unfinished for now.
See https://github.com/wxWidgets/wxWidgets/pull/1499
It causes a warning with MSVC code analysis:
"warning C26437: Do not slice (es.63)"
It's unclear if this function even needs to exist, but at least
move it out of line so the warning does not occur for user code.
wxNativeFontInfo constructor calculates the pointSize using the main screen DPI.
But lfHeight returned by GetNonClientMetrics is based on the window DPI.
Update the documentation to reflect change to the GetMenu event
working for all 3 menu events. Also update the sample to give the
menu for the highlight event.
Use wxString::StartsWith() instead of comparing the result of Find()
with 0: this is shorter and more clear (and marginally more efficient).
No real changes.
This ensures that they are always available and can be used in
wxLaunchDefaultBrowser() in all build variants, whereas before this
function didn't handle file:// URLs correctly when the library was built
with wxUSE_FILESYSTEM==0.
Closes https://github.com/wxWidgets/wxWidgets/pull/1469Closes#10414.
The various arrays containing row/column coordinates (m_rowHeights,
m_rowBottoms, m_colWidths, m_colRights) must not be accessed directly as
they are empty by default, and are only initialized if any rows/columns
have non-default width/height.
Use safe accessor functions instead.
See https://github.com/wxWidgets/wxWidgets/pull/1417