Commit Graph

65326 Commits

Author SHA1 Message Date
Václav Slavík
60542745f6 Fix accel handling when removing item from submenu
wxMSW propagates accelerators to the top menu in wxMenu::UpdateAccel(),
but the reverse operation in wxMenu::DoRemove() didn't do it, resulting
in leaked leftover accelerator entries that could prevent the same
accelerator from working if an item using it was later added. Fix by
adding RemoveAccel() helper method that behaves analogously to
UpdateAccel().
2016-12-05 17:59:03 +01:00
Mat M
4f0c6c9a3a Amend documentation regarding image/selected image parameters
Make it clear that the "image" argument is only used if it's valid.
2016-12-05 01:30:53 +01:00
Paul Cornett
7cab4bbb20 Restore line unintentionally removed in 4b8c83cb 2016-12-04 11:55:36 -08:00
Paul Cornett
d20fb180b1 Display system colors in alphabetical order 2016-12-04 11:33:48 -08:00
Paul Cornett
4b8c83cb09 Improve wxSystemSettings::GetColour() for GTK3
Previous implementation was inadequate, particularly for GTK+ >= 3.20
2016-12-04 11:32:50 -08:00
Václav Slavík
4775853cf9 Ensure display update in wxCocoaDataViewControl::UnselectAll()
NSOutlineView deselectAll apparently doesn't repaint the control itself
(or not always), so we have to do it explicitly.
2016-12-03 18:37:28 +01:00
Václav Slavík
699d6f25ad Improve rendering custom-colored buttons on Win10
Take advantage of Windows 10's flat appearance to completely fill the
button's area with background color. This isn't as easily possible in
other versions and can't be done by e.g. enlarging the painted rectangle
because focus ring (which we don't want to override) may be thin or
thick depending on user settings.
2016-12-03 17:47:18 +01:00
Václav Slavík
7b85f232f9 Don't use custom background color in PBS_HOT state
MSW buttons are highlighted by the theme when the mouse hovers over
them. This servers as a feedback to the user that the button is
clickable, so it's desirable to preserve it even if the button uses a
custom background color.
2016-12-03 17:47:18 +01:00
Václav Slavík
c9b1ebf816 Remove ATSU-related dead code from wxOSX
ATSU was deprecated for a long time and was finally removed from OS X
SDK in 10.11. wxOSX_USE_ATSU_TEXT was unconditionally disabled already,
so the code was never used and can be safely removed.
2016-12-03 12:44:10 +01:00
Václav Slavík
40a04218f4 Don't remove bgcolor in selected markup in wxOSX
It does more harm than good: if an item uses background colors in the
markup, it stands to reason it's important and simply eliminating it
would result in confusing rendering. The decision how to best handle
background color in selection is application-specific.
2016-12-03 11:07:54 +01:00
Václav Slavík
e9c1f43925 Improve wxDataViewCtrl selection rendering in wxOSX
Check NSCell's backgroundStyle property to determine whether the row's
content should be rendered normally or in the appearance for selected
rows, instead of previously used isHighlighted. The latter reports the
row as selected even if the control doesn't have focus and the selection
is therefore rendered in light gray rather than blue. In that case, e.g.
reducing colors of the text is not necessary and native controls don't
do it either.

This change makes the behavior match the native one and only renders
highlighted appearance if the row background is blue/dark.

This also matches wxDATAVIEW_CELL_SELECTED to dark background rather
than being selected. This is consistent with its purpose (alternative
appearance) as well as with what the generic wxDataViewCtrl
implementation does.
2016-12-03 11:07:54 +01:00
Laurent Poujoulat
7c730334a2 Fix long long format specifier when using MinGW with ANSI STDIO
When using MinGW own, more standard-compliant, STDIO library, the correct
format specified to use for long long values is "%lld" and not "%I64d" as when
using MSVC CRT.

Closes #17736.
2016-12-02 20:47:43 +01:00
Vadim Zeitlin
a5529fc16c Improve documentation of CreateTextSizer() widthMax argument
Also fix the version since which it is available.

See 73f6f622f9
2016-12-01 14:54:08 +01:00
Tobias Schlager
73f6f622f9 Allow specifying the maximum width of static text in dialogs
This patch allows specification of the maximum width of static texts
created with wxDialog::CreateTextSizer.

The patch preserves backwards compatibility by setting the previous
width value as the default argument value.

Closes https://github.com/wxWidgets/wxWidgets/pull/355
2016-12-01 14:06:43 +01:00
Vadim Zeitlin
aad8663698 Avoid harmless warning about shadowing a parameter
Rename GetSysErrorMsg() buffer size parameter introduced in the recent commit
343318d73e to avoid clash with the local
variable of the same name.

See https://github.com/wxWidgets/wxWidgets/pull/343
2016-11-30 17:59:27 +01:00
Graham Dawes
d639e4ffce Fix wxQt build errors when using gcc 4.4
Closes #17733.
2016-11-30 16:13:46 +01:00
VZ
5551932c25 Allow using Bind() with non-public inheritance in C++11 code
Using Bind() with a method of the class deriving from wxEvtHandler
non-publicly used to result in a compile-time error, but at least with C++11
we can detect this case and allow the code to compile.

Closes #17623.
2016-11-29 19:32:40 +01:00
VZ
4212202a9a Add support for cache directory to wxStandardPaths::GetUserDir()
This has direct equivalent under macOS and when using XDG.

See #17727.
2016-11-29 19:32:14 +01:00
VZ
ac31c85901 Merge macOS version-related fixes
Notably fix build with pre-10.11 SDK.
2016-11-29 00:53:33 +01:00
scootergrisen
90bd2523d1 Danish translation improvements 2016-11-28 02:25:42 +01:00
Vadim Zeitlin
2b764a1b8a Avoid clang 4.0 -Wexpansion-to-defined warnings
It's not really clear why, but clang 4.0 has decided to start giving warnings
about using the result of an expression constructed using the preprocessor
"defined" operation in #if checks, so trivially avoid doing this.
2016-11-28 01:50:30 +01:00
Jonathan Li
713c3f9d1b Use locale name directly for Windows Vista and later
Instead of combining the language, country and codepage and passing the
resulting string to setlocale(), the locale name can be used instead for
setlocale() on Windows Vista and onwards.

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

This fixes a crash that occurs when switching locale from Korean to
Norwegian Bokmål, since the language_country.codepage string resolves to
"Norwegian Bokmål_Norway.1252" and mbstowcs trips up on the non-ASCII
character.
2016-11-28 00:55:59 +01:00
Vadim Zeitlin
fec4d61377 Merge branch 'syserrormsgstr'
Add thread-safe wxSysErrorMsgStr() to be used instead of wxSysErrorMsg().

Closes https://github.com/wxWidgets/wxWidgets/pull/343
2016-11-27 15:08:31 +01:00
Vadim Zeitlin
9e24755d00 Minor improvements to wxSysErrorMsgStr() documentation
Link to the new function, instead of wxSysErrorMsg(), from the other functions
documentation.

Also mention that this function is new since 3.1.0.
2016-11-27 15:02:53 +01:00
Vadim Zeitlin
110d1b03e5 Another blind fix for wxTextDataObject under macOS
Use the length provided to SetData() instead of assuming it is NUL-terminated
in the wxNEEDS_UTF16_FOR_TEXT_DATAOBJ case too, and not only in the
wxNEEDS_UTF8_FOR_TEXT_DATAOBJ onem, as was done by the previous attempt to fix
this in 20c130a578.

Closes #9522.
2016-11-26 18:44:00 +01:00
Vadim Zeitlin
295576f78f Fix compilation of WebView code in wxOSX with SDK < 10.11
This was broken by 05857e66c0 which introduced
dependencies on protocols only declared in 10.11 headers.

Fix build by checking if we're using 10.11 SDK and using these protocols only
in this case.
2016-11-26 17:29:27 +01:00
Vadim Zeitlin
50190395c6 Get rid of macOS 10.7 version checks, they're always true
We don't support OS X < 10.7 anyhow any more.
2016-11-26 17:28:12 +01:00
Vadim Zeitlin
2638869fc7 Move HAVE_<strfunc> definitions to wx/osx/config_xcode.h
They are not needed in wx/osx/cocoa/chkconf.h as they are detected by
configure normally, so only define them when using Xcode.
2016-11-26 17:15:54 +01:00
Vadim Zeitlin
cb2474f040 Use wxDC::GetPartialTextExtents() in wxStaticText::Wrap()
This is more efficient than calling GetTextExtent() with a growing string in a
loop as we used to do (with ~60 character string wrapped on 2 lines it brings
wrapping time down from 4ms to 600us).

It is also slightly more accurate under macOS, even though it's still off and
some text may be truncated when wrapping.
2016-11-24 02:17:41 +01:00
Jens Göpfert
c43b59616f Make Ctrl+A not work in multiline wxTextCtrl in MSW
The native EDIT control doesn't handle this key combination, but RICHEDIT does
and people just expect it to work, so handle it at wxMSW level.

Closes https://github.com/wxWidgets/wxWidgets/pull/300
2016-11-24 02:10:39 +01:00
Paul Cornett
0ef695ef9b Revert d30673e5, it's completely broken. See #17089 2016-11-23 09:28:28 -08:00
VZ
05857e66c0 Declare Objective-C protocols in the code using web view
This avoids clang -Wincompatible-pointer-types warnings when setting
delegates.
2016-11-23 16:25:09 +01:00
Robin Dunn
016d8f5af4 Fix instances of e.g. and i.e. 2016-11-22 10:49:58 -08:00
Robin Dunn
fcc453848b Add missing GetPageImage 2016-11-22 10:38:39 -08:00
Robin Dunn
0dfe73c21e Add public attributes to wxAuiPaneInfo 2016-11-22 10:37:59 -08:00
Robin Dunn
aaa1a51a59 Additions and fixes for AUI class interfaces 2016-11-22 10:37:15 -08:00
Robin Dunn
90059c0cf9 Add AUI event types 2016-11-22 10:32:13 -08:00
Vadim Zeitlin
fe685bc4c6 Allow pasting using Cmd+V in wxTextCtrl with wxTE_PASSWORD style
For some reason known only to Apple, NSSecureTextField allows pasting text
into it using its standard context menu, but not using the standard Cmd+V
keyboard shortcut. Moreover, apparently the control does something special to
disable it because pressing Cmd+V does result in a call to
-[NSSecureTextField control:textView:doCommandBySelector:], but with a dummy
"noop:" selector.

Detect this specific situation and check if we're called while handling Cmd+V
event and, if this is indeed the case, do paste the text into the control.

While it could be argued that this changes the platform behaviour, it seems
very hard, if not impossible, to imagine a situation in which this would be a
problem while not being able to easily paste into password fields is
definitely a real usability bug.
2016-11-22 15:01:19 +01:00
Václav Slavík
92dc929b3f Implement vertical alignment in wxDataViewCtrl in wxOSX
When using non-default row height, text would be aligned to the top of
the row. This is a known limitation of NSTextFieldCell and the solution
is to either switch to modern view-based rendering or customize the cell
as this commit does.

See https://red-sweater.com/blog/148/what-a-difference-a-cell-makes for
Daniel Jalkut's description of this solution.
2016-11-22 14:51:55 +01:00
Václav Slavík
818b084b4b Fix wxOSX wxDataViewRenderers' alignment handling
Don't override renderer's wxDVR_DEFAULT_ALIGNMENT alignment when
column's alignment is set. Call a method to recompute effective
alignment instead.

Related to a6be5bda that fixed a similar issue in wxGTK.
2016-11-22 14:51:55 +01:00
Václav Slavík
f32362bc79 Support background colors in wxMarkupText::RenderItemText
DrawItemText() doesn't respect text background so we have to render the
background rectangle manually.
2016-11-22 14:51:39 +01:00
Václav Slavík
7833c65c2a Add wxGraphicsContext::CreateFromUnknownDC()
A convenience helper for writing generic code that may operate on
different kinds of DCs, all supported by wxGraphicsContext, but without
knowing its specific type.
2016-11-22 14:51:39 +01:00
Andreas Falkenhahn
6615c06d31 Respect alignment in wxOSX wxTextCtrl::SetStyle()
Honour the alignment specified in the style, if any.

Closes #17529.
2016-11-22 02:31:11 +01:00
Andreas Falkenhahn
d5c008da03 Fix setting alignment for wxOSX wxTextCtrl with wxTE_DONTWRAP
Don't make the controls with wxTE_DONTWRAP (a.k.a. wxHSCROLL) style
"infinitely" wide, but just "very" wide to allow alignment still work in it.

See #17529.
2016-11-22 02:29:13 +01:00
Vadim Zeitlin
dcb1229f41 Don't send mouse events to disabled windows in wxOSX
Disabled controls are not supposed to accept any input, so don't send any
mouse events to them.

This fixes the behaviour of wxSlider which could be moved (and generated the
corresponding events) even when it was disabled.

Closes #17194.
2016-11-22 02:10:40 +01:00
Igor Korot
27ca9ad556 Invalidate wxOSX wxListBox best size after adding items to it
Make wxListBox behave the same as in the other ports and invalidate its best
size after inserting items into it.

In the future it would be nice to call this from the base wxWindowWithItems
class itself, rather than doing it in port-specific DoInsertItems() for all
ports, but for now this will do.

Closes #17606.
2016-11-22 01:55:27 +01:00
Vadim Zeitlin
28f96bdff0 Fix wxTreeListCtrl under wxOSX
Postpone resetting indent in wxOSX wxDataViewCtrl to avoid always removing,
and hence never showing the expanders at all, for wxTreeListCtrl whose model
starts its life as a list but becomes a tree as soon as any items with
children are added to it.

By postponing the call to IsListModel() until the next resize, we give the
model the time it needs to decide what it's going to be, while still removing
the unnecessary indent if there is no need for it.

Closes #17409.
2016-11-22 01:42:28 +01:00
Václav Slavík
cbc386b2fb Add stock accelerator for wxID_SELECTALL
Ctrl+A (or Cmd+A) is used on all three major platforms.
2016-11-21 18:44:32 +01:00
Lauri Nurmi
bdb3f6fea7 Use more descriptive argument names for wxCopyFile() and others
Use more clear "src" and "dest" names for wxConcatFiles, wxCopyFile, and
wxRenameFile functions arguments instead of non-self-descriptive file1, file2,
etc used before.

No real changes.
2016-11-21 18:22:22 +01:00
Lauri Nurmi
902130f64e Use the new wxSysErrorMsgStr() instead of wxSysErrorMsg() 2016-11-21 19:15:20 +02:00