Václav Slavík [Mon, 5 Apr 2010 17:18:55 +0000 (17:18 +0000)]
Pass events around with ProcessEvent(), not AddPendingEvent().
The latter adds the event for later processing. As a result, the event
appears to be processed to the caller, even if the handled it was passed
to called Skip() on it. ProcessEvent() doesn't suffer from this problem,
it may modify the event as expected.
Václav Slavík [Mon, 5 Apr 2010 17:18:41 +0000 (17:18 +0000)]
In wxPopupFocusHandler, watch for EVT_CHAR, not EVT_KEY_DOWN.
We should close the popup only if neither of these events was processed;
previously, EVT_CHAR would never reach the popup in open state, as it
would be closed automatically.
Add support for gradient stops to wxGraphicsContext.
Allow specifying a set of gradient stops instead of just the beginning and
ending colours. Add the new wxGraphicsGradientStop(s) classes and new
wxGraphicsContext::Create{Linear,Radial}GradientBrush() overloads. Also change
the same methods of wxGraphicsRenderer to take wxGraphicsGradientStops instead
of a pair of colours.
Implement the new API for MSW and Cairo. OS X still uses just the two colours
for now.
Jaakko Salli [Sun, 4 Apr 2010 15:22:43 +0000 (15:22 +0000)]
Resolve GCC's 'type-punned pointer will break strict-aliasing rules' warning by breaking up code in wxAny GetValue() and SetValue() functions into several lines (fixes #11865)
Fix wxTaskBarIcon to work under all Windows versions.
When the code was compiled using a new SDK, creating wxTaskBarIcon failed
under older Windows systems because of a too big NOTIFYICONDATA size specified
by the program.
Fix this by using the fixed NOTIFYICONDATA_V2_SIZE to get old version of the
struct which nevertheless contains everything we need and even fall back to
NOTIFYICONDATA_V1_SIZE for Win9x if needed.
Allow using wxGraphicsContext with MinGW if gdiplus.h is available.
MinGW doesn't include gdiplus.h but it can be installed independently by the
user. Allow to use it if it's available:
- Include windows.h when checking for it in configure as this is apparently
needed for its compilation.
- Don't reset wxUSE_GRAPHICS_CONTEXT to 0 for non-Microsoft compilers, instead
just define it as 0 by default for them, allowing the user to simply change
the definition in wx/msw/setup.h.
Fix crash in wxMediaCtrl::GetDownloadProgress() with ActiveMovie backend.
IActiveMovie::get_FilterGraph() may return S_FALSE, i.e. succeed, while
leaving the output pointer NULL. Check for this and don't dereference the
pointer before checking for its validity.
Also do it for the other call in this function just in case. And rearrange the
code to be slightly more readable.
Committing modified version of jwiesemann's patch (see #11223):
Fix wxURL copy ctor and assignment: the default ones provided by the compiler are wrong because wxURL uses pointers internally.
Also add a test for copy & assignment in URLTestCase.
Jaakko Salli [Mon, 29 Mar 2010 18:17:55 +0000 (18:17 +0000)]
For better support of wxValidators, invoke wxValidator::Validate() directly. Also remove obsolete flag wxPG_FL_VALIDATION_FAILED and make wxPropertyGrid::DoEditorValidate() virtual.
Václav Slavík [Mon, 29 Mar 2010 14:19:06 +0000 (14:19 +0000)]
Use fixed screen DPI of 96 when printing HTML.
Unlike font sizes, which depend on screen resolution because of weird
wxFont API, pixel sizes used elsewhere (and in particular, for images)
shouldn't depend on screen DPI.
This finally makes the output independent of screen size.
Vadim Zeitlin [Sun, 28 Mar 2010 22:39:39 +0000 (22:39 +0000)]
Fix bug in wxMBConv_cf::FromWChar() in OS X.
Apparently CFStringGetBytes() doesn't always behave as expected, work around
this by checking that the returned buffer size is not greater than the size we
passed in.
no real changes: just a small optimization on wxStaticText::DoSetLabel() to avoid altering m_labelOrig there (it's already modified by SetLabel(), no need to change it twice)
Václav Slavík [Sun, 28 Mar 2010 15:41:41 +0000 (15:41 +0000)]
Reverted wxFileSystem support in wxLocale.
The implementation was broken in numerous ways. URLs were corrupted in
search paths thanks to use of wxFileName for normalization. Lookup of
catalogs was broken, because ":" in URLs were interpreted as path
separators. Asserts occured because filenames were (incorrectly!)
interpreted as URLs.
Václav Slavík [Sun, 28 Mar 2010 15:41:35 +0000 (15:41 +0000)]
Fix wxFileSystem::FileNameToURL() for Unicode file names.
If filename with non-ASCII characters was encoded, resulting URL
contained non-ASCII characters. But URLToFileName() expected the
input to be in UTF-8. This change fixes it by using UTF-8 for
file: URLs in FileNameToURL() too.
Vadim Zeitlin [Thu, 25 Mar 2010 20:08:05 +0000 (20:08 +0000)]
Fix compilation of wx/debug.h when it's the first wx header to be included.
We must include wx/dlimpexp.h from wx/debug.h to be able to forward declare
wxString and wxCStrData using WXDLLIMPEXP_FWD_BASE, otherwise compilation
errors occur in the code which includes wx/debug.h as the first wx header.
Vadim Zeitlin [Tue, 23 Mar 2010 10:36:36 +0000 (10:36 +0000)]
Always call wxView::Close() when closing it.
After wxDocView refactoring the behaviour has changed and wxView::Close() and
hence user-overriddable OnClose() called from it) was only called if the close
event could be vetoed. This broke code which relied on OnClose() being
executed in any case to perform some cleanup and was incompatible with 2.8 so
restore the old behaviour now.
Vadim Zeitlin [Mon, 22 Mar 2010 22:56:22 +0000 (22:56 +0000)]
Let uiaction sample compile even if wxUSE_UIACTIONSIMULATOR==0.
There is no way to exclude the sample from the build under Windows so make it
compile and link even if wxUSE_UIACTIONSIMULATOR==0 but just give an error
message on startup in this case instead of working as expected.
Vadim Zeitlin [Mon, 22 Mar 2010 11:40:35 +0000 (11:40 +0000)]
Add wxUSE_UIACTIONSIMULATOR and turn it off by default.
Disable the recently added wxUIActionSimulator class until the issues with it
mentioned at http://article.gmane.org/gmane.comp.lib.wxwidgets.devel/119792/
are fixed.
Also use "" around wx headers instead of <> in wx code itself.
Vadim Zeitlin [Mon, 22 Mar 2010 11:40:26 +0000 (11:40 +0000)]
Don't enter an infinite loop if a spacer with min size of -1 is used.
Sizer layout algorithm broke down if min size of an item happened to be -1,
i.e. the same value as we use as a sentinel for indicating that the min size
hasn't been fixed yet. It doesn't make much sense for min size to be negative
in the first place but currently this can happen at least for spacers so deal
with it here by ensuring that the min size we use is positive.
reorder GetLabel(), GetLabelText(), SetLabel() and SetLabelText() function declarations, implementations and relative documentations.
Add wxStaticTextBase::GetLabelWithoutMarkup() and use it in the wxMSW implementation of wxStaticText::SetLabel() to close bug #11446; the function RemoveMarkup() which was previously used in fact could not check for presence/absence of wxST_MARKUP style since it's a static function.
Add wxStaticTextBase::SetLabelText() functions for symmetry with wxControlBase::SetLabelText()
Add test unit for both wxControl::*Label* and wxStaticText::*Label* functions.
Vadim Zeitlin [Sat, 20 Mar 2010 13:18:28 +0000 (13:18 +0000)]
Remove obsolete parts of wxPageSetupDialog documentation.
Don't speak about features "new" in Windows 95 nor 4.0 any more (what next,
discussion of wxWidgets limitations when running on an abacus?) but do mention
that this dialog is native under all major platforms now.
Vadim Zeitlin [Sat, 20 Mar 2010 13:18:23 +0000 (13:18 +0000)]
Add wxMessageDialog::GetEffectiveIcon() and use it in all ports.
Remove code duplication and inconsistencies among different ports by using a
single function in the base class for the determination of the effective icon
style to use, correctly handling both wxICON_NONE and the absence of any
wxICON_XXX styles.
Vadim Zeitlin [Sat, 20 Mar 2010 13:03:05 +0000 (13:03 +0000)]
Rename wxWindow::GetMainWindow() to X11GetMainWindow() in wxX11.
This avoids conflicts with GetMainWindow() defined in other wxWindow-derived
classes (such as wxDataViewCtrl and potentially user-defined classes as well).
Vadim Zeitlin [Sat, 20 Mar 2010 12:45:28 +0000 (12:45 +0000)]
Always include sys/time.h and sys/select.h from selectdispatcher.h.
fd_set used by this header is supposed to be defined in sys/select.h and not
including this header resulted in compilation problems under QNX. And
including sys/time.h shouldn't hurt and is needed by select() under many
systems anyhow.
Vadim Zeitlin [Sat, 20 Mar 2010 12:45:23 +0000 (12:45 +0000)]
Define wxGraphicsRenderer::GetDefaultRenderer() for all non-{MSW,Mac} ports.
wxGraphicsRenderer::GetDefaultRenderer() was only defined for wxGTK for some
reason but it needs to be defined in terms of GetCairoRenderer() for all ports
without native renderer implementation, i.e. everything but wxMSW and wxMac.
Vadim Zeitlin [Sat, 20 Mar 2010 12:45:19 +0000 (12:45 +0000)]
Remove duplicate variable definition.
The splitterX variable in wxPropertyGrid::HandleMouseMove() was defined twice
with the same value, remove the second definition to avoid warnings about
shadowing the variable in outer scope from some compilers.
Vadim Zeitlin [Thu, 18 Mar 2010 15:51:19 +0000 (15:51 +0000)]
Return exit code as signed integer from wxExecute(wxEXEC_SYNC).
The caller expects the function to return -1 if the child process exited with
-1 error code and not 255 that was returned before. The function is also
documented as returning -1 if the execution fails which wasn't true neither.
Fix this by explicitly handling the exit code as signed.
Vadim Zeitlin [Thu, 18 Mar 2010 15:07:39 +0000 (15:07 +0000)]
Ensure that setting wxChoice height to its default value does set it.
Setting wxChoice height to its default value didn't change the height even if
the current height was different from the default. This resulted in problems
when a wxChoice was used inside a wxAuiToolBar because AUI temporarily reduces
the toolbar size to (1, 1) when docking it (thus ensuring that the height of
wxChoice is changed too) and generally didn't make sense.
Fix this by resetting the height to the default value if the value passed to
wxChoice::SetSize() is what it considers to be its default height.
Add a unit test for this bug and also add a wxChoice to AUI sample to allow
testing for wxChoice behaviour inside a wxAuiToolBar being [un]docked.