Commit Graph

61464 Commits

Author SHA1 Message Date
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
Artur Wieczorek
9a215bb393 Fixed creating wxGraphicsContext from wxPrinterDC with Cairo (MSW).
Modification of the mapping mode of underlying DC encapsulated in wxPrinterDC (from MM_ANISOTROPIC to MM_TEXT) which is done prior to creating Cairo context affects the value of device origin which needs to be applied to the Cairo context. Due to the change of the mapping mode it has to be rescaled based on the current scaling factor value.

See #17496.
2016-04-16 21:06:03 +02:00
Vadim Zeitlin
246ae58c19 Replace wxTreeItemAttr and wxListItemAttr with wxItemAttr
The two existing structs were completely identical, just replace them with a
single wxItemAttr.

Notice that wxDataViewItemAttr is not quite the same, although pretty similar,
so it remains separate for now. It would be nice to combine it with this one
too in the future, e.g. to make it simpler to make items bold in a wxListCtrl.
2016-04-16 19:04:52 +02:00
Vadim Zeitlin
c592363e95 Remove obsolete test for HDN_BEGINTRACKA being defined
It's used without this test in src/msw/headerctrl.cpp, so we can be sure using
this symbol doesn't create any problems any more.
2016-04-16 17:03:54 +02:00
Dimitri Schoolwerth
fe716b3c8e Fix 'not enough actual parameters for macro' warning
The macro wxGCC_WARNING_RESTORE is being used without a parameter which
MSVC warns about. Fix by passing the same parameter as when using
wxGCC_WARNING_SUPPRESS, namely deprecated-declarations.

Regression since b58c87db28.
2016-04-15 02:35:40 +00:00
Dimitri Schoolwerth
3486c5707b Fix macro redefinition warning
APIENTRY is unconditionally defined through windows.h while it already has
been defined previously in oglpfuncs.h, resulting in a macro redefinition
warning. In this case fix the warning by undefining the macro prior to
including windows.h.
2016-04-15 02:35:40 +00:00
Dimitri Schoolwerth
8267df75fb Disable 2 warnings occurring in release builds
Because of using a jump in an asm block there is a warning regarding
disabling global optimisations (for that function only) and as a result of
that another warning about being unable to check for buffer overruns. To
work around the warnings temporarily disable both (C4740 and C4748).

Regression since e405bf1607.
2016-04-15 02:35:39 +00:00
Dimitri Schoolwerth
7977839a56 Fix unreachable code warning
The return NULL statement at the bottom of
wxAuiXmlHandler::DoCreateResource() is never reached because the catch-all
else branch above it always returns. Fix by removing the bottom return
statement (same as how other *XmlHandler::DoCreateResource() methods
handle this, and not by changing the else into an else if).
2016-04-15 02:35:39 +00:00
Artur Wieczorek
a662e306be Fixed reporting transformation settings for wxGraphicsContext with Cairo renderer.
When wxGraphicsContext is created from "native" Cairo context (cairo_t*) then transformation settings applied initially to the underlying source Cairo context need to be stored (in a dedicated variable) to make possible determining what transformations were applied to wxGC instance since its creation. Only these explicitly applied transformations are reported by GetTransform().
2016-04-14 20:49:07 +02:00
Artur Wieczorek
a1a3f7309b Fixes and optimizations for determining wxCairoContext size (wxMSW).
1. Because Cairo uses internally GetClipBox Win API to determine surface size so we can employ the same approach in wxGraphicsRenderer::CreateContextFromNativeContext and just call this API instead of executing complicated code to determine size of underlying objects selected into DC.
2. Determine context size (and initialize respective data members with proper values) for wxCairoContext created from wxWindow.
3. Initialize respective data members with 0 values for generic wxCairoContext (with no source object provided).
2016-04-14 20:47:41 +02:00
Artur Wieczorek
0ae78d608a Restore source DC state when wxCairoContext is destroyed (wxMSW).
Since raw DC (encapsulated in source wxDC) can be modified in wxCairoContext explicitly (e.g. when context is instantiated from wxPrinterDC or wxEnhMetaFileDC) or implicitly (by some Cairo functions) we have to store its state in ctor and restore it in dtor to assure consistent state of the source wxDC.
2016-04-14 20:45:42 +02:00
Artur Wieczorek
c911f737e3 Implemented wxGraphicsContext created from wxEnhMetaFileDC for Cairo renderer (wxMSW). 2016-04-14 20:44:35 +02:00
Vadim Zeitlin
ba5a0a3878 Fix more typos in comments and wxFAIL messages
Closes https://github.com/wxWidgets/wxWidgets/pull/270
2016-04-14 16:08:28 +02:00
Marek Temnyak
d4460435d9 Make source string const in wxPropertyGrid escape sequence methods
Source string is not changed in {Expand,Create}EscapeSequences() methods, so
make it const.

Closes https://github.com/wxWidgets/wxWidgets/pull/271
2016-04-14 16:05:10 +02:00
Dimitri Schoolwerth
c6570770bc Fix signed/unsigned mismatch warning
When not using MinGW the value NO_ITEM (-1) is passed as an item count to
the macro ListView_ApproximateViewRect. While Windows/Platform SDKs since
at least 6.0a cast the argument to (only!) a WPARAM, older ones such as
5.0 don't which results in a signed/unsigned mismatch (converting -1 to
WPARAM, which is an UINT_PTR).

Fix by always casting to WPARAM when using ListView_ApproximateViewRect.
Also use a value of -1 again instead of NO_ITEM because the latter is a
bit of a misnomer in this case (as it refers to the total number of items
in the control) and to reduce the risk of the cast being removed in the
future as well as differentiate it from the MinGW headers issue.

Note that this is a different casting problem than with other ListView_XXX
macros such as ListView_GetNextItem (which cast to int first and then to
WPARAM) where casting to WPARAM results in a warning with WIN64 builds.
That situation does not apply to ListView_ApproximateViewRect.

Regression since 00c63cfd3a.
2016-04-13 23:58:04 +00:00
Dimitri Schoolwerth
faf26f3939 Fix crash when using default wxDataViewEvent ctor
Check the value of the wxDataViewCtrl pointer parameter in Init() instead
of unconditionally calling GetModel() on it. The default ctor of
wxDataViewEvent calls Init() with a null pointer.

This fixes the failing GUI tests with the XP buildbot slave.

Regression since 9829446755.

Also see #12649.
2016-04-13 18:33:04 +00:00
Vadim Zeitlin
adfc3c18c3 Merge branch 'datetime-compare'
Miscellaneous improvements to wxDateTime comparison operators.

Closes #17490.
2016-04-13 15:14:45 +02:00
Kevin B. McCarty
a922d576ec Use wxINT64_MIN for the value of invalid wxDateTime
Use 0xffffffffffffffff instead of the strange 0xffffffff00000000 that we used
before, for some reason.
2016-04-12 20:54:27 +02:00
Vadim Zeitlin
5e5d872150 Document wxDateTime comparison operators behaviour
Mention that they intentionally can't be used with invalid objects except for
the exact comparison.
2016-04-12 20:51:09 +02:00