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.
Vadim Zeitlin [Thu, 18 Mar 2010 15:07:32 +0000 (15:07 +0000)]
Remove wxAuiProportionalBoxSizer hack and replace it with wxBoxSizer.
The temporary workaround due to wxBoxSizer changes in 2.9.0 is not needed any
more, revert r59889 and use wxBoxSizer instead of custom
wxAuiProportionalBoxSizer again.
Vadim Zeitlin [Thu, 18 Mar 2010 15:07:24 +0000 (15:07 +0000)]
Fix box sizer layout algorithm to respect both proportions and min sizes.
The new version of the algorithm tries to distribute the entire space
allocated to the sizer among its children, just as the version in 2.8 did,
while still respecting minimal children sizes first and foremost. This means
that the space allocated to the item will always be at least its minimal size
if the total space is at least equal to the sum of minimal sizes of the
children but that if there is enough space, the proportions will be respected
too.
Extended the unit test to check that laying out various combinations of three
elements results in the expected results.
Vadim Zeitlin [Thu, 18 Mar 2010 15:07:19 +0000 (15:07 +0000)]
Ensure that size in the minor direction of box sizer doesn't exceed the total.
This is similar to the previous commit but for the transversal direction of a
box sizer: we could give an item size larger than the size of the sizer itself
making only part of its window visible (and thus potentially making the window
unusable e.g. because the scrollbar wasn't visible at all).
Fix this by always restricting the item size in the minor direction to the
total size available and add a unit test which failed previously and passes
now.
Vadim Zeitlin [Thu, 18 Mar 2010 15:07:14 +0000 (15:07 +0000)]
Ensure that size in the major direction of box sizer doesn't exceed the total.
After fixing the problem with "growing items by negative proportion" in r56010
(which still was the correct thing to do as it fixed such indefensibly broken
behaviour as shrinking items with larger proportion by more than "smaller"
items when there was not enough space) the items in a box sizer could become
larger than the total space allocated to the sizer resulting in only parts of
them being visible.
Fix this by truncating the items to the (remaining) total size even if this
means making them less than their minimal sizes -- because there is nothing
else we can do when the total space is smaller than the sum of minimal sizes
anyhow.
Jaakko Salli [Wed, 17 Mar 2010 18:17:19 +0000 (18:17 +0000)]
Use explicit wxPGPropertyFlags enum type with wxPGProperty::SetFlag() and similar member functions (thus preventing use of incorrect set of flags). Also now document wxPGProperty flags.
Vadim Zeitlin [Tue, 16 Mar 2010 14:48:02 +0000 (14:48 +0000)]
Add white outline to bulls eye cursor used under MSW.
The cursor used black circles only making it perfectly invisible on black
background. Add a white outline as well to ensure that it can be seen in this
case too, similarly to how it's done for magnifying glass cursor and the same
bulls eye cursor in GTK+.
Vadim Zeitlin [Tue, 16 Mar 2010 00:23:57 +0000 (00:23 +0000)]
Initialize picker style in native GTK file/dir pickers.
This fixes the styles used in the native wxGTK version after changes in
r63654: we must initialize base class m_pickerStyle now and the code didn't do
this before resulting in various asserts and incorrect behaviour.
Vadim Zeitlin [Sun, 14 Mar 2010 14:47:11 +0000 (14:47 +0000)]
Fix test for compilers not supporting \u escapes in strings (such as VC6).
Also reformat the code to follow wx style and explicitly use UTF-8 for the
test strings encoding instead of assuming the encoding of the current locale
was UTF-8 (which is never the case under Windows).
Vadim Zeitlin [Sun, 14 Mar 2010 14:15:49 +0000 (14:15 +0000)]
Use an appropriate icon automatically in wxMSW wxMessageDialog.
wxMessageBox() functions uses wxICON_QUESTION or wxICON_INFORMATION
automatically if no other icon style (including wxICON_NONE) is specified but
wxMessageDialog under MSW didn't do this, unlike under e.g. wxGTK.
Fix this by also determining the appropriate icon automatically in
wxMessageDialog itself in wxMSW.
Ideally we'd do this in all ports wxMessageDialog implementations and remove
the code doing it from wxMessageBox() but right now it's still needed for the
platforms other than wxMSW and wxGTK.