From 79b850659c8a2d2dca03efb92997ae726eb096d2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Sun, 8 Dec 2013 19:49:30 +0100 Subject: [PATCH] wx debugging: ostream<< for wxTreeItemId --- src/common/wx.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/common/wx.h b/src/common/wx.h index 60823b223..a7bc0d887 100644 --- a/src/common/wx.h +++ b/src/common/wx.h @@ -27,6 +27,7 @@ #include #include #include +#include #include "common/logger.h" @@ -103,6 +104,17 @@ operator <<(std::ostream &out, # endif #endif +inline std::ostream & +operator <<(std::ostream &out, + wxTreeItemId const &id) { +#if wxCHECK_VERSION(2, 9, 0) + out << "ItemID[" << id.IsOk() << "@" << id.GetID() << "]"; +#else + out << "ItemID[" << id.IsOk() << "@" << id.m_pItem << "]"; +#endif + return out; +} + // Use wxComboBox on non-Windows builds with wxWidgets 2.8.0 and newer // because GTK's combo box has serious problems (see bug 339). // wxWidgets 2.9.x's default wxComboBox is good, though.