Commit Graph

50947 Commits

Author SHA1 Message Date
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
Vadim Zeitlin
d93b98740c Check that menu ids are limited to MSW-supported range.
We already check that positive (i.e. specified by user and not generated by
wx) window ids are in 0..SHRT_MAX range. Now do the same for the menu ids as
ids outside of this range suffer from the same problem under MSW: they get
wrapped and become negative when we receive events for them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64226 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:40:18 +00:00
Vadim Zeitlin
bcd286534a Added wxLANGUAGE_BOSNIAN.
Closes #12016.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:40:11 +00:00
Vadim Zeitlin
de623c67b9 Mention that hatched pens don't work under wxGTK and wxX11.
See #11983.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64224 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:22:57 +00:00
Václav Slavík
611bed3511 Refactor wxTranslationsLoader API.
Instead of calling back into wxTranslations to actually load the data,
return wxMsgCatalog instance from
wxTranslationsLoader::LoadCatalog(). This requires making wxMsgCatalog
public.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64223 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 12:12:53 +00:00
Václav Slavík
ba5619e076 Move wxScopedPtr::reset() implementation to wxDEFINE_SCOPED_PTR.
Just as the destructor, reset() calls delete on T pointer and so can
only be defined when T is fully defined.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64222 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 05:43:01 +00:00
Václav Slavík
bdd6a03de7 Use wxCHECKED_DELETE in wxScopedPtr::reset().
It was only used in delete call in destructor, but the use in  reset()
needs safeguards as well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64221 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 05:42:57 +00:00
Václav Slavík
4e0c592f98 Use wxCHECKED_DELETE in wxScopedPtr<T>.
It was only used in macros-based implementation, use it in the template
version too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-06 05:42:52 +00:00
Vadim Zeitlin
c14dc5541c Fix PCH-less compilation after recent changes.
Include wx/sizer.h explicitly when not using PCH.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64219 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 13:53:40 +00:00
Václav Slavík
ce411ca8f5 Fix incorrect assumptions about locales codes.
wx incorrectly assumes that Unix locale codes have the form of xx_YY,
where both xx and yy are two characters long. This is wrong, xx is
ISO 639 code, which can often have 3 characters ("ast", "gez" etc.);
future ISO 639-6 will have up to 4 chars. Similarly, ISO 3166 has
alpha-3 variant of country codes too (even though they aren't used in
this context today).

For parsing needs, we can just look for '_' in the code. The only place
where a check for xx_YY code was performed was GetSystemLanguage().
Instead of bothering with correct check (or a heuristic), let's simply
assume locale is xx_YY code and only do alternative handling if that
assumption fails. According to the comments, this alternative handling
was for cases such as LANG=german environment on SuSE, but it's safe to
say that no modern systems do that anymore, so it's OK that this patch
is marginally less efficient on such legacy systems.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64218 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 13:50:15 +00:00
Vadim Zeitlin
fd61f68445 No changes, just make wxDataViewEditorCtrlEvtHandler private.
This class is used by wxDataViewCtrl implementation only, there is no need for
it to be in a public header.

Move the class declaration from wx/dataview.h to datavcmn.cpp.

See #11732.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64217 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:45:14 +00:00
Vadim Zeitlin
66c02e6e33 Pop event handler from wxDVC edit control before destroying it.
This fixes the assert in wxWindow dtor checking that all event handlers pushed
on the window were removed.

Also fix a memory leak by not creating an unnecessary object of wxKillRef
class. In fact remove this class entirely.

Closes #11732.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64216 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:45:09 +00:00
Václav Slavík
dfbb5eff44 Don't use size_t for plural forms parameter.
size_t should be used for size of objects, which wxGetTranslation() and
wxTranslations::GetString() 'n' argument isn't -- it's just a regular
integer.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64215 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:27:07 +00:00
Vadim Zeitlin
fc48f78fd0 Notify user less intrusively about overflow when previewing HTML printouts.
We used to show a modal dialog if the page didn't fit horizontally but this
was too intrusive when the user was just previewing the output and not really
printing it. Moreover, the question of the message box ("Print" or "Cancel")
simply didn't make sense in this case.

Fix both problems by not showing this dialog at all when previewing. Instead,
notify the user with a much less intrusive info bar in the preview window.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64214 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:20:15 +00:00
Vadim Zeitlin
742df99230 Move wxInfoBar to core library from adv.
This is necessary in order to be able to use it in the print preview (an
upcoming change).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64213 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:20:08 +00:00
Vadim Zeitlin
1bd122ddfa Replace wxPrintout::SetIsPreview() with SetPreview().
Unlike the old function just indicating whether a printout is being used for
previewing, the new one associates the preview object with it. This can be
useful if we need to access the window used for the preview, for example.

Also remove a bunch of apparently unnecessary SetIsPreview(false) calls as
printing (and not previewing) is already the default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:19:59 +00:00
Vadim Zeitlin
5009cb6acc No real changes, just clean up wxAbortProc mess.
Remove m_lpAbortProc which is not needed at all and just requires ugly casts
because its type was different from the real type of wxAbortProc.

Get rid of the rest of the old Win16 code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64211 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:19:53 +00:00
Vadim Zeitlin
79d81c45ca Remove GtkPrintOperation preview signal handler.
This handler wasn't doing anything useful as we were always using the default
preview based on an external program, so just remove it completely.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64210 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 12:19:44 +00:00
Václav Slavík
338084945b Fix wxScopedCharTypeBuffer<T>::CreateOwned() to match docs.
The documentation says that it takes ownership of the memory block
passed to it, but the implementation made a copy.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64209 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-05 07:45:33 +00:00
Vadim Zeitlin
10acc3ef6a Ignore time component of SYSTEMTIME in wxCalendarCtrl.
Native month calendar functions doesn't always return correct values in the
time part of SYSTEMTIME so ignore it and use just the date component.

To simplify doing it, add helper (MSW-specific) SetFromMSWSysDate() and
GetAsMSWSysDate() functions which convert between wxDateTime and SYSTEMTIME
but take only date component into account.

This commit partially replaces changes of r63560 and closes #11276.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64208 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2010-05-04 21:59:17 +00:00