Commit Graph

66731 Commits

Author SHA1 Message Date
Dan-Korn
b82f7f1c0e Fix wxPOPUP_WINDOW to work as documented (Cocoa): (#1535)
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.
2019-09-06 08:58:33 +02:00
Artur Wieczorek
a7cc686853 Initialize flag with actual value
There is no need to pre-initialize alpha flag with default value.
2019-09-06 00:15:38 +02:00
Artur Wieczorek
f5a589180f Fix converting wxImage with mask to wxBitmap with alpha channel
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.
2019-09-06 00:15:23 +02:00
Vadim Zeitlin
c12b0e8509 Merge branch 'grid-fixes'
Fixes for wxGrid when using native header control.

Closes https://github.com/wxWidgets/wxWidgets/pull/1529
2019-09-05 23:36:50 +02:00
Ilya Sinitsyn
120b33746a Implement scrolling for MSW wxHeaderCtrl correctly
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.
2019-09-05 20:11:09 +02:00
Ilya Sinitsyn
e5d59c6b7f Respect minimum grid column width when using native header too
Override wxHeaderColumn::GetMinWidth() to return the actual minimum
width instead of just returning 0.

Add a unit test verifying that this works as intended.
2019-09-05 20:11:09 +02:00
Ilya Sinitsyn
2290d97453 Fix dragging grid columns when using scrolled native header
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).
2019-09-05 20:11:09 +02:00
Robin Dunn
1269b712bb Add wxEVT_DPI_CHANGED 2019-09-04 14:14:59 -07:00
Paul Cornett
92cbb02e9f Fix erroneous header click event after double click
See #18490
2019-09-04 11:41:28 -07:00
Maarten Bent
2c27f9851b Check if window is created before getting the display it is on
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/1527

Closes #18481.
2019-09-04 00:33:32 +02:00
Vadim Zeitlin
3d73b30b56 Fix recently broken AUI layout
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.
2019-09-04 00:28:22 +02:00
Paul Cornett
560c247feb Write PNG image data directly to wxImage buffer when possible
If there is no alpha or mask, copying from an intermediate buffer is not necessary.
2019-09-03 11:12:20 -07:00
Artur Wieczorek
991f11707f Convert wxImage with mask to wxBitmap with alpha channel
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.
2019-09-01 11:01:38 +02:00
Artur Wieczorek
9404dc2f9a Fix creating alternate bitmap for toggle wxToolBar button
We need to fill entire area of the alternate button to the transparent colour prior to drawing non-transparent grey background.

Closes #18468.
2019-08-30 00:05:56 +02:00
Artur Wieczorek
8403b79ad7 Fix colours of mask bitmap
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.
2019-08-30 00:03:37 +02:00
Artur Wieczorek
0522587bcb Fix creating a bitmap representing wxMask
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.
2019-08-29 18:35:14 +02:00
Vadim Zeitlin
417eff2bf8 Add missing wxUSE_MENUS checks to generic MDI classes
Make mdig.cpp compile with wxUSE_MENUS==0, as it already had many
wxUSE_MENUS checks and only missed a few more of them.

See #9626.
2019-08-28 20:11:23 +02:00
Ian McInerney
2f8b2d9a8e Fix deletion of array in fswatcher_inotify 2019-08-28 09:44:55 -07:00
Paul Cornett
df450566dd Avoid including X11 headers from <wx/glcanvas.h>
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".
2019-08-28 09:37:49 -07:00
Vadim Zeitlin
20b9964007 Avoid warnings about deprecated wxPG_XXX when building wx itself
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
2019-08-27 22:21:01 +02:00
Ilya Sinitsyn
1bce1a1d4c Make using non-wxControl-derived wxGrid editors really work
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
2019-08-27 22:09:03 +02:00
wangqr
0ea4366163 Fix the width of expander in wxDataViewCtrl
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/1508

Closes #18473.
2019-08-27 13:19:48 +02:00
Vadim Zeitlin
83134174fa Merge branch 'menu_highlight_event' of https://github.com/imciner2/wxWidgets
Set menu object for the menu highlight events too.

See https://github.com/wxWidgets/wxWidgets/pull/1506
2019-08-27 13:13:23 +02:00
Vadim Zeitlin
6596f5a98d Merge branch 'accel_key_compat' of https://github.com/imciner2/wxWidgets
Give warnings for accelerator keys not supported by GTK under all
platforms instead of using asserts fin wxGTK only.

See https://github.com/wxWidgets/wxWidgets/pull/1505
2019-08-27 13:11:07 +02:00
Vadim Zeitlin
feb30d3929 Merge branch 'wxhtml-total-width'
Fix computation of max total width for container cells in wxHTML.

See https://github.com/wxWidgets/wxWidgets/pull/1504
2019-08-27 13:09:51 +02:00
Vadim Zeitlin
5873ee7e4a Merge branch 'tlw-layout'
Make wxTLW::Layout() do the right thing and resize the only child to fit
the entire TLW client area.

See https://github.com/wxWidgets/wxWidgets/pull/1496
2019-08-27 13:08:47 +02:00
Vadim Zeitlin
b225d78187 Merge branch 'per-monitor-dpi-aware-framework' of https://github.com/MaartenBent/wxWidgets
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
2019-08-27 12:59:56 +02:00
Paul Cornett
536025791a Avoid converting empty strings to NULL pointers in non-Unicode build
...when using utf8_str() or wxGTK_CONV as argument to const char* function parameter
2019-08-25 23:08:59 -07:00
Paul Cornett
db16c7af93 Avoid deferred show if frame is iconized 2019-08-25 21:10:52 -07:00
Paul Cornett
453999737f Simplification to avoid unreachable code 2019-08-25 21:03:21 -07:00
Paul Cornett
fca4ef0458 Use wxDC rather than wxClientDC for parameter type 2019-08-25 20:53:33 -07:00
Paul Cornett
3b54720b3a Move wxKeyEvent assignment operator out of header
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.
2019-08-25 18:11:01 -07:00
Paul Cornett
cf4f3a92c5 Avoid Gdk-CRITICAL warnings when GTKFindWindow() is passed an unrealized widget 2019-08-25 17:57:55 -07:00
Maarten Bent
10fec15751 Calculate correct font pointSize for GetNonClientMetrics
wxNativeFontInfo constructor calculates the pointSize using the main screen DPI.
But lfHeight returned by GetNonClientMetrics is based on the window DPI.
2019-08-25 22:01:56 +02:00
Maarten Bent
219fa3fa89 Add function to get font pointSize from lfHeight at specific DPI 2019-08-25 22:01:33 +02:00
Vadim Zeitlin
e563d4858a Adjust the font size when DPI of window changes 2019-08-25 22:01:14 +02:00
Maarten Bent
e3d3a0b7e8 Generate wxDPIChangedEvent when DPI changes 2019-08-25 22:01:11 +02:00
Ian McInerney
2c146d830d Fixes from review 2019-08-25 17:31:02 +02:00
Ian McInerney
d846b24450 Update menu event documentation and sample
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.
2019-08-25 16:25:55 +02:00
Ian McInerney
65a21a5393 Add menu object to menu item highlight events
The OSX highlight events already included the menu object, so this
adds it to the other platforms to make it consistent.
2019-08-25 16:07:01 +02:00
Ian McInerney
e961307043 Add compatibility warning for invalid GTK accelerator keys 2019-08-25 15:26:13 +02:00
Ian McInerney
2a08afb369 Replace fail msg with logdebug in the GTK accelerator creation 2019-08-25 15:26:13 +02:00
Tomay
050ca4ce3a Add wxRegEx::QuoteMeta() helper
Quote all characters special for wxRegEx in the given string: this can
be useful when searching for a literal string using wxRegEx.

Closes https://github.com/wxWidgets/wxWidgets/pull/1489
2019-08-25 12:32:51 +02:00
Vadim Zeitlin
363cdc5fdc Slightly simplify wxFileName::URLToFileName()
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.
2019-08-25 00:59:16 +02:00
Vadim Zeitlin
93983ee229 Remove not really needed global variables in wxFileName code
There is no need to initialize these 2 strings on each and every wx
program startup.

No real changes.
2019-08-25 00:55:40 +02:00
Vadim Zeitlin
1527e657c3 Remove obsolete Mac Classic code from wxFileName::URLToFileName()
This platform is not supported since a long time any longer.
2019-08-25 00:53:47 +02:00
Vadim Zeitlin
111587549e Remove now unnecessary header from filesys.cpp
There is no need to include wx/uri.h from this file any more, now that
it doesn't use wxURI::Unescape() any longer.
2019-08-25 00:52:33 +02:00
oneeyeman1
14bcf09924 Move URL<->filename conversion functions to wxFileName
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/1469

Closes #10414.
2019-08-25 00:48:39 +02:00
oneeyeman1
5e7b515349 Avoid showing 2 tooltips simultaneously in wxMSW wxListCtrl
Only show the built-in control tooltips if we're not showing any custom
ones.

Closes https://github.com/wxWidgets/wxWidgets/pull/1500

Closes #10492.
2019-08-25 00:40:08 +02:00
AliKet
0b7a7141e3 Fix access to row/column coordinates in wxGrid freezing code
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
2019-08-25 00:27:28 +02:00