wxBitmap uses CGImage instead of NSImage internally and the conversion
looses NSImage metadata. In particular, it looses the "template"
attribute, which is set for files ending with "Template" and loaded
trough wxArtProvider.
This change makes it easy to use template images with native controls
such as the toolbar.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@78017 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Avoid the following bogus compiler error:
Error E2015 ..\..\src\common\filename.cpp 2589: Ambiguity between 'wxFileName::Exists(int)
const at ..\..\src\common\filename.cpp:777' and 'wxFileName::Exists(const wxString &,int)
at ..\..\src\common\filename.cpp:790' in function wxFileName::SetPermissions(int)
by using an unambiguous overload.
See #16592.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Add the stubs after the real functions were moved into wxDisplayImplGTK in
r76365. This is necessary because wxDisplayImplX11 is wrongly exported from
the DLL and so its virtual methods are part of the ABI.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77952 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Creating the status bar before the menu bar but associating it with the frame
after creating the menu bar resulted in a status bar of completely wrong height.
Fix this by enforcing the default height on the status bar when it's attached
to the frame.
Closes#10956.
[This is the backport of r76417 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77949 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This ended up being broken due to an interplay between different unrelated
changes (at least r15120 and r41134) which were both correct, but didn't work
well together and resulted in not only preventing IsDialogMessage() from
handling ESC, but also our own accelerator tables.
Fix this by doing the check for IsDialogMessage() brokenness in
MSWProcessMessage() itself, just before calling it, instead of doing it in
MSWShouldPreProcessMessage() which is (and must be) called before
MSWTranslateMessage() which checks for accelerators using ESC.
Closes#3813.
[This is the backport of r77071 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't use mask and alpha together, this results in visual artefacts and masks
are unnecessary with RGBA bitmaps anyhow.
The only potentially problematic remaining case is mixing bitmaps with alpha
and mask inside the same image list (as we need to indicate whether we use the
mask or not when creating it), but this should probably be rare and in the
meanwhile we can at least RGBA bitmaps with image lists, which includes doing
this implicitly when they are used as button bitmaps.
Also refactor wxBitmap code to extract part of CopyFromIconOrCursor() to allow
reusing it in the newly added MSWUpdateAlpha().
See #11476.
[This is the backport of r75567 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Override DoGetBestClientSize() instead of DoGetBestSize(), as we're really
computing just the size of our contents and like this we don't need to hard
code platform-dependent border sizes in this control itself.
Also use the client size in LayoutControls() for the same reason. This also
makes it unnecessary to pass it the width and height as it can find them on
its own. And x and y were never used in the first place, so remove them too.
Finally, center the bitmaps vertically.
Closes#16422.
[This is the backport of r77083 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use position, not the ID, to find the native menu items to allow the code in
wxMenuItem::SetItemLabel() and DoSetBitmap() to also work with submenus and
not just the normal items.
Closes#16246.
[This is the backport of r76676 from trunk.]
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Shift clicking in a control with multiple selections without a previous
current row attempted to select all rows from the current one up to UINT_MAX
which resulted in a program freezing (and probably running out of memory in 64
bit builds).
Fix this by explicitly checking for the absence of the current item.
Closes#16582.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Something broke NSApp compatibility object in 10.10 and its setDelegate:
expects NSFileManagerDelegate, not NSApplicationDelegate, and the
compiler warns about. Use the equivalent [NSApplication
sharedApplication] object to fix this.
Also cast appcontroller to the expected type, because passing untyped
object to setDelegate: yields a warning as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Local time zone already logically includes DST, even if its offset doesn't
account for it (because the offset depends on the date, so it can't be part of
TZ itself), so don't add it again when converting to/from it.
Closes#16585.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77898 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
There doesn't seem to be any advantage in doing this, but it can result in
problems see #16055. So just always let the other handlers for this event
execute as well, even if we did process it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77896 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The two compilers are binary compatible and by pretending that Intel compiler
is the same as MSVC, we allow using ICC to build applications using DLLs built
with MSVC.
Closes#9437.
(this is a backport of r76425 from trunk).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77894 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxOSX's implementation used a shared global delegate for all toolbars,
which is not only highly unusual, but broke with code that modified the
delegate. Specifically, wxPreferencesEditor's window uses
OSXSetSelectableTools() to make its toolbar selectable. Because the
delegate was shared, all toolbars in the application would start
behaving as selectable as soon as the user opened preferences (even
after the preferences window was closed).
Don't share the delegate. Create a unique copy and store it in
wxNSToolbar instance. This isn't particularly elegant solution, but it
has the advantage of being binary compatible and simple.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Actually use gray background behind toggled icon. Remove the ugly black
frame. Increase rounded rectangle's radius so that it is (barely)
visible that the rectangle is rounded.
Previously, the code used wxLIGHT_GREY by mistake, which is the same
color as the toolbar already uses, so toggled items were rendered with
the same background as untoggled, only with an ugly black rectangle
around them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Don't compare nLength with "nFirst + nCount" as this could wrap around.
Compare nCount with maximal allowed count, after ensuring that nFirst itself
is valid first, instead.
Closes#16572.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77725 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Initialize m_buffer to avoid crashes when deleting it in Cairo-based
wxGraphicsContext implementation for bitmaps created from the native ones.
Don't leave the bitmap size uninitialized neither, this might not result in
crashes, but is definitely wrong as well.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_3_0_BRANCH@77720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775