Commit Graph

60894 Commits

Author SHA1 Message Date
Tobias Taschner
5ba67c67e4 Remove wxOSX/Carbon support.
Cocoa has been the default toolkit in wxWidgets for a long time. There is really no good reason to use Carbon in 2016 and this removes a lot of unused and unmaintained code.
2016-02-01 13:48:48 +01:00
Daniel Kulp
8d42890df4 Turn off automatic dash replacement in wxOSX wxTextCtrl
This makes the text control match the other platforms as well as making it
usable for entering compiler or command line flags for programs.

Closes https://github.com/wxWidgets/wxWidgets/pull/186
2016-02-01 03:39:39 +01:00
Vadim Zeitlin
ddae98fc35 Really add wxGA_PROGRESS support to wxGauge in wxOSX
Finish the work started in 11a5b83e2c by moving
more wxAppProgressIndicator-related parts of wxMSW wxGauge implementation into
the base class and reusing them from the wxOSX version.

Also remove MSW-specific test for wxUSE_TASKBARBUTTON from the widgets sample
which prevented this style from being taken into account at all under Mac.

See #16638.
2016-02-01 03:03:53 +01:00
Igor Korot
f5187859cc Add support for wxTE_AUTO_URL to wxOSX
Recognize URLs by using native support for this available since OS X 10.5.

Closes #17137.
2016-02-01 02:16:51 +01:00
John Roberts
33d8d4e57c Correct positioning of popup menus relative to mouse pointer
Also simplify the code by using the native method available since OS X 10.6
instead of emulating it.

Closes #15385.
2016-02-01 01:58:17 +01:00
Vadim Zeitlin
023fd88bd7 Fix common system colours values in wxOSX/Cocoa
Reuse Carbon code for some colours which don't seem to have any Cocoa
equivalents.

Also map highlight colours to the selected text colours which seem more
appropriate.

Closes #17218.
2016-02-01 01:44:27 +01:00
Vadim Zeitlin
9b39ffc0cb Ignore initially specified labels for buttons with wxBU_NOTEXT
It doesn't make much sense to specify a non-empty label and wxBU_NOTEXT style
together, but if this happens, the label should be ignored, as it was already
done by wxGTK, but not wxMSW and wxOSX -- so add the missing checks for
wxBU_NOTEXT to these ports too.

Closes #17152.
2016-02-01 01:29:03 +01:00
Vadim Zeitlin
a0548db9f5 Don't link with system lzma and jbig when using built-in libtiff
It doesn't make much sense to have dependencies on the system libraries when
using a built-in library as this makes the binaries using wxWidgets unportable
to the systems without the matching versions of these libraries which was
probably the goal if the built-in library is used.
2016-02-01 01:18:55 +01:00
Vadim Zeitlin
8581f6851e Fix handling of wxGA_PROGRESS in wxGauge under MSW
This was broken by the refactoring during the addition of OS X implementation
of wxAppProgressIndicator in 11a5b83e2c, restore
this functionality by explicitly calling the code initializing the progress
indicator in wxGaugeBase from wxMSW implementation.

Closes #17301.
2016-01-31 20:11:06 +01:00
Andrius Balsevičius
2071f03127 Update Lithuanian translations
Also don't use original untranslated English strings as "translations".
2016-01-31 19:51:12 +01:00
Artur Wieczorek
3e24453be4 Check wxBK_HITTEST_ONITEM state in hit test in notebook sample
Closes https://github.com/wxWidgets/wxWidgets/pull/159
2016-01-31 03:07:05 +01:00
Artur Wieczorek
1237e932ad Fix setting wxBK_HITTEST_xxx flags in wxNotebook::HitTest
The state represented by TCHT_ONITEM Win API flag is not a superposition
TCHT_ONITEMICON and TCHT_ONITLABEL states but it represents a separate state.
The fact that binary value of TCHT_ONITEM is bitwise-OR operation on
TCHT_ONITEMICON and TCHT_ONITEMLABEL doesn't matter here. The same applies to
wxBK_HITTEST_xxx flags where state represented by wxBK_HITTEST_ONITEM is not a
superposition of wxBK_HITTEST_ONICON and wxBK_HITTEST_ONLABEL.

Add note to wxBookCtrl::HitTest documentation that wxBK_HITTEST_ONICON,
wxBK_HITTEST_ONLABEL, wxBK_HITTEST_ONITEM are mutually exclusive bits.

See https://github.com/wxWidgets/wxWidgets/pull/159
2016-01-31 03:06:33 +01:00
Vadim Zeitlin
a016e6b896 Allow suppressing warnings from wxImage::LoadFile()
Add wxImage::SetLoadFlags() and static SetDefaultLoadFlags() to allow
suppressing the warning messages that can be logged when loading some files,
notably PNG ones with invalid sRGB profiles which, unfortunately, seem to be
rather common and result in annoying warnings about them with libpng 1.6+.

Closes #15331.
2016-01-31 02:22:55 +01:00
Vadim Zeitlin
5066bff04e Fix harmless warning about shadowed variable in image sample
Don't redeclare a previously declared variable, just reuse the same one.
2016-01-31 01:53:01 +01:00
Paul Kulchenko
987235da53 Update the bundled libpng to 1.6.21
This fixes several security and other important bugs present in the previously
used 1.6.2.

Closes #17232.
2016-01-31 01:53:01 +01:00
Artur Wieczorek
1e92b204f7 Rename variable in TARGA image handler.
Current name of the variable ('index') is misleading. Actually it represents number of bytes created on output so 'outputLength' name seems to be more relevant.
2016-01-30 23:50:12 +01:00
fx
53db09d0e5 Fixed checking buffer overflow while loading RLE-compressed TARGA image.
Output data length (stored in 'index' variable) can be <= image buffer size so an error occurs if it exceeds this value.

Closes #14672.
2016-01-30 23:48:59 +01:00
Vadim Zeitlin
bc8293a9e5 Update wxMenu::UpdateUI() parameter comment and documentation
The argument to this method should basically just never be used, so while we
still keep it for compatibility (because it doesn't cost anything to do it),
make it clear that it should never be specified in the new code and, also,
that this function is actually only used inside wxWidgets and shouldn't be
normally called from outside of the library at all.
2016-01-30 21:39:09 +01:00
Vadim Zeitlin
c618c0b620 Fix wxEVT_UPDATE_UI propagation for popup menus in MDI windows too
This is similar to f74379c751 but specific to
wxMSW MDI code: also call wxMenu::UpdateUI() without any parameters from it
instead of overriding its logic for determining where to send the events.

Add code to the mdi sample demonstrating that the event handlers in the window
itself and its MDI frame parent get the events they're supposed to get.

See #17352.
2016-01-30 21:33:38 +01:00
Vadim Zeitlin
e89fc9c152 Avoid annoying prompt when closing MDI sample with one window
Ask the user when closing the window with several MDI frames opened, if only
to demonstrate how to do it, but not if there is only one window as this is
just too annoying when using the sample for testing.
2016-01-30 21:30:43 +01:00
Igor Korot
aa4aa74154 Don't generate wxEVT_LIST_ITEM_RIGHT_CLICK outside of item area
Make wxGenericListCtrl used under wxGTK and wxOSX behave the same as the
native wxMSW wxListCtrl and wxTreeCtrl under all platforms and only generate
ITEM_RIGHT_CLICK events when an item was actually clicked, i.e. don't generate
them for the clicks completely outside of the client area.

Closes #4711.
2016-01-30 18:54:09 +01:00
Vadim Zeitlin
2bd179a2fc Combine all Travis CI commands into a single one
Don't build if configure failed and don't build tests if building the library
failed and so on: contrary to the expectations, Travis continues to execute
the rest of the commands even if a previous one had failed, so chain them all
explicitly together using "&&" to make sure we fail as soon as possible.

See https://github.com/travis-ci/travis-ci/issues/1066
2016-01-30 18:42:46 +01:00
Kinaou Herve
38cd4b4769 Don't make wxAuiFloatingFrame root of a top navigation domain
This allows the accelerators associated with it to propagate to the parent
frame, which is what we want to happen in practice.

Closes #16870.
2016-01-30 18:41:18 +01:00
Kinaou Herve
8034e35391 Use IsTopNavigationDomain() in accelerator handling code in all ports
This is more correct than IsTopLevel() as accelerators shouldn't traverse the
"navigation domain" boundaries, by definition, and, even more importantly in
practice, some TLWs shouldn't stop the accelerators propagation, see the next
commit.

See #16870.
2016-01-30 18:40:07 +01:00
Vadim Zeitlin
11f6ecce6b Fix crash when right clicking AUI toolbar while left button is pressed.
Ignore the unrelated mouse events during the item dragging.

This avoids a crash due to m_actionItem being NULL when right clicking an item
while the left mouse button is kept pressed.

Closes #16327.

(this is a forward port of 648d9ce1fbd6d4f2241eda764f2a9679aed6b2c4 from 3.0)
2016-01-30 18:30:13 +01:00
Zane U. Ji
71dfb3b414 Fix invisible captions in high contrast mode
Don't use black text on dark background.

Closes #16186.
2016-01-30 18:27:10 +01:00
Vadim Zeitlin
f74379c751 Avoid duplicate wxEVT_UPDATE_UI for popup menus
Don't call wxMenu::UpdateUI() explicitly in wxMSW, wxGTK and wxOSX code before
showing the popup menu as it is also called when any menu is opened from
port-independent wxFrameBase wxEVT_MENU_OPEN handler, resulting in two events
being generated.

But also don't send the events from wxFrameBase handler only to the frame
itself, by explicitly passing "source" argument to wxMenu::UpdateUI(), as this
prevented the event from being sent to the window popping up the menu. By just
omitting this parameter we ensure that this event is sent to the right window.

Closes #17352 (but notice that there are still duplicate events under OS X,
see #17354).
2016-01-30 17:35:42 +01:00
Vadim Zeitlin
0ddf12104a Remove the ancient controls sample
It's time to embrace the 21st century.

Closes #15895.
2016-01-30 05:09:32 +01:00
Vadim Zeitlin
5dd5d68e67 Revert "Fix fields initialization in wxCommandEvent copy ctor."
This reverts commit 62763ad541 which seems to
have been completely unnecessary as the fields had been already initialized
and this commit actually broke initialization of the propagation level of the
copied wxCommandEvent objects.

Add a unit test proving that things do work.

Closes #16739.
2016-01-30 05:02:54 +01:00
Vadim Zeitlin
a7d31701ab Work around a crash in wxD2DContext when using gcc
Don't call GetSize() method as gcc can't handle aggregates returned by value
from D2D libraries currently and the code just crashes if this method is
called.

See #17171.
2016-01-30 04:43:46 +01:00
Vadim Zeitlin
0220d86ef4 Fix missing wxContextMenuEvent for wxTreeCtrl in wxMSW
This reverts 54753c3d75 and (partially)
dbd5b2ce42 (leaving the unit test added by it)
and implements yet another fix for the original problem of duplicate
wxContextMenuEvents generated in wxMSW which doesn't break the generation of
wxContextMenuEvents entirely in wxTreeCtrl.

wxTreeCtrl is special as its DefWindowProc() sends WM_CONTEXTMENU directly to
its parent, and not to the control itself, when handling WM_RBUTTONUP, so the
code checking that WM_CONTEXTMENU was not coming from one of the window own
children added in dbd5b2 filtered out all messages from it completely. As it's
probably not the only control behaving in this way, abandon the idea of the
message origin check and instead set things up so that we still pass the
message to DefWindowProc() (because not doing it breaks built-in context menus
in wxTextCtrl, for example), but don't do anything when the message is
propagated upwards from it.

This should ensure that we only process the message once in MSWHandleMessage()
of the first window which gets it, whether it's the original window or its
parent, which ensures the event propagation on wxWidgets side of things, but
prevents it being done by Windows itself.

See #13683.
2016-01-30 04:43:45 +01:00
Vadim Zeitlin
585b49474d Restore sending wxEVT_CONTEXT_MENU for wxTE_RICH controls in wxMSW
Since the changes to use IRichEditOleCallback in wxMSW wxTextCtrl (i.e.
bd650ec3d9 in master), wxEVT_CONTEXT_MENU was
not sent for it any more as the control consumed it after using the callback.

Send the event manually before the default handling takes place to fix this.
2016-01-30 01:03:32 +01:00
Vadim Zeitlin
56a6bc8006 Use correct version string for wxHTTP User-Agent header by default
Just reuse the existing version string macro instead of duplicating the
version here.

Closes #17199.
2016-01-30 00:55:39 +01:00
Steffen Olszewski
13039d5548 Fix REG_EXPAND_SZ values handling in wxRegKey::{Copy,Format}Value()
Don't expand these string when reading them.

See #16719.
2016-01-30 00:48:52 +01:00
Steffen Olszewski
d00fef689f Guard against invalid string values of length 1 in wxRegKey
It is not really clear if it can happen, but avoid integer underflow in case
it somehow does and just discard the single byte which can't represent a valid
UTF-16 character anyhow.

See #16719.
2016-01-30 00:45:40 +01:00
Vadim Zeitlin
142edf8b78 Report type mismatch when reading registry values
Instead of asserting, report a user-visible error when trying to use a wrong
key, this should give more information to the developers and users if (when)
things go wrong.

See #16719.
2016-01-30 00:44:35 +01:00
Artur Wieczorek
3d476369ec Fix inserting owner drawn menu items in wxMSW after menu creation
When menu item is inserted to the menu using wxMenu::DoInsert(), it is first
added to the list of all menu items in wxMenuBase::DoAppend() and then it is
added to the physical menu in wxMenu::DoInsertOrAppend(). Prior to adding the
menu item to the menu all already existing menu items are set as owner drawn,
so the list of items is iterated and SetOwnerDrawnMenuItem() is called for
each item. Because the new item is on the list but doesn't yet physically
exist, it has to be skipped in the iterations to avoid assigning wrong data
(like address of handler) to the wrong item.

Closes #17350.
2016-01-30 00:09:00 +01:00
Vadim Zeitlin
b4d835090f Merge branch 'bitmap_image_conversion' of https://github.com/a-wi/wxWidgets
Closes #14582.
2016-01-30 00:05:19 +01:00
Vadim Zeitlin
fbe7fc85b2 Suppress harmless warning in a standard header with VC14
imagehlp.h from 8.1 SDK contains an extraneous "typedef" in an enum
declaration which results in several warnings when building, avoid them.
2016-01-29 22:35:17 +01:00
Vadim Zeitlin
0dc57e9e23 Avoid 1px gaps between consecutive underlined words in wxHTML
At least when using standard fonts under MSW, the underlines under the
consecutive words didn't overlap, resulting in ugly gaps between them when
using more than one word as the link text, for example.

Work around this by drawing an extra, slightly offset, underlined space when
the previous cell was drawn underlined.
2016-01-29 17:19:29 +01:00
Vadim Zeitlin
9f15ca5f53 Don't use "-B" make option in Travis CI builds
This just seems unnecessary.
2016-01-29 15:16:15 +01:00
Vadim Zeitlin
7aedb3f064 Revert to using -stdlib=libc++ as part of CXX under OS X
Putting it in LDFLAGS breaks compilation of plugins using shared-ld-sh script
for linking as it doesn't support this option.
2016-01-29 15:15:14 +01:00
Vadim Zeitlin
9e6af23062 Use -stdlib=libc++ explicitly with clang under OS X in Travis CI
Fix the compilation of the sample using non configure-generated makefile in OS
X Travis CI build.
2016-01-28 15:15:59 +01:00
Vadim Zeitlin
e1c7b0fc6a Also add C++11 options to OBJCXXFLAGS in configure
We need these options in both CXXFLAGS and OBJCXXFLAGS, otherwise
Objective-C++ code would fail to compile when including C++11 headers such as
<type_traits>.
2016-01-27 04:22:41 +01:00
Vadim Zeitlin
96522491ad Add -stdlib=libc++ to {CXX,LD}FLAGS and not CXX
This allows things work even if a non-default of CXX is specified on the
command line.
2016-01-27 03:41:16 +01:00
Vadim Zeitlin
bef874a674 Skip network tests when running under Travis CI
These tests fail sporadically for some reason outside of our control, just
skip them rather than have frequent false positives.
2016-01-26 23:19:51 +01:00
Artur Wieczorek
68eae6ba5b Fix disabling control tools in wxMSW wxToolBar
Tools containing controls should be enabled/disabled in a different way from
the button tools in wxToolBar::DoEnableTool(). The control and its label (if
any) need to be explicitly enabled/disabled for wxToolBarBase::EnableTool() to
work properly.

Closes #17346.
2016-01-26 21:49:38 +01:00
Artur Wieczorek
fadda15db1 Add Visual Studio 2015 specific folder to the list of ignored files/folders.
VS 2015 specific folder .vs (with solution user options and cache) should be ignored in commits by default.
2016-01-25 23:37:33 +01:00
Vadim Zeitlin
12ee10040a Merge branch 'travis'
Set up Travis CI builds using clang, C++11 and OS X.
2016-01-25 02:57:54 +01:00
Vadim Zeitlin
a358c898c5 Don't account for the border size twice in wxMSW wxListCtrl
When computing the best control width from height, or vice versa, don't
account for the border size twice, once inside ListView_ApproximateViewRect()
and another time in our own code in the base class.

As we can't change the former, just compensate what the latter does by
returning the best width or height of the client part of the control, as
indicated by the DoGetBestClient{Height,Width}() methods names.
2016-01-25 02:51:06 +01:00