Commit Graph

16992 Commits

Author SHA1 Message Date
Maarten Bent
444c5fd630 Correctly draw poly-polygons in wxSVGFileDC.
Each polygon in the poly-polygon needs to end with the start-point. The implementation is similar to the wxDCImpl implementation, except for the extra end points that are inserted.
2016-06-12 15:59:26 +02:00
Maarten Bent
ebab640578 Enable usage of clipping regions in wxSVGFileDC.
It was implemented 3 and half years ago in 614e38d.
Close remaining clipping regions when closing the SVG file.
2016-06-12 15:59:26 +02:00
Vadim Zeitlin
023ee99ea7 Don't crash in wxTextFile::GetLastLine() if the file is empty
Just return a reference to an empty wxString, as GetFirstLine() already does
(although this is actually questionable -- what if this string is modified?).

See #17283.
2016-06-09 16:48:01 +02:00
Vadim Zeitlin
dd562649f0 Fix recently broken wxPickerBase::SetPickerCtrlGrowable()
Resetting growable flag didn't work correctly after the changes of
0d86c01b8b, fix this and reuse the same code for
both this function and SetTextCtrlGrowable().

See https://github.com/wxWidgets/wxWidgets/pull/296
2016-06-09 15:24:44 +02:00
Vadim Zeitlin
0d86c01b8b Deprecate wxPickerBase::GetDefaultXXXFlag() methods
They just seem completely useless, not documented and only used by wxPickerBase
itself internally. Replace the code using them with wxSizerFlags which is more
clear and also doesn't hard code the border sizes (especially in the case of
the picker control which doesn't even have borders in the first place) and
prepare for removing them later.
2016-06-08 02:51:53 +02:00
Vadim Zeitlin
7f603c959f Move wxPanel::HasTransparentBackground() to wxControlContainer
This MSW-specific hack is actually needed by all windows containing more than
one control, even if they don't derive from wxPanel (which is just the most
commonly used class for such windows), otherwise the parts of the window not
covered by the child controls won't have the correct appearance when the
window itself is inside a wxNotebook.

So do this for all classes inheriting from wxNavigationEnabled<>, notably this
fixes the wrong background for all kinds of picker controls (wxDirPickerCtrl,
wxFilePickerCtrl, ...) when they're used inside a wxNotebook.

After moving this method out of wxPanel, src/msw/panel.cpp became empty, so
also delete it and remove it from {bake,make,project} files.
2016-06-07 22:08:51 +02:00
Vadim Zeitlin
4dfde501df Add support for returning item location to wxGTK wxMimeTypesManager.
This is a squash merge of gtk_mimetype branch from
https://github.com/Hanmac/wxWidgets.git with some extra minor cleanup.

Closes https://github.com/wxWidgets/wxWidgets/pull/293
2016-06-07 14:29:52 +02:00
Vadim Zeitlin
5f01172165 Compilation fix for wxUSE_STATUSBAR==0 build
This should have been part of 152b9fc0eb.

Closes #17553.
2016-06-07 14:29:52 +02:00
Vadim Zeitlin
ed73e4f624 Merge branch 'uisim-xtest'
Make wxUIActionSimulator work with GTK+3, including when using DPI scaling.
2016-06-04 22:44:25 +02:00
Vadim Zeitlin
152b9fc0eb Fix sending of wxEVT_UPDATE_UI events when wxUSE_STATUSBAR==0
wxFrameBase code unintentionally excluded the function generating
wxUpdateUIEvents for the menus from compilation when wxUSE_STATUSBAR was
turned off.

Move OnMenuOpen() out of #if wxUSE_STATUSBAR section to ensure that it's
compiled whenever wxUSE_MENUS==1.

Closes #17553.
2016-06-04 21:59:36 +02:00
Vadim Zeitlin
690ca5a1b4 Merge branch 'scintilla366' of https://github.com/pkulchenko/wxWidgets
Update bundled Scintilla version to 3.6.6.
2016-06-04 19:47:49 +02:00
Vadim Zeitlin
4154fbb8a3 Add conversions between wxSecretValue and wxString
This is less secure, but more convenient, than using raw pointers and in most
cases the password will already be stored in a wxString anyhow.
2016-06-04 19:19:15 +02:00
Vadim Zeitlin
1de80a72d9 Refactor wxSecretValue creation
No real changes, just add a new platform-specific NewImpl() method instead of
making wxSecretValue ctor itself platform-specific.

This makes adding other ctors for this class simpler.
2016-06-04 18:46:23 +02:00
Vadim Zeitlin
675d9d779d Add wxSecretStore
Add a new class allowing to store passwords and other sensitive information
using the OS-provided facilities.

Add implementations for all the main platforms, documentation and a new sample
(which contains an ad hoc unit test as the real unit test for this class would
probably be a bad idea as it wouldn't run in non-interactive contexts and
could show OS level dialog boxes if it did).
2016-06-04 18:29:15 +02:00
Paul Kulchenko
36c5b5f9ca Updated Scintilla to add GetTargetTextRaw (closes #17426). 2016-05-31 23:06:51 -07:00
Paul Kulchenko
c03ce59b86 Upgrade Scintilla component to 3.6.6. 2016-05-31 22:19:10 -07:00
Vadim Zeitlin
78bfde8ac0 Fix link errors with older MinGW due to use of GetLayout()
This function is not present in older MinGW import libraries, up to at least
MinGW 4.8.1, so we can't use it directly as it was done in
22f0801378 and we need to load it dynamically.

This was already done in wxDC code, so just reuse the same wrapper function
after extracting it (and a few others, for consistency) into a new header.
2016-05-30 19:30:07 +02:00
Vadim Zeitlin
4a0938d2b7 Allow "moving" wxX11Display objects
This is not a real move-ctor but std::auto_ptr<>-like "stealing" ctor. It
still allows to pass Display ownership to another function which is all that
is needed for our purposes.
2016-05-23 03:00:49 +02:00
Vadim Zeitlin
cfc1681b4c Virtualize wxUIActionSimulator implementation
Extract platform-specific code in a wxUIActionSimulatorImpl-derived class
instead of keeping it in wxUIActionSimulator itself.

This will allow determining which implementation to use dynamically (i.e. at
run-time and not compile-time) to use later and already allows to get rid of
an __WXOSX__ #ifdef in common code.
2016-05-23 03:00:49 +02:00
Vadim Zeitlin
e82c619402 Only define wxUSE_XTEST in Unix-specific headers
This symbol is not needed and doesn't make sense in wxMSW.
2016-05-23 03:00:48 +02:00
Scott Talbert
a4716916b7 Add support for using the XTest extension in wxUIActionSimulator
Fixes wxUIActionSimulator under wxGTK3, see #17530.
2016-05-23 03:00:48 +02:00
Vadim Zeitlin
6a2a4ef38b Use "int" instead of "long" for TLW geometry storage
For some reason, "long" was used for window coordinates even though they're
really "int", and implicitly converting from the former to the latter resulted
in warnings in user code including this header with e.g. Apple clang.

Just use int to avoid conversions.
2016-05-15 20:23:01 +02:00
Benjamin Drung
bc41cbeb25 Define wxIsNaN() as std::isnan() in C++11 mode
std::isnan() is always available when using C++11, so just use it.

Also pout the test for C++11 implementations of both wxIsNaN() and wxFinite()
first, eventually the rest of the checks will become obsolete and will be
removed.

Closes https://github.com/wxWidgets/wxWidgets/pull/283
2016-05-14 00:13:47 +02:00
Vadim Zeitlin
a5d2f53f41 Inherit wxGauge from wxGaugeBase in wxGTK
Ensure the proper class hierarchy in wxGTK, this notably allows to override
SetValue() in classes derived from wxGauge, which didn't work in wxGTK (but
did in wxMSW and wxOSX) before.

Also remove the now unnecessary IsVertical().
2016-05-13 22:32:16 +02:00
Vadim Zeitlin
189e4c5024 Null-terminate arrays returned from wxCmdLineArgsArray
This is required for compatibility with the real argv array that this class is
supposed to emulate.

Closes #17531.
2016-05-13 15:40:22 +02:00
Eric Jensen
e7a526604c Implement auto complete in generic wxSearchCtrl
Just forward the relevant methods to the embedded wxTextCtrl.

Closes #17519.
2016-05-07 01:49:22 +02:00
Vadim Zeitlin
8677b7eb0a Move our own CFM_BACKCOLOR definition to src/msw/textctrl.cpp
It is only needed/used in this source file, no need to have it in the global
header.
2016-05-06 18:54:40 +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
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
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
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
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
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
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
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
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
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
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
Kevin B. McCarty
56aa94c61e Allow using wxDateTime::operator==() and !=() with invalid objects
Unlike the other operators, we comparing for equality has a well-defined
semantics even for invalid objects, so there doesn't seem any reason to not
allow it.
2016-04-12 20:50:09 +02:00
Kevin B. McCarty
fda904ea77 Implement wxDateTime::Is{EqualTo,{Earlier,Later}Than}() in terms of operators
Avoid duplicating the same code, even if it's trivial, in both places.

Notice that these functions are implemented in terms of operators and not vice
versa because we have no functions corresponding to operator<=() or
operator>=().
2016-04-12 20:45:15 +02:00
Kevin B. McCarty
d47efc42ff Remove redundant IsValid() checks from wxDateTime comparison methods
They're not necessary as GetValue() asserts when passed an invalid object
anyhow, there is no need to check for this twice.
2016-04-12 20:43:14 +02:00
orbitcowboy
e3f1423632 Fix typos in comments in C++ code
No real changes.

Closes https://github.com/wxWidgets/wxWidgets/pull/268
2016-04-12 17:15:23 +02:00
Vadim Zeitlin
bac5975b02 Merge branch 'rtl-fixes'
Fix appearance of wxNotebook children background when using RTL locales.
2016-04-10 20:51:33 +02:00
Vadim Zeitlin
eed5700a07 Refactor: remove wxNotebook::DoDrawBackground() in wxMSW
The code in QueryBgBitmap() and MSWPrintChild() is sufficiently different that
we can't easily reuse the drawing calls between them, so don't tie ourselves
in knots trying to do it, just duplicating these 2 calls in the 2 functions is
not that bad and the code is more clear.

No real changes.
2016-04-10 20:49:36 +02:00
Vadim Zeitlin
5368c72d37 Fix wxMSW build with wxUSE_DEFERRED_SIZING==0
Don't define BeginRepositioningChildren() and EndRepositioningChildren() at
all in this case instead of defining them as "do nothing" functions because
BeginRepositioningChildren() still needs to return a bool, so the old code
didn't compile and we would need to add another "#else" to fix this -- instead
make it simpler by just not compiling at all in this case.
2016-04-08 22:22:22 +02:00