Commit Graph

50178 Commits

Author SHA1 Message Date
Kevin Ollivier
1665389a9a Remove the native toolbar from the frame in Destroy() rather than the destructor, as removing it in the destructor causes resize / repaint events to fire on the native control, which then goes to wx controls being deleted.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62988 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 20:43:43 +00:00
Kevin Ollivier
849754a451 Use NSTrackingArea when available (building for 10.5+) so that we can get mouse moved events for inactive / non-focused windows too.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62987 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 20:40:05 +00:00
Vadim Zeitlin
7591b0bb53 Always show hint in text entries, even when they have focus.
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
2009-12-25 11:36:54 +00:00
Stefan Csomor
0aaa6ace7e removing event handlers on non-owned windows when the destroy event is sent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62985 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 09:47:30 +00:00
Jaakko Salli
22a2e3fa6b Refactored a very confusing condition in wxPGComboBox item paint code
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62984 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 09:18:04 +00:00
Jaakko Salli
5f54075053 Added wxComboCtrlBase::SetFore/BackgroundColour()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 09:04:53 +00:00
Stefan Csomor
03ef5fefb8 fixing parameter names
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62982 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 08:39:11 +00:00
Jaakko Salli
f8e4413e5e Added documentation for wxPGEditor::SetControlAppearance()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62981 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-25 08:33:56 +00:00
Vadim Zeitlin
f3d0bc4364 Erase toolbar background even if it doesn't contain any controls/spaces.
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
2009-12-23 21:42:06 +00:00
Vadim Zeitlin
fe0c328904 Don't pass 0 timer ids to ::SetTimer().
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
2009-12-23 13:56:55 +00:00
Michael Wetherell
224d978ffb Add support for large stdio files for VC 8+. What versions of the other Windows
compilers?


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-22 21:22:59 +00:00
Jaakko Salli
3e6d8c3118 Added wxPropertyGrid::SetUnspecifiedValueAppearance(); Added wxPGEditor::SetControlAppearance() for applying wxPGCell attributes on a property editor.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62973 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-22 16:12:02 +00:00
Vadim Zeitlin
69bc65e3f8 Remove the test of erase background events from the toolbar sample.
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
2009-12-22 15:37:49 +00:00
Vadim Zeitlin
bec9bf3e20 Finally really correct background erasing for wxMSW wxToolBar.
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
2009-12-22 15:37:43 +00:00
Vadim Zeitlin
4b601a59b5 Fix best size computation for buttons without image and with empty label.
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
2009-12-22 15:37:37 +00:00
Jaakko Salli
2ec335db78 Added wxMSW wxChoice::GetClassDefaultAttributes(), initially used in wxComboCtrl
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62960 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-21 15:20:37 +00:00
Francesco Montorsi
163bd4f700 fix miscellaneous Doxygen 1.6.1 warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62958 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-20 15:07:08 +00:00
Francesco Montorsi
69aa257b83 fix a few doxygen warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62957 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-20 14:50:50 +00:00
Francesco Montorsi
7145bcfc47 add a detailed description to wxMenuItem::SetItemLabel() partially moving docs from wxMenu::Append; add usage examples; organize wxMenuItem functions in 3 sections (getters, setters, checkers) to make it easier to browse the docs; use @onlyfor tag where necessary instead of the (Windows only) text
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62956 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-20 14:24:42 +00:00
Jaakko Salli
68174df30e Added wxPropertyGrid::GetUnspecifiedValueText(). Use it instead of assuming that the unspecified value text is always an empty string.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62955 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-20 12:48:41 +00:00
Jaakko Salli
0871417690 Added some missing SetupTextCtrlValue() calls
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62954 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-20 12:31:24 +00:00
Jaakko Salli
b9de6a2187 Suppress 'unused argument' warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62948 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 15:07:52 +00:00
Jaakko Salli
a5b1be33b7 Added wxWindowMSW::MSWGetThemeColour(); initially use it in wxComboCtrl::OnThemeChange()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62947 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 14:47:37 +00:00
Jaakko Salli
bc0f253462 Properly notify active editor control when it receives the focus.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62946 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 12:08:00 +00:00
Vadim Zeitlin
42427d8950 Document wxSpinCtrlDouble in correct header file.
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
2009-12-19 12:00:16 +00:00
Vadim Zeitlin
16e40259d6 Document wxSizerItem::Assign{Window,Sizer,Spacer}() methods.
Also explain why SetSpacer() and SetSizer() are deprecated.

Closes #11555.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62944 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 12:00:04 +00:00
Vadim Zeitlin
b5123fb66f Document wxDV_NO_HEADER style.
Closes #11559.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62943 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 11:59:55 +00:00
Vadim Zeitlin
b10c408980 Corrections to expander position calculations and drawing in generic wxDVC.
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
2009-12-19 11:17:49 +00:00
Vadim Zeitlin
e3dbeaaf31 Correct selection/drop highlight rectangles width in generic wxDataViewCtrl.
The third parameter of wxRect ctor is the width, not the right edge.

See #11558.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62941 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 11:17:42 +00:00
Vadim Zeitlin
68d7680d0f Always draw standard-sized checkboxes in generic wxDataViewToggleRenderer.
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
2009-12-19 11:17:32 +00:00
Vadim Zeitlin
c3fe02e952 Use correct width in wxDataViewCustomRendererBase::RenderText().
The text should be ellipsized to fit in the text rectangle, not the total cell
one (which is larger).

See #11558.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 11:17:25 +00:00
Jaakko Salli
3020453f5a In wxPropertyGrid::HandleCustomEditorEvent(), also filter out excess wxEVT_COMMAND_TEXT_UPDATED events that originated from wxComboCtrl-derived editors.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62938 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-19 11:13:03 +00:00
Vadim Zeitlin
fab9753681 Don't create labels with wxST_NO_AUTORESIZE flag with empty size by default.
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
2009-12-18 22:31:54 +00:00
Vadim Zeitlin
8c118ca4cb Don't draw over dummy separators in MSW toolbar, just don't draw them at all.
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
2009-12-18 22:31:48 +00:00
Vadim Zeitlin
cd57c6d690 Don't explicitly set the background colour for wxChoice.
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
2009-12-18 20:49:29 +00:00
Vadim Zeitlin
b8797d96ca No real changes, just change type of MSWGetBgBrush() argument.
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
2009-12-18 20:49:23 +00:00
Vadim Zeitlin
b93051ef46 Don't force themed background for wxToolBar under MSW, just use the default.
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
2009-12-18 20:49:15 +00:00
Jaakko Salli
3b9ba64cce Have wxComboCtrl honour any custom foreground and background colour.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62930 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-18 17:28:42 +00:00
Vadim Zeitlin
d5892339a1 Don't access the first character of a possible empty USEMAP parameter.
This fixes an assert when using debug CRT in VC9.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-18 14:47:25 +00:00
Vadim Zeitlin
247afab527 Only call GetTextMetrics() in wxDC::GetTextExtent() if necessary.
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
2009-12-18 14:47:18 +00:00
Vadim Zeitlin
ec38225e66 Call SymCleanup() in wxStackWalker to fix problem with next call to it.
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
2009-12-18 14:47:08 +00:00
Vadim Zeitlin
dc09d66523 Don't use "-I @" in ctags command line as cmd.exe handles '@' specially.
Just use the file path instead as '@' is used for the "response files" by
cmd.exe, at least under Windows 7.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62924 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-18 14:46:58 +00:00
Vadim Zeitlin
e75390d4aa No changes, just minor cleanup.
Don't call wxWindow::PrepareDC() which doesn't do anything anyhow.

Use wxBitmap::IsOk() instead of Ok().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-18 14:46:44 +00:00
Vadim Zeitlin
388feca61b Restore the use of the correct brush for toolbar background erasing.
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
2009-12-18 14:46:38 +00:00
Vadim Zeitlin
404013f849 Correct wxDateTime::GetWeekOfMonth() for days in the beginning of January.
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
2009-12-17 17:51:12 +00:00
Vadim Zeitlin
a30305f8b0 Add test of accelerators using both ASCII and non-ASCII keys to the sample.
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
2009-12-17 16:44:22 +00:00
Vadim Zeitlin
4f04a4fd78 Always use FVIRTKEY for the accelerators under MSW.
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
2009-12-17 16:44:09 +00:00
Jaakko Salli
bca35e84c0 Allow wxPropertyGrid::RecalculateVirtualSize() execute even if pg is not completely initialized (otherwise virtual size calculations may go wrong)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62912 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-17 14:41:57 +00:00
Stefan Csomor
4c58f5c2c2 supporting sleep mode properly, see #11557
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62909 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-17 12:15:48 +00:00
Vadim Zeitlin
c50ab33de6 Initialize all fields of EXCEPINFO object to avoid crashes later.
We could call SysFreeString() on uninitialized pointers if IDispatch::Invoke()
failed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62908 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-12-17 10:52:02 +00:00