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.
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
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
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
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.
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)
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).
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.
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.
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.
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.
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.
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.
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.
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.
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>.
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.
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.