Commit Graph

50966 Commits

Author SHA1 Message Date
Vadim Zeitlin
2954883593 Document wxDocument::DeleteContents().
This method purpose was not quite clear as it was only mentioned in passing in
documentation of OnCloseDocument() but not really documented itself.

Also don't call it from wxDocument dtor as this is useless: the user-defined
overridden version will never be called from here and the base class version
does nothing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64299 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-13 14:37:00 +00:00
Jaakko Salli
17c02cc8e6 Make text drawn by wxGraphicsContext slightly less intrusive
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-13 08:36:37 +00:00
Jaakko Salli
8371a35340 Added wxGraphicsContext::Create(const wxEnhMetaFileDC& dc) so that wxPrintPreview can work with wxMSW's wxGraphicsContext (closes #12028)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64297 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-13 08:22:36 +00:00
Václav Slavík
f19f8180a5 Add missing check for wxUSE_FILE_HISTORY existence.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64296 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-13 06:25:33 +00:00
Vadim Zeitlin
c48bdb0c28 Refactor wxDocParentFrame and wxDocMDIParentFrame to share common base class.
Use the same approach as for the child frames: add a base template class which
allows wxDocParentFrame to inherit from wxFrame and wxDocMDIParentFrame from
wxMDIParentFrame while still allowing to reuse the common code.

This reduces code duplication and should make implementing parent AUI document
frame easier as well, see #8945.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64295 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-12 14:34:18 +00:00
Vadim Zeitlin
8329f1d1d6 Restore wxString::Printf() example showing position parameters in the docs.
The example was lost during the translation of the manual to Doxygen.

Closes #12038.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64294 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-12 08:18:17 +00:00
Francesco Montorsi
1125960175 update the main page of the manual to be more consistent; update its date
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64293 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 21:25:17 +00:00
Francesco Montorsi
dc735b4085 fix errors/inconsistencies pointed out by ifacecheck
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64292 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 21:12:10 +00:00
Francesco Montorsi
ed923a37e5 better error message when an inconsistency has been found
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64291 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 21:10:18 +00:00
Francesco Montorsi
001f1f5678 minor fixes to reduce number of Doxygen warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64290 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 19:44:16 +00:00
Francesco Montorsi
a300c74538 img tags need a final slash as they are empty tags; change <img> => <img/>
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64289 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 19:39:06 +00:00
Francesco Montorsi
0f3216c8c9 make H3 titles center-aligned (fixes the display of the manual version for HTML docs which currently appears left-aligned)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64288 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 19:37:29 +00:00
Jouk Jansen
4290ae6a1c Update OpenVMS comiles support
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64287 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 10:40:47 +00:00
Vadim Zeitlin
1acbfd013d Fix position for wxKeyEvents in wxMSW.
Use ScreenToClient() instead of painstakingly (and incorrectly) transforming
the position in this function itself.

Closes #12024.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64286 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 10:39:42 +00:00
Francesco Montorsi
5d029a1d7c fix for non-PCH builds; also use wxMilliSleep instead of wxThread::Sleep since the former is more readable (it's clear that it takes milliseconds).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64285 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-11 07:16:58 +00:00
Francesco Montorsi
1f5496a0f5 move code testing wxThread classes from the console sample to a new CppUnit test
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64283 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:48:24 +00:00
Vadim Zeitlin
0fe260084e Build fix: forgotten part of the previous commit.
This commit should have been part of r64281.

Also notice that the previous commit message mentioned a wrong ticket number,
see #10572.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64282 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:28:17 +00:00
Vadim Zeitlin
b6812a6f19 Add column parameter to wxListCtrl::GetItemText().
Allow retrieving the text from columns other than the first one directly.

Add implementations for MSW and generic versions, documentation and a unit
test.

Closes #11597.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64281 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:22:16 +00:00
Vadim Zeitlin
654e324628 Change wxDIALOG_NO_PARENT value to avoid clashing with wxCENTRE.
Use a bit freed by removing wxTINY_CAPTION_HORIZ for wxDIALOG_NO_PARENT. This
allows to move it out from the lower byte of the style word to avoid conflicts
with the button selection flags which can be commonly combined with the dialog
styles.

More precisely, wxDIALOG_NO_PARENT used to clash with wxCENTRE, meaning that
wxSingleChoiceDialog, for example, was always created without parent because
its default style included wxCENTRE. This commit fixes this particular bug and
probably more similar ones.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64280 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:10:03 +00:00
Vadim Zeitlin
7282b0678a Replace wxTINY_CAPTION_{HORIZ,VERT} with a single wxTINY_CAPTION.
These two styles were always equivalent so we can just as well replace them
with a single one and stop wasting an extra bit.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:09:57 +00:00
Vadim Zeitlin
f16fad90b2 No changes, just added comments summarizing the use of style bits.
Add comments allowing to see more clearly the styles allocation.

Please make sure to amend them if you change any style values in the future.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64278 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:09:50 +00:00
Vadim Zeitlin
f6b4a1b98d Don't use wxWindow::ClearBackground() in the image sample and explain why.
Painting on both wxPaintDC and wxClientDC simultaneously doesn't work well,
e.g. under Windows the client DC can be actually erased after we finished
painting the window contents, overwriting it.

Simply use wxDC::Clear() instead of wxWindow::ClearBackground() to avoid this
and document the danger of using ClearBackground() from EVT_PAINT handler.

Closes #10700.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64277 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 21:02:30 +00:00
Jaakko Salli
a29df06231 Make text printed by wxGraphicsContext shorter
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64274 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 14:16:07 +00:00
Jaakko Salli
a5e40d85a4 Use wxGraphicsContext to draw some text and a rectangle around it (so that GetTextExtent() can be verified to work correctly)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64273 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 14:14:35 +00:00
Jaakko Salli
465642da29 In wxGDIPlusContext::GetTextExtent(), return more accurate text height if possible
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 13:54:20 +00:00
Jaakko Salli
a53b5e867b Set wxGraphicsContext page scale, which is required for printing to work properly
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64271 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-10 13:52:12 +00:00
Vadim Zeitlin
512220b67b Replace public wxEvtHandler::ProcessEventHere() with private TryHere().
ProcessEventHere() doesn't have to be public any more now that we have
ProcessEventLocally() which is safe to call from the outside (i.e. doesn't
forget about the chained event handlers and validators).

Still keep this function because it makes the code more modular and also
because we might want to make it virtual for consistency with TryBefore() and
TryAfter() later. Also rename it to TryHere() to make the symmetry with these
functions more manifest.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:46 +00:00
Vadim Zeitlin
44070fd379 Use ProcessEventLocally() instead of ProcessEventHere() in docview code.
Use wxEvtHandler::ProcessEventLocally() instead of ProcessEventHere() when
forwarding events in the docview code. This ensures that any event handlers
chained with the objects involved (document manager, document, view) will be
used.

Incidentally the old code didn't work at all as ProcessEventHere() didn't even
call TryBefore() where the (further) forwarding was implemented.

Closes #10640.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:41 +00:00
Vadim Zeitlin
396e9eb8e2 Add wxWindow::ProcessWindowEventLocally() and use it in wxMSW MDI code.
Add ProcessWindowEventLocally() which wraps ProcessEventLocally() in the same
way as ProcessWindowEvent() wraps ProcessEvent(). I.e. it allows to process
the event in this window only, without propagating it upwards, but taking into
account any event handlers associated with it.

Use the new method in wxMDIParentFrame code in wxMSW to ensure that event
handlers pushed on MDI children frames are taken into account. Add a test for
this to the MDI sample.

Closes #11225.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64262 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:33 +00:00
Vadim Zeitlin
3cbb9df817 Refactor the event processing code to add ProcessEventLocally().
This new method can be used to only process the event in this handler or any
handlers connected to it (unlike ProcessEventHere() which doesn't follow the
chain at all), without propagating the event upwards (unlike ProcessEvent()).

Unfortunately implementing this required a field to wxEvent but there doesn't
seem to be any other way to do what we need.

There should be no user-visible changes after this commit, it just paves the
way for the upcoming fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64261 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:28 +00:00
Vadim Zeitlin
255ea4a702 Call wxEvtHandler::TryBefore() only once from ProcessEvent().
The event pre-processing hooks associated with the window should be called
only once during the event processing, we don't need to call TryBefore() for
each and every event handler associated with the window too.

This makes the code slightly simpler and faster and shouldn't change the
behaviour of any existing code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64260 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 14:55:21 +00:00
Jaakko Salli
c0c05e79b2 Supress SetFocus() warning in wxVListBoxComboPopup
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64258 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 10:29:48 +00:00
Václav Slavík
008809c73c Prevent idMenuTitle from being accidentally used as invalid wx ID.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64257 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 10:27:44 +00:00
Václav Slavík
0c51948f7d Whitelist wxID_NONE as valid menu item ID.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 10:27:40 +00:00
Václav Slavík
163e127d2e Fixed popup menu's title to be bold regardless of method used.
Popup menus with title set via SetTitle() had bold font, but menus
created by passing title as ctor argument used normal font. Fixed this
by using the same code (SetTitle) in both cases, instead of having two
independent (and out of sync) implementations of the same functionality.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-09 10:27:35 +00:00
Václav Slavík
3a72e0ed15 wxMsgCatalog destructor should be public.
Fixes #12031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64248 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-08 15:31:12 +00:00
Václav Slavík
35a4807534 Fixed a test in wxTranslations::GetString() to use UINT_MAX instead of -1.
See #12031.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64247 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-08 15:31:07 +00:00
Vadim Zeitlin
316bba0c72 Invalidate wxListBox best size immediately without waiting for idle time.
Since r53743 the listbox best size was only invalidated during idle time but
this meant that it could be laid out using incorrect old best size. So while
we still defer (expensive) horizontal extent calculation until later, do
invalidate the best size immediately to ensure the listbox is laid out
correctly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64246 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-08 10:28:01 +00:00
Vadim Zeitlin
1544ba0edc Fix crash in wxCommandProcessor of capacity N when N-1 commands were undone.
Performing N commands (where N is the maximal number of commands stored by
wxCommandProcessor), undoing N-1 of them and performing another command
resulted in a crash because a dangling pointer was left.

Closes #12027.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64245 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-07 23:38:31 +00:00
Vadim Zeitlin
a104022931 Fix assert during separator items creation introduced by r64226.
Add separators with correct kind, setting m_kind doesn't work any more because
it's overwritten below.

Also add a comment explaining why is overriding the user-specified kind the
right thing to do here.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64244 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-07 23:38:26 +00:00
Vadim Zeitlin
fd6e15974c Fix bugs related to two phase creation of wxRibbon classes.
Add missing wxRibbonControl::Create() method. Ensure that member variables are
always initialized by the ctor. Check that we're fully initialized in EVT_SIZE
handler.

Closes #12018.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64243 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-07 23:38:21 +00:00
Jouk Jansen
740ebe19a4 Updating setup for OpenVMS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-07 13:38:53 +00:00
Václav Slavík
690ddfec6e Integrate with GNOME's Recent Documents menu.
GTK+ provides GtkRecentManager for this purpose since 2.10. Use it in
wxFileHistory if available. Integration is simple, we just add a file to
GtkRecentManager in addition to normal wxFileHistory handling.

A well-behaved GNOME application would use GtkRecentManager as the
primary store for recent files, so that it reflects when the user works
with supported files in another editor(s) too. But for now, this is much
better than no support at all.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64240 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-07 06:45:48 +00:00
Václav Slavík
8122745571 Clarify that wxFileSystem::OpenFile() takes URL, not filename.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64239 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 18:28:31 +00:00
Jaakko Salli
75ac0891d8 Change wxPGProperty::SetChoices() to accept 'const wxPGChoices&'
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64232 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 17:42:26 +00:00
Jaakko Salli
d517b60699 Modify float/double wxAny testing to use CPPUNIT_ASSERT_EQUAL() instead of CPPUNIT_ASSERT_DOUBLES_EQUAL(), so that we know the retrieved values are truly identical.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64231 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 17:21:50 +00:00
Vadim Zeitlin
64b62afea8 Don't accept focus in the dummy main generic spin control window.
This window is only used as a container for the sub-windows and shouldn't
accept focus, trying to set it to it doesn't work anyhow (see #12004).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64230 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:58:36 +00:00
Vadim Zeitlin
3a71210569 Don't send wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED when nothing changed.
The generic double spin control sent UPDATED events whenever it lost focus,
whether anything changed or not.

Don't send events unless the controls value has really changed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64229 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:58:32 +00:00
Vadim Zeitlin
5afb019a0c Always update the value of generic spin control when leaving it.
We could be left with an invalid value in the control when leaving it. E.g. in
the widgets sample whose double spin control has range from 0 to 10, 123 could
be entered in it and was not replaced by 10 when the control lost focus. This
happened because the code didn't bother to update the text control if its
contents already corresponded to the internally stored value -- but this was
wrong as it could have a different representation.

Just always update the text unconditionally when synchronizing it with the
internal value.

See #12004.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64228 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:58:27 +00:00
Vadim Zeitlin
fbf3385651 Make keyboard navigation in generic wxTreeCtrl more Mac-like under OS X.
In the native OS X tree control right cursor arrow expands the current item
and the left one collapses it if it's expanded, make the generic control work
like this too under Mac.

Closes #12019.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64227 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:58:22 +00:00