Commit Graph

832 Commits

Author SHA1 Message Date
Vadim Zeitlin
a07013a6f1 Tab navigation improvements for wxOSX
Closes #17341.

Closes https://github.com/wxWidgets/wxWidgets/pull/493
2017-07-16 15:59:48 +02:00
Vadim Zeitlin
4defd593dc Compilation fix for wxOSX when not using PCH
Explicitly include wx/containr.h in a header using wxNavigationEnabled.
2017-07-16 15:57:54 +02:00
Vadim Zeitlin
de3087c0de Tab navigation improvements for wxOSX
Closes https://github.com/wxWidgets/wxWidgets/pull/493
2017-07-16 15:52:38 +02:00
Vadim Zeitlin
a2056d7314 Fix 32 bit wxOSX build after wrong merge
Correct wrong merge of 1c0ecec225, the
checks for __LP64__ should have been removed in the merge commit
aaae5ef702 but were mistakenly left in.

See https://github.com/wxWidgets/wxWidgets/pull/377
2017-07-16 14:54:28 +02:00
Vadim Zeitlin
467c48841f Rename wxTextFieldCell members once again
Use underscores on them to show that they are different from properties or
local variables (in pure Objective C they would actually start with
underscores, but this is not a good idea in C++ code) and avoid conflict
between a member name and "wxAlignment" type name, which was confusing.
2017-07-11 23:16:14 +02:00
Vadim Zeitlin
a326da369b No real changes, just remove leading underscore from variables
Now that these variables are in a public header, don't use leading underscores
for them, if only for consistency with all the others.
2017-07-11 23:16:13 +02:00
Vadim Zeitlin
1c0ecec225 Better fix for 32 bit wxOSX build
Instead of disabling vertical alignment support in wxDataViewCtrl, move the
private variables to the header file: this is supported by all versions of the
Objective-C runtime, including the old one used for 32 bit applications,
unlike the new way based on declaring the variable in an anonymous extension.

This replaces the changes of 22216b70e7.
2017-07-11 23:16:13 +02:00
Stefan Csomor
a352f80537 Fix 32 bit compilation
The class wxTextFieldCell was still declared, but not defined for 32 bit builds, move the define to NSTextFieldCell into the header.
2017-06-27 18:10:07 +02:00
Stefan Csomor
b0470eb91d Bring OSX API in sync with MSW 2017-06-25 13:55:06 +02:00
Stefan Csomor
a77066d530 Use toll-free bridges from CTFontRef to NSFont or UIFont from (#507) 2017-06-24 11:09:29 +02:00
Stefan Csomor
36de95bd8e wxSecretStore is not implemented on iOS 2017-06-23 11:04:26 +02:00
Stefan Csomor
e15d417a76 Move config_xcode.h include to setup.h
In order to allow inclusion of configure determined flags via a wx/setup.h include also for xcode builds, the include has to move into the setup0.h template
2017-06-22 22:23:28 +02:00
Stefan Csomor
8b1381f2b1 OSX use fontAttributes for better emulation of bold fonts (#501)
* using fontAttributes dictionary allows for better emulation of bold typefaces, also switch to using color from context, this allows keeping the same dict throughout, as a side effect fix font caching

* reverting in order to maintain crossplatform compatibility

* applying review suggestions

* applying review suggestions
2017-06-20 17:55:26 +02:00
Steve Browne
1eea936f8f Properly handle tab navigation for wxRadioBoxes on wxOSX. 2017-06-05 01:17:52 -04:00
Steve Browne
f4b73fd99e Account for wxTE_PROCESS_TAB when doing tab navigation on wxOSX. 2017-06-05 01:14:43 -04:00
Steve Browne
8bca6deda3 Properly handle tab navigation for most controls on wxOSX #17341. 2017-06-05 01:10:53 -04:00
Vadim Zeitlin
de47af2f0f Merge branch 'configure-enhance'
Miscellaneous enhancements to configure
2017-05-28 16:21:21 +02:00
Vadim Zeitlin
e2dfa8e477 Regenerate comments in setup.h headers
Update the generated files after 338629e314.

The only changes are in the comments.
2017-05-28 16:20:19 +02:00
Vadim Zeitlin
5283fa14a7 Fix wxUSE_XTEST location in include/wx/osx/setup.h
Move it out from the auto-generated section to avoid losing it during the next
build/update-setup-h execution (see e24bc249e4
which added this option in the wrong place).
2017-05-28 16:18:12 +02:00
Vadim Zeitlin
2f8a343b22 Add an option for reproducible library builds
This can be useful to the library packagers, notably under Debian.

Closes #17000.
2017-05-27 19:03:32 +02:00
Vadim Zeitlin
e24bc249e4 Add back wxUSE_XTEST definition to Xcode setup.h file
This was erroneously removed by e82c619402 but
it still needs to be defined here, even if it's not used under macOS, in order
to avoid errors about it being undefined in wx/unix/chkconf.h.
2017-05-20 16:50:59 +02:00
Václav Slavík
11f79cda31 Fix handling of & in wxDataViewCtrl markup on wxOSX
Follow up to 60bd6842e4. Apply equivalent
changes to wxMarkupToAttrString, add a new wxItemMarkupToAttrString
class for mnemonics-less strings and use it in wxDataViewTextRenderer.
2017-05-12 16:43:21 +02:00
Scott Talbert
cbe0a1f049 Add support for WebKit2GTK+ in wxWebView 2017-04-22 20:00:48 +01:00
Vadim Zeitlin
5cf9fcbb1a Add wxStandardPaths::ConfigFileConv enum for clarity and safety
Use an enum instead of type-unsafe "int" for the second parameter of the
recently added wxStandardPaths::MakeConfigFileName().

This also avoids unnatural dependency of wxStandardPaths on
wxCONFIG_USE_SUBDIR constant defined in a higher level wxFileConfig class.

No real changes, but just make things a bit more robust and hopefully more
clear.
2017-03-09 17:53:14 +01:00
Martin Koegler
8d5d00db9d Implement MakeConfigFileName 2017-03-08 22:29:55 +01:00
Vadim Zeitlin
e125c3b657 Allow disabling unsafe implicit conversions in wxString
While we have to keep these conversions enabled by default, they are very
dangerous as they can result in silent data loss on any system not using a
locale with UTF-8 encoding, i.e. always under MSW.

Allow mitigating this by defining wxNO_UNSAFE_WXSTRING_CONV when compiling the
application code using the library, which makes these conversions invisible to
the user code, and so can be used without recompiling the library.

Also add wxUSE_UNSAFE_WXSTRING_CONV which can be set to 0 when compiling the
library to disable these conversions globally for all applications using it.

Closes #11830.
2017-02-12 02:29:30 +01:00
Vadim Zeitlin
4cc45797a1 Fix wxUSE_DC_TRANSFORM_MATRIX comment in wx/setup_inc.h
Propagate the change done in 49000defcf to the
generated include/wx/msw/setup0.h file to wx/setup_inc.h, so that this change
won't be lost during future regenerations.
2017-02-12 02:27:22 +01:00
Václav Slavík
288a301b97 Don't corrupt pasted UTF-16 text in wxOSX
Fix breakage introduced by 587067bc68:
pasting text could mangle some Unicode characters if it was in UTF-16.
The code in that commit converted newlines all right, but it also
converted _any_ occurrence of 0x0d to 0x0a, which wasn't very Unicode
friendly.

Fixed by partially reverting the change and adding a dedicated UTF-16
variant of wxMacConvertNewlines13To10() instead.
2017-01-29 13:55:56 +01:00
Václav Slavík
587067bc68 Fix pasting multiline text in wxOSX to not use \r
Use wxMacConvertNewlines13To10(), not wxMacConvertNewlines10To13() when
copying content from native pasteboard. Perform this conversion not only
for 8bit text, but for UTF-16 one (which is the one actually used on
modern OS X versions) as well.
2017-01-11 16:48:19 +01:00
Václav Slavík
5d87c70eba Mimic native focus handling in wxStatusBar on macOS
Improve the logic for determining whether the statusbar should be
renderer as for active/key window or a background one.
wxTopLevelWindow::IsActive() is not a sufficient test because it returns
false in some situations when the statusbar need to appear as active
(another floating window) and also didn't account for window-modal
sheets (which don't change statusbar appearance either).
2017-01-11 12:42:42 +01:00
Václav Slavík
2b342e8777 Don't leak associations in wxCocoaDataViewControl
Fix ClearColumns() to release associations between m_OutlineView and
native Cocoa control when re-creating the latter. Previously it only
created a new association, but left the old one with no-deleted native
control in the map.

Fixes #17485.
2017-01-05 16:35:04 +01:00
Václav Slavík
8b5387bc3d Enable wxUSE_ACCESSIBILITY by default (MSW)
Compile accessibility support on Windows by default now that the generic
wxDataViewCtrl control implements accessible interface. After the
changes from 7dab555f71, accessibility
support is much more lightweight and doesn't interfere with normal win32
behavior, so this change shouldn't affect accessibility-unaware code in
any way.
2016-12-13 18:56:20 +01:00
Václav Slavík
ff1dba498e Add wxDataViewValueAdjuster
Add wxDataViewRenderer:: SetValueAdjuster() and a
wxDataViewValueAdjuster class. This can be used to customize rendering
of values depending on whether they are highlighted (selection) or not,
without having to implement an entire new custom renderer.
2016-12-11 15:20:42 +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
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
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
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
c146103c64 Make wxStatusBar look (more) native on macOS
Significantly improve the appearance of wxStatusBar on macOS, both the
modern flat look since 10.10 and older versions. Increase the size to
match native bottom bars, center the text inside it, use appropriate
background and border colors and the same gray for the text as Finder
uses, correctly change the appearance for inactive windows.

This is still far from ideal - that would be using
setContentBorderThickness:forEdge: and rendering the text atop it. But
that seems to be much easier said than done due to interference from
other parts of wx. This is much better than the previous state.
2016-10-31 14:31:11 +01:00
Václav Slavík
5e5ffad0b8 Respect item font when rendering markup (wxOSX)
Respect per-item attributes and namely the font (which may differ from
the control's font) when rendering markup items in wxDataViewCtrl.
2016-10-21 17:36:32 +02:00
Václav Slavík
90e1769569 Add API to control OS X wxTextCtrl’s smart behavior
Allow the user to customize smart quotes and dashes substutions on OS X
and also provide the OSXDisableAllSmartSubstitutions() method for
disabling them all at once.
2016-10-16 16:49:18 +02:00
Václav Slavík
29d310c6f0 Implement wxDataViewCtrl::SetFont() on OS X
wxDataViewCtrl now behaves consistently with other ports on OS X:
calling SetFont() sets the default font used by renderers and adjusts
row height to fit.
2016-10-09 16:10:31 +02:00
Václav Slavík
8a6a20b1e3 Implement wxDataViewCtrl::SetRowHeight() on OS X 2016-10-09 16:10:30 +02:00
Václav Slavík
8e70ef3aec OS X: Fix wxDataViewBitmapRenderer autosizing
wxDataViewCtrl code expects, quite reasonably, that NSCell's cellSize:
will behave as documented and return the minimal size for image cells
too. Unfortunately, that's not the case.

A cell created as NSImageCell, which seems to exists for exactly this
purpose, will always return the size as (0,0), regardless of whether it
has any image set or not an regardless of its size.

On the other hand, a cell created with NSCell.imageCell constructor
sizes itself correctly, but is not a NSImageCell instance and somehow
interferes with other wxDataViewCtrl rendering, presumably due to its
special status.

The simplest fix to make the sizing work correctly therefore seems to be
to specialize NSImageCell and implement its (trivial) cellSize: method.
2016-10-08 18:29:22 +02:00
ARATA Mizuki
32666e8d4f Remove feature test for HAVE_EXPLICIT 2016-09-14 18:45:12 +09:00
Vadim Zeitlin
74c0462c84 Add wxDataViewTextRenderer::EnableMarkup()
Implement the new method to all the implementations (generic, GTK, OS X), show
it in the sample and update the documentation.
2016-06-16 00:06:23 +02:00
Vadim Zeitlin
675d9d779d Add wxSecretStore
Add a new class allowing to store passwords and other sensitive information
using the OS-provided facilities.

Add implementations for all the main platforms, documentation and a new sample
(which contains an ad hoc unit test as the real unit test for this class would
probably be a bad idea as it wouldn't run in non-interactive contexts and
could show OS level dialog boxes if it did).
2016-06-04 18:29:15 +02:00
Václav Slavík
98f5315405 Don't set initial label in wxNativeWindow on OS X
Differentiate between setting the label from SetLabel() and from
SetPeer() (i.e. initially), because some native controls shouldn't have
an empty string set as their intitial value.

Override SetInitialSize() to be empty for wxNativeWindow in order to
prevent label-setting issues when an unknown, caller-controlled native
widget is attached. Reverts db9baf9aa5,
which was the previous attempt to fix this, but was causing too many
problems elsewhere.
2016-04-29 17:26:02 +02:00
Vadim Zeitlin
716dace3d6 Make wxDataViewCtrl::Expand() expand ancestors in native ports too
Expand() called ExpandAncestors() in the generic wxDataViewCtrl implementation
but not in the native ones, resulting in observable difference in the
behaviour: for example, the wxDataViewTreeCtrl in the dataview sample appeared
initially expanded under MSW, using the generic version, but collapsed under
GTK and OSX.

Harmonize this among all ports. This also has a nice side effect of making
Expand() less horribly inefficient as it is not recursively called by
ExpandAncestors() which it itself used to call: now ExpandAncestors() only
calls DoExpand() which is a simple function that only expands the item passed
to it and does nothing else.

Closes #14803.
2016-03-22 21:22:36 +01:00