Commit Graph

61482 Commits

Author SHA1 Message Date
Artur Wieczorek
984e54ffdd Fixed closing sub-paths of wxGraphicsPath with GDI+ renderer.
When sub-path is closed with CloseSubpath() then current point should be moved to the joined endpoint of the sub-path (what is equivalent of moving it to the starting point of the sub-path). Native CloseFigure() doesn't move the native current point to the starting point of the figure so we need to maintain it on our own in this case.
To implement this behaviour we need to store the starting point of the figure in a dedicate data member and use it to update the current point when the figure is closed.
But native GDI+ renderer doesn't offer any support for updating directly the current point (only explicit drawing operations update its value) so we need also to remember our "logical" current point (being the result of calling CloseSubPath, MoveToPoint, etc.) in a dedicated data member and use it instead of the native current point in the next operation which requires current point location.

Closes #17520
2016-05-05 13:52:12 +02:00
Artur Wieczorek
329aee5660 Fixed closing sub-path of wxGraphicsPath with Direct2D renderer.
When sub-path is closed with CloseSubpath() then current point should be moved to the joined endpoint of the sub-path (what is equivalent of moving it to the starting point of the sub-path). To implement this behaviour we need to store on our own the starting point of the figure in a dedicate data member because native D2D renderer apparently doesn't offer any support for retrieving it.

See #17520
2016-05-05 13:51:27 +02:00
Artur Wieczorek
6879311b98 Fixed appending a line to wxGraphicsPath with GDI+ renderer.
New line appended to the path should be started explicitly at the current point.

See #17520
2016-05-05 13:50:52 +02:00
Artur Wieczorek
a28f1b7f44 Fixed appending a line to wxGraphicsPath with Direct2D renderer.
If there is necessary to start a new D2D figure prior to appending the line to the path it should be started at the current point and not always at (0,0).

See #17520
2016-05-05 13:50:09 +02:00
Artur Wieczorek
008a162241 Fixed appending circle/ellipse to wxGraphicsPath with Direct2D renderer.
Circle/ellipse should be appended as a closed sub-path and the current point after the operation should be moved to "the rightmost point" of the figure ((x+r,y) and (x+w,y+h/2) respectively).

See #17520
2016-05-05 13:49:36 +02:00
Vadim Zeitlin
e2b13a7b8e Fix background colour returned by wxTextCtrl::GetStyle() in wxMSW
Don't return the background colour unless it's really set, otherwise we
returned black background even if it was never changed.
2016-05-05 03:05:45 +02:00
Paul Kulchenko
25520cbb80 Don't use wxWindowBase in the interface headers
This class is an implementation detail, only wxWindow is public and there are
never objects of wxWindowBase (but not wxWindow) class in wxWidgets programs.

Closes https://github.com/wxWidgets/wxWidgets/pull/279
2016-05-05 02:59:43 +02:00
Jouk
426b11036f Ignore compile warnings on OpenVMS 2016-05-04 10:22:15 +02:00
Vadim Zeitlin
e41a59ee07 Fix Unicode conversions in Scintilla code in ANSI build
Don't just use wxWX2MBbuf which is just a "const char*" in ANSI build and can
become a dangling pointer if the string it was constructed from was temporary,
as it happens with the string returned by wxStyledTextEvent::GetString().

Closes #17517.
2016-05-03 16:09:11 +02:00
Dimitri Schoolwerth
c5a18a3407 Revert "Create native buttons without any label in wxOSX/Cocoa"
This change is not any longer needed since the fix in
98f5315405.

This reverts commit ef1db7acda.
2016-05-01 22:20:16 +04:00
Maarten Bent
7c16c93807 Fix for PCH-less build for wxD2DContext.
It is required for FLT_MAX in Direct2D graphics context.

Closes https://github.com/wxWidgets/wxWidgets/pull/276
2016-05-01 19:03:58 +02:00
Artur Wieczorek
1e6cf64a2a Fixed creating wxGraphicsPath with Direct2D renderer.
When current endpoint is moved to a new position with MoveToPoint() then current sub-path should be ended without closing the figure (no line from the current point to the beginning of the sub-path should be added).

Closes #17516
2016-05-01 19:02:58 +02:00
Václav Slavík
98f5315405 Don't set initial label in wxNativeWindow on OS X
Differentiate between setting the label from SetLabel() and from
SetPeer() (i.e. initially), because some native controls shouldn't have
an empty string set as their intitial value.

Override SetInitialSize() to be empty for wxNativeWindow in order to
prevent label-setting issues when an unknown, caller-controlled native
widget is attached. Reverts db9baf9aa5,
which was the previous attempt to fix this, but was causing too many
problems elsewhere.
2016-04-29 17:26:02 +02:00
Vadim Zeitlin
77939b4b62 Update the version in MSVS binaries helper script
Take care of the just added getversion.bat in the inc_release script.

See #17510.
2016-04-28 23:30:29 +02:00
Danny Scott
e6b8e14cfd Add improves scripts for building official MSVS binaries
Use a single script for all compiler versions, another simple script just
defining wxWidgets version and, finally, a script building all the binaries
for all the compilers.

Closes #17510.
2016-04-28 23:30:07 +02:00
Troels Knakkergaard
db62698720 Fix for DLL build after wxItemAttr addition
Don't forward declare this class as being DLL-exported, it isn't.

Closes #17508.
2016-04-25 12:08:28 +02:00
Vadim Zeitlin
875a40be13 Fix wxString::ToStdString(wxMBConv) to compile in ANSI build
70ddab243e broke compilation without Unicode as
mb_str() doesn't return a buffer in this case.

See #17461.
2016-04-24 18:12:31 +02:00
Maarten Bent
5266f4785c Fix PCH-less build after CustomDraw addition
Include "wx/msw/private.h" for wxColourToRGB().

See https://github.com/wxWidgets/wxWidgets/pull/276
2016-04-24 18:03:49 +02:00
Maarten Bent
82ed51d167 Add virtual dtor to wxMSW CustomDraw class
This class is used polymorphically and needs a virtual dtor.

See https://github.com/wxWidgets/wxWidgets/pull/276
2016-04-24 18:02:58 +02:00
Marek Temnyak
1bcc5aa7e4 Add missing implementation of wxScrollBar::SetThumbSize() in wxGTK
This method was declared but never defined somehow, do define it now.

Closes https://github.com/wxWidgets/wxWidgets/pull/272
2016-04-23 18:55:29 +02:00
Vadim Zeitlin
70b64b8c53 Merge branch 'rename-listctrl-checkbox-methods' of https://github.com/discnl/wxWidgets
Use consistent case for wxListCtrl::{Has,Enable}CheckBoxes() methods.

Closes https://github.com/wxWidgets/wxWidgets/pull/275
2016-04-23 18:53:41 +02:00
Vadim Zeitlin
b1fcf100ff Fix user-visible with AUI tab selection after dragging
Selection at wxAuiNotebook level was not updated, resulting in all attempts to
select the tab at the same index as the tab that was dragged elsewhere being
ignored, e.g. after dragging the first tab to the second position in the AUI
sample, the first tab couldn't be selected again.

Fix this by always changing the selection in OnTabEndDrag(). This might not be
the best thing to do as the selection is also changed later in the code and
the fact that the code returns without sending the event is probably a bug
too, but for now at least fix the user-visible problem.

Closes #15071.
2016-04-23 18:51:49 +02:00
Kolya Kosenko
bb2b48f2ba Handle negative width size in GDI+ DrawRectangle() and document it
Apparently it's a common convention to allow width and/or height of a
rectangle to be negative as both GDI and Cairo handle this natively, so also
allow this for GDI+ and document this as the expected behaviour.

Closes #17495.
2016-04-23 18:31:01 +02:00
Dimitri Schoolwerth
cb08b32f43 Regenerate Xcode projects 2016-04-23 20:26:10 +04:00
Vadim Zeitlin
2c9a435f46 Use correct variant type in generic wxDataViewChoiceByIndexRenderer
This solves the same problem as daa8fd03f3 did
for the GTK+ native version and ensures that the variant type at the renderer
level is consistent with the type of the values actually used with this
renderer (which are integers as they are indices).

Closes #17474.
2016-04-23 17:55:39 +02:00
Vadim Zeitlin
983f5f29a2 Merge branch 'owner-draw-headers'
Implement support for changing fonts and colours in wxMSW header control.
2016-04-23 17:52:49 +02:00
Václav Slavík
e5e92c92ce wxMSW: Fix display of file history items in menus
Unlike other platforms, wxMSW assumes natural text directionality (i.e.
right to left under RTL locales), but absolutely filenames are always
LTR because they begin with a Latin character. It is therefore necessary
to add  an explicit directional mark in front of them on Windows.
2016-04-23 14:49:42 +02:00
Václav Slavík
a0805d32eb MSW: Fix dialog default positions under RTL locales
Toplevel windows use their parent's coordinate system as the reference
frame, not desktop's, so need to be adjusted accordingly if its
mirrored. Without these changes, default-positioned wxDialogs would end
to the right side of the parent window's right border (instead of being
slightly inside the window) and changing their size would move them as
well.
2016-04-23 14:49:01 +02:00
Artur Wieczorek
6243e0e507 Use wxList instead of std::list in Direct2D renderer.
This would remove explicit dependency on STL.
2016-04-22 21:17:01 +02:00
Artur Wieczorek
e962172cd9 Don't call std::sin, std::cos functions.
This is for the sake of consistency because everywhere else there are used trigonometric functions from standard C library (only <math.h> is included).
2016-04-22 21:15:41 +02:00
Vadim Zeitlin
bed710d9a7 Add wxDataViewCtrl::GenericGetHeader() accessor
And show how to use it to increase the header size in the sample.
2016-04-22 01:12:21 +02:00
Vadim Zeitlin
bed7d9fe74 Add wxDataViewCtrl::SetHeaderAttr() too
This is currently only implemented in the generic version but could be
implemented at least for GTK+ native one as well in the future.
2016-04-22 00:58:38 +02:00
Artur Wieczorek
8a7374e5ca Fixed drawing with wxGraphicsContext and Direct2D renderer.
When render target to draw to a DC (created with ID2D1Factory::CreateDCRenderTarget method) is bound to the device context with ID2D1DCRenderTarget::BindDC method then the size of the area of drawing has to be a logical size of a DC (with its scaling factor taken int account). This can be determined directly using GetClipBox API and there is no need to pass it as a parameter of wxD2DDCRenderTargetResourceHolder ctor.

Closes #17504.
2016-04-21 20:24:43 +02:00
Dimitri Schoolwerth
3689f0119b Rename methods in listctrl sample to use CheckBox instead of Checkbox 2016-04-21 17:58:01 +00:00
Dimitri Schoolwerth
c78470b647 Rename wxListMainWindow::IsInsideCheckBox to IsInsideCheckbox 2016-04-21 17:47:10 +00:00
Dimitri Schoolwerth
602111f2b3 Rename wxListCtrl::HasCheckboxes() and EnableCheckboxes()
Rename them to HasCheckBoxes and EnableCheckBoxes for consistency with
wxCheckBox naming.

See also PR https://github.com/wxWidgets/wxWidgets/pull/153
2016-04-21 15:25:10 +00:00
Artur Wieczorek
deb162fc5a Fixes for PCH-less build for Direct2D graphics context.
Include the required headers inside "#ifndef WX_PRECOMP" block.

See #17502.
2016-04-20 22:03:38 +02:00
Artur Wieczorek
4b0732269d Fixed determining Direct2D graphics context size (wxMSW).
Determine actual size of wxD2DContext instance and initialize respective data members to report proper size of wxGraphicsContext created by wxGraphicsRenderer::CreateContextFromNativeContext / CreateContextFromNativeWindow.

Closes #17502.
2016-04-20 20:54:48 +02:00
Lauri Nurmi
858e50daaa Document wxDynamicLibrary::GetDllExt() method
Make this method part of the public API.

Closes https://github.com/wxWidgets/wxWidgets/pull/273
2016-04-18 00:15:47 +02:00
Artur Wieczorek
32d76cefe2 Refactored code to get access to wxBitmap's bit values in wxCairoContext ctor (MSW).
Use simpler version of wxAlphaPixelData and wxNativePixelData ctors and invoke respective accessors to obtain bitmap size.
2016-04-17 19:15:49 +02:00
Artur Wieczorek
be6f93d725 Fixed initialization sequence in wxCairoContext ctor.
Shared method Init should be invoked to initialize the context to assure consistency with other ctors.
2016-04-17 19:15:32 +02:00
Artur Wieczorek
fdc2189808 Move duplicated code to the shared function.
Code to store initial Cairo transformation settings can be moved from wxCairoContext ctor bodies to the shared method wxCairoContext::Init.
2016-04-17 19:15:12 +02:00
Vadim Zeitlin
5388c7a72e Add wxListCtrl::SetHeaderAttr()
This method can be used to change the list view header appearance.

Add the method declaration, documentation, show it in the sample and implement
it for wxMSW (only, for now).
2016-04-17 18:26:13 +02:00
Vadim Zeitlin
dfb993274c Add equality operators to wxItemAttr
It can be necessary to compare two item attributes for equality, e.g. to check
if the attributes have changed, so provide a straightforward implementation of
equality and inequality operator for it.
2016-04-17 17:36:20 +02:00
Vadim Zeitlin
c17f1d7888 Consistently use British "colour" spelling in wxItemAttr documentation
The methods of this class use "Colour", not "Color", so use "colour" and not
"color" when documenting them too.
2016-04-17 17:21:30 +02:00
Vadim Zeitlin
e84053ed64 Add wxItemAttr::HasColours() and IsDefault() accessors
They are trivial but useful to have as testing for HasBackgroundColour() ||
HasTextColour() || HasFont() is too verbose.
2016-04-17 17:19:20 +02:00
Vadim Zeitlin
c15f75b81d Use custom draw in wxMSW wxHeaderCtrl to support colours
Add a helper wxMSWImpl::CustomDraw class which will be reused in the other
places too and, for now, use it just to implement support for custom colours
in wxHeaderCtrl.

Notice that the control took care of the custom font on its anyhow and that
background colour is ignored when themes are enabled, so the net effect of
this change is that now changing the header foreground colour works, while
it was ignored before.
2016-04-17 17:01:08 +02:00
Vadim Zeitlin
64196306bc Add a very simple page showing wxHeaderCtrl in the widgets sample
This is mostly in order to test that changing font and colours works for this
control (or, rather, that currently it doesn't in wxMSW).
2016-04-17 16:03:28 +02:00
Artur Wieczorek
ca7670d2fc Fixed creating wxGraphicsContext from Cairo context.
Reference count of the source Cairo context should be increased to prevent source context from being destroyed in wxGraphicsContex dtor (where cairo_destroy is invoked).
2016-04-16 21:34:08 +02:00
Artur Wieczorek
495a88ba73 Fixed creating wxPrinterDC from wxGraphicsContext with Cairo renderer (GTK).
When wxGraphicsContext is created from wxPrinterDC then also logical scaling factor applied to the source wxPrinterDC has to be explicitly applied to the Cairo context.
All inherited transformation settings should be used only internally by wxGraphicsContext object and shouldn't be exposed through e.g. GetTransform() function and hence they are stored separately (in a dedicated variable) and "subtracted" from actual transformation settings for reporting purposes.

Closes #17496.
2016-04-16 21:23:21 +02:00