Commit Graph

66709 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
eff6564795 Don't expand environment variables in wxFileName::MakeRelativeTo()
This could have been unexpected even if it worked as designed and,
unlike with direct calls to Normalize(), there was no way to prevent
this from happening.

Worse, even when no expansion was done, the simple fact of calling
wxExpandEnvVars() could result in replacing "dir\$file" with "dir$file"
as the backslash is considered as an escape character by this function
and hence break the file name structure.

Closes #17977.
2019-08-22 14:28:46 +02:00
Vadim Zeitlin
2a487ffe83 Update wxWindow and wxTopLevelWindow::Layout() documentation
Explain how these methods actually work, remove a very (from wx 1.x
days?) outdated reference to wxPanel always calling Layout() and mention
the special case of wxTopLevelWindow in the overview too.
2019-08-22 14:04:54 +02:00
Vadim Zeitlin
c74a15eded Call wxTopLevelWindow::Layout() rather than DoLayout()
Ideal would be to completely get rid of the DoLayout() method later,
however this method seems to be used in the existing applications, so
for now it needs to be kept.
2019-08-22 14:04:54 +02:00
Vadim Zeitlin
3241e7a850 Make wxTopLevelWindow::Layout() do the expected thing
It makes sense for explicit calls to Layout() to use the same logic as
is implicitly used when a TLW is resized, so override it to use
TLW-specific logic instead of using a separate DoLayout() for this.

Note that DoLayout() still has to be preserved because Debian code
search finds at least a couple of examples of its use outside the
library, meaning that there are probably quite a few more of them in the
wild.

Also, wxTopLevelWindow still needs its own wxEVT_SIZE handler because
the base class only calls Layout() if GetAutoLayout() is true, while we
want it to be always called. This might be worked around by just calling
SetAutoLayout(true) in wxTopLevelWindow ctor, but it seems safer, from
compatibility point of view, to keep wxTopLevelWindow::OnSize() instead.

See #18472.
2019-08-22 14:01:34 +02:00
Vadim Zeitlin
8dc3c38fad Set event object in wxMSW wxTE_RICH control wxContextMenuEvent
Add forgotten SetEventObject() call.

Closes #18460.
2019-08-22 12:44:09 +02:00
Vadim Zeitlin
70f8bf4c86 Just return true from wxString::Shrink()
The comparison of lengths() seems to be completely unnecessary.

Also document that Shrink() always returns true.
2019-08-22 00:04:04 +02:00
Vadim Zeitlin
ea965327eb Add wxString::shrink_to_fit() as synonym for Shrink()
Provide C++11 std::string-compatible method name too.
2019-08-22 00:01:36 +02:00
Vadim Zeitlin
2dbdbe1927 Merge branch 'mac-opengl-resize'
Really fix Mac wxGLCanvas resize under macOS 10.14.5.

See https://github.com/wxWidgets/wxWidgets/pull/1492

Closes #18402.
2019-08-21 23:53:27 +02:00