Vadim Zeitlin [Thu, 26 Nov 2009 16:17:00 +0000 (16:17 +0000)]
Make wxFileDialog::Set/SetPath() behave consistently.
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().
Vadim Zeitlin [Thu, 26 Nov 2009 15:59:27 +0000 (15:59 +0000)]
Don't set wxTextAttr font family to invalid value.
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.
Vadim Zeitlin [Thu, 26 Nov 2009 15:59:20 +0000 (15:59 +0000)]
Use wxTE_RICH style for the log window in the text sample.
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.
Vadim Zeitlin [Thu, 26 Nov 2009 03:29:27 +0000 (03:29 +0000)]
Explicitly set the cursor when showing popup menu on text control in wxMSW.
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.
Vadim Zeitlin [Thu, 26 Nov 2009 02:34:01 +0000 (02:34 +0000)]
No changes, just avoid overriding GetNativeFontInfoDesc() in wxMSW wxFont.
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).
Vadim Zeitlin [Tue, 24 Nov 2009 00:02:05 +0000 (00:02 +0000)]
Don't return italic/bold suffix from wxFont::GetFaceName() in wxMSW.
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.
Vadim Zeitlin [Tue, 24 Nov 2009 00:01:25 +0000 (00:01 +0000)]
Don't change file access time implicitly when setting it explicitly.
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.
Vadim Zeitlin [Sun, 22 Nov 2009 11:24:09 +0000 (11:24 +0000)]
Define wxNO_RTTI if RTTI support is disabled for g++ or MSVC.
For g++ it could have been possible to define wxNO_RTTI in configure itself
but it seems better/simpler/more maintainable to do it in C++ code. As for
MSVC, we already define wxNO_RTTI correctly if build/msw/makefile.vc is used
but not if (modified or rebaked) project files are used and detecting RTTI
support in the code is the only way to fix it.
Jaakko Salli [Sat, 21 Nov 2009 11:39:32 +0000 (11:39 +0000)]
Added a new documentation overview section 'Caveats When Not Using C++ RTTI', describing possible problems with Bind() and wxAny when C++ RTTI is disabled.
Jaakko Salli [Thu, 19 Nov 2009 19:27:24 +0000 (19:27 +0000)]
Added typeinfo.h which implements wxTypeId, using C++ RTTI if available. wxAny and Unbind<>() code are updated to use it. Added and updated related unit tests.
Vadim Zeitlin [Thu, 19 Nov 2009 01:36:54 +0000 (01:36 +0000)]
Compilation fix for wxUSE_STL build: another missing _str().
Use utf8_str() to convert wxString to GTK+ string instead of relying on
implicit conversion which doesn't exist when wxUSE_STL==1 (and also when using
wchar_t-based Unicode build).
Vadim Zeitlin [Wed, 18 Nov 2009 03:45:32 +0000 (03:45 +0000)]
Fix handling of invalid paths with multiple columns in wxFileName.
SplitVolume() didn't handle colons in the initial position correctly which
surprised SetPath() and led to accessing an out-of-range string element. Fix
SplitVolume() and also add a check to SetPath() itself as it seems like it
could be called with a path containing the volume only.
Vadim Zeitlin [Wed, 18 Nov 2009 03:18:24 +0000 (03:18 +0000)]
Remove unnecessary manual face name selection code.
The change of r60391 made specifying the face name explicitly unnecessary but
left the code which filled "facename" array in wxNativeFontInfo::SetFamily()
with face names even though it was never used -- simply remove this code.
Vadim Zeitlin [Wed, 18 Nov 2009 03:18:16 +0000 (03:18 +0000)]
Implement wxFont::GetFaceName() to return the face name being really used.
Since the change of r60391 empty face name was returned for all fonts created
using the standard wxFont constructor (so basically all fonts except for those
created from native font info and the default/normal font which we retrieve
from the system). Use Windows GetOutlineTextMetrics() function to get the real
face name being used independently of the way the font was created.
Kevin Ollivier [Sun, 15 Nov 2009 01:36:30 +0000 (01:36 +0000)]
ShowWithoutActivating fix for OS X Cocoa, and also add support for shaped windows at least when the image being drawn has proper alpha/mask set. I'm not sure if we can support it by setting a region on the TLW, as the way to do this in Cocoa is just to make the TLW's background transparent and use alpha in whatever you draw.
Vadim Zeitlin [Sat, 14 Nov 2009 16:11:09 +0000 (16:11 +0000)]
No real changes, just remove the ugly CONST_CAST macro.
Use const_cast<> directly, we don't support compilers which don't have it any
more. And CONST_CAST macro conflicts with a macro with the same name (and
similar purpose) defined in Symbian headers.
Vadim Zeitlin [Wed, 11 Nov 2009 22:30:07 +0000 (22:30 +0000)]
Set wxSL_VERTICAL style in wxSlider demo page.
wxGTK doesn't currently take wxSL_{LEFT,RIGHT,TOP,BOTTOM} styles into account
but at least make it change the slider orientation correctly depending on them.
Jaakko Salli [Wed, 11 Nov 2009 19:49:58 +0000 (19:49 +0000)]
Fix wxPropertyGrid rendering problems when used with wxAUI. It seems we cannot rely on wxWindow::GetRect() to return wxRect with x=0 here. (fixes #11433)
We had wxBase64Decode(void*,size_t,const char*,size_t) as well as
wxBase64Decode(const char*,size_t) and wxBase64Decode(wxString) already but
not a version taking the buffer and wxString, complete the set of overloads
now.
This allows the unit test to compile in STL build (where there is no implicit
conversion from wxString to const char *).
Vadim Zeitlin [Wed, 11 Nov 2009 01:50:06 +0000 (01:50 +0000)]
Implement text ellipsizing for wxDataViewCustomRenderer in wxGTK.
Add another virtual function (GtkGetTextRenderer()) to the base class which
allows us to reuse the same code setting the "ellipsize" property that we
already used for wxDataViewTextRenderer for wxDataViewCustomRenderer as well.
Vadim Zeitlin [Tue, 10 Nov 2009 18:17:31 +0000 (18:17 +0000)]
No changes, just reformat comments in osx/dataview.mm.
Wrap long lines to be able to read the comments and remove the perfectly
useless "// variable definition" and "// constant definition for
abbreviational purposes" noise.
Vadim Zeitlin [Tue, 10 Nov 2009 17:42:58 +0000 (17:42 +0000)]
Fix width of the wxDataViewTreeCtrl column under OSX/Cocoa.
Set the column resizing mode to "automatic" instead of "none" if the control
doesn't show the header. This allows the native control to properly resize the
only tree control column to always take up the entire window size (provided we
don't explicitly create it resizeable, so don't do this).
Vadim Zeitlin [Tue, 10 Nov 2009 17:42:46 +0000 (17:42 +0000)]
Add support for wxDV_NO_HEADER to OS X/Cocoa wxDataViewCtrl.
Also use this flag with the tree control in the sample to test it and also
because it doesn't make much sense to have a single column without title
anyhow.
Vadim Zeitlin [Tue, 10 Nov 2009 17:42:24 +0000 (17:42 +0000)]
Add support for custom attributes to wxOSX/Cocoa wxDataViewCustomRenderer.
Virtualize applying the attributes in a new OSXApplyAttr() function and simply
store the attribute in its wxDataViewCustomRenderer version so that it could
be reused later in Render().
The attributes now work correctly in wxOSX/Cocoa dataview sample too.
Vadim Zeitlin [Tue, 10 Nov 2009 17:42:04 +0000 (17:42 +0000)]
Don't overwrite background in custom renderer in OSX/Cocoa.
Erasing background seems to be unnecessary and was actively harmful for the
selected items which didn't appear with the correct background colour. Just
don't do it at all.
Vadim Zeitlin [Tue, 10 Nov 2009 17:41:58 +0000 (17:41 +0000)]
Add support for custom attributes to wxGTK wxDataViewCustomRenderer.
Call SetAttr() to store them in wxDataViewCustomRenderer before rendering it
and also honour the attributes in RenderText() (by reusing the same code we
already use for wxDataViewTextRenderer).
The attributes now work correctly in dataview sample under wxGTK as well.
Vadim Zeitlin [Tue, 10 Nov 2009 17:41:50 +0000 (17:41 +0000)]
Correct text position in wxDataViewCustomRenderer::RenderText() in wxGTK.
It simply ignored the passed in rectangle meaning that the text was always
drawn at the top left corner of the cell rectangle.
Also more code cleanup: collect all render call parameters in a single struct
and provide a public function to set them all at once instead of making them
public.
Vadim Zeitlin [Tue, 10 Nov 2009 17:41:42 +0000 (17:41 +0000)]
Pass full cell rectangle to WXCallRender().
There is no need to ask the item for its size in gtk_wx_cell_renderer_render()
as WXCallRender() will already do it (correctly, accounting for badly
implemented GetSize() unlike this version) internally on its own.