Vadim Zeitlin [Sun, 10 Feb 2013 16:13:53 +0000 (16:13 +0000)]
Erase the entire virtual area of the window in the erase sample.
Just clearing the DC is not enough when the window is scrolled, so clear the
entire virtual area. We should be able to optimize it by clearing just the
rectangle currently scrolled into view but this is at least correct, i.e.
doesn't result in corrupted display, even if it's suboptimal.
Vadim Zeitlin [Sun, 10 Feb 2013 16:13:50 +0000 (16:13 +0000)]
Compilation fix for !wxHAS_MSW_BACKGROUND_ERASE_HOOK case.
This doesn't actually change anything as wxHAS_MSW_BACKGROUND_ERASE_HOOK is
always defined, except under WinCE where this file is not used anyhow, but do
test it here for completeness.
Vadim Zeitlin [Sun, 10 Feb 2013 16:13:46 +0000 (16:13 +0000)]
Create wxCURSOR_RIGHT_ARROW on the fly from normal arrow cursor under MSW.
This allows to avoid having another cursor resource and also makes this cursor
nicer as rightarr.cur looks rather out of place under modern Windows systems.
Vadim Zeitlin [Sat, 9 Feb 2013 11:11:53 +0000 (11:11 +0000)]
Don't call ::GetLayout() in wxMSW code directly.
Use wxMSW::GetLayout() wrapper to avoid directly binding to a function not
present in old Windows versions and also to fix linking errors with MinGW
after the changes of r73484.
Vadim Zeitlin [Sat, 9 Feb 2013 00:36:02 +0000 (00:36 +0000)]
Fix infinite loop in wxGrid::PosToEdgeOfLine().
Return -1 from wxGridRowOperations::GetLineBefore(0) to ensure that we exit
the loop in wxGrid::PosToEdgeOfLine(). Doing this is the logical thing to do
as wxGridColumnOperations::GetLineBefore() already behaved like this and this
was is more expected than returning 0, as the function previously did for some
reason.
Vadim Zeitlin [Sat, 9 Feb 2013 00:35:58 +0000 (00:35 +0000)]
Fix pulsing of bitmaps in focused buttons under Windows 7.
It turns out that the actual bitmap shown in this case varies between the
bitmaps at PBS_DEFAULTED and PBS_STYLUSHOT, so that it's invisible half of the
time if we don't specify the value for the latter. Do it now to fix unwanted
pulsing of the bitmap in the focused button.
Vadim Zeitlin [Sat, 9 Feb 2013 00:35:54 +0000 (00:35 +0000)]
Refresh wxMSW wxStaticBitmap when its size changes.
As MSW native control centers the image, it must be entirely redrawn when the
area in which the image is centered changes, but it doesn't happen by default,
so do it ourselves explicitly.
Also explain that this centering behaviour is platform-specific and shouldn't
be relied upon.
Vadim Zeitlin [Sat, 9 Feb 2013 00:35:49 +0000 (00:35 +0000)]
Fix drawing of bitmaps with masks in mirrored wxDC.
The mask must be mirrored in the same way as the main bitmap itself (currently
it's not mirrored at all but this could change in the future), so create the
temporary memory HDC with the same layout as is used by the main HDC.
Vadim Zeitlin [Sat, 9 Feb 2013 00:35:46 +0000 (00:35 +0000)]
Don't include the manifest in wx/msw/wx.rc by default for MSVC compiler.
The later versions of this compiler don't need it any more, so make it easier
to set up the projects for them at the expense of MSVC 6 and 7 users who will
now need to explicitly define wxUSE_RC_MANIFEST=1 and predefine the
architecture macro (or setup their resource compiler include path to get
wx/msw/rcdefs.h under the lib directory but predefining the architecture is
clearly simpler).
Do generate manifest when using gcc as it predefines the architecture macros
allowing us to avoid requiring using the generated rcdefs.h.
The other compilers will be dealt with as needed if anybody is still using
them.
Vadim Zeitlin [Wed, 6 Feb 2013 12:48:12 +0000 (12:48 +0000)]
Don't recurse into top level children when validating recursively.
Even with wxWS_EX_VALIDATE_RECURSIVELY flag, we should never validate the top
level children (e.g. dialogs) when validating the parent window. This is never
useful and can be completely unexpected.
Vadim Zeitlin [Wed, 6 Feb 2013 12:48:09 +0000 (12:48 +0000)]
Refactor children traversal in wxWindow::TransferData{To,From}Window().
No real changes, just factor out the logic for children traversal into a
helper template class and reuse it in Validate() and both TransferData()
methods to avoid triplicating it.
Vadim Zeitlin [Tue, 5 Feb 2013 20:47:02 +0000 (20:47 +0000)]
Add benchmarks for wxImage and raw bitmap access to the graphics test.
Compare the speed of drawing the bitmaps by synthesizing wxImage and
converting it to wxBitmap and directly modifying wxBitmap bits using raw
bitmap access.
Vadim Zeitlin [Tue, 5 Feb 2013 20:46:55 +0000 (20:46 +0000)]
Run wxClientDC and wxMemoryDC tests too in the graphics benchmark.
These tests were not run because OnPaint() handler was called before OnCreate()
and exited the main loop before the create event could be dispatched. Fix this
by just running everything from OnPaint(), like this we're sure to do it.
Also refactor the code a little to avoid duplicating the tests.
Vadim Zeitlin [Tue, 5 Feb 2013 20:46:26 +0000 (20:46 +0000)]
Ignore empty LC_XXX variables in locale detection code.
If LC_ALL or LC_MESSAGES is set but empty, ignore it and use the next
environment variable. This is consistent with the standard setlocale()
behaviour which only uses LC_ALL if it is set and not empty.
Vadim Zeitlin [Tue, 5 Feb 2013 20:46:10 +0000 (20:46 +0000)]
Only impose minimal height for buttons with non-empty label in wxMSW.
wxBU_EXACTFIT in wxMSW only affected the width of the button but not its
height, which was still made as big as the standard button size as otherwise
the button text was rendered badly. However there is no reason to do this for
the buttons without any text, so let wxBU_EXACTFIT be really exact, in both
directions, in this case.
Also document this rather non obvious wxBU_EXACTFIT behaviour.
Vadim Zeitlin [Tue, 5 Feb 2013 20:46:06 +0000 (20:46 +0000)]
Really fix resizing of wxGird column/rows after a hidden one.
The previous fix (r73399) broke resizing from the side of the preceding grid
line, restore the old code and just add a loop finding the first visible line
before the one being clicked.
Julian Smart [Mon, 4 Feb 2013 12:52:14 +0000 (12:52 +0000)]
Added support for sub-object virtual attributes (temporary attributes for characters within objects)
and also virtual text that can replace the actual text.
Vadim Zeitlin [Sun, 20 Jan 2013 22:39:34 +0000 (22:39 +0000)]
A fix for VC6 compilation: define missing priority constants.
{ABOVE,BELOW}_NORMAL_PRIORITY_CLASS aren ot defined in VC6 headers, see
http://buildbot.tt-solutions.com/wx/builders/XPSP2%20VC6%20wxMSW%20trunk%20release/builds/2943/steps/compile/logs/stdio
so define them ourselves.
Vadim Zeitlin [Sun, 20 Jan 2013 12:53:22 +0000 (12:53 +0000)]
Improve appearance of text with background colour in wxHTML.
Use wxHTML_CLR_TRANSPARENT_BACKGROUND instead of wxHTML_CLR_BACKGROUND for the
bgcolor attribute of the body tag to prevent clipping of the text cells by the
next cell with opaque background.
Vadim Zeitlin [Sun, 20 Jan 2013 12:45:52 +0000 (12:45 +0000)]
Fix wxKeyEvent::GetPosition() after the changes of r72207.
Now that the position of wxKeyEvent is initialized on demand, don't use m_x
and m_y fields directly but always use GetX() and GetY().
Also improve GetPosition() documentation slightly and mention only the new
version, taking wxCoord, in it as the old one, taking long, is provided for
compatiblity only.
Vadim Zeitlin [Sun, 20 Jan 2013 02:09:56 +0000 (02:09 +0000)]
Fix appearance of multiline wxCheckBox with non-standard colours in wxMSW.
Owner-drawn checkbox (which is used when wxCheckBox colour is changed) didn't
center its label correctly and didn't right align it when using wxALIGN_RIGHT
style in focused state.
Vadim Zeitlin [Sun, 20 Jan 2013 02:09:48 +0000 (02:09 +0000)]
Fix wxDateTime::GetWeekOfYear() for the days in the last week of the year.
The code took into account the possibility that the days in the beginning of
the year might belong to the last week of the previous year but not that the
days at the end of the year could belong to the first week of the next year.
Vadim Zeitlin [Sun, 20 Jan 2013 02:09:44 +0000 (02:09 +0000)]
Fix wxSearchCtrl::HasFocus() in the generic version.
Override GetMainWindowOfCompositeControl() in the windows composing the
generic wxSearchCtrl to ensure that HasFocus() correctly returns true for the
entire control when any of them has focus.
Add a trivial unit test to check that this really works and facilitate adding
more tests for this class later.
Vadim Zeitlin [Sun, 20 Jan 2013 02:09:35 +0000 (02:09 +0000)]
Fix bug with showing hidden wxGrid lines when resizing an adjacent one.
Don't blindly assume that the previous line is big enough if the current one
isn't in wxGrid::PosToEdgeOfLine() (this assumption is wrong even without
taking hiding into account...).
Vadim Zeitlin [Sun, 20 Jan 2013 02:09:14 +0000 (02:09 +0000)]
Fix setting initial wxSpinCtrl value outside 0..100 range in wxMSW.
Set the range before setting the initial value when creating wxSpinCtrl, as
otherwise the value was wrongly limited to the default 0..100 range instead of
the one really specified.
Vadim Zeitlin [Sun, 20 Jan 2013 02:08:51 +0000 (02:08 +0000)]
Fix bug with dragging non-draggable columns in wxMSW wxHeaderCtrl.
Properly ignore HDN_BEGINDRAG events for the columns without wxCOL_REORDERABLE
flag. This fixes dragging non-draggable columns in wxDataViewCtrl under MSW.
Steve Lamerton [Sun, 13 Jan 2013 19:22:24 +0000 (19:22 +0000)]
Allow registering of custom wxWebView backends.
Add wxWebViewFactory as an abstract factory to provide backend creation. Remove old factory methods using wxWebViewBackend enum in favour of the new wxString based method.