Commit Graph

60792 Commits

Author SHA1 Message Date
Pete Stieber
5948602f4f Make wx/dirdlg.h safe to include as first wx header
Include wx/defs.h to get wxUSE_DIRDLG value from it, otherwise it could be
undefined, and hence evaluate to 0 (unfortunately without even a warning with
some compilers), if this header was the first wx header to be included.
2016-01-05 01:29:19 +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
htalbot
c0e75f27d1 Allow predefining wxHAS_MODE_T to avoid mode_t conflicts
This symbol can now be predefined to avoid conflicts with mode_t definition in
wx/filefn.h when wxWidgets is used in applications also using another library
which also defines mode_t.

Closes https://github.com/wxWidgets/wxWidgets/pull/165
2016-01-03 17:25:05 +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
Peter Tissen
cfd4da8fdb Copy wx/msw/setup0.h to setup.h if none already exists
Automatically create setup.h when using a git checkout with MSVS.

Closes https://github.com/wxWidgets/wxWidgets/pull/52
2016-01-02 17:26:17 +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
Vadim Zeitlin
72c47669ab Add wx/generic/collheaderctrl.h to the list of GUI headers
This file is used by the public wx/collheaderctrl.h but wasn't previously
installed, breaking the build of any code including that header under Unix.

Closes #17309.
2016-01-02 13:26:26 +01:00
Vadim Zeitlin
017bbdf516 Define ToDIP() in wxHAVE_DPI_INDEPENDENT_PIXELS case too
Previously any code using this function wouldn't link under GTK+ 3 or OS X
where wxHAVE_DPI_INDEPENDENT_PIXELS are defined.

Closes #17310.
2015-12-31 00:26:04 +01:00
Vadim Zeitlin
52a4fac626 Add proper support for wxUSE_NATIVE_PROGRESSDLG
This symbol was wrongly added to include/wx/msw/setup0.h directly in
075ef6551e, so it didn't work when
cross-compiling from Unix (which doesn't use this file) and would have been
lost after any future modification of include/wx/setup_inc.h where it should
have been added in the first place.

Do this now and also make the check for this symbol in wx/progdlg.h a bit more
readable.
2015-12-30 18:54:35 +01:00
Vadim Zeitlin
ed0b899fe5 Fix the build when using mismatching strict ANSI modes with MinGW
Don't use __STRICT_ANSI__ to determine whether a function is available or not
as its value can be different when building the library and the application,
resulting in mysterious link errors.

Instead use the same approach as in aa30a2f97ade6fe019f2f288917296b009bf4221
and just declare the functions that are available but just not declared in
strict ANSI mode manually.

Closes #15793.
2015-12-28 01:27:49 +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
537fcac633 Disable "Use wxDC" menu item if displayed screen requires wxGraphicContext (drawing sample).
To display "show alpha" and "show graphics" screens there is necessary to use wxGraphicContext and switching to wxDC should blocked in this case.
2015-12-26 17:44:28 +01:00
Artur Wieczorek
3fb70061ae Synchronize menu state in drawing sample with actually selected graphics renderer.
Because graphics renderer is not only selected via menu but also directly in the application (in MyFrame::OnShow) there is necessary to update menu items responsible for selecting graphics context to represent current state of the application.
This is done in EVT_UPDATE_UI handlers where there is checked what graphics renderer is currently in use and state of the menu items is updated accordingly.

Closes #16971.
2015-12-26 17:43:50 +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
TMTisFree
3e3d2ff096 French translations update from TMTisFree
Closes #17287.
2015-12-21 12:56: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
Vadim Zeitlin
4e00229b6e Mention C++11 lambdas and std::function<> in event handling docs
When using a C++11 compiler, it is very convenient to use lambdas directly as
event handlers, so explicitly give an example of doing this in the
documentation.

Closes #17294.
2015-12-19 16:14:27 +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
Bryan Petty
a775d57f97 Update apt sources in Travis CI builds. 2015-12-17 08:58:10 -07: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
Vadim Zeitlin
f8f69118cd Restore wxPython build scripts
These scripts were removed in c9220befc7 but are
still referenced in wxPython build instructions, so restore them.

Closes #17289.
2015-12-15 14:53:12 +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
JulianSmart
24580198b8 Fixed includes for generic image list 2015-12-14 23:17:01 +00:00
Artur Wieczorek
38f6cf13d5 Refresh the toolbar after changing tool placing value.
After changing padding for toolbar in SetToolPacking() there is necessary to refresh/recalculate the toolbar to reflect new padding.
2015-12-14 22:19:35 +01:00
Artur Wieczorek
0a917b86b7 Initialize padding while creating a toolbar.
If padding value (stored in m_toolPacking) has been assigned prior to creating the toolbar (with SetToolPacking) then apply this padding to just created toolbar.
Otherwise initialize this variable with current padding retrieved from the toolbar to let GetToolPacking return proper padding value.
Implemented new method MSWSetPadding() to set padding for native toolbar.
2015-12-14 22:19:32 +01:00
Artur Wieczorek
dd29ecf840 Implemented features to modify tool spacing in the toolbar sample.
There were added two menu items (under 'Tools' menu) to modify current tool spacing.
This way is possible to test SetToolPacking/GetToolPacking methods.
2015-12-14 22:13:04 +01:00
JulianSmart
16d8d6c4a4 wxFileIconsTable::SetSize allows an application to set a different icon size in its initialisation, to adapt directory and file controls for HiDPI. 2015-12-13 20:22:02 +00:00
JulianSmart
0484975fed Added wxImageList::GetSize to retrieve the size originally passed 2015-12-13 19:17:40 +00:00
Artur Wieczorek
57793cb6f1 Reset opacity check box value when control settings are reset in ColourPicker demo.
All settings should be reset to default values when 'Reset' operation is invoked.
2015-12-13 19:18:57 +01:00
JulianSmart
b2e35d25c1 Implemented wxToolBar::SetToolPacking on Windows 2015-12-13 17:49:35 +00:00