diff --git a/Makefile.in b/Makefile.in
index 782aa59413..a5c48ea26c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -3872,6 +3872,7 @@ COND_USE_GUI_1_ALL_GUI_HEADERS = \
wx/systhemectrl.h \
wx/collheaderctrl.h \
wx/generic/collheaderctrl.h \
+ wx/itemattr.h \
$(LOWLEVEL_HDR) \
$(GUI_CORE_HEADERS) \
$(ADVANCED_HDR) \
diff --git a/build/bakefiles/files.bkl b/build/bakefiles/files.bkl
index e8a3dc4630..79a311f57a 100644
--- a/build/bakefiles/files.bkl
+++ b/build/bakefiles/files.bkl
@@ -1181,6 +1181,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
wx/systhemectrl.h
wx/collheaderctrl.h
wx/generic/collheaderctrl.h
+ wx/itemattr.h
diff --git a/build/files b/build/files
index c75433c695..b28fd79527 100644
--- a/build/files
+++ b/build/files
@@ -1039,6 +1039,7 @@ GUI_CMN_HDR =
wx/imagtga.h
wx/imagtiff.h
wx/imagxpm.h
+ wx/itemattr.h
wx/listbase.h
wx/listbook.h
wx/listctrl.h
diff --git a/build/msw/wx_core.vcxproj b/build/msw/wx_core.vcxproj
index 425d1e1845..fc524cf554 100644
--- a/build/msw/wx_core.vcxproj
+++ b/build/msw/wx_core.vcxproj
@@ -1379,6 +1379,7 @@
+
diff --git a/build/msw/wx_core.vcxproj.filters b/build/msw/wx_core.vcxproj.filters
index 39e16aeb8f..5a8a2cd509 100644
--- a/build/msw/wx_core.vcxproj.filters
+++ b/build/msw/wx_core.vcxproj.filters
@@ -690,6 +690,9 @@
MSW Sources
+
+ MSW Sources
+
MSW Sources
@@ -897,9 +900,6 @@
Common Sources
-
- MSW Sources
-
@@ -928,6 +928,9 @@
Common Headers
+
+ Common Headers
+
Common Headers
@@ -1312,6 +1315,9 @@
Common Headers
+
+ Common Headers
+
Common Headers
@@ -1672,9 +1678,6 @@
MSW Headers
-
- Common Headers
-
Common Headers
diff --git a/build/msw/wx_vc7_core.vcproj b/build/msw/wx_vc7_core.vcproj
index 1a69b3b619..363ba1eb54 100644
--- a/build/msw/wx_vc7_core.vcproj
+++ b/build/msw/wx_vc7_core.vcproj
@@ -2285,6 +2285,9 @@
+
+
diff --git a/build/msw/wx_vc8_core.vcproj b/build/msw/wx_vc8_core.vcproj
index c87b463021..0e1dcaa624 100644
--- a/build/msw/wx_vc8_core.vcproj
+++ b/build/msw/wx_vc8_core.vcproj
@@ -3548,6 +3548,10 @@
RelativePath="..\..\include\wx\infobar.h"
>
+
+
diff --git a/build/msw/wx_vc9_core.vcproj b/build/msw/wx_vc9_core.vcproj
index 24d92eb874..27ac832be8 100644
--- a/build/msw/wx_vc9_core.vcproj
+++ b/build/msw/wx_vc9_core.vcproj
@@ -3544,6 +3544,10 @@
RelativePath="..\..\include\wx\infobar.h"
>
+
+
diff --git a/include/wx/generic/private/listctrl.h b/include/wx/generic/private/listctrl.h
index 9cd50707a8..0f5c002632 100644
--- a/include/wx/generic/private/listctrl.h
+++ b/include/wx/generic/private/listctrl.h
@@ -85,8 +85,8 @@ public:
void GetItem( wxListItem &info ) const;
- void SetAttr(wxListItemAttr *attr) { m_attr = attr; }
- wxListItemAttr *GetAttr() const { return m_attr; }
+ void SetAttr(wxItemAttr *attr) { m_attr = attr; }
+ wxItemAttr *GetAttr() const { return m_attr; }
public:
// the item image or -1
@@ -103,7 +103,7 @@ public:
wxListMainWindow *m_owner;
// custom attributes or NULL
- wxListItemAttr *m_attr;
+ wxItemAttr *m_attr;
protected:
// common part of all ctors
@@ -263,8 +263,8 @@ public:
wxString GetText(int index) const;
void SetText( int index, const wxString& s );
- wxListItemAttr *GetAttr() const;
- void SetAttr(wxListItemAttr *attr);
+ wxItemAttr *GetAttr() const;
+ void SetAttr(wxItemAttr *attr);
// return true if the highlighting really changed
bool Highlight( bool on );
diff --git a/include/wx/itemattr.h b/include/wx/itemattr.h
new file mode 100644
index 0000000000..90ae149d85
--- /dev/null
+++ b/include/wx/itemattr.h
@@ -0,0 +1,65 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/itemattr.h
+// Purpose: wxItemAttr class declaration
+// Author: Vadim Zeitlin
+// Created: 2016-04-16 (extracted from wx/listctrl.h)
+// Copyright: (c) 2016 Vadim Zeitlin
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_ITEMATTR_H_
+#define _WX_ITEMATTR_H_
+
+// ----------------------------------------------------------------------------
+// wxItemAttr: a structure containing the visual attributes of an item
+// ----------------------------------------------------------------------------
+
+class wxItemAttr
+{
+public:
+ // ctors
+ wxItemAttr() { }
+ wxItemAttr(const wxColour& colText,
+ const wxColour& colBack,
+ const wxFont& font)
+ : m_colText(colText), m_colBack(colBack), m_font(font)
+ {
+ }
+
+ // default copy ctor, assignment operator and dtor are ok
+
+
+ // setters
+ void SetTextColour(const wxColour& colText) { m_colText = colText; }
+ void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
+ void SetFont(const wxFont& font) { m_font = font; }
+
+ // accessors
+ bool HasTextColour() const { return m_colText.IsOk(); }
+ bool HasBackgroundColour() const { return m_colBack.IsOk(); }
+ bool HasFont() const { return m_font.IsOk(); }
+
+ const wxColour& GetTextColour() const { return m_colText; }
+ const wxColour& GetBackgroundColour() const { return m_colBack; }
+ const wxFont& GetFont() const { return m_font; }
+
+
+ // this is almost like assignment operator except it doesn't overwrite the
+ // fields unset in the source attribute
+ void AssignFrom(const wxItemAttr& source)
+ {
+ if ( source.HasTextColour() )
+ SetTextColour(source.GetTextColour());
+ if ( source.HasBackgroundColour() )
+ SetBackgroundColour(source.GetBackgroundColour());
+ if ( source.HasFont() )
+ SetFont(source.GetFont());
+ }
+
+private:
+ wxColour m_colText,
+ m_colBack;
+ wxFont m_font;
+};
+
+#endif // _WX_ITEMATTR_H_
diff --git a/include/wx/listbase.h b/include/wx/listbase.h
index 1c79de0084..841b4c00fa 100644
--- a/include/wx/listbase.h
+++ b/include/wx/listbase.h
@@ -16,6 +16,7 @@
#include "wx/gdicmn.h"
#include "wx/event.h"
#include "wx/control.h"
+#include "wx/itemattr.h"
#include "wx/systhemectrl.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
@@ -158,60 +159,10 @@ enum
wxLIST_FIND_RIGHT
};
-// ----------------------------------------------------------------------------
-// wxListItemAttr: a structure containing the visual attributes of an item
-// ----------------------------------------------------------------------------
-
-// TODO: this should be renamed to wxItemAttr or something general like this
-// and used as base class for wxTextAttr which duplicates this class
-// entirely currently
-class WXDLLIMPEXP_CORE wxListItemAttr
-{
-public:
- // ctors
- wxListItemAttr() { }
- wxListItemAttr(const wxColour& colText,
- const wxColour& colBack,
- const wxFont& font)
- : m_colText(colText), m_colBack(colBack), m_font(font)
- {
- }
-
- // default copy ctor, assignment operator and dtor are ok
-
-
- // setters
- void SetTextColour(const wxColour& colText) { m_colText = colText; }
- void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
- void SetFont(const wxFont& font) { m_font = font; }
-
- // accessors
- bool HasTextColour() const { return m_colText.IsOk(); }
- bool HasBackgroundColour() const { return m_colBack.IsOk(); }
- bool HasFont() const { return m_font.IsOk(); }
-
- const wxColour& GetTextColour() const { return m_colText; }
- const wxColour& GetBackgroundColour() const { return m_colBack; }
- const wxFont& GetFont() const { return m_font; }
-
-
- // this is almost like assignment operator except it doesn't overwrite the
- // fields unset in the source attribute
- void AssignFrom(const wxListItemAttr& source)
- {
- if ( source.HasTextColour() )
- SetTextColour(source.GetTextColour());
- if ( source.HasBackgroundColour() )
- SetBackgroundColour(source.GetBackgroundColour());
- if ( source.HasFont() )
- SetFont(source.GetFont());
- }
-
-private:
- wxColour m_colText,
- m_colBack;
- wxFont m_font;
-};
+// For compatibility, define the old name for this class. There is no need to
+// deprecate it as it doesn't cost us anything to keep this typedef, but the
+// new code should prefer to use the new wxItemAttr name.
+typedef wxItemAttr wxListItemAttr;
// ----------------------------------------------------------------------------
// wxListItem: the item or column info, used to exchange data with wxListCtrl
@@ -237,7 +188,7 @@ public:
{
// copy list item attributes
if ( item.HasAttributes() )
- m_attr = new wxListItemAttr(*item.GetAttributes());
+ m_attr = new wxItemAttr(*item.GetAttributes());
}
wxListItem& operator=(const wxListItem& item)
@@ -254,7 +205,7 @@ public:
m_data = item.m_data;
m_format = item.m_format;
m_width = item.m_width;
- m_attr = item.m_attr ? new wxListItemAttr(*item.m_attr) : NULL;
+ m_attr = item.m_attr ? new wxItemAttr(*item.m_attr) : NULL;
}
return *this;
@@ -310,7 +261,7 @@ public:
int GetWidth() const { return m_width; }
wxListColumnFormat GetAlign() const { return (wxListColumnFormat)m_format; }
- wxListItemAttr *GetAttributes() const { return m_attr; }
+ wxItemAttr *GetAttributes() const { return m_attr; }
bool HasAttributes() const { return m_attr != NULL; }
wxColour GetTextColour() const
@@ -342,10 +293,10 @@ public:
protected:
// creates m_attr if we don't have it yet
- wxListItemAttr& Attributes()
+ wxItemAttr& Attributes()
{
if ( !m_attr )
- m_attr = new wxListItemAttr;
+ m_attr = new wxItemAttr;
return *m_attr;
}
@@ -364,7 +315,7 @@ protected:
m_width = 0;
}
- wxListItemAttr *m_attr; // optional pointer to the items style
+ wxItemAttr *m_attr; // optional pointer to the items style
private:
wxDECLARE_DYNAMIC_CLASS(wxListItem);
@@ -443,7 +394,7 @@ public:
virtual bool SetColumnWidth(int col, int width) = 0;
// return the attribute for the item (may return NULL if none)
- virtual wxListItemAttr *OnGetItemAttr(long item) const;
+ virtual wxItemAttr *OnGetItemAttr(long item) const;
// Other miscellaneous accessors.
// ------------------------------
@@ -475,7 +426,7 @@ protected:
private:
// user defined color to draw row lines, may be invalid
- wxListItemAttr m_alternateRowColour;
+ wxItemAttr m_alternateRowColour;
};
// ----------------------------------------------------------------------------
diff --git a/include/wx/msw/listctrl.h b/include/wx/msw/listctrl.h
index 1b8beaed63..1790454cce 100644
--- a/include/wx/msw/listctrl.h
+++ b/include/wx/msw/listctrl.h
@@ -402,7 +402,7 @@ protected:
// get the item attribute, either by quering it for virtual control, or by
// returning the one previously set using setter methods for a normal one
- wxListItemAttr *DoGetItemColumnAttr(long item, long column) const;
+ wxItemAttr *DoGetItemColumnAttr(long item, long column) const;
wxTextCtrl* m_textCtrl; // The control used for editing a label
@@ -437,7 +437,7 @@ protected:
virtual int OnGetItemColumnImage(long item, long column) const;
// return the attribute for the given item and column (may return NULL if none)
- virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
+ virtual wxItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
{
return OnGetItemAttr(item);
}
diff --git a/include/wx/msw/treectrl.h b/include/wx/msw/treectrl.h
index 914cddc395..b9206acfb9 100644
--- a/include/wx/msw/treectrl.h
+++ b/include/wx/msw/treectrl.h
@@ -34,7 +34,8 @@ class WXDLLIMPEXP_FWD_CORE wxDragImage;
struct WXDLLIMPEXP_FWD_CORE wxTreeViewItem;
// hash storing attributes for our items
-WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxTreeItemAttr *, wxMapTreeAttr);
+class wxItemAttr;
+WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP(wxItemAttr *, wxMapTreeAttr);
// ----------------------------------------------------------------------------
// wxTreeCtrl
diff --git a/include/wx/qt/listctrl.h b/include/wx/qt/listctrl.h
index b534a0128e..3b08104dcc 100644
--- a/include/wx/qt/listctrl.h
+++ b/include/wx/qt/listctrl.h
@@ -279,7 +279,7 @@ public:
virtual int OnGetItemColumnImage(long item, long column) const;
// return the attribute for the given item and column (may return NULL if none)
- virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
+ virtual wxItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
{
return OnGetItemAttr(item);
}
diff --git a/include/wx/treebase.h b/include/wx/treebase.h
index 6ce145f603..f7513bb2ab 100644
--- a/include/wx/treebase.h
+++ b/include/wx/treebase.h
@@ -180,40 +180,6 @@ static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
// tree ctrl default name
extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeCtrlNameStr[];
-// ----------------------------------------------------------------------------
-// wxTreeItemAttr: a structure containing the visual attributes of an item
-// ----------------------------------------------------------------------------
-
-class WXDLLIMPEXP_CORE wxTreeItemAttr
-{
-public:
- // ctors
- wxTreeItemAttr() { }
- wxTreeItemAttr(const wxColour& colText,
- const wxColour& colBack,
- const wxFont& font)
- : m_colText(colText), m_colBack(colBack), m_font(font) { }
-
- // setters
- void SetTextColour(const wxColour& colText) { m_colText = colText; }
- void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
- void SetFont(const wxFont& font) { m_font = font; }
-
- // accessors
- bool HasTextColour() const { return m_colText.IsOk(); }
- bool HasBackgroundColour() const { return m_colBack.IsOk(); }
- bool HasFont() const { return m_font.IsOk(); }
-
- const wxColour& GetTextColour() const { return m_colText; }
- const wxColour& GetBackgroundColour() const { return m_colBack; }
- const wxFont& GetFont() const { return m_font; }
-
-private:
- wxColour m_colText,
- m_colBack;
- wxFont m_font;
-};
-
// ----------------------------------------------------------------------------
// wxTreeEvent is a special class for all events associated with tree controls
//
diff --git a/interface/wx/itemattr.h b/interface/wx/itemattr.h
new file mode 100644
index 0000000000..49e72bd510
--- /dev/null
+++ b/interface/wx/itemattr.h
@@ -0,0 +1,82 @@
+/////////////////////////////////////////////////////////////////////////////
+// Name: wx/itemattr.h
+// Purpose: wxItemAttr documentation
+// Author: Vadim Zeitlin
+// Copyright: (c) 2016 Vadim Zeitlin
+// Licence: wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
+
+/**
+ @class wxItemAttr
+
+ Represents the attributes (color, font, ...) of an item of a control with
+ multiple items such as e.g. wxListCtrl.
+
+ @library{wxcore}
+ @category{data}
+
+ @see @ref overview_listctrl
+
+ @since 3.1.1 (previous versions had the identical wxListItemAttr class)
+*/
+class wxItemAttr
+{
+public:
+ /**
+ Default Constructor.
+ */
+ wxItemAttr();
+
+ /**
+ Construct a wxItemAttr with the specified foreground and
+ background colors and font.
+ */
+ wxItemAttr(const wxColour& colText,
+ const wxColour& colBack,
+ const wxFont& font);
+
+ /**
+ Returns the currently set background color.
+ */
+ const wxColour& GetBackgroundColour() const;
+
+ /**
+ Returns the currently set font.
+ */
+ const wxFont& GetFont() const;
+
+ /**
+ Returns the currently set text color.
+ */
+ const wxColour& GetTextColour() const;
+
+ /**
+ Returns @true if the currently set background color is valid.
+ */
+ bool HasBackgroundColour() const;
+
+ /**
+ Returns @true if the currently set font is valid.
+ */
+ bool HasFont() const;
+
+ /**
+ Returns @true if the currently set text color is valid.
+ */
+ bool HasTextColour() const;
+
+ /**
+ Sets a new background color.
+ */
+ void SetBackgroundColour(const wxColour& colour);
+
+ /**
+ Sets a new font.
+ */
+ void SetFont(const wxFont& font);
+
+ /**
+ Sets a new text color.
+ */
+ void SetTextColour(const wxColour& colour);
+};
diff --git a/interface/wx/listctrl.h b/interface/wx/listctrl.h
index cfe47e97df..c1538bfd1c 100644
--- a/interface/wx/listctrl.h
+++ b/interface/wx/listctrl.h
@@ -1278,14 +1278,14 @@ protected:
@c item or @NULL to use the default appearance parameters.
wxListCtrl will not delete the pointer or keep a reference of it.
- You can return the same wxListItemAttr pointer for every OnGetItemAttr() call.
+ You can return the same wxItemAttr pointer for every OnGetItemAttr() call.
The base class version always returns @NULL.
@see OnGetItemImage(), OnGetItemColumnImage(), OnGetItemText(),
OnGetItemColumnAttr()
*/
- virtual wxListItemAttr* OnGetItemAttr(long item) const;
+ virtual wxItemAttr* OnGetItemAttr(long item) const;
/**
This function may be overridden in the derived class for a control with
@@ -1302,7 +1302,7 @@ protected:
@see OnGetItemAttr(), OnGetItemText(),
OnGetItemImage(), OnGetItemColumnImage(),
*/
- virtual wxListItemAttr* OnGetItemColumnAttr(long item, long column) const;
+ virtual wxItemAttr* OnGetItemColumnAttr(long item, long column) const;
/**
Override this function in the derived class for a control with
@@ -1513,80 +1513,6 @@ wxEventType wxEVT_LIST_ITEM_CHECKED;
wxEventType wxEVT_LIST_ITEM_UNCHECKED;
-/**
- @class wxListItemAttr
-
- Represents the attributes (color, font, ...) of a wxListCtrl's wxListItem.
-
- @library{wxcore}
- @category{data}
-
- @see @ref overview_listctrl, wxListCtrl, wxListItem
-*/
-class wxListItemAttr
-{
-public:
- /**
- Default Constructor.
- */
- wxListItemAttr();
-
- /**
- Construct a wxListItemAttr with the specified foreground and
- background colors and font.
- */
- wxListItemAttr(const wxColour& colText,
- const wxColour& colBack,
- const wxFont& font);
-
- /**
- Returns the currently set background color.
- */
- const wxColour& GetBackgroundColour() const;
-
- /**
- Returns the currently set font.
- */
- const wxFont& GetFont() const;
-
- /**
- Returns the currently set text color.
- */
- const wxColour& GetTextColour() const;
-
- /**
- Returns @true if the currently set background color is valid.
- */
- bool HasBackgroundColour() const;
-
- /**
- Returns @true if the currently set font is valid.
- */
- bool HasFont() const;
-
- /**
- Returns @true if the currently set text color is valid.
- */
- bool HasTextColour() const;
-
- /**
- Sets a new background color.
- */
- void SetBackgroundColour(const wxColour& colour);
-
- /**
- Sets a new font.
- */
- void SetFont(const wxFont& font);
-
- /**
- Sets a new text color.
- */
- void SetTextColour(const wxColour& colour);
-};
-
-
-
/**
@class wxListView
diff --git a/samples/listctrl/listtest.cpp b/samples/listctrl/listtest.cpp
index c96eab1366..e839398409 100644
--- a/samples/listctrl/listtest.cpp
+++ b/samples/listctrl/listtest.cpp
@@ -1226,7 +1226,7 @@ void MyListCtrl::OnListKeyDown(wxListEvent& event)
GetItem(info);
- wxListItemAttr *attr = info.GetAttributes();
+ wxItemAttr *attr = info.GetAttributes();
if ( !attr || !attr->HasTextColour() )
{
info.SetTextColour(*wxCYAN);
@@ -1416,13 +1416,13 @@ int MyListCtrl::OnGetItemColumnImage(long item, long column) const
return -1;
}
-wxListItemAttr *MyListCtrl::OnGetItemAttr(long item) const
+wxItemAttr *MyListCtrl::OnGetItemAttr(long item) const
{
// test to check that RefreshItem() works correctly: when m_updated is
// set to some item and it is refreshed, we highlight the item
if ( item == m_updated )
{
- static wxListItemAttr s_attrHighlight(*wxRED, wxNullColour, wxNullFont);
+ static wxItemAttr s_attrHighlight(*wxRED, wxNullColour, wxNullFont);
return &s_attrHighlight;
}
diff --git a/samples/listctrl/listtest.h b/samples/listctrl/listtest.h
index f1f21b5b9a..7494dfec97 100644
--- a/samples/listctrl/listtest.h
+++ b/samples/listctrl/listtest.h
@@ -84,7 +84,7 @@ private:
virtual wxString OnGetItemText(long item, long column) const wxOVERRIDE;
virtual int OnGetItemColumnImage(long item, long column) const wxOVERRIDE;
- virtual wxListItemAttr *OnGetItemAttr(long item) const wxOVERRIDE;
+ virtual wxItemAttr *OnGetItemAttr(long item) const wxOVERRIDE;
long m_updated;
diff --git a/src/common/listctrlcmn.cpp b/src/common/listctrlcmn.cpp
index 25f29b8042..518718e94f 100644
--- a/src/common/listctrlcmn.cpp
+++ b/src/common/listctrlcmn.cpp
@@ -244,10 +244,10 @@ void wxListCtrlBase::EnableAlternateRowColours(bool enable)
}
}
-wxListItemAttr *wxListCtrlBase::OnGetItemAttr(long item) const
+wxItemAttr *wxListCtrlBase::OnGetItemAttr(long item) const
{
return (m_alternateRowColour.GetBackgroundColour().IsOk() && (item % 2))
- ? wxConstCast(&m_alternateRowColour, wxListItemAttr)
+ ? wxConstCast(&m_alternateRowColour, wxItemAttr)
: NULL; // no attributes by default
}
diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp
index ef7aa27c6c..a3813d0323 100644
--- a/src/generic/listctrl.cpp
+++ b/src/generic/listctrl.cpp
@@ -168,7 +168,7 @@ void wxListItemData::SetItem( const wxListItem &info )
if ( m_attr )
m_attr->AssignFrom(*info.GetAttributes());
else
- m_attr = new wxListItemAttr(*info.GetAttributes());
+ m_attr = new wxItemAttr(*info.GetAttributes());
}
if ( m_rect )
@@ -654,7 +654,7 @@ int wxListLineData::GetImage( int index ) const
return item->GetImage();
}
-wxListItemAttr *wxListLineData::GetAttr() const
+wxItemAttr *wxListLineData::GetAttr() const
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
wxCHECK_MSG( node, NULL, wxT("invalid column index in GetAttr()") );
@@ -663,7 +663,7 @@ wxListItemAttr *wxListLineData::GetAttr() const
return item->GetAttr();
}
-void wxListLineData::SetAttr(wxListItemAttr *attr)
+void wxListLineData::SetAttr(wxItemAttr *attr)
{
wxListItemDataList::compatibility_iterator node = m_items.GetFirst();
wxCHECK_RET( node, wxT("invalid column index in SetAttr()") );
@@ -677,7 +677,7 @@ void wxListLineData::ApplyAttributes(wxDC *dc,
bool highlighted,
bool current)
{
- const wxListItemAttr * const attr = GetAttr();
+ const wxItemAttr * const attr = GetAttr();
wxWindow * const listctrl = m_owner->GetParent();
diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp
index 1aeac569fd..f45fca5e24 100644
--- a/src/generic/treectlg.cpp
+++ b/src/generic/treectlg.cpp
@@ -37,6 +37,7 @@
#include "wx/generic/treectlg.h"
#include "wx/imaglist.h"
+#include "wx/itemattr.h"
#include "wx/renderer.h"
@@ -223,7 +224,7 @@ public:
{
wxFont font;
- wxTreeItemAttr * const attr = GetAttributes();
+ wxItemAttr * const attr = GetAttributes();
if ( attr && attr->HasFont() )
font = attr->GetFont();
else if ( IsBold() )
@@ -282,19 +283,19 @@ public:
// attributes
// get them - may be NULL
- wxTreeItemAttr *GetAttributes() const { return m_attr; }
+ wxItemAttr *GetAttributes() const { return m_attr; }
// get them ensuring that the pointer is not NULL
- wxTreeItemAttr& Attr()
+ wxItemAttr& Attr()
{
if ( !m_attr )
{
- m_attr = new wxTreeItemAttr;
+ m_attr = new wxItemAttr;
m_ownsAttr = true;
}
return *m_attr;
}
// set them
- void SetAttributes(wxTreeItemAttr *attr)
+ void SetAttributes(wxItemAttr *attr)
{
if ( m_ownsAttr ) delete m_attr;
m_attr = attr;
@@ -303,7 +304,7 @@ public:
m_widthText = -1;
}
// set them and delete when done
- void AssignAttributes(wxTreeItemAttr *attr)
+ void AssignAttributes(wxItemAttr *attr)
{
SetAttributes(attr);
m_ownsAttr = true;
@@ -335,7 +336,7 @@ private:
wxArrayGenericTreeItems m_children; // list of children
wxGenericTreeItem *m_parent; // parent of this item
- wxTreeItemAttr *m_attr; // attributes???
+ wxItemAttr *m_attr; // attributes???
// tree ctrl images for the normal, selected, expanded and
// expanded+selected states
@@ -2554,7 +2555,7 @@ void wxGenericTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
else
{
wxColour colBg;
- wxTreeItemAttr * const attr = item->GetAttributes();
+ wxItemAttr * const attr = item->GetAttributes();
if ( attr && attr->HasBackgroundColour() )
{
drawItemBackground =
@@ -2789,7 +2790,7 @@ wxGenericTreeCtrl::PaintLevel(wxGenericTreeItem *item,
}
else
{
- wxTreeItemAttr *attr = item->GetAttributes();
+ wxItemAttr *attr = item->GetAttributes();
if (attr && attr->HasTextColour())
colText = attr->GetTextColour();
else
diff --git a/src/msw/listctrl.cpp b/src/msw/listctrl.cpp
index 2b2e42d79e..450fee8cda 100644
--- a/src/msw/listctrl.cpp
+++ b/src/msw/listctrl.cpp
@@ -198,7 +198,7 @@ private:
///////////////////////////////////////////////////////
// Problem:
// The MSW version had problems with SetTextColour() et
-// al as the wxListItemAttr's were stored keyed on the
+// al as the wxItemAttr's were stored keyed on the
// item index. If a item was inserted anywhere but the end
// of the list the text attributes (colour etc) for
// the following items were out of sync.
@@ -223,7 +223,7 @@ public:
wxMSWListItemData() : attr(NULL), lParam(0) {}
~wxMSWListItemData() { delete attr; }
- wxListItemAttr *attr;
+ wxItemAttr *attr;
LPARAM lParam; // real user data
wxDECLARE_NO_COPY_CLASS(wxMSWListItemData);
@@ -811,13 +811,13 @@ bool wxListCtrl::SetItem(wxListItem& info)
// attributes
if ( info.HasAttributes() )
{
- const wxListItemAttr& attrNew = *info.GetAttributes();
+ const wxItemAttr& attrNew = *info.GetAttributes();
// don't overwrite the already set attributes if we have them
if ( data->attr )
data->attr->AssignFrom(attrNew);
else
- data->attr = new wxListItemAttr(attrNew);
+ data->attr = new wxItemAttr(attrNew);
}
}
@@ -1754,7 +1754,7 @@ long wxListCtrl::InsertItem(const wxListItem& info)
if ( info.HasAttributes() )
{
// take copy of attributes
- data->attr = new wxListItemAttr(*info.GetAttributes());
+ data->attr = new wxItemAttr(*info.GetAttributes());
// and remember that we have some now...
m_hasAnyAttr = true;
@@ -2858,7 +2858,7 @@ static void HandleItemPaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont)
static WXLPARAM HandleItemPrepaint(wxListCtrl *listctrl,
LPNMLVCUSTOMDRAW pLVCD,
- wxListItemAttr *attr)
+ wxItemAttr *attr)
{
if ( !attr )
{
@@ -3103,7 +3103,7 @@ int wxListCtrl::OnGetItemColumnImage(long item, long column) const
return -1;
}
-wxListItemAttr *wxListCtrl::DoGetItemColumnAttr(long item, long column) const
+wxItemAttr *wxListCtrl::DoGetItemColumnAttr(long item, long column) const
{
if ( IsVirtual() )
return OnGetItemColumnAttr(item, column);
diff --git a/src/msw/treectrl.cpp b/src/msw/treectrl.cpp
index a2dc9138b4..25ca687277 100644
--- a/src/msw/treectrl.cpp
+++ b/src/msw/treectrl.cpp
@@ -39,6 +39,7 @@
#include "wx/msw/private.h"
#include "wx/imaglist.h"
+#include "wx/itemattr.h"
#include "wx/msw/dragimag.h"
#include "wx/msw/uxtheme.h"
@@ -1146,14 +1147,14 @@ void wxTreeCtrl::SetItemTextColour(const wxTreeItemId& item,
{
wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
- wxTreeItemAttr *attr;
+ wxItemAttr *attr;
wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
if ( it == m_attrs.end() )
{
m_hasAnyAttr = true;
m_attrs[item.m_pItem] =
- attr = new wxTreeItemAttr;
+ attr = new wxItemAttr;
}
else
{
@@ -1170,14 +1171,14 @@ void wxTreeCtrl::SetItemBackgroundColour(const wxTreeItemId& item,
{
wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
- wxTreeItemAttr *attr;
+ wxItemAttr *attr;
wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
if ( it == m_attrs.end() )
{
m_hasAnyAttr = true;
m_attrs[item.m_pItem] =
- attr = new wxTreeItemAttr;
+ attr = new wxItemAttr;
}
else // already in the hash
{
@@ -1193,14 +1194,14 @@ void wxTreeCtrl::SetItemFont(const wxTreeItemId& item, const wxFont& font)
{
wxCHECK_RET( item.IsOk(), wxT("invalid tree item") );
- wxTreeItemAttr *attr;
+ wxItemAttr *attr;
wxMapTreeAttr::iterator it = m_attrs.find(item.m_pItem);
if ( it == m_attrs.end() )
{
m_hasAnyAttr = true;
m_attrs[item.m_pItem] =
- attr = new wxTreeItemAttr;
+ attr = new wxItemAttr;
}
else // already in the hash
{
@@ -3550,7 +3551,7 @@ bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
break;
}
- wxTreeItemAttr * const attr = it->second;
+ wxItemAttr * const attr = it->second;
wxTreeViewItem tvItem((void *)nmcd.dwItemSpec,
TVIF_STATE, TVIS_DROPHILITED);