Commit Graph

34550 Commits

Author SHA1 Message Date
Artur Wieczorek
390091cc24 Don't set alpha flag for wxBitmaps with depth < 32 bpp (wxMSW).
Flag indicating that bitmap contains alpha channel can be set only for 32 bpp bitmap.
2016-01-17 16:19:52 +01:00
Vadim Zeitlin
884f3c623d Fix wxMSW wxMimeTypesManager compilation in UTF-8 build
Use wxStringCharType with wxS(), not wxChar (which should be used with wxT())
to fix UTF-8 build after 0ed580f451.

Closes #17335.
2016-01-17 14:09:04 +01:00
Paul Cornett
b74923eb29 add missing wxOVERRIDE 2016-01-16 11:08:25 -08:00
Paul Cornett
03aae8254f remove unused private member variables 2016-01-16 11:04:27 -08:00
Paul Cornett
6245e2d996 remove const from pass-by-value parameters 2016-01-16 11:03:50 -08:00
Paul Cornett
56701052eb remove const from pass-by-value parameters 2016-01-16 10:55:01 -08:00
Paul Cornett
c557f66eaf Fix SetWindowStyleFlag() override
Base class SetWindowStyle() is not virtual
2016-01-16 10:40:23 -08:00
Artur Wieczorek
976e3115b7 Always use DIBs in wxMSW wxGCDC.
Ensure that 32bpp bitmaps selected in wxMemoryDC use DIB for their internal
representation as GDI+ functions don't seem to work correctly with DDBs.

Note: Code responsible for converting and fixing the bitmap has been moved
from wxGCDCImpl::wxGCDCImpl to wxGDIPlusRenderer::CreateContext because this
is the common entry point for creating context for GDI+.

Closes #17324.
2016-01-16 13:20:06 +01:00
Tim Kosse
8eef0f9ce2 Don't assert if Ctrl+Tab is pressed inside a wxGTK window
Ignore the WinChange flag in DoNavigateIn() to fix an assertion that happened
when pressing Ctrl+Tab with the generic wxListCtrl having focus.

This seems to be consistent with pressing Ctrl+Tab elsewhere, e.g. when
cycling between buttons in a dialog.
2016-01-14 15:50:54 +01:00
Paul Cornett
e72133371e fix cursor unref for GTK2, broken by 3e75b23 2016-01-12 23:58:34 -08:00
Paul Cornett
bf56c34ad2 remove incorrect cursor unref added in 3e75b23, see #17330 2016-01-12 23:53:01 -08:00
Jens Göpfert
abd46cb99a Add support for multimedia keys to wxMSW and wxGTK
Add WXK_XXX constants for the standard multimedia keys and generate events
corresponding to them under wxGTK and wxMSW.

Closes https://github.com/wxWidgets/wxWidgets/pull/157
2016-01-08 23:22:24 +01:00
Paul Cornett
2585d73204 In FindOrCreateFont(), avoid using family if facenames are specified.
GetFamily() is not reliable in wxGTK. See #17313
2016-01-08 09:56:28 -08:00
David Vanderson
c5659b19b4 Implement wxToolTip::SetDelay() for wxOSX
Set the "NSInitialToolTipDelay" object in NSUserDefaults.

Closes #17322.
2016-01-08 17:02:19 +01:00
Artur Wieczorek
13783d8733 Fixed regression in wxMenuItem::Check introduced by dbd98a10.
Internal check flag (via wxMenuItemBase::Check) has to be set as a first to avoid generating a spurious wxEVT_MENU when menu item is checked.
2016-01-07 21:45:17 +01:00
Vadim Zeitlin
525296aec5 Preserve the button attributes when setting its bitmap in wxGTK
The button label font and colour could be lost when its bitmap was set because
this could result in the recreation of the GtkLabel, internally.

Fix this by reapplying the styles to the possibly recreated label when
changing the bitmap or its position in the button.
2016-01-07 18:43:01 +01:00
Artur Wieczorek
41e94974a0 Fixed positioning controls on the toolbar after removing a tool.
When a tool is removed from the toolbar then all tools with controls on the right hand side have to be repositioned (shifted left) manually.
2016-01-06 23:06:40 +01:00
Artur Wieczorek
dbd98a1078 Don't attempt to uncheck menu radio item in wxGTK
Unchecking radio item makes no sense and wxMSW does nothing in this case, so
don't do anything in wxGTK neither, in particular don't generate a spurious
wxEVT_MENU.

Closes #17318.
2016-01-06 03:45:00 +01:00
Vadim Zeitlin
6c897a28fd Merge branch 'osx_close_btn' of https://github.com/TcT2k/wxWidgets
Improve appearance of the close button on high DPI displays under OS X.
2016-01-05 23:08:19 +01:00
Tobias Taschner
d4a2f1578a Handle high resolution displays in wxBitmapButtonBase::NewCloseButton().
Bitmap for the close button is scaled based on GetContentScaleFactor(). On OS X the resulting bitmap has to use the correct scaling factor in order to be displayed correctly on the button when using a high resolution display.
2016-01-05 15:13:18 +01:00
Tobias Taschner
e0cb697991 Replace images in wxRendererMac::DrawTitleBarBitmap() with drawing code.
The low resolution (14x14) bitmaps scaled badly on high resolution displays. A close button suitable for usage inside a window (like wxInfoBar) is not available via HI theme drawing methods. This drawing code tries to emulate a close button, as close as possible to the one found in the Xcode 6+ welcome window.
2016-01-05 14:51:04 +01:00
Andreas Falkenhahn
27c8601646 Avoid unnecessary selection changes in wxMSW wxTextCtrl::GetStyle()
We don't need to change the selection if we're interested in the attribute of
its starting position, as is typically the case because this is also the
cursor position, because EM_GETCHARFORMAT returns the attribute of the first
character of the selection and not, as was apparently believed when this code
was written, only the attributes which are the same for the whole selection.

This avoids flicker when constantly using GetStyle() to check for the format
at the cursor position as the selection is not changed all the time any more.
2016-01-05 01:21:45 +01:00
Artur Wieczorek
527c25b898 Store alpha channel in the output wxImage only if internal GDI+ bitmap contains it.
When converting internal bitmap to wxImage in wxGDIPlusBitmapData::ConvertToImage set up output alpha channel buffer only if source bitmap contains alpha channel values.
2016-01-04 22:59:44 +01:00
Artur Wieczorek
ca52d09a03 Optimize converting internal Direct2D renderer bitmap to wxImage.
Get access to bitmap bits with IWICBitmap::Lock instead of IWICBitmapSource::CopyPixels because in-place processing is more effective in terms of speed and memory consumption (see IWICBitmap interface description in MSDN).

See #17311.
2016-01-04 22:35:57 +01:00
Artur Wieczorek
6498776b52 Initialize internal bitmap when creating D2D graphics context from wxImage.
Internal D2D WIC bitmap should be initialized with source wxImage contents in wxD2DRenderer::CreateContextFromImage.

Closes #17314.
2016-01-04 18:30:39 +01:00
Artur Wieczorek
4a3f3f4ed7 Store alpha channel values when converting internal D2D bitmap to wxImage.
Save alpha channel retrieved from internal bitmap if target wxImage is capable to store it. Also undo premultiplication of RGB values if bitmap contains alpha channel values.

Closes #17311.
2016-01-03 21:48:29 +01:00
Artur Wieczorek
ca8f5eae93 Optimize converting internal GDI+ bitmap to wxImage
Write retrieved pixel data directly to the internal buffers of destination wxImage.
2016-01-03 15:13:39 +01:00
Vadim Zeitlin
3195bc14d0 Merge branch 'high-dpi-checkboxes-fix' of https://github.com/MaartenBent/wxWidgets
Correct calculation of the checkboxes size when using themes and other minor
renderer fixes.
2016-01-03 01:02:14 +01:00
Stefano D. Mtangoo
28bc1bdac0 Allow specifying the replacement character in wxString::ToAscii()
Don't hardcode "_" as the replacement character but accept the one specified
by the user.

Closes https://github.com/wxWidgets/wxWidgets/pull/116
2016-01-03 00:40:11 +01:00
Artur Wieczorek
b65a3f5520 Don't lose alpha when converting GDI+ bitmap to wxImage
wxGDIPlusBitmapData::ConvertToImage() lost the alpha channel of the image as
it used the bitmap handle returned Gdiplus::Bitmap::GetHBITMAP() which is a
DDB and doesn't contain real alpha channel values.

In order to retrieve actual alpha channel data there is necessary to get
direct access to Gdiplus::Bitmap bits with Bitmap::LockBits and transfer pixel
data to wxImage pixel by pixel.

Closes #17174.
2016-01-02 17:13:36 +01:00
Artur Wieczorek
450019dc21 Ensure COM is still active when Direct2D renderer is in use
Some internal D2D operations need active COM library so ensure it is properly
initialized and released in wxDirect2DModule.

Closes #17308.
2016-01-02 17:09:30 +01:00
Artur Wieczorek
602fe6cb83 Set initial point of the path in wxD2DPathData::wxD2DPathData ctor.
Set initial point to (0,0) for newly created Direct2D wxGraphicsPath path.
2015-12-28 00:08:24 +01:00
Artur Wieczorek
846dde3b36 Fixed drawing ellipse/circle in Direct2D wxGraphicsPath.
Instead of drawing an ellipse as a filled figure draw it as a curve (concatenation of two elliptical arcs).

Closes #17306.
2015-12-28 00:07:00 +01:00
Vadim Zeitlin
bad2538697 Revert "Fix warnings about pointer/int casts in Win32 part of libtiff too."
This reverts commit 6caa5e92c1 because it fixed
a warning during compilation but broke the behaviour of TIFFFdOpen() during
run-time: initializing the union via its int component didn't clear the high
DWORD of the 64 bit thandle_t value, resulting in a wrong value being used.

Closes #17286.
2015-12-26 19:34:06 +01:00
Artur Wieczorek
537519a8ed Fixed initialization of Direct2D path geometry in wxD2DPathData ctor.
To properly initialize path geometry there is also necessary to open at least once its geometry sink.

Closes #16970.
2015-12-26 16:24:26 +01:00
Artur Wieczorek
358e42a829 Fix drawing bitmap in the selection field of wxBitmapComboBox
When drop-down list is open for wxBitmapComboBox with wxCB_READONLY style and
keyboard is used to select the item on the list then the contents of the
selection field should remain unchanged. (Especially, the bitmap bitmap drawn
in the selection field should be the bitmap associated with text value
displayed in this field.)

Closes #17299.
2015-12-23 18:44:18 +01:00
Troels Knakkergaard
50435ef678 Use the appropriate parent for the choice dialogs
Fall back to the main application window if no parent was explicitly specified
using the standard GetParentForModalDialog() method.

See #17295
2015-12-22 18:29:59 +01:00
Troels Knakkergaard
4ebb8d9837 Use document window as parent for "Save changes?" dialog
This ensures that the message box is centered on its parent window and not the
screen.

Closes #17295.
2015-12-21 12:44:17 +01:00
Paul Cornett
5524cec193 implement Flush() for wxImage wxGraphicsContext under Cairo and GDI+, see #16694 2015-12-20 10:20:30 -08:00
Paul Cornett
cd27b73237 flush Cairo surface before converting to wxImage 2015-12-20 10:10:04 -08:00
Phil Rosenberg
ec824f7e8d Avoid asserts when drawing zero-size wxStaticBox in wxMSW
If a wxStaticBox is rendered, but has zero size in either dimension we
generate assert failures when creating the bitmap. Check for these conditions
and just do not render if this is the case.

Closes #17288.
2015-12-19 16:23:44 +01:00
Artur Wieczorek
231c9c7168 Really parse the extra field seeking for ZIP64 extended data
Extended ZIP64 data are stored in the field with Header ID = 1 and we need to
iterate over all fields to find it because it is not stated in the
documentation the it must be the first record in the collection. wxZipHeader
is designed to process standard 64-byte headers and it is safe to use it to
process data in the field with Header ID = 1 which can have up to 28 bytes.

Closes #17170.
2015-12-19 16:19:37 +01:00
Maarten Bent
3cbdbba2fb Add validity checks to GetCheckBoxSize. 2015-12-17 17:21:50 +01:00
Maarten Bent
1585530623 Show custom foreground colour when theme is used. 2015-12-17 17:21:03 +01:00
Vadim Zeitlin
2c2b9051d8 Merge branch 'toolbar_change_placing' of https://github.com/a-wi/wxWidgets
Fix several problems related to SetToolPacking() in wxMSW.
2015-12-17 02:09:21 +01:00
Artur Wieczorek
2dd87a93df Take into account tool placing value in contructing tools with controls.
Tool padding value should be taken into account also in sizing custom made tools (with controls) to get the same visual appearance and behaviour for all tools (buttons).
2015-12-16 21:41:12 +01:00
Maarten Bent
bbe61adae8 Use IsThemePartDefined according to the specification.
iStateId should always be 0 (https://msdn.microsoft.com/en-us/library/windows/desktop/bb759819%28v=vs.85%29.aspx).
2015-12-16 21:01:46 +01:00
Maarten Bent
64c4e0674c Determine correct checkbox size when using theme. 2015-12-16 20:59:27 +01:00
JulianSmart
e27027a1dd Selected images now differentiated in wxOSX/Cocoa 2015-12-15 12:37:06 +00:00
Artur Wieczorek
8fdf4221dc Fix setting tool spacing.
Don't set orthogonal padding value to zero but preserve its current value (using MSWSetPadding method).
This way vertical padding is not zeroed when horizontal padding is set and horizontal padding is not zeroed when vertical padding is set.
2015-12-15 08:19:00 +01:00