Commit Graph

2137 Commits

Author SHA1 Message Date
Vadim Zeitlin
d77661c73b Fix string iteration logic in wxFTP::Pwd()
wxString iterators can't be dereferenced once they reach the end of the
string, so compare them with end rather than checking if the value they point
to is non-NUL.

This makes wxFTP::Pwd() actually work, which was apparently broken since quite
some time (perhaps ever since c9f7896861 9+
years ago).

See #17679.

(cherry picked from commit d0c57dbef0)
2016-09-25 01:27:37 +02:00
Pete Bannister
d4ae8219d9 Fix rendering of owner-drawn multi-column menus in wxMSW
Compute the item rectangle bounds correctly for the items in non-first column.

See #17072.

(cherry picked from commit 61083f4871)
2016-09-09 23:46:32 +02:00
Vadim Zeitlin
f252e56e88 Fix wxBitmap ctor from XBM in wxGTK
Width and height were exchanged in the loops, so the conversion code didn't
work correctly and overflowed the pixel buffer (due to extra padding in the
row stride) for non-square bitmaps. It also resulted in a completely wrong
bitmap appearance, but somehow this managed to go unnoticed, unlike the memory
errors.

See #17633.

(cherry picked from commit f9740e8180)
2016-08-21 14:49:07 +02:00
David Costanzo
b4e2f93248 Don't handle special keys as characters in wxSTC in non-Unicode build
Correct the check for non-special keys when wxUSE_UNICODE==0.

Closes #17598.

(cherry picked from commit ab092c8d13)
2016-07-17 14:17:40 +02:00
Vadim Zeitlin
0264b2218c Use equally-sized buttons in wxMSW horizontal toolbars
Only use TBSTYLE_AUTOSIZE, adjusting each button to the size it really needs,
for the toolbars with wxTB_HORZ_LAYOUT style as they don't have any uniform
button size anyhow.

(cherry picked from commit 967bdbf994)
2016-06-30 19:13:30 +02:00
Vadim Zeitlin
cfe9625a0d Fix checked disabled wxToolBar tools with custom images in wxMSW
Windows doesn't use the correct image for checked disabled tools, at least
up to and including Windows 7, so don't put such tools in the "checked"
state at all: this doesn't matter as they are disabled anyhow, but shows
the correct image for them.

See #12989.

(cherry picked from commit 29cd13cc8f)
2016-06-08 01:20:18 +02:00
Kevin B. McCarty
fa19bfa239 Fix race condition in Unix wxExecute() if child exited too quickly.
Check if the child has already finished before starting waiting for it.

Closes #16661.

(cherry picked from commit 1298f5970b)
2016-06-07 23:35:34 +02:00
Andreas Falkenhahn
49d52abb4e Add wxTE_{RIGHT,CENTER} support for multiline wxTextCtrl in wxOSX
Just use -[NSTextView setAlignment].

Closes #13702.

(cherry picked from commit d45ba8ce62)
2016-06-06 01:34:20 +04:00
Vadim Zeitlin
990ebe2dc2 Null-terminate arrays returned from wxCmdLineArgsArray
This is required for compatibility with the real argv array that this class is
supposed to emulate.

See #17531.

(cherry picked from commit 189e4c5024)
2016-05-13 15:42:45 +02:00
Jonathan Dagresta
143e55b8df Ensure wxGenericListCtrl item selected from keyboard is visible
When using the keyboard to select an item by typing the first characters of
its name, we need to make the item visible in addition to selecting it.

See #16336.

(cherry picked from commit 306597c4fa)
2016-05-13 15:34:43 +02:00
Artur Wieczorek
470a46dd48 Fix wxSearchCtrl vertical size in wxMSW
Don't add the borders twice, this made the control too tall.

Closes #16817.
2016-02-23 00:26:32 +01:00
Vadim Zeitlin
a487dc88c1 Fix modifying file type associations under MSW as non-admin
The existing code tried writing to HKEY_CLASSES_ROOT which doesn't work, in
general, for normal, i.e. non administrator, users, under any post-XP versions
of Windows.

Fix it to write to HKEY_CURRENT_USER\Software\Classes, which is the part of
HKEY_CLASSES_ROOT for the current user and to which we do have write access,
and only continue to use HKEY_CLASSES_ROOT itself for reading.

(this is a backport of 0ed580f451 from master)
2015-12-02 23:29:10 +01:00
Vadim Zeitlin
034684d476 Initialize wxAuiNotebookXmlHandler::m_isInside in ctor
See #15694.

Closes #17222.

(this is a backport of 7439c0951b from master)
2015-10-24 15:16:05 +02:00
Vadim Zeitlin
d3a5963258 Don't mention that wxVariant doesn't derive from wxObject
Because it still does, only wxVariantData does not.

See #17217.

(this is a backport of 165842423c from master)
2015-10-22 00:04:23 +02:00
Vadim Zeitlin
c89cc865ca Fix wxLocale::IsOk() in case of initialization failure
Ever since 700256bbdb IsOk() returned true even
if setting the locale actually failed because the old locale was still set to
the null value.

Apply the minimal possible fix for this and just reset the old locale pointer
to null if initializing the locale fails to make sure IsOk() doesn't return
true in this case.
2015-10-18 22:07:03 +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
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
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
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
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
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
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
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
Tobias Taschner
f7b8fdd275 Fix wxGetOsDescription() for Windows 10.
Check for Windows 10 was implemented as check for version 6.4 but the final
version of Windows 10 actually returns 10.0.

(this is a backport of c87c432033)
2015-08-05 20:30:45 +02:00
Vadim Zeitlin
21dc1a1d4f Blind fix for wxTextDataObject trailing NUL under OS X.
Use the length provided to SetData() instead of assuming it is NUL-terminated.

Closes #9522.

(this is a backport of 20c130a578 from master)
2015-07-17 14:35:26 +02:00
Vadim Zeitlin
e62173c479 Fix using wxHTTP and wxFTP from worker thread in Unix ports.
This backports e18c8fd29a,
d421373c2e and
6c43aa90b6 from master to avoid crashes when
using wxHTTP or wxFTP from threads other than main.

See #17031.
2015-07-09 20:59:38 +02:00
Leland Lucius
0797a6f875 Fix accessibility support in wxMSW.
Return the correct result from handing WM_GETOBJECT message.

Closes #17058.

(this is a backport of 6a435345f5 from master)
2015-07-06 23:56:48 +02:00
Vadim Zeitlin
2632977f6b Don't attempt using <type_traits> with g++ 4.9.2 in C++98 mode.
g++ 4.9.2 added support of __has_include() but, unlike clang, refuses to
compile the <type_traits> header that is detected as existing now in C++98
mode, so the build was broken with it when not using configure (i.e. under
MSW).

Fix this by, first, testing for C++11 compilers separately (which seems like a
good idea anyhow as it will allow using these headers with other compilers)
and, second, not trusting g++ __has_include() for C++11 headers in C++98 mode.
2015-06-14 15:06:18 +02:00
Vadim Zeitlin
2923d95264 Fix flickering when resizing a frame with status bar in wxMSW.
The flicker was only visible under Windows XP or when using a class theme
and was due to mis-positioning the status bar initially in PositionStatusBar().
Fix this by adjusting its position by the toolbar offset before calling its
SetSize().

Closes #16705.

(this is a backport of 8d12e07453 from master)
2015-06-01 00:15:48 +02:00
Vadim Zeitlin
de891ddb03 Fix wxFileName::MakeRelativeTo() for directory relatively to itself.
The expected result in this case is ".", but the filename became empty instead
when wxPATH_NATIVE was used.

Fix this by examining GetFormat(format), which takes care of mapping
wxPATH_NATIVE to its real value, instead of wxPATH_NATIVE itself.

Also add a unit test verifying that this works as expected.

Closes #17010.
2015-05-29 16:25:45 +02:00
Iwbnwif Yiw
3f4304f6ab Update wxGrid correctly in presence of hidden rows/columns.
Use GetRowHeight()/GetColWidth() instead of accessing m_rowHeights/m_colWidths
arrays directly as the functions handle the hidden rows/columns correctly.

This fixes bug with corruption of wxGrid appearance if any rows/columns were
inserted into or deleted from a grid containing some hidden rows/columns.

Closes #16980.
2015-05-10 03:17:53 +02:00
Knut Petter Lehre
d1f3be5846 Fix adding blocks to existing selection in wxGrid by Ctrl-drag.
Allow using Ctrl-dragging to add more blocks to the existing selection,
similarly to how spreadsheets work.

Closes #14141.
2015-05-09 18:03:06 +02:00
Vadim Zeitlin
12b857a329 Fix infinite loop when deleting columns from wxTreeListCtrl.
Wrong variable was checked in the loop adjusting the columns values resulting
in an infinite loop.

Closes #16955.
2015-04-22 14:50:33 +02:00
Vadim Zeitlin
c2543cd474 Fix using custom paper format in wxOSX.
Do actually use the custom paper object the code creates.

Closes #16959.
2015-04-21 15:56:52 +02:00
Vadim Zeitlin
f99cd0b2e1 Accept wxALIGN_CENTRE_HORIZONTAL in wxStaticText XRC handler.
In addition to wxALIGN_CENTRE, also accept this one (and its US variant).

Closes #16943.
2015-04-12 17:27:23 +02:00
Vadim Zeitlin
46c335c8ef Generate wxEVT_SPINCTRL of the correct wxSpinEvent type.
Handlers for this event expect to get wxSpinEvent but wxMSW and wxGTK1 sent an
object of base wxCommandEvent class which resulted in invalid memory access in
the handlers when using the derived class methods such as Veto().

See #16948.
2015-04-10 16:37:46 +02:00
Vadim Zeitlin
9a9ea0c295 Fix bug with clearing shared alpha channel in wxImage::ClearAlpha().
Allocate our own exclusive copy of the data before modifying it, otherwise
calling ClearAlpha() would clear alpha not only for the image it was called on
but also for all the other images sharing data with it.
2015-04-01 14:38:14 +02:00
Vadim Zeitlin
62f8950e0e Fix vertical alpha adjustment in wxPixelData<wxImage>::Offset().
Handle "y" parameter correctly when offsetting m_pAlpha, it was just ignored
before, i.e. Offset(x, y) and OffsetY(y) always behaved as if y were 1.
2015-04-01 14:20:10 +02:00