Commit Graph

49891 Commits

Author SHA1 Message Date
Vadim Zeitlin
a923d77fc5 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.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62594 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:42 +00:00
Vadim Zeitlin
9d02e49483 Add helper wxRectFromGDKRect() function and use it.
No real changes, just another small refactoring.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62593 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:35 +00:00
Vadim Zeitlin
70884c6fc8 No real changes, just remove some unnecessary casts.
Use correct GdkRectangle* type for wxDataViewCustomRenderer::xxx_area members
instead of casting them to and from void*.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:28 +00:00
Vadim Zeitlin
c2a738e372 Avoid setting attributes in GTK wxDataViewRenderer if not supported.
If the native renderer doesn't support the properties which we map our
attributes to, trying to set them is useless and results in GTK+ warnings so
don't do it.

Add wxDataViewRenderer::GtkSupportsAttrs() which can be overridden to indicate
whether the renderer supports attributes or not. We probably could use
g_object_class_find_property() instead to detect it automatically but for now
these properties are all supported only by GtkCellRendererText and not
supported anywhere else so using a single virtual function seems tidier.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62591 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:22 +00:00
Vadim Zeitlin
62265c2c67 Allow custom wxDataViewCtrl renderers to easily use attributes.
Set up the DC passed to wxDataViewCustomRenderer::Render() to use the font and
colour defined by the item attribute by default so that any calls to
RenderText() from it will use them automatically.

Also added public wxDataViewCustomRenderer::GetAttr() to allow retrieving the
attribute explicitly in Render().

The column using custom renderer in the dataview sample now works as expected
in the generic version; the native ones will be corrected in the upcoming
commits.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62590 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:41:11 +00:00
Vadim Zeitlin
6eec70b984 Big wxDataViewCtrl renderer classes refactoring.
This commit adds no changes in functionality but paves way for the upcoming
improvements of wxDataViewCustomRenderer.

First, introduce wxDataViewCustomRendererBase class in order to allow
implementing behaviour common to custom renderers in all ports in this class
instead of triplicating it.

This required splitting monolithic dataview.h in more parts, now we have
wx/dvrenderer.h which defines wxDataViewRendererBase and the new
wxDataViewCustomRendererBase and includes wx/port/dvrenderer.h which define
wxDataViewRenderer and wx/port/dvrenderers.h which defines all the other
renderer classes.

Also bring renderers hierarchy in the generic version closer to other ports:
all standard renderer classes now inherit from wxDataViewRenderer and not
wxDataViewCustomRenderer in for consistency with the other ports.
wxDataViewRenderer itself still does derive from wxDataViewCustomRendererBase,
unlike elsewhere, but this is unavoidable considering that all generic
renderers are custom ones.

Finally do some cleanup in OS X part of the code: correct indentation,
spacing, comment style.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:40:58 +00:00
Vadim Zeitlin
ef6833f9ab Add custom renderer column to the list model example in dataview sample.
Add a column using custom renderer to the example using a list model with
attributes to test attributes support -- currently they are ignored, but this
will be fixed soon.

Also make the custom renderer display somewhat more clear as previously it
didn't depend at all on its value.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62588 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:40:37 +00:00
Vadim Zeitlin
2746bccf23 Use symbolic constants for list model columns in dataview sample.
Using Col_EditableText, Col_IconText and Col_TextWithAttr instead of 0, 1 and
2 makes the sample code a bit easier to read.

Also use switch on the column value instead of nested ifs everywhere to give
compiler a chance to warn us if we forget to update some function when a new
column is added.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62587 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:40:25 +00:00
Paul Cornett
f0368d28bf wxSpinCtrl values are always integral, they don't need to be rounded
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62586 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:36:53 +00:00
Paul Cornett
92e164ff92 wxSpinCtrl::SetIncrement is supposed to take an int, not a double
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62583 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 17:12:36 +00:00
Vadim Zeitlin
0738b901b1 Fix discrepancy between different ways of measuring text extents under Mac.
wxGraphicsContext::GetTextExtent() didn't round the returned double result to
int but truncated it instead and so returned different extent than
GetPartialTextExtents() which did round it up.

Moreover, wxGraphicsContext::GetPartialTextExtents() didn't round it up
correctly: it wrongly added 0.5 to the value still stored as double and which
was hence rounded up (correctly, this time) when converted to int in
wxDC::GetPartialTextExtents().

These two errors combined to produce difference of up to 2 pixels between the
last offset returned by wxDC::GetPartialTextExtents() and the total string
extent returned by wxDC::GetTextExtent() which thoroughly confused the code in
wxControlBase::DoEllipsizeSingleLine() (and probably not only there).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-10 00:13:57 +00:00
Vadim Zeitlin
acaa833787 Fix unit test added in r62561 to work under Windows too.
The unit test checking that slashes were allowed in UNCs too didn't work under
Windows because GetPath() returned volume as part of the path there (and also
used backslashes by default), fix it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62579 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 18:20:05 +00:00
Vadim Zeitlin
d4953dd469 Remove unused anywhere wxDataViewRenderer::RightClick().
Code calling this method was removed by r53020 but its declaration was still
left (almost certainly by mistake) in the header, remove it now too.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:52 +00:00
Vadim Zeitlin
c8b6d5a049 Fix fatal bug when changing wxDataViewCtrl model in wxGTK.
wxDataViewCtrl::AssociateModel() wrongly delete m_notifier itself if the
control already had a model even though the notifier was registered using
AddNotifier() which also scheduled it for deletion when the old model itself
was destroyed. This resulted in double deletion and reproducible crash
whenever the model was changed.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62577 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:47 +00:00
Vadim Zeitlin
80093617fe No changes, just correct a recurring typo in "Override".
Two "r"s should be enough for anybody.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:42 +00:00
Vadim Zeitlin
eaae3ee7d7 No changes, just regenerated with bakefile 0.2.8.
There are no changes in this file except for the version of bakefile in the
header comment.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-09 01:57:33 +00:00
Paul Cornett
845a6bbf74 avoid causing idle event from GetValue(), fixes #11013
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62574 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-08 23:50:46 +00:00
Peter Cawley
7d8c1fbc47 Replaced hard-coded font size in ribbon art provider with a system defined font size (see #11341).
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-08 21:50:06 +00:00
Václav Slavík
b9b2c695ff document that wxMessageDialog API additions appeared in 2.9.0
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62570 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-08 11:35:58 +00:00
Kevin Ollivier
b6dc21e768 Make wxSTAY_ON_TOP and other window styles toggleable via SetWindowStyleFlag under OS X Cocoa.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62568 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-08 03:03:06 +00:00
Vadim Zeitlin
5c892f574c Recognize MSVC 10 in wx/platform.h.
Define __VISUALC10__ for it and avoid a warning when building wx using it.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62567 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-06 20:48:01 +00:00
Vadim Zeitlin
5414d62e3a Change interpretation of font height in wxMSW to mean character height.
Accept both positive and negative height values in wxFont::SetPixelSize() in
wxMSW and map them both to a negative height when passing to MSW API in order
to request mapping against the character height and not the total cell height.

For positive heights this is more consistent with the other ports and also
expectations of people using this function. We keep the possibility to use
the negative heights inly for compatibility with the existing code which
worked around the (incorrect) interpretation of the positive height as cell
heights in the previous wxMSW versions by passing a negative height
explicitly.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62566 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-06 20:47:52 +00:00
Vadim Zeitlin
aa2444bd9e Prefer to use standard selection colour in wxDataViewCustomRenderer.
We currently don't allow customizing the background colour of the selected
items which is always the system standard colour and so we should also use the
system standard selection foreground colour as a combination of a custom
foreground and standard background may be completely unreadable.

Notice that it is still possible to use custom colour if really needed from a
custom renderer by removing wxDATAVIEW_CELL_SELECTED from the flags before
calling the base class version of RenderText().

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62565 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-06 20:47:44 +00:00
Stefan Csomor
f2d5064cca adding support for wxShowEvent
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62564 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-06 17:33:55 +00:00
Vadim Zeitlin
636a334145 Compilation fix after r62562.
Use char*, not wxChar*, for format specification strings.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 15:37:48 +00:00
Vadim Zeitlin
651548666a Change wxLongLongFmtSpec to be a non-wide string.
As with other ANSI/Unicode unification changes, we choose to preserve
compatibility with the existing code using wxLongLongFmtSpec in ANSI build
and require people using it in Unicode build to change their code.

Closes #11372.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62562 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 14:59:55 +00:00
Vadim Zeitlin
7b611a3ae9 Recognize UNCs starting with forward slashes too in wxFileName.
Treat \\share\path and //share/path in the same way (for wxPATH_DOS paths).

Add a test for UNC parsing to the unit test.

Closes #11376.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62561 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 14:59:39 +00:00
Vadim Zeitlin
eb6fda807a No real changes, just correct "synonim" typo in comments.
Closes #11408.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62560 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 14:59:30 +00:00
Vadim Zeitlin
2b76dfb048 Implement wxFindWindowAtPoint() correctly for wxOSX/Carbon.
Use Carbon FindWindow() function instead of the generic wx version which
doesn't take the relative windows Z-order into account correctly.

Closes #11412.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62559 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 14:59:14 +00:00
Kevin Ollivier
32e806fe7f Create an autorelease pool to catch objects created during several special situations, like customized initialization, so that we don't leak there.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62557 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-05 00:31:36 +00:00
Vadim Zeitlin
a3873c6f9c Revert "trivial" change of r61772.
The "slight code simplification" of r61772 broke the code as it could now
crash if dangling m_Cell pointer was used during parsing. Revert it and add a
comment explaining why the code is written in the way it is.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62556 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-04 16:15:52 +00:00
Paul Cornett
69cecdb1c4 work around probable bug in GTK+ 2.18 when calling WriteText on a new, empty control, #11409
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62555 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-04 05:18:38 +00:00
Vadim Zeitlin
80842e1632 Document wxDocument::SetDocumentSaved().
While this function is usually called by wx itself it may be useful to call it
explicitly in some particular situations, as documented in the function
description, so make it officially public.

Closes #11396.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62546 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-03 14:12:14 +00:00
Jaakko Salli
ddadf560da Some wxComboCtrlBase member functions were enclosed within incorrect compatibility condition
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62537 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-02 14:57:35 +00:00
Michael Wetherell
03ba71bdf8 Do trunk builds on ravnsgaard.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62536 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-02 06:27:26 +00:00
Kevin Ollivier
16671f229a Start on Get/SetStyle support for OS X Cocoa wxTextCtrl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-01 00:58:04 +00:00
Kevin Ollivier
19b4098602 wxColour -> NSColor conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62530 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-11-01 00:56:23 +00:00
Kevin Ollivier
f7946addb2 NSFont -> wxFont conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62526 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 23:00:04 +00:00
Kevin Ollivier
b478f24288 Adding NSColor -> wxColour conversion.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62525 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 22:20:27 +00:00
Kevin Ollivier
a7ebaf0ddd Bakefile 0.2.8 rebake.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62522 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 20:56:47 +00:00
Kevin Ollivier
fcc9ca7f72 Update to Bakefile 0.2.8.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62521 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 20:52:55 +00:00
Paul Cornett
e88f9403f0 make sure ShowWithoutActivating only takes effect once
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62520 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 16:29:19 +00:00
Vadim Zeitlin
74d9b8fbd6 Make public and document wxDataView{Index,Virtual}ListModel::GetCount().
This method is useful for getting the number of items in the control and
should be part of the public API instead of being marked as internal.

Closes #11380.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62519 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 15:58:19 +00:00
Vadim Zeitlin
1f22f9a50b Fix wx headers compilation in mingw32 strict ANSI mode.
Add checks for !defined(__STRICT_ANSI__) when checking for various common but
non-standard CRT extensions.

This allows compiling programs using wx with g++ -std=c++[0x] option (notice
that compiling wx itself using it still doesn't work).

Closes #11374.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62518 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 15:58:05 +00:00
Vadim Zeitlin
0ead57d528 No real changes, just fix a typo in wxDataViewModel::Compare().
Return -1 from the comparison function instead of -11 when comparing
wxDateTime values. It shouldn't matter which value is returned as long as it's
negative but it is definitely tidier.

Closes #11381.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62517 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 15:57:58 +00:00
Vadim Zeitlin
d831e2db16 Return the real column width from wxOSX wxDataViewColumn::GetWidth().
Code used to return the last programmatically set width value instead of the
real column width which could have been changed by user if the column was
resizeable, fix this by returning the current NSTableColumn:width value.

Closes #11397.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62516 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-31 15:57:51 +00:00
Paul Cornett
52802b0727 implement ShowWithoutActivating for GTK+
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62510 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-30 07:39:58 +00:00
Kevin Ollivier
335b5afa77 Compilation fix for last commit.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-30 06:01:16 +00:00
Kevin Ollivier
dbc7ceb925 Initial ShowWithoutActivating implementations for Mac and Windows, and attempt to improve IsActive behavior on Mac. Also adding ShowWithoutActivating() and Show/Hide tests, but until the mainloop issues are resolved, not adding them to tests.bkl.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-30 05:04:47 +00:00
Jouk Jansen
bc7879ec4c fixing wx/evtloop.h for gtk1
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62507 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2009-10-29 07:30:42 +00:00