Commit Graph

66982 Commits

Author SHA1 Message Date
Matthew Griffin
2780f1bde6 Added function to protect against null header when getting its height 2019-09-02 10:47:39 +01: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
Maarten Bent
2704d32089 Update wxDPIChangedEvent documentation 2019-08-27 23:06:04 +02: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
oneeyeman1
7e3bbedaa5 Add a test case for wxListCtrl::GetSubItemRect()
Check that the results for the item icon/label rectangles are
consistent.
2019-08-27 17:12:47 +02:00
Vadim Zeitlin
32fe124899 Add support for icon/label rectangles to generic wxListCtrl
Honour the value of "code" parameter in GetSubItemRect().
2019-08-27 17:12:14 +02:00
Vadim Zeitlin
9395d7f404 Replace another hardcoded constant with a symbolic one
Use the already existing IMAGE_MARGIN_IN_REPORT_MODE instead of "5".
2019-08-27 17:12:14 +02:00
Vadim Zeitlin
a87e596be7 Replace hardcoded number with a constant in generic wxListCtrl
Use ICON_OFFSET_X instead of hardcoded 2.
2019-08-27 17:12:14 +02:00
Vadim Zeitlin
0bf223be44 Return empty rect for wxLIST_RECT_ICON for subitems without icons
It doesn't make sense to return anything else than an empty rectangle
when querying the icon rectangle of the sub-items that can't show any
icon.

Also document this behaviour, just in case it's not obvious.
2019-08-27 16:42:39 +02:00
Vadim Zeitlin
ba787af932 Replace a chain of "if"s with a "switch" in wxMSW wxListCtrl
Also return false from GetSubItemRect() if an invalid code is passed in,
instead of silently using wxLIST_RECT_BOUNDS instead of it.
2019-08-27 16:42:39 +02:00
Vadim Zeitlin
eba26cf35e Remove unneeded workaround for wxLIST_RECT_LABEL in wxMSW
The code added in https://github.com/wxWidgets/wxWidgets/pull/1461 is
completely unnecessary, using LVIR_LABEL works just fine.
2019-08-27 16:42:39 +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
Maarten Bent
137713e0c8 Add framework for Per-Monitor DPI Awareness on Windows
React to the WM_DPICHANGED event and update the size of the  child windows and
the top-level window. Scale the minimum and maximum window size to the new DPI.

Only react to WM_DPICHANGED when DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 is
used.
2019-08-24 22:30:11 +02:00
Vadim Zeitlin
9d17d5c376 Simplify and fix again wxStaticBitmap auto-resizing in wxMSW
This updates/replaces 6c59a4e7af which
fixed the problem with auto-resizing of wxStaticBitmap with borders, but
broke auto-resizing of wxStaticBitmap that previously used an invalid
bitmap, as they still have a non-null (currently hard-coded as 16x16)
size in this case and the size updating logic didn't take it into
account.

Instead of trying to make it even smarter, get rid of it completely and
just set the control size to its best size, as the other ports do. This
is simpler and should be less error-prone -- and won't require updating
when the constant 16x16 will be changed to something else (which will
happen soon as part of better high DPI support).

See #18398.
2019-08-24 21:27:26 +02:00
Jeff Davidson
04dfe90e55 Fix wxWindow::setBackgroundColour(wxNullColour) on OS X
Commit 91aa6ba36e introduced a
regression causing this to crash. We need to validate that the color
is valid before attempting to call OSXGetNSColor; if it is not, we
should clear any previously-set background color.

Closes #18470.

Closes https://github.com/wxWidgets/wxWidgets/pull/1503
2019-08-24 21:04:47 +02:00