It was impossible to show the hint for the initially focused child of a dialog
before, as the hint was hidden from the very beginning. By showing it always
we avoid this problem.
We may want to add an option/flag for SetHint() to make this configurable
later if somebody really needs to show hints only for as long as the control
doesn't have focus.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62986 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Minor correction to changes in r62971: we still need to hook WM_ERASEBKGND in
toolbar parent when painting the toolbar itself even when there are no dummy
separators in it (and so we don't need to paint them over). Without this, the
background of simple toolbars without controls was not erased correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62980 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Creating timers with 0 id failed because Windows SetTimer() function requires
a non-zero id. Fix this by using a (impossible at wx API level) -1 id value in
this case instead.
Closes#11392.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Handling erase background events for toolbars never worked for the ports other
than wxMSW and now it doesn't work for MSW neither as we need to skip erasing
the background in WM_ERASEBKGND handler to avoid flicker which would result
from erasing the background twice, from there and from WM_PAINT handler which
must do it. So don't even try to test if it works, it's unlikely to be very
useful anyhow.
This reverts the change to this file in r62805.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62972 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Do use TBSTYLE_FLAT and TBSTYLE_TRANSPARENT (the former actually implies the
latter) for MSW toolbar as it is the only way to avoid the flicker of toolbar
buttons. These styles were disabled before because of lack of understanding
about how they worked: with them, the toolbar supposes that its parent takes
care of erasing its background but wx didn't do this (in fact wxFrame did
accidentally erase toolbar background because of the use of Win32 client
rectangle, including tool/status bars, instead of wx client rectangle,
excluding them, in wxWindowMSW::DoEraseBackground(), but it didn't do it
correctly).
Now we allow hooking WM_ERASEBKGND events processing in a parent window by a
child one and use this to handle toolbar background erasing in toolbar itself.
We still prevent the native toolbar from drawing dummy separators and always
erase the area occupied by them ourselves and thus avoid the flicker entirely.
The only remaining flicker in the toolbar sample is that of embedded
wxStaticText control. It does appear with correctly transparent background and
bitmaps with alpha channel also (still) are drawn correctly in wxStaticBitmaps
embedded in the toolbar.
Finally, we still use solid background brush for toolbar but we can easily use
a themed background if really desired, there is just a single function to
change to do it (MSWGetToolbarBgBrush()).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62971 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
If a button was initially created with an empty label (but without image
neither), its best size was computed and cached as being null. Correct this by
giving the button the default size instead, as expected.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62970 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The public header for this class is wx/spinctrl.h, but it was documented in
wx/generic/spinctrg.h which didn't even correspond to an existing real header
file (which is called spinctlg.h). Move the documentation to wx/spinctrl.h and
remove the old file.
Closes#11548.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Correct the calculation of the indent for the columns following the expander
and the calculation of the position of the expander itself.
See #11558.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62942 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The checkbox should be always shown in its normal size, otherwise it looks
strange. And this also fixes the overflow of the checkbox in the next column
which happened if the size passed to Render() had negative width before.
See #11558.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62940 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Since r57627 wxStaticText objects with wxST_NO_AUTORESIZE flag created with
wxDefaultSize were created with zero width. This accounted for the
disappearance of the labels for the toolbar controls (as could be seen in the
toolbar sample where the combobox label was not shown any more).
Fix this by explicitly setting the correct initial size after the correct
label is set.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Prevent the native toolbar from drawing the separators which we use simply as
placeholders by excluding them from the update region when handling WM_PAINT.
This reduces flicker by not redrawing the areas occupied by these separators
twice and also prevents them from ever being shown (you could see them briefly
appear before being erased before).
The other toolbar tools still flicker though, there doesn't seem to be any
simple way to prevent the control from entirely invalidating itself whenever
it is resized.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62934 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This is unnecessary and results in flicker when the control is resized because
we explicitly erase its background ourselves and then it does it itself.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62933 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Pass wxWindow instead of HWND to it as in most cases we already have wxWindow
for the HWND we have and calling wxFindWinFromHandle() once more is
unnecessary.
This also makes the code of MSWGetBgBrushForChild() slightly simpler.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62932 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Native toolbars don't have themed background under Vista/7 and don't look good
with rebar background (which is the same one as used for the menus) as
toolbars don't appear on the top of the window.
Erasing background ourselves also results in flicker and display problems and
makes the code much more complicated. Simply don't do this to avoid all the
problems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62931 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
A micro-optimization: avoid ::GetTextMetrics() call if we don't use its
results (as is the case if neither descent nor external leading were
requested).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62926 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calling SymInitialize() second and subsequent times failed (and hence so did
wxStackWalker::WalkFrom() and other methods) as we didn't call SymCleanup()
because of some problems with old versions of debughlp.dll. These problems
don't seem to exist any more so do call SymCleanup() so that we can walk the
stack more than once.
Closes#11544.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
The call to SetBrush() was mistakenly removed in r62850 but it is needed
because wxClientDC only inherits background colour but not the brush used by
DrawRectangle() call in wxToolBar::MSWEraseRect(), so the wrong colour was
used under systems < Vista.
Restore this call now.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62922 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This function was implemented in terms of GetWeekOfYear() which made it tricky
to get it right as GetWeekOfYear() can, correctly, return week number for the
previous year for the first days of January (and also from the next one for
the last days of December).
Replace this implementation with a simple one directly counting the number of
weeks since the first of the month, this seems to be much simpler and does
pass the new unit test case which the old version failed.
Also make the unit test failures more informative by using
WX_ASSERT_EQUAL_MESSAGE() instead of CPPUNIT_ASSERT_EQUAL().
See #11561.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62916 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Test using 'Ctrl-A', just 'A' and 'Esc' as accelerators as all of them except
the first one were reported not to work in some cases.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62914 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Not using FVIRTKEY results in problems in non-US keyboard layouts and, in
fact, we were already always using it because wxCharCodeWXToMSW() returned
true in its output IsVirtual argument most of the time.
Just do it always now and also remove IsVirtual parameter with badly (if at
all...) defined meaning from wxCharCodeWXToMSW() as it's not used anywhere any
longer.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62913 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775