Commit Graph

58827 Commits

Author SHA1 Message Date
Vadim Zeitlin
f0e67ed517 Allow requesting core OpenGL profile and explicit OpenGL version.
Add WX_GL_CORE_PROFILE and WX_GL_{MAJOR,MINOR}_VERSION attributes which can be
used to use modern OpenGL with wxGLCanvas.

See #16402.

(this is a backport of 3c7ba39135 from master)
2015-09-23 03:18:33 +02:00
Vadim Zeitlin
3530c2ff95 Initialize wxFontRefData::m_sizeUsingPixels in wxMSW
Don't leave the variable uninitialized, even though it's not totally obvious
which value should it have for wxFontRefData objects created from native
fonts, using "true" seems more appropriate and is definitely better than not
initializing the field at all.

(this is a backport of 2f1e8c5402 from master)
2015-09-20 18:32:33 +02:00
Vadim Zeitlin
4276726f3c Document "expmode" argument of exported array macros
At least mention the previously missing "expmode" argument in the
documentation.

See #17156.

(this is a backport of 9589eaa113 from master)
2015-09-19 19:58:07 +02:00
Tim Kosse
8f29de5231 Escape filenames in wxFileDataObject::GetDataSize/GetDataHere
On wxGTK, wxFileDataObject::SetData calls g_filename_from_uri which
percent-decodes URIs. No corresponding percent-encoding was done in
wxFileDataObject::GetDataSize/GetDataHere. Use g_filename_to_uri instead in so
that filenames are properly escaped.

This commit also fixes the data being truncated if it contains non-ASCII
characters on wide-character builds, see the memcpy arguments in the original
code.
2015-09-14 11:45:25 +02:00
Tobias Taschner
401aa2a511 Replace usage of wxCFStringRef with wxStringWithNSString.
Usage of wxCFStringRef broke carbon build.
2015-09-11 15:05:44 +02:00
Vadim Zeitlin
db56c7bcb8 Merge branch '3.0-osx-fixes' into 3.0
Various fixes for wxOSX back ported from master.
2015-09-11 14:22:42 +02:00
Tobias Taschner
733eae83dc Fix OS X wxWebView ignoring JavaScript window.open() calls
On OS X (tested on 10.10.5) calls to window.open() with a different target
than _self were simply ignored. No navigation and no EVT_WEBVIEW_NEWWINDOW as
expected.

Unfortunately WebKit does not call the decidePolicyForNewWindowAction delegate
method in these cases. A new delegate method createWebViewWithRequest has been
implemented to handle this case and send EVT_WEBVIEW_NEWWINDOW as in other
ports.

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

(cherry picked from commit e6b31adefe)
2015-09-11 14:02:10 +02:00
Tobias Taschner
3251fa4156 Include Windows 10, VS2013 and VS2015 in docs.
Include Windows 10 in the documentation were appropriate.
2015-09-11 13:35:43 +02:00
Tobias Taschner
a75d5298b7 Use official name of Windows Server 2016.
Use the official name of Windows Server 2016 in wxGetOsDescription().
2015-09-11 13:21:17 +02:00
Paul Cornett
6cf902b407 Avoid bug in VS 2015 code generation
When using Whole Program Optimization, pItem->OnDrawItem() incorrectly calls the
base class wxOwnerDrawn::OnDrawItem() instead of the appropriate override, for
example wxCheckListBoxItem::OnDrawItem(). The problem can be avoided by not
using an unnecessary cast to wxListBoxItem*.

(cherry picked from commit 5905857dba)
2015-09-09 22:43:47 -07:00
Paul Cornett
8706f0f22c Improve link color getters, and suppress deprecation warnings
Use default colors when link style is not set

(cherry picked from commit 87202a9b02)
2015-09-07 20:21:55 -07:00
Paul Cornett
ef1c614df8 Show widget at GTK+ level regardless of "child visibility" status, see #17134, #4343
(cherry picked from commit 8bceeba143)
2015-09-07 09:44:40 -07:00
Paul Cornett
6b6832796a Avoid GCC warning: base class should be explicitly initialized in the copy constructor
(cherry picked from commit 67fadfbbf1)
2015-09-06 21:30:04 -07:00
Paul Cornett
641784c42a Use wx-prefixed macros in documentation 2015-09-06 21:13:49 -07:00
Paul Cornett
de402edc09 Fix null pointer check from 198d7c6c (r40919)
operator '?:' has lower precedence than '+'

(cherry picked from commit 845444f35f)
2015-09-06 21:00:14 -07:00
Paul Cornett
a0b56a2675 Implement SetVisited()/GetVisited()
and set the visited state when the link is clicked
(backport of 2fbd2a7800)
2015-09-03 09:40:23 -07:00
Artur Wieczorek
f239eba7b0 Fix bug when a wxToolBar tool is deleted from its click handler
Deleting a tool from its own event handler resulted in at least in an assert
and could also lead to a crash as an already deallocated pointer was
dereferenced.

Fix this by checking if the tool with the same ID is still available after the
event handler finishes.

Closes #16762.

(this is a backport of faffaaae29 from master)
2015-09-01 18:53:27 +02:00
Paul Cornett
234f081527 Add gtk_cell_renderer_set_padding() compatibility function
(cherry picked from commit 83ce88402c)
2015-09-01 08:44:23 -07:00
Paul Cornett
5a18f1caa0 Update internal sorting state in wxDataViewColumn::SetSortOrder()
This allows a subsequent wxDataViewModel::Resort() to actually work, see #15626

(cherry picked from commit e77c48331b)
2015-09-01 08:24:49 -07:00
John Roberts
3cae6b0b82 Don't show wxDatePickerCtrl as being disabled when it isn't in wxOSX.
Use setDrawsBackground: to fix the background colour and adjust the text
colour whenever the control is enabled or disabled.

Closes #16807.

(this is a backport of 9bedba0bf3 from master)
2015-08-26 15:59:39 +02:00
sbrowne
9153da02e7 Don't use extra margins around content of wxStaticBox in wxOSX.
This makes top and left borders for the controls inside the box the same as
right and bottom ones.

Closes #16808.

(this is a backport of bd177b0635 from master)
2015-08-26 15:59:38 +02:00
sbrowne
723e61a4b5 Adjust inset border values for OS X >= 10.6.
The bottom border was off by one pixel, use the values tested to work for OS X
10.[6789].

See #16808.

(this is a backport of cb0625b9d9 from master)
2015-08-26 15:59:38 +02:00
Tim Kosse
3379b053bd Don't allow rich text content in non-rich wxTextCtrl in wxOSX.
Explicitly disable rich text content and automatic quotation marks replacement
in normal multiline text controls to make them behave closer to single line
ones and also multiline ones on other platforms.

Closes #16805.

(this is a backport of 262ed2c133 and
 3465d659fee0313a6dc650074432c3c435e4a83e from master)
2015-08-26 15:59:20 +02:00
Tim Kosse
0329fe3e0a Fix initial position of controls with layout insets in wxOSX.
For such controls (e.g. wxButton, wxChoice, wxGauge), their initial position
was different from the one specified when creating them, even though calling
SetPosition() later did position them at exactly the position passed as
argument.

Closes #16780.

(this is a backport of a4681572cc from master)
2015-08-26 15:55:25 +02:00
mj_smoker
aefc0ecf82 Handle wxTE_PROCESS_ENTER with wxTE_PASSWORD correctly in wxOSX.
Controls with wxTE_PASSWORD style didn't send wxEVT_TEXT_ENTER even if they
also had wxTE_PROCESS_ENTER. Fix this by checking for the latter style before
mapping the enter presses to default button activation.

Closes #14930.

(this is a backport of 8e0799e3e5 from master)
2015-08-26 15:55:25 +02:00
sbrowne
53269a7cba Do use disabled control text color for wxStaticText in OS X.
Contrary to an old comment, using it seems to work, while using
secondarySelectedControlColor results in incorrect appearance, different from
the other disabled controls and, worse, makes the labels unreadable as their
colour is too close to that of the background inside nested panels.

Closes #10524.

(this is a backport of c269398588 and
 e7327959e06ae051a85622cbde9d0a6b7b1fba53 from master)
2015-08-26 15:54:52 +02:00
John Roberts
1b4a7cd671 Fix handling of "Cancel" button in wxSearchCtrl under OS X.
Pressing it results in a control action with an empty, but not null, string.
Recognize it correctly.

Closes #16869.

(this is a backport of 7065e26fb3 from master)
2015-08-26 15:53:39 +02:00
Rob Krakora
76ee2fa0a0 Implement sending wxIconizeEvent in wxOSX.
Translate windowDid{Miniaturize,Deminiaturize} callbacks to calls to
SendIconizeEvent().

Closes #16718.

(this is a backport of 31e1387541 from master)
2015-08-26 15:53:39 +02:00
John Roberts
f313ecf9b6 Fix wxSearchCtrl appearance under OS X 10.10 Yosemite.
Avoid centered look which renders the control unusable under this version.

Closes #16871.

(this is a backport of 563329f89f from master)
2015-08-26 15:53:38 +02:00
John Roberts
38e410a273 Fix generating events for WXK_NUMPAD_ENTER in wxOSX.
This allows to properly detected numeric keypad "Enter" key in the code,
notably in wxTextCtrl inside wxWidgets itself.

Closes #16415.

(this is a backport of 4f69410cd8 from master)
2015-08-26 15:53:38 +02:00
John Roberts
9fe3c3f774 Handle WXK_NUMPAD_ENTER correctly in wxOSX wxTextCtrl.
Basically just do the same thing for it as for WXK_RETURN.

See #16415.

(this is a backport of a79a2c0c8a from master)
2015-08-26 15:53:38 +02:00
John Roberts
acec4b363b Fix printing all pages without dialog prompt in wxOSX.
Do set from and to pages if we're not asking the user to choose them,
otherwise nothing is printed at all.

Closes #16294.

(this is a backport of 896e148da5 from master)
2015-08-26 15:53:38 +02:00
Vadim Zeitlin
2eb5cb50bb Don't keep using invalid wxSound object in the sound sample.
If creating a sound object fails, delete it to ensure that it is recreated
later.

This fixes a minor bug: previously, if an invalid file was used as sound file,
only the first attempt to play it resulted in an error and all the subsequent
ones were just silently ignored. Now every attempt to play an invalid file
results in an error message, as expected.

(this is a backport of a788351eb6 from master)
2015-08-26 15:53:38 +02:00
Vadim Zeitlin
37f97729c6 No real changes, just get rid of a variable in wxOSX wxSound code.
Don't define a variable which is used exactly once, testing for the async flag
directly is just as, or even more, readable and shorter.

(this is a backport of 605149ed07 from master)
2015-08-26 15:53:38 +02:00
Vadim Zeitlin
7d15904e1a Fix wxSound::Create() and IsOk() return values in wxOSX.
Don't pretend that we created wxSound object successfully without actually
doing it: this means that now passing an invalid (e.g. non-existent or using
wrong format) file to wxSound::Create()/ctor will return false/result in
IsOk() returning false later, just as in the other ports.

It also means that playing a successfully created wxSound object won't give
any error messages, as unexpectedly happened before.

(this is a backport of a6a3ad0d66 from master)
2015-08-26 15:53:38 +02:00
Vadim Zeitlin
7c81707a7e Add error handling to wxSound under wxOSX.
Don't assume that we can open any file as a sound, check for the return value
from AudioServicesCreateSystemSoundID().

(this is a backport of ba4d3d31a6 from master)
2015-08-26 15:53:37 +02:00
Tobias Taschner
d62674e81d Avoid run-time warnings for OS X version checks under 10.10+.
Implement workaround in UMAGetSystemVersion() function which produced the following
warning on the console for every application launch on OS X 10.10+:

WARNING: The Gestalt selector gestaltSystemVersion is returning 10.9.5 instead
of 10.10.5. Use NSProcessInfo's operatingSystemVersion property to get correct
system version number.*

Workaround for 3.0 branch instead of correct implementation in commit 658eca2896
2015-08-25 11:41:02 +02:00
Vadim Zeitlin
79676e1e9d Fix wxGTK build after wxLaunchDefaultBrowser() fix backport.
2dd407609b uses wxGetTopLevelGDK() only
available in master and not in 3.0 branch, avoid it by just using the default
screen (which also avoids having to add another GTK+ version check for
gdk_window_get_screen() which is only available since 2.24).
2015-08-24 17:20:58 +02:00
Cătălin Răceanu
e4eb6920fd Improve formatting of identifiers in wxTextCtrl documentation.
Render "std" in fixed-width font.

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

(cherry picked from commit 8d4d4c45b1)
2015-08-24 08:05:05 -07:00
Cătălin Răceanu
e9a5d5b7d1 Correct document of wxListView constructor.
The documented default values of constructor arguments didn't correspond to
the reality.

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

(cherry picked from commit f3da2e27e9)
2015-08-24 08:03:24 -07:00
dasimx
eed42abba5 Don't change the clipboard in wxNotebook::SetPageImage() in wxOSX.
For some reason the implementation of this method (see #12754) also put the
image on the clipboard, which was completely unexpected and unnecessary, so
just don't do it.

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

(cherry picked from commit 10a4d15b27)
2015-08-24 07:49:17 -07:00
Paul Cornett
bb89014bc2 Fix clipped cell contents with custom renderers and GTK3, see #17116
(cherry picked from commit b1fa69a2ce)
2015-08-20 21:16:29 -07:00
Paul Cornett
65b17ab188 fix wxHyperlinkCtrl opening URL twice, see #13813
(cherry picked from commit 0ff96c620f)
2015-08-18 23:06:52 -07:00
Paul Cornett
2dd407609b use gtk_show_uri() in wxLaunchDefaultBrowser() implementation for GTK+
(cherry picked from commit 22eec38806)
2015-08-18 23:06:30 -07:00
JulianSmart
2611aeca04 Corrected wxRTC font dialog spin button behaviour 2015-08-18 16:42:45 +01:00
Paul Cornett
51e766093e IsShown() now returns false for non-selected wxNotebook pages, see #4343 2015-08-15 11:09:03 -07:00
Václav Slavík
05862e608d Only set native label if nonempty in wxWindowMac::SetPeer()
Some native controls don't take kindly to being set setStringValue: with
a value invalid for the control (such as empty string for
NSPathControl). Don't do this if the label is empty anyway to avoid
problems with wxNativeWindow when the underlying native control is like
that.

(This is backport of db9baf9 from master)
2015-08-15 18:56:53 +02:00
Vadim Zeitlin
f8249a7275 Don't process events handled in user code in generic scrolling code.
Undo the change introduced, probably accidentally, by r11369 (12 years ago)
and skip the default handling of all events except wxEVT_SIZE and wxEVT_PAINT,
which are special for the reasons explained in the comments in the code, if
the user code has already handled the event.

This allows to customize scrolling by selectively handling some scrolling
events only and generally makes sense.

Closes #15684.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75252 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
(cherry picked from commit de54520c95)
2015-08-10 09:22:09 -07:00
Paul Cornett
f5dccf312d enable wxGraphicsContext offset for wxMemoryDC, see #17091
(cherry picked from commit 941834fd0e)
2015-08-10 09:09:54 -07:00
Paul Cornett
b8abf338c8 Make rectangle size the same as is drawn by raster-based wxDCs
Outlined rectangles are one pixel larger with vector-based drawing,
adjust them to get consistent behavior.
Ellipses do not appear to need adjustment.
See #17091

(cherry picked from commit 4623c5ad9c)
2015-08-09 22:08:20 -07:00