Don't fail loudly if the image file is not found (which can happen under Unix
if the image sample wasn't built yet or if we're not running the sample from
its own directory) but just don't create the bitmap.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62770 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Remove the assert added in r62101 (see #10917), it was wrong as the other
ports do not assert in this case. Instead, just ensure that the path we use
with the GTK+ native chooser is absolute.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62769 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Replace all occurrences of
@interface wxFoo : NSFoo
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
<NSProtocol>
#endif
which we used for protocols new in 10.6 with just
@interface wxFoo : NSFoo wxOSX_10_6_AND_LATER(<NSProtocol>)
which looks better and simpler.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62755 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Defining lfind as _lfind is not enough and a warning C4996 is still generated
by MSVC9 when the function is called.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62753 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Avoid dozens of warnings about "unsafe" use of the standard C library
functions in 3rd party code which are harmless and which we don't care about
in any case.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62752 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Calls to wxStrchr(char-string, wide-char) would previously fail if wide
character couldn't be converted to a single character in the current locale
encoding. Change it to simply return NULL in this case as it's a safe and
useful generalization: a narrow string will never contain a wide character not
representable in the current locale.
Add wxUniChar::GetAsChar() to help with implementing this.
Closes#11487.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62738 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix VC6 compilation: INVALID_FILE_ATTRIBUTES is not defined in its headers so
we need to do it ourselves (this was done in filefn.cpp before but part of the
code using this constant was moved to filename.cpp in r62735 so now we need to
define it here too).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62737 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Use wxFileName from the global functions instead of using global functions in
wxFileName methods as wxFileName is the preferred API for all these
operations.
Closes#11488.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62735 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Introducing a system option for all toolbars and then ignoring it inside wx
itself is ridiculous and just goes to prove that this option itself was a
mistake. But as we have it, we should respect whatever value it's set to
(which should hopefully be 0 anyhow for most modern systems) instead of
overriding it forcefully making the mockery of the whole "option" concept.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62734 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Reset m_needsRealizing flag before calling wxToolBar::Realize() as doing this
can result in another call to wxToolbook::OnSize() itself.
Closes#11942.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62733 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
In spite of the name, we need to use otmpFamilyName member of
OUTLINETEXTMETRIC struct and not otmpFaceName to get the font face name: the
latter may contain (locale-dependent, so the changes of r62708 didn't work for
non-English versions of Windows) "Italic" or "Bold" suffix while the former
does not and is what we want.
This should really fix the unit test failures, even in French locale.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62732 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxUSE_CAIRO used to be defined only in wx/cairo.h but this header wasn't
included by src/common/dcgraph.cpp so the code there was compiled as if we
were not using Cairo even when we were (thanks g++ for the warning).
Define it in wx/chkconf.h (included from wx/defs.h, i.e. always) now to ensure
that not only this bug is fixed but also that it can't happen any more.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62730 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGridCellAttr didn't provide any way to query its alignment attributes
without falling back to the (always defined) default alignment so the code in
wxGridCellNumberRenderer and similar classes simply always used right
alignment,
Add a new wxGridCellAttr::GetNonDefaultAlignment() function which allows to
retrieve the alignment defined in the attribute and use it to use right
alignment by default but allow overriding it.
Add a test to the sample showing a non right-aligned numeric cell.
Incidentally fix a long-standing bug in wxGridCell{DateTime,Enum}Renderers
which used wxRIGHT instead of wxALIGN_RIGHT and so were not aligned properly
even by default.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62728 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxGridCellAttr was using literal -1 to indicate "no alignment" which wasn't
immediately obvious, use a new wxALIGN_INVALID (which has the same value)
instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62727 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFileDialog::GetPath() didn't return the value set by a previous call to
SetPath() in wxMSW version. Fix this and also implement SetPath() and
SetDirectory() methods in the generic versions in the same way as
SetFilename().
Closes#3672.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62722 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxTextAttr::HasFontFamily() shouldn't return true if there is no valid font
family in this attribute but this could happen if it was constructed from a
font which didn't know its own family.
This fixes asserts on the startup of the text sample in wxMSW due to passing
wxFONTFAMILY_UNKNOWN to wxFont::SetFamily() when trying to use such invalid
attribute later.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This makes it have nicer colour (white instead of grey by default) under MSW
and wxTE_RICH was already in the code, just commented out -- it seems it's
better to enable it (as it also allows more text to be shown in the control
under old Windows versions) than to remove it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Without this, an I-beam cursor is used when a menu is shown by a rich text
control. Set the arrow cursor explicitly to work around this apparent bug in
the native control.
Closes#11314.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62718 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFont::GetNativeFontInfoDesc() and GetNativeFontInfoUserDesc() were
overridden just to ensure that the font is realized but it makes sense to do
it in wxFontRefData::GetNativeFontInfo() itself as detecting the face name
won't work if the font is not realized anyhow. And then we don't need these
functions at all as the only thing they do is checking that the font is valid
when they are called but this can be done in the base class itself as this
should happen in all ports (document that this is the case).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62717 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Retrieve the face name from the system if we don't have it already before
returning the native font info.
This fixes the currently failing font unit tests.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62716 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Fix a nice buffer overflow waiting to happen due to the use of wxStrcpy().
Call wxNativeFontInfo::SetFaceName() which uses wxStrlcpy() instead.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
These suffixes don't make part of the face name in wx API but the native MSW
API which we use since r62675 does return them. This made the unit test fail
in SettingsTestCase::GlobalFonts() as a face name with such suffix wasn't
recognized as a valid face name any more, so simply remove them.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62708 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
Wrong width was returned for the icon or label rectangle when querying the
first column. Fix this and add a test to the sample allowing to check this.
GetSubItemRect() still returns wrong results for second and subsequent
columns, see #11355.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62706 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
wxFileHandle helper class used in wxFileName::SetTimes() under MSW modified
the file access time by setting it to the current time because it opened the
file in a wrong mode.
Closes#10567.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62705 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
For MSW, check for gdiplus.h availability when using configure but only
support it for MSVC 7+ otherwise. For the other platforms, always support it.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62704 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775