Commit Graph

58797 Commits

Author SHA1 Message Date
Vadim Zeitlin
e093a3b1b4 Preserve Win32 last error in wxTlsKey::Get()
::TlsGetValue() resets the last error code which means that the previous last
error is lost, but it shouldn't as we might be in the middle of logging it
with wxLogSysError(). So preserve the last error explicitly.

See #17209.

(this is a backport of 5e29b26d9e from master)
2015-10-17 18:25:54 +02:00
Markus Juergens
56a3441663 Add better error checking to wxWebViewIE
Verify that accessing a property really succeeded before using the returned
value.

This should fix at least one crash due to the use of uninitialized BSTR in
wxWebViewIE::GetCurrentTitle().

See #17204.

(this is a backport of 4489ec80e0 from master)
2015-10-15 16:43:31 +02:00
Václav Slavík
668be48b65 Allow NSAttributedString in [wxNSTextFieldEditor insertText]
According to the documentation, insertText: argument is either NSString
or NSAttributedString. The latter is not a subclass of the former, yet
the code assumed the argument is always a NSString. This caused the
following exception:

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason:
-[NSConcreteMutableAttributedString characterAtIndex:]: unrecognized selector sent to instance

Fix this by checking for NSAttributedString and extracting plain string
from it.

(cherry picked from commit 1acfe88347)
2015-10-13 14:53:01 +02:00
Vadim Zeitlin
d9d1917785 Fix crash when deleting items in wxTreeListCtrl
An invalid pointer was dereferenced after being deleted as ToDVI(item) checked
the item parent, i.e. used it, even though the item was already invalid.

Closes #17198.
2015-10-12 01:08:05 +02:00
Paul Cornett
def0cd59ea avoid gtk_widget_get_root_window(), deprecated in GTK+ 3.12
(cherry picked from commit a15e776dcd)
2015-10-10 12:54:18 -07:00
Paul Cornett
61460acef7 avoid GtkAlignment and gtk_widget_reparent(), deprecated in GTK+ 3.14
(cherry picked from commit 48459e3cd2)
2015-10-10 11:42:57 -07:00
Paul Cornett
f1707959d4 add compatibility header for older GTK3 versions
(cherry picked from commit a0173ec13e)
2015-10-10 11:40:07 -07:00
Paul Cornett
d3dba370da avoid gtk_widget_reparent(), deprecated in GTK+ 3.14
(cherry picked from commit f8e430e479)
2015-10-10 10:42:29 -07:00
Paul Cornett
41e5cd4506 fix wxTB_RIGHT toolbar positioning with GTK3
(cherry picked from commit 457182b7e2)
2015-10-10 10:11:42 -07:00
Jan van Dijk
349c905ffc Work around clang warning about side effects inside typeid().
This warning was harmless but very annoying as it was given for each and
every inclusion of this header.

Closes #16968.

(this is a backport of 5aae7c7387,
d2c1fce24e and
ec510a0c4b from master)
2015-10-10 09:52:48 +02:00
Cătălin Răceanu
4b9712582c Correct wxThread::Delete() default parameter documentation.
It is actually wxTHREAD_WAIT_DEFAULT and not always wxTHREAD_WAIT_BLOCK.

Closes https://github.com/wxWidgets/wxWidgets/pull/107
2015-10-05 00:32:08 +02:00
John Roberts
1c8e5a10ac Fix scrolling behaviour of wxSearchCtrl under OS X
Make it behave in the same way as single line wxTextCtrls do.

Closes #17178.
2015-10-03 18:11:38 +02:00
Paul Cornett
6f6bad4702 Avoid invalidating best size for foreground/background color change
(cherry picked from commit beffb32d2d)
2015-10-02 10:13:35 -07:00
Vadim Zeitlin
958515adc7 Copy fonts more faithfully and efficiently in wxGTK
Use pango_font_description_copy() to copy fonts instead of
pango_font_description_to_string() and pango_font_description_from_string()
via wxNativeFontInfo::{To,From}String() respectively.

This is not only more efficient but also preserves the original family whereas
wxNativeFontInfo::FromString() helpfully replaces any fonts it doesn't know
about with the normal font name. That behaviour is probably wrong on its own,
but for now at least avoid silently changing fonts when copying them.

(cherry picked from commit 07380ba0b5)
2015-10-02 09:23:44 -07:00
Paul Cornett
0f9f942a5b Fix memory leak introduced in 8f29de52
Also, use memcpy() instead of strcpy() since we already have the length,
and use static_cast instead of reinterpret_cast.
2015-10-02 09:14:06 -07:00
Tim Kosse
8be40b6789 include/wx/generic/private/widthcalc.h makes use of wxLogTrace, so wx/log.h needs to be included.
This fixes a regression introduced by commits b64e030f0c and c21ad5d9c2 which break compilation when configured with --disable-precomp-headers.
2015-09-29 10:35:07 +02:00
Vadim Zeitlin
9397570429 Remove wxOVERRIDE from backported columns width calculation code.
See #10326.
2015-09-27 12:04:44 +02:00
Kinaou Hervé
b64e030f0c Correct implement wxLIST_AUTOSIZE_XXX in the generic wxListCtrl.
Use both the contents and the header width when wxLIST_AUTOSIZE_USEHEADER is
given instead of just the latter.

Also make both wxLIST_AUTOSIZE_USEHEADER and the previously implemented
wxLIST_AUTOSIZE work efficiently for the virtual list controls by reusing
wxMaxWidthCalculatorBase already used in the generic wxDataViewCtrl.

Closes #10326.

(this is a backport of de7e315557 and
0e2d9e539c from master)
2015-09-27 11:57:13 +02:00
Vadim Zeitlin
c21ad5d9c2 Factor out wxMaxWidthCalculatorBase from wxDataViewCtrl code.
This will allow reusing it elsewhere, notably in the generic wxListCtrl.

See #10326.

(this is a backport of fa1c3ecfa6 from master)
2015-09-27 11:54:40 +02:00
Vadim Zeitlin
d68d0dd72f Build fix for wxOSX build with 10.6 SDK after last commit
OpenGL core profile constants only exist in 10.7 SDK, don't use them when
compiling with 10.6 one.

See #16402.
2015-09-23 03:37:36 +02:00
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