Commit Graph

50039 Commits

Author SHA1 Message Date
Vadim Zeitlin
c937bcac0f Add ellipsization support to wxDataViewCtrl.
Implemented ellipsization in the generic, GTK and both OS X Carbon and Cocoa
versions but it currently doesn't work well in GTK as it changes the item
alignment unconditionally, this will need to be fixed later.

The behaviour for the columns is currently inconsistent between ports too:
under MSW they (natively) use wxELLIPSIZE_END, under GTK -- wxELLIPSIZE_NONE
and under OS X the same ellipsization mode as the column contents, i.e.
wxELLIPSIZE_MIDDLE by default.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62433 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 21:35:26 +00:00
Vadim Zeitlin
355ce7adea Rename wxEllipsizeFlags elements to avoid confusion with wxEllipsizeMode.
We shouldn't use the same "wxELLIPSIZE_" prefix for two different enums, so
use wxELLIPSIZE_FLAGS one for wxEllipsizeFlags (they should be used less often
than wxEllipsizeMode so it's better to keep the short prefix for the latter).

Also add wxELLIPSIZE_FLAGS_NONE flag.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62432 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 21:32:51 +00:00
Vadim Zeitlin
73b1b99623 Improve wxCollapsiblePane appearance under OS X.
By default, don't use border in wxDisclosureTriangle because the native
applications do not. However do honour wxBORDER_XXX style if specified in case
this becomes useful in the future (this required no effort as the code was
already there for bitmap buttons and just had to be extracted into a reusable
function).

Don't expand the disclosure triangle in wxCollapsiblePane sizer, as this
resulted in the text being centered instead of remaining left-aligned.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62431 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 16:25:43 +00:00
Vadim Zeitlin
3d35ec88d9 Don't use sunken border for the list control in log dialog.
There doesn't seem to be any reason to use a heavy border here as there is
nothing much to separate the list control from. In particular this looks
rather horrible under OS X.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62430 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 16:25:37 +00:00
Vadim Zeitlin
2d5e5799a9 Make assert in wxMSW wxListCtrl::InsertItem() more informative.
Assert if inserting an item failed (this is really unexpected and must be a
programmer error) instead of asserting about items number mismatch -- which
might be true but only indirectly helpful.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62429 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 14:35:21 +00:00
Jaakko Salli
23d74d894d Fix incorrect wxComboBox dropdown and closeup event macro names in doxygen docs (closes #11340)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 13:54:56 +00:00
Vadim Zeitlin
205bdf2069 Implement icon text column using native GTK renderers in wxDVC.
This has a possible advantage of a more native look and feel (although it's
hard to tell the difference between drawing the icon ourselves and how the
default GTK+ renderer does it to be honest) and a very real advantage of
allowing to edit in place cells with icons. It also reduces code duplication
in GTK implementation.

Modify the sample to make the icon-text column in the list model editable to
show that it works. This required storing the values of the second column as
well, so do it in its own array and to avoid calling it "m_array2", rename the
existing m_array to m_textColValues (which accounts for most of the diff in
the sample) and call the new one m_iconColValues.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62423 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-16 01:29:06 +00:00
Vadim Zeitlin
7bade612f0 Correct cell alignment computation for too small column sizes.
Actually the column size might not even be too small but the size returned by
renderers GetSize() could be too large -- as is the case for spin renderer
currently. And trusting it results in drawing outside of the cell boundary
even when there is enough space inside it, so don't do this and fall back to
left alignment if there is not enough space.

This fixes display of the year column in the dataview sample broken by the
recent changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62418 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 16:53:52 +00:00
Vadim Zeitlin
84fc95da58 Use correct colour for selected items in generic wxDVC.
wxDataViewCustomRenderer::RenderText() taking attributes must use correct
colour for the selected items if no attribute is specified as it can be (and
is) called directly and not only via the compatibility overload.

This fixes the display of the selected items in the dataview sample broken by
recent changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62417 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 16:53:45 +00:00
Jaakko Salli
e607eac25c Changed 'bool recursively' to 'int flags' argument (with default value of wxPG_RECURSE) in wxPropertyGrid Set(Property)BackgroundColour() and Set(Property)TextColour() member functions.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62416 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 16:39:19 +00:00
Jaakko Salli
50355f75e5 Fixed regression: wxPropertyGrid caption selection rectangle was drawn at incorrect horizontal offset.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62415 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:49:08 +00:00
Vadim Zeitlin
c27181d1a1 Replace wxValidator::SetBellOnError() with SuppressBellOnError().
SetBellOnError() erroneously inversed the value of its parameter. Fixing it to
behave correctly could silently break the existing code which might work
around this bug already because it always behaved like this (ever since it was
added 10.5 years ago). So instead simply deprecate this function and add a new
SuppressBellOnError() one which behaves as expected.

Closes #11318.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62414 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:44:22 +00:00
Vadim Zeitlin
b68d34f34c Correct typo in wxDocument::OnSaveModified() description.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62413 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:44:13 +00:00
Jaakko Salli
aaf5f98682 Added wxPGCell::SetFont() and GetFont(); Documented wxPGCell class.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-15 14:41:00 +00:00
Vadim Zeitlin
d85aece199 Test whether GTK+ is 2.18 or newer in configure.
We need to define __WXGTK218__ symbol in configure instead of simply checking
if we are compiled with 2.18 in wx/infobar.h because GTK_CHECK_VERSION() can't
be used when compiling user code which can't even include gtk/gtkversion.h
defining it because it doesn't necessarily use `pkg-config --cflags gtk+-2.0`
at all in its CFLAGS.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 22:49:38 +00:00
Vadim Zeitlin
b43914a8be Suppress harmless warning about unhandled wxSHOW_EFFECT_NONE.
wxNonOwnedWindowImpl::ShowWithEffect() is not supposed to be called with
wxSHOW_EFFECT_NONE effect so assert if it is.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62404 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 21:48:27 +00:00
Vadim Zeitlin
aa62256a06 Add a detailed explanation of possible error reasons to wx/chkconf.h.
Also modify the #error directives to point to the comment near the top of this
file.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62403 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 20:59:41 +00:00
Jaakko Salli
e6f918647e Fixed bug: wxPropertyGrid::Thaw() should no longer move the scroll bar when reselecting property that was selected prior to Freeze() call.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 17:30:47 +00:00
Vadim Zeitlin
9aa2e298ae Fixes to comparison operators for wxDVC classes.
Comparison operators for wxDataViewItem and wxDataViewIconText were not inline
and not exported, resulting in linking errors for any code using them in
shared wx build. Fix this by making them inline.

Also correct wxDataViewIconText operator==() implementation to compare icons
as well and to return true when comparing the object with itself.

Finally add operator!=() matching existing operator==() as a class having one
of these operators is supposed to have the other one as well and it costs
nothing to define it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62401 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 17:00:28 +00:00
Vadim Zeitlin
31d4e10524 Fix harmless unused variable warning in wxPropertyGrid code.
Declare variable only used #if wxPG_DOUBLE_BUFFER inside the #if.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62400 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-14 17:00:20 +00:00
Paul Cornett
4d4ec2a507 Make m_idleMutex an object instead of a pointer. Use bool for hook-installed flag, the actual hook id is not needed.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62399 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-13 15:40:35 +00:00
Jaakko Salli
cd644aa10f Removed wxTE_READONLY style from multi-line wxTextCtrls in combo and propgrid samples (looks a bit better that way on wxMSW)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62398 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-13 14:34:47 +00:00
Vadim Zeitlin
f115ff4a4f Fix conversion from wxColour to NSColor in wxOSX/Cocoa wxDVC.
wxColour components are in 0.255 range while NSColor ones are in 0..1 one. The
old code compiled just fine but didn't work correctly for any colours which
had any channel with value different from 0 and 255 (unsurprisingly, my tests
only used wxRED, wxGREEN and wxBLUE which all passed...).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62396 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:44:23 +00:00
Vadim Zeitlin
38c349189a Implement attributes support in generic wxDataViewIconTextRenderer.
Simply override RenderWithAttr() instead of Render().

Update the sample to show that this works now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62395 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:44:15 +00:00
Vadim Zeitlin
3e60a3c147 Make generic wxDataViewProgressRenderer fill the entire cell.
After the fixes in the previous commit it is finally possibly to make the
progress renderer expand to the entire cell area instead of taking a
fixed width, it is enough to simply override RenderWithAttr() instead of
Render() and ignore the alignment as this avoids the use of (arbitrary and
hardcoded) wxDataViewProgressRenderer::GetSize().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62394 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:44:09 +00:00
Vadim Zeitlin
a6f1201f97 Handle cell alignment in the renderer itself in generic wxDVC.
Instead of using wxDataViewRenderer::GetSize() and rendering the cell into the
appropriate part of the rectangle, pass the full rectangle and the alignment
of the cell contents in it to the renderer itself.

This fixes the bug with bold text being truncated in the "attributes" column
of the dataview sample and is also generally more flexible as the renderer may
decide itself what to do with the extra space.

It also somewhat reduces the code duplication between CreateItemBitmap() and
OnPaint().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62393 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:44:03 +00:00
Vadim Zeitlin
b74399b982 Correct bug with items without attributes in wxGTK wxDVC.
After the change to the sample in r62390 it turned out that wxGTK version
didn't handle items without attributes in a column where other items did have
attributes neither -- they inherited the last used attribute.

Fix this by remembering whether we are using any non-default attributes or not
and resetting them if we do.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62392 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:43:57 +00:00
Vadim Zeitlin
47583ac103 No real changes, just minor cleanup in wxGTK wxDVC.
Don't duplicate wxGtkTreeCellDataFunc declaration.

Don't triplicate "visible" property setting inside the function itself.

Indent the inside of if statement properly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62391 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 22:43:51 +00:00
Vadim Zeitlin
09a0ece0dc Fix display of items without attributes in Cocoa wxDVC.
The attribute used for the last item was reused for the next item in the same
column unless it was overridden in the attribute of this item, fix this by
remembering the original attribute and using it if no attributes are
explicitly specified.

Also change the sample to show the items without attributes in a column with
attributes and make the label correspond to the attribute of the item.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62390 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 17:30:48 +00:00
Vadim Zeitlin
a8afd748c7 No real changes, just clean up wxCustomRendererObject in Cocoa wxDVC.
The variables tableColumn and item are unneeded in this class so remove them.

Use static_cast<>s instead of C casts.

Avoid repeating oneVeryLongVariableName->anotherEvenLongerVariableName->
somethingElse->andSoOn multiple times, temporary variables are allowed in C++.

Also don't call wxDataViewCustomRenderer::GetSize() twice unnecessarily.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62389 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 17:30:41 +00:00
Vadim Zeitlin
67c4b73f9b Use Cocoa methods instead of wx ones in wxDVC font setting code.
Use NSFontManager to create bold or italic version of the font instead of
using wxFont. This works better for the bold attribute, but setting the italic
one still doesn't do anything.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62388 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 17:30:35 +00:00
Vadim Zeitlin
a65452ba5d Update German translation.
German translation update from Max Christian Pohle.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62387 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 15:50:46 +00:00
Vadim Zeitlin
f6b3bfba97 Add support for cell attributes to wxDVC in wxOSX/Cocoa.
Set the colour and font for the cell before rendering it if we have an
attribute for it.

The colours in dataview sample now work as expected, but making the font bold
or italic still doesn't work for some reason.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62386 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:44 +00:00
Vadim Zeitlin
77ea22ef1c Make the colours in the demo a bit more logical.
Make the colours of the items in the "attributes" column blue/green/red in
order instead of making all odd items blue and all even and divisible by 3
ones green while making the rest of them red -- it was a bit difficult to
figure out how it worked before.

Also correct wxDataViewItemAttr::SetItalic() check: comparing the remainder of
the division by 2 with 5 didn't risk to work.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62385 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:39 +00:00
Vadim Zeitlin
de40d73647 No real changes, just minor cleanup in Cocoa wxDataViewCtrl.
Start cleaning up Cocoa wxDataViewCtrl implementation:
 - Don't use "this->" which is not used anywhere else in wx code.
 - Use "()" instead of "(void)" as per wx coding standards.
 - Don't use end of function comments, this is inconsistent and
   unmaintainable.

No real changes otherwise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62384 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:32 +00:00
Vadim Zeitlin
2d0d781336 Remove wxDataViewTextRendererAttr by merging it with wxDataViewTextRenderer.
There is no reason to have a separate class for rendering the text honouring
the attributes defined for it, wxDataViewTextRenderer itself already does this
perfectly well.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62383 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:25 +00:00
Vadim Zeitlin
ca4adfd062 Added wxDCFontChanger ctor not changing font.
This is similar to the existing wxDCTextColourChanger ctor not changing colour
and is useful in the same kind of situations: when the font may or not be
changed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62382 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:13 +00:00
Vadim Zeitlin
489cc69b39 Document wxDCTextColourChanger "do nothing" constructor.
Only wxDCTextColourChanger(wxDC, wxColour) one was documented, also document
wxDCTextColourChanger(wxDC) and its Set() method now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62381 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 13:59:06 +00:00
Vadim Zeitlin
6d15a392cb Exclude message catalogs from UTF-8 check.
Many existing message catalogs don't use UTF-8 so don't check them in svn
pre-commit hook.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62380 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 10:38:43 +00:00
Jouk Jansen
30fbed20ac add more samples to the compile cascade for OpenVMS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-12 06:50:59 +00:00
Jaakko Salli
0da1f1c4cc Have page-specific splitter setup flags in order to fix bug that caused splitter change in one page to affect others. Also fixed a regression in splitter auto-centering.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62374 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-11 15:30:03 +00:00
Jaakko Salli
b5e184c6ff Code cleanup and clarification
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62372 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-11 08:45:34 +00:00
Jaakko Salli
aff6c20af5 Fixed post-expand/collapse rendering
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62371 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-11 08:35:48 +00:00
Jaakko Salli
0b6a0a7272 Fixed wxPropertyGrid empty space rendering
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62370 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-11 08:32:25 +00:00
Vadim Zeitlin
5f2b0d8586 Don't document WarpPointer() as not implemented under Mac because it is.
Still recommend to avoid using it though.

Closes #11307.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62363 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 19:07:59 +00:00
Vadim Zeitlin
3781248c7d Compilation fix for STL build.
Don't rely on implicit conversion of wxString to char* in
wxStandardPaths::GetDataDir() added in r62337.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 18:28:34 +00:00
Vadim Zeitlin
6da1d056ca Don't use vendor name by default in wxStandardPaths.
The changes in r50025 made the behaviour of wxStandardPaths silently
incompatible with the previous versions under MSW and OS X as it now used the
vendor name in the paths it returned, unlike before. The benefits of doing
this don't justify silently breaking the existing programs so revert this
change and continue to use the application name only by default.

It is, of course, still possible to explicitly ask for the vendor name to be
used with wxStandardPaths::UseAppInfo().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62360 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 18:28:28 +00:00
Julian Smart
8e494db90c Set the initial size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62359 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 11:02:01 +00:00
Jaakko Salli
39e4e221dd Removed intermediate wxPanel from wxPropertyGrid.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62358 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-10 09:52:44 +00:00
Paul Cornett
8e6efd1fd2 replace TRUE/FALSE with true/false
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62356 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-09 17:39:19 +00:00