Commit Graph

61860 Commits

Author SHA1 Message Date
JulianSmart
c7d91d28a9 When collecting common attributes, reset attributes in target that are absent in source 2016-07-07 15:27:08 +01:00
Vadim Zeitlin
4c0e272589 Don't pass parameters to wxSizerXmlHandler::GetGB{Pos,Span}()
This doesn't make sense, these functions can only be ever used with a single
parameter ("cellpos" for the former and "cellspan" for the latter), so just
hard-code it inside the functions themselves.

No real changes, just make the code less confusing.
2016-07-06 18:51:10 +02:00
Vadim Zeitlin
50c16da687 Remove invalid "option" elements from XRC sample file
<option> can't be used for wxFlexGridSizer items, remove all these tags to
allow the file to validate against the XRC schema.
2016-07-06 18:48:35 +02:00
Vadim Zeitlin
f68c67aa85 Use "pair of ints" type for wxGridBagSizer size and position in XRC
Introduce a new type for XRC values imaginatively called just "pair of
integers" which can be used for values not expressed in pixels and hence for
which it doesn't make sense to use dialog units nor to scale them by the DPI.

Use this new type for wxGridBagSizer position and span elements to prevent
them from being changed when using higher than normal DPI.

Closes #17592.
2016-07-06 18:44:07 +02:00
Vadim Zeitlin
c4d2ba1335 Fix a typo in wxRadioBox XRC format documentation
s/ratio/radio/
2016-07-06 18:26:54 +02:00
JulianSmart
ab1ffb0c7c Removed @true typo from code 2016-07-06 13:35:28 +01:00
phallobst
9ae41a0f00 Update position correctly in wxGTK insert-text signal handler
"position" argument is input/output and must point after the newly inserted
text on return, but we didn't do it when handling the insertion specially.

Closes #17591.
2016-07-05 23:45:57 +02:00
pb101
105bd96319 Add missing "const" to wxGridCellEditor::PaintBackground() documentation
Closes #17589.
2016-07-05 23:37:26 +02:00
Artur Wieczorek
2d096311c5 Fixed clipping box tests for Direct2D
Flushing native Direct2D renderer (invoking wxGCDC::Flush() -> wxGraphicsContext::Flush() -> ID2D1RenderTarget::Flush()) is apparently not enough to update underlying DC (with selected in bitmap) and therefore we have to destroy the renderer (which in turn invokes ID2D1RenderTarget::EndDraw()) to do so.
2016-07-05 21:58:48 +02:00
Artur Wieczorek
832db47346 Fixed layer management in Direct2D renderer.
ID2D1RenderTarget::PushAxisAlignedClip/PopAxisAlignedClip used to clip the region (with wxGraphicsRenderer::Clip) and ID2D1RenderTarget::PushLayer/PopLayer used to rendering to the transparent layer (with wxGraphicsRenderer::BeginLayer) are non independent but have to be used in the controlled sequences: "A PushAxisAlignedClip and PopAxisAlignedClip pair can occur around or within a PushLayer and PopLayer, but cannot overlap" (and of course finally each Push* call must have a matching Pop* call).
To control the sequence of access to the AxisAlignedClips and Layers there is implemented a wxStack data member holding Clips/Layers parameters which reflects a physical stack of respective Clips/Layers in ID2D1RenderTarget. This way we know in which order to pop and what to pop from ID2D1RenderTarget stack if there is a need to do so.

Closes #17590
2016-07-05 21:58:34 +02:00
Artur Wieczorek
6b7ae05e3f Fixed updating clipping box parameters prior to retrieving the box (MSW).
Empty clipping region doesn't mean that there is no clipping.
2016-07-03 22:40:12 +02:00
Artur Wieczorek
8615921f42 Fixed retrieving clipping box parameters when there is no clipping region set.
When there is no clipping region currently set then current effective clipping region is identical with entire DC surface and therefore DC size should be returned as a region size.

Closes #17013
2016-07-03 22:39:48 +02:00
Artur Wieczorek
0b8975ac18 Properly reset internal data when destroying clipping region (wxGCDC).
Call ResetClipping() function in wxGCDCImpl::DestroyClippingRegion() to be sure that all internal clipping data are reset properly.
2016-07-03 22:39:26 +02:00
Artur Wieczorek
d50f331a99 Fixed calculation of clipping box with negative size (wxGCDC).
Graphics renderers accept negative clipping box size but for internal calculations done in wxDCImpl::DoSetClippingRegion() we need to have a box defined by (x,y) at top-left corner and having non-negative size so we need to recalculate parameters if necessary.
2016-07-03 22:39:25 +02:00
Artur Wieczorek
dafd0f217b Fixed setting clipping box.
While setting a clipping box there is necessary to intersect it either with current clipping region location if such region exists or with wxDC surface extents if no clipping region is set. This way effective clipping box will be always inside the wxDC surface.
Note: Effective clipping box can be an empty region.

See #17013
2016-07-03 22:39:23 +02:00
Artur Wieczorek
8b07bd1e27 Fixed setting clipping box for wxDC (MSW).
Because CreateRectRgn() Win API requires that (x1,y1) parameters represent the top-left corner of the clipping box so if a box with negative values of the width or height is passed to wxMSWDCImpl::DoSetClippingRegion() (what means that (x,y) doesn't represent top-left corner) we need to recalculate passed parameters to get the box with (x,y) at top-left corner.
2016-07-03 22:39:21 +02:00
Vadim Zeitlin
94d93bc53c Describe "d" suffix in XRC more clearly
Document that it has to be specified only at the end, not after each
component.
2016-07-03 14:40:21 +02:00
Vadim Zeitlin
2543c336b0 Revert "Fix invisible captions in high contrast mode"
This reverts commit 71dfb3b414 which fixed
appearance of the captions in high contrast mode but broke them for wxGTK.

Ideal would be to make this code work in wxGTK too or, in the worst, case only
use this code for wxMSW, but for now at least avoid breaking wxGTK appearance
by default.

See #16186.
2016-07-03 14:38:36 +02:00
Artur Wieczorek
e953447ae9 Include GDI+ and Direct2D clipping box test cases only for MSW build. 2016-07-03 10:40:02 +02:00
Artur Wieczorek
7968f37883 Updated documentation of some wxPropertyGrid-related classes.
Updated wxPropertyGridPageState, wxPropertyGridHitTestResult, wxPropertyGridIterator,  documentation.
2016-07-02 23:20:11 +02:00
Artur Wieczorek
4d91d6d2ff Enhance clipping box test cases
1. Added checking if actual drawing output is really clipped at the edge of the clipping box.
2. Added tests for wxGCDC with GDI+, Direct2D, Cairo renderers under wxMSW.
3. Added new test to check calculations for bounding box set entirely outside DC area.
2016-07-02 23:14:37 +02:00
Iwbnwif Yiw
015ffbb0ef Make background of book controls in wxMSW be the same as parent
This improves their appearance especially when they're used as children of
wxNotebook, which uses a different background colour than plain wxPanel by
default.

This generalizes what was already done for wxChoicebook in 6cab632f
(see #12503) to all book controls.

Closes #16878.
2016-07-02 15:04:19 +02:00
Danny Scott
059704edc1 Update instructions for producing official MSW binaries
Simplify the officialbuild.bat script by only checking for "vcXX" instead of
accepting both them and "vsYYYY".

Also add instructions for using it in the corresponding HOWTO.

Closes #17514.
2016-07-02 14:54:16 +02:00
Vadim Zeitlin
ebb3a791b9 Revert using an event object for waking up event loop in wxMSW
This reverts 6c40531fb7 ("Make main thread wake
up code more efficient and less error-prone in wxMSW") as, while being more
efficient, the new code doesn't work at all when we're not running the message
loop ourselves as it happens when the user opens a menu or starts resizing a
window because in both cases Windows runs a local message loop dispatching the
messages itself and this message loop doesn't react to our event object being
signalled.

So this approach can't work and needs to be reverted, even if it reintroduces
the danger of overflowing the message queue (see #9053).

Closes #17579.
2016-07-02 14:49:15 +02:00
mirh
26a58e9d48 Don't use thread-safe statics with MSVS when targeting XP
Disable thread-safe initialization for static local variables in Visual Studio
2015 when XP toolset is used as this results in crashes when using DLLs under
XP, see #13116.

Closes #17403.
2016-07-02 14:30:42 +02:00
Vadim Zeitlin
f9df538788 Make empty list boxes narrower by default in wxMSW
Allocating 100px (+ margins) for empty listboxes in wxMSW resulted in a
surprising behaviour when the best size of a listbox became (significantly)
smaller after adding some items to it.

One possible solution could be to ensure that all listboxes are at least as
wide as empty ones, but it seems wrong to insist on always allocating 100+ px
when a listbox could be much narrower.

So try to mitigate the problem by making the empty listboxes narrower by
default which should reduce the chance of them becoming narrower still after
appending some items to them, even if it doesn't completely eliminate it.

Also, as a side effect, this commit replaces non-font-and-DPI-dependent
hard-coded 100px value with a more reasonable value based on text metrics.
2016-07-01 20:37:19 +02:00
JulianSmart
3d4da0ceeb Fix for clipped 16x16 bitmap buttons 2016-07-01 15:37:32 +01:00
JulianSmart
3d8f9517f3 Compare window size size with scaled buffer size 2016-07-01 11:36:30 +01:00
JulianSmart
511923a974 Scaled bitmap and selection click fixes 2016-06-30 20:16:43 +01:00
Vadim Zeitlin
ffcdcc1617 Make wxTimeSpan::operator-() const
Due to an oversight, it wasn't declared as const, making it impossible to
subtract from a const wxTimeSpan object.

Fix this and add a unit test verifying that this compiles and works as
expected.

Closes #17583.
2016-06-30 19:09:04 +02:00
Artur Wieczorek
9bf97bd607 Use wxMemoryDC with selected wxBitmap to create wxGraphicsContext in the graphics test.
If there is no wxBitmap selected into wxMemoryDC which is passed to wxGraphicsContext then there is raised an assertion warning (harmless in this context but caught and reported by CppUnit). To suppress this message we need to select any bitmap into wxMemoryDC prior to creating a wxGraphicsContext.
2016-06-29 21:01:53 +02:00
Artur Wieczorek
eb7a9f85c5 Added new tests to check clipping box calculations for wxDC and wxGCDC.
See #17013
2016-06-29 21:01:36 +02:00
Vadim Zeitlin
68d235fed3 Output test name before GTK error messages in the test suite
Try to make it possible to understand where exactly do the GTK+ errors
appearing in the buildbot slaves output originate from by installing a custom
Glib log handler and prefixing the normal log messages with the name of the
test running when they're generated.

This required a small refactoring of DetailListener which is now always
installed, in order to always have access to the current test name, but still
needs to be explicitly enabled to produce output.
2016-06-29 18:49:47 +02:00
Vadim Zeitlin
8686ca62e7 Avoid asserts when destroying windows with mouse capture in tests
Destroying a window with mouse capture results in an assert, which is
translated into an exception when running the test suite. As this exception is
thrown from wxWindowBase dtor, it results in an immediate program termination
when using C++11 and can also have the same effect even when using C++98 if
this exception is thrown while already handling another exception due to a
test failure.

Try to avoid this by using a "safe" DeleteTestWindow() function instead of
deleting the window directly. Currently this function ensures that the window
doesn't have mouse capture before deleting it, but it could also be used to
check for other things later. Also, this commit only uses this function for
the two controls which do happen to be destroyed with mouse capture currently
(at least when using wxGTK), but it should probably be generalized to all
controls in the future.
2016-06-29 18:26:11 +02:00
Vadim Zeitlin
dae164b8aa Return correct main window from wxListHeaderWindow
wxListHeaderWindow is part of the composite wxGenericListCtrl, so override
GetMainWindowOfCompositeControl() in it to indicate this relationship.
2016-06-29 18:20:55 +02:00
Vadim Zeitlin
8bb4495d95 Remove mouse capture assert from wxGTK wxWindow dtor
This assert was redundant as a similar check is done in the base class dtor.
And while usually this assert is just annoying, instead of being helpful, when
running the unit test suite which installs a custom assert handler throwing an
exception, it is actively harmful as generating 2 asserts during the
destruction of a window with mouse capture results in immediate termination
(even in C++98 mode, unfortunately the whole idea of throwing from dtor is
probably unsalvageable anyhow when using C++11).
2016-06-29 17:55:17 +02:00
Vadim Zeitlin
a7d82aa776 Turn off optimizations for all gcc versions in hash unit tests
Optimizations were turned off for g++ 4.8 to work around compiler bug
resulting in generating infinite loops for the code in this function in
052e598d09, but apparently other versions of g++
suffer from it as well, so just always turn them off until we can be sure
about the version of the compiler in which this bug was really fixed.
2016-06-29 15:43:01 +02:00
Vadim Zeitlin
83489d6ca1 Fix PCH-less build after the previous commit
Include wx/textctrl.h to get wxTE_PASSWORD definition.
2016-06-28 15:38:49 +02:00
Vadim Zeitlin
3dc54df247 Ignore hints on wxTE_PASSWORD controls when not supported natively
There is no way to show the hint without native support in a control with
wxTE_PASSWORD style, so simply ignore them completely in this case.

Closes #17078.
2016-06-28 14:40:52 +02:00
Vadim Zeitlin
967bdbf994 Use equally-sized buttons in wxMSW horizontal toolbars
Only use TBSTYLE_AUTOSIZE, adjusting each button to the size it really needs,
for the toolbars with wxTB_HORZ_LAYOUT style as they don't have any uniform
button size anyhow.
2016-06-26 18:51:50 +02:00
Vadim Zeitlin
98bb2b265a Merge branch 'strip-cjk-mnemonics'
Strip mnemonics correctly from the translations including them in parentheses
after the translated menu text, as is apparently common when using CJK.

Closes #16736.
2016-06-26 18:37:50 +02:00
Vadim Zeitlin
68b2e06f70 Improve translated mnemonics unit test
Don't switch locale to Japanese, which might not be supported, but just use
wxTranslations directly because we only need translations, not full locale
support.

Also rename the test method to a more descriptive name.
2016-06-26 18:36:14 +02:00
David Hart
13068d3603 Strip mnemonics from CJK translations of menu items too
Chinese, Japanese etc translations use a special style for the menu mnemonics
and append them to the translated menu label in brackets, e.g. the menu label
could have the form of "<translation-of-file> (&F)".

Check for this style of mnemonics in wxStripMenuCodes() too and strip them as
well.
2016-06-26 18:36:11 +02:00
Vadim Zeitlin
423ad59b00 Replace AddCatalog() overload with defaulted argument
There is no need to have 2 overloads of this function when we could have just
a single one with a default parameter value.
2016-06-26 18:30:32 +02:00
Artur Wieczorek
8d87ebfe47 Updated wxGraphicsContext and wxGraphicsRenderer documentation.
Added some notes regarding Direct2D and Cairo renderers to reflect latest changes.

Closes #17575
2016-06-25 18:20:24 +02:00
Artur Wieczorek
2ea7ff3160 Updated documentation for wxPropertyGridInterface.
Updated documentation and removed doxygen-style comments from propgridiface.h header file.
2016-06-25 18:17:57 +02:00
Vadim Zeitlin
bbe0ba46e2 Fix heading of transformation matrix section in wxDC docs
The first word of the section title was misinterpreted as an anchor, add a
real anchor to prevent this from happening.
2016-06-24 23:10:56 +02:00
Vadim Zeitlin
fe1e8e46c3 Fix the documented type of wxSecretValue ctor from string
It should be wxString, not wxSecretValue.
2016-06-24 14:21:46 +02:00
Vadim Zeitlin
aa84e6379a Document wxDateTime::GetValue()
It was referred to in GetTicks() description but not documented itself, add it
now.
2016-06-24 14:20:34 +02:00
Artur Wieczorek
47791737db Revert code commented out by mistake in f06bfe37.
We need to restore HDC after Cairo operations.
2016-06-23 22:23:05 +02:00