Václav Slavík [Wed, 7 Apr 2010 18:59:51 +0000 (18:59 +0000)]
Fixed wxFileSystem::FileNameToURL() regression with UNC paths.
We cannot use wxURI to do the escaping, because wxFileSystem depends on
use of nonstandard escaping and prefixes (wxURI eats away
file:// prefix, while wxFileSystem uses it to signify UNC paths;
wxFileSystem needs to escape #,: as well).
Suppress dummy gcc warnings in regex library code.
These warnings are harmless (variables are always initialized when they are
used) but they unfortunately prevent buildbot from reporting any new warnings
(which may not be harmless) during the library compilation step so suppress
them in the least intrusive way possible.
Work around "possibly uninitialized variable" warning in wxFileName.
Initialize multiplier to its default value in GetHumanReadableSize() to avoid
a "warning: 'multiplier' may be used uninitialized in this function" from g++.
Use this method to forward the status of text events in the implementation of
wxComboBox in wxOSX/Carbon. This ensures that the events are correctly [not]
generated when various wxComboBox methods are called.
Fix text text changed events sending in OS X combo box and text control.
Don't duplicate needlessly wxTextEntry functionality in wxTextCtrl.
Don't clear the combobox text entry part twice in wxComboBox::DoClear(), it is
supposed to only clear the item container contents as the base class Clear()
already calls wxTextEntry::Clear().
Do send text updated events from wxTextEntry itself as it applies to
wxComboBox just as well as to wxTextCtrl.
The unit tests now pass under wxOSX/Cocoa, not breaking them again would be
appreciated.
Attempt to correct mysterious MSVC6 compilation error.
For some reasons MSVC6 refuses to compile TestData struct initialization. Try
to work around it by not using wxULongLong as this looks like the only thing
which might be confusing it.
Add support for IEC and SI size units to wxFileName::GetHumanReadableSize().
Allow choosing the multiplier to use (1000 or 1024) and the names of the units
(SI or IEC). By default, still use traditional convention, i.e. multiplier of
1024 but SI unit names. This will probably need to be changed to use IEC units
in the future.
Add default constructor to wxGraphicsGradientStop.
It may be convenient to create wxGraphicsGradientStop first and initialize it
later so allow doing this by providing the default argument for constructor
parameters and thus allowing to use it as the default constructor.
Václav Slavík [Mon, 5 Apr 2010 17:19:04 +0000 (17:19 +0000)]
Fix text input and completion in wxComboCtrl and wxOwnerDrawnComboBox.
Both wxEVT_KEY_DOWN and wxEVT_CHAR must be handled and only the latter
used for completion (or any characters input). Don't make incorrect
assumptions about wxEVT_CHAR keycodes either, it's only the Unicode
character and printability that matter.
Otherwise, completion in readonly controls wouldn't work correctly
for e.g. numbers on numpad or non-ASCII characters.
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.