Commit Graph

67276 Commits

Author SHA1 Message Date
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
Artur Wieczorek
70e9dbd756 Make wxComboCtrl a wxCompositeWindow
wxComboCtrl consists of several controls (text entry, button, popup) and therefore should be implemented as a wxCompositeWindow to prevent problems with generating spurious events when e.g. focus is transferred between the sub-controls.

Closes #18394.
2019-08-23 22:55:05 +02:00
Vadim Zeitlin
a47d16dc9f Document that wxTreeCtrl::ScrollTo() doesn't work when frozen
Also mention that EnsureVisible() does work in this case.

See #18435.
2019-08-23 17:23:22 +02:00
basos
6cd53a2816 Fix computation of max total width for container cells in wxHTML
We could end up with 0 max total width because we could assign the value
of the child max total width, which could have been 0, just because the
child "width", which is actually the total available width for the
container cells (and a child of a container cell can, of course, be
another container cell), was greater than our own total width so far.

This is confusing because it might be expected that "width" is always
less than "max total width", but actually this is (almost) never the
case for the container cells.

Closes #10263.
2019-08-23 14:45:00 +02:00
Vadim Zeitlin
57aa265862 Show wxHtmlCell address in its Dump()
This makes it easier to see which cell is which one when debugging.

Also use GetMaxTotalWidth() instead of GetWidth(), as the former is more
useful for container cells (and the same for the other ones).
2019-08-23 14:41:58 +02:00
oneeyeman1
78c3ef2ebb Implement support for wxFD_NO_FOLLOW in wxMac
Disable aliases resolving in standard file dialogs if this flag is
specified.

Closes https://github.com/wxWidgets/wxWidgets/pull/1479
2019-08-22 23:27:54 +02:00
Rutger van Eerd
0861f6504b Scale maximum value in wxProgressDialog::SetMaximum() too
MSW-specific scaling was done for the initial maximum value in Create(),
but not if the maximum was changed later in SetMaximum(). Now do it
there as well.

Closes https://github.com/wxWidgets/wxWidgets/pull/1497
2019-08-22 23:27:54 +02:00
Stefan Csomor
b822e9efe8 running OpenGL fix only when really needed
(second attempt)
2019-08-22 19:03:18 +02:00
Stefan Csomor
e6ae83c386 running OpenGL fix only when really needed 2019-08-22 19:02:02 +02:00
Vadim Zeitlin
773f8f86e3 Merge branch 'svg-misc' of https://github.com/MaartenBent/wxWidgets
Miscellaneous improvements to wxSVGFileDC, notably add gradient fill
support and shape rendering mode.

See https://github.com/wxWidgets/wxWidgets/pull/1493
2019-08-22 17:21:00 +02:00
Vadim Zeitlin
870f03cd15 Handle wxSL_MIN_MAX_LABELS and wxSL_VALUE_LABEL correctly in wxMac
Create the labels corresponding to each style instead of always creating
all 3 of them whenever any of the styles is specified.

See #11427.

Closes https://github.com/wxWidgets/wxWidgets/pull/1495
2019-08-22 17:17:13 +02:00
Olly Betts
5137b8044e Fix flicker in wxGTK wxStyledTextCtrl
Use the same logic for wxGTK (and other platforms using double
buffering) as was already used for wxMac, it seems to result in less
flicker.

Closes #18017.
2019-08-22 14:57:34 +02:00