1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/common/gdicmn.cpp
3 // Purpose: Common GDI classes
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/gdicmn.h"
25 #include "wx/palette.h"
27 #include "wx/cursor.h"
28 #include "wx/settings.h"
31 #include "wx/colour.h"
32 #include "wx/bitmap.h"
34 #include "wx/hashmap.h"
36 WXDLLIMPEXP_DATA_CORE(wxBrushList
*) wxTheBrushList
;
37 WXDLLIMPEXP_DATA_CORE(wxFontList
*) wxTheFontList
;
38 WXDLLIMPEXP_DATA_CORE(wxPenList
*) wxThePenList
;
40 WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
42 WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
43 WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
44 WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
45 WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
46 WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
47 WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
48 WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
50 WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
53 WX_DECLARE_STRING_HASH_MAP(wxColour
*, wxStringToColourHashMap
);
55 const wxSize
wxDefaultSize(wxDefaultCoord
, wxDefaultCoord
);
56 const wxPoint
wxDefaultPosition(wxDefaultCoord
, wxDefaultCoord
);
58 #if wxUSE_EXTENDED_RTTI
62 template<> void wxStringReadValue(const wxString
&s
, wxPoint
&data
)
64 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
67 template<> void wxStringWriteValue(wxString
&s
, const wxPoint
&data
)
69 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
72 wxCUSTOM_TYPE_INFO(wxPoint
, wxToStringConverter
<wxPoint
> , wxFromStringConverter
<wxPoint
>)
74 template<> void wxStringReadValue(const wxString
&s
, wxSize
&data
)
76 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
79 template<> void wxStringWriteValue(wxString
&s
, const wxSize
&data
)
81 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
84 wxCUSTOM_TYPE_INFO(wxSize
, wxToStringConverter
<wxSize
> , wxFromStringConverter
<wxSize
>)
88 wxRect::wxRect(const wxPoint
& point1
, const wxPoint
& point2
)
92 width
= point2
.x
- point1
.x
;
93 height
= point2
.y
- point1
.y
;
110 bool wxRect::operator==(const wxRect
& rect
) const
112 return ((x
== rect
.x
) &&
114 (width
== rect
.width
) &&
115 (height
== rect
.height
));
118 wxRect
wxRect::operator+(const wxRect
& rect
) const
120 int x1
= wxMin(this->x
, rect
.x
);
121 int y1
= wxMin(this->y
, rect
.y
);
122 int y2
= wxMax(y
+height
, rect
.height
+rect
.y
);
123 int x2
= wxMax(x
+width
, rect
.width
+rect
.x
);
124 return wxRect(x1
, y1
, x2
-x1
, y2
-y1
);
127 wxRect
& wxRect::Union(const wxRect
& rect
)
129 // ignore empty rectangles: union with an empty rectangle shouldn't extend
130 // this one to (0, 0)
131 if ( !width
|| !height
)
135 else if ( rect
.width
&& rect
.height
)
137 int x1
= wxMin(x
, rect
.x
);
138 int y1
= wxMin(y
, rect
.y
);
139 int y2
= wxMax(y
+ height
, rect
.height
+ rect
.y
);
140 int x2
= wxMax(x
+ width
, rect
.width
+ rect
.x
);
147 //else: we're not empty and rect is empty
152 wxRect
& wxRect::Inflate(wxCoord dx
, wxCoord dy
)
156 // Don't allow deflate to eat more width than we have,
157 // a well-defined rectangle cannot have negative width.
163 // The inflate is valid.
170 // Don't allow deflate to eat more height than we have,
171 // a well-defined rectangle cannot have negative height.
177 // The inflate is valid.
185 bool wxRect::Inside(int cx
, int cy
) const
187 return ( (cx
>= x
) && (cy
>= y
)
188 && ((cy
- y
) < height
)
189 && ((cx
- x
) < width
)
193 wxRect
& wxRect::Intersect(const wxRect
& rect
)
202 if ( x2
> rect
.GetRight() )
203 x2
= rect
.GetRight();
204 if ( y2
> rect
.GetBottom() )
205 y2
= rect
.GetBottom();
210 if ( width
<= 0 || height
<= 0 )
219 bool wxRect::Intersects(const wxRect
& rect
) const
221 wxRect r
= Intersect(rect
);
223 // if there is no intersection, both width and height are 0
227 // ============================================================================
229 // ============================================================================
231 // ----------------------------------------------------------------------------
232 // wxColourDatabase ctor/dtor
233 // ----------------------------------------------------------------------------
235 wxColourDatabase::wxColourDatabase ()
237 // will be created on demand in Initialize()
241 wxColourDatabase::~wxColourDatabase ()
245 WX_CLEAR_HASH_MAP(wxStringToColourHashMap
, *m_map
);
251 delete [] m_palTable
;
255 // Colour database stuff
256 void wxColourDatabase::Initialize()
260 // already initialized
264 m_map
= new wxStringToColourHashMap
;
266 static const struct wxColourDesc
273 {wxT("AQUAMARINE"),112, 219, 147},
274 {wxT("BLACK"),0, 0, 0},
275 {wxT("BLUE"), 0, 0, 255},
276 {wxT("BLUE VIOLET"), 159, 95, 159},
277 {wxT("BROWN"), 165, 42, 42},
278 {wxT("CADET BLUE"), 95, 159, 159},
279 {wxT("CORAL"), 255, 127, 0},
280 {wxT("CORNFLOWER BLUE"), 66, 66, 111},
281 {wxT("CYAN"), 0, 255, 255},
282 {wxT("DARK GREY"), 47, 47, 47}, // ?
284 {wxT("DARK GREEN"), 47, 79, 47},
285 {wxT("DARK OLIVE GREEN"), 79, 79, 47},
286 {wxT("DARK ORCHID"), 153, 50, 204},
287 {wxT("DARK SLATE BLUE"), 107, 35, 142},
288 {wxT("DARK SLATE GREY"), 47, 79, 79},
289 {wxT("DARK TURQUOISE"), 112, 147, 219},
290 {wxT("DIM GREY"), 84, 84, 84},
291 {wxT("FIREBRICK"), 142, 35, 35},
292 {wxT("FOREST GREEN"), 35, 142, 35},
293 {wxT("GOLD"), 204, 127, 50},
294 {wxT("GOLDENROD"), 219, 219, 112},
295 {wxT("GREY"), 128, 128, 128},
296 {wxT("GREEN"), 0, 255, 0},
297 {wxT("GREEN YELLOW"), 147, 219, 112},
298 {wxT("INDIAN RED"), 79, 47, 47},
299 {wxT("KHAKI"), 159, 159, 95},
300 {wxT("LIGHT BLUE"), 191, 216, 216},
301 {wxT("LIGHT GREY"), 192, 192, 192},
302 {wxT("LIGHT STEEL BLUE"), 143, 143, 188},
303 {wxT("LIME GREEN"), 50, 204, 50},
304 {wxT("LIGHT MAGENTA"), 255, 0, 255},
305 {wxT("MAGENTA"), 255, 0, 255},
306 {wxT("MAROON"), 142, 35, 107},
307 {wxT("MEDIUM AQUAMARINE"), 50, 204, 153},
308 {wxT("MEDIUM GREY"), 100, 100, 100},
309 {wxT("MEDIUM BLUE"), 50, 50, 204},
310 {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
311 {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
312 {wxT("MEDIUM ORCHID"), 147, 112, 219},
313 {wxT("MEDIUM SEA GREEN"), 66, 111, 66},
314 {wxT("MEDIUM SLATE BLUE"), 127, 0, 255},
315 {wxT("MEDIUM SPRING GREEN"), 127, 255, 0},
316 {wxT("MEDIUM TURQUOISE"), 112, 219, 219},
317 {wxT("MEDIUM VIOLET RED"), 219, 112, 147},
318 {wxT("MIDNIGHT BLUE"), 47, 47, 79},
319 {wxT("NAVY"), 35, 35, 142},
320 {wxT("ORANGE"), 204, 50, 50},
321 {wxT("ORANGE RED"), 255, 0, 127},
322 {wxT("ORCHID"), 219, 112, 219},
323 {wxT("PALE GREEN"), 143, 188, 143},
324 {wxT("PINK"), 188, 143, 234},
325 {wxT("PLUM"), 234, 173, 234},
326 {wxT("PURPLE"), 176, 0, 255},
327 {wxT("RED"), 255, 0, 0},
328 {wxT("SALMON"), 111, 66, 66},
329 {wxT("SEA GREEN"), 35, 142, 107},
330 {wxT("SIENNA"), 142, 107, 35},
331 {wxT("SKY BLUE"), 50, 153, 204},
332 {wxT("SLATE BLUE"), 0, 127, 255},
333 {wxT("SPRING GREEN"), 0, 255, 127},
334 {wxT("STEEL BLUE"), 35, 107, 142},
335 {wxT("TAN"), 219, 147, 112},
336 {wxT("THISTLE"), 216, 191, 216},
337 {wxT("TURQUOISE"), 173, 234, 234},
338 {wxT("VIOLET"), 79, 47, 79},
339 {wxT("VIOLET RED"), 204, 50, 153},
340 {wxT("WHEAT"), 216, 216, 191},
341 {wxT("WHITE"), 255, 255, 255},
342 {wxT("YELLOW"), 255, 255, 0},
343 {wxT("YELLOW GREEN"), 153, 204, 50}
348 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
350 const wxColourDesc
& cc
= wxColourTable
[n
];
351 (*m_map
)[cc
.name
] = new wxColour(cc
.r
, cc
.g
, cc
.b
);
355 m_palTable
= new long[n
];
356 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
358 const wxColourDesc
& cc
= wxColourTable
[n
];
359 m_palTable
[n
] = OS2RGB(cc
.r
,cc
.g
,cc
.b
);
365 // ----------------------------------------------------------------------------
366 // wxColourDatabase operations
367 // ----------------------------------------------------------------------------
369 void wxColourDatabase::AddColour(const wxString
& name
, const wxColour
& colour
)
373 // canonicalize the colour names before using them as keys: they should be
375 wxString colName
= name
;
378 // ... and we also allow both grey/gray
379 wxString colNameAlt
= colName
;
380 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
382 // but in this case it is not necessary so avoid extra search below
386 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
387 if ( it
== m_map
->end() && !colNameAlt
.empty() )
388 it
= m_map
->find(colNameAlt
);
389 if ( it
!= m_map
->end() )
391 *(it
->second
) = colour
;
395 (*m_map
)[colName
] = new wxColour(colour
);
399 wxColour
wxColourDatabase::Find(const wxString
& colour
) const
401 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
404 // make the comparaison case insensitive and also match both grey and gray
405 wxString colName
= colour
;
407 wxString colNameAlt
= colName
;
408 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
411 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
412 if ( it
== m_map
->end() && !colNameAlt
.empty() )
413 it
= m_map
->find(colNameAlt
);
414 if ( it
!= m_map
->end() )
415 return *(it
->second
);
417 // we did not find any result in existing colours:
418 // we won't use wxString -> wxColour conversion because the
419 // wxColour::Set(const wxString &) function which does that conversion
420 // internally uses this function (wxColourDatabase::Find) and we want
421 // to avoid infinite recursion !
425 wxString
wxColourDatabase::FindName(const wxColour
& colour
) const
427 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
430 typedef wxStringToColourHashMap::iterator iterator
;
432 for ( iterator it
= m_map
->begin(), en
= m_map
->end(); it
!= en
; ++it
)
434 if ( *(it
->second
) == colour
)
438 return wxEmptyString
;
441 // ----------------------------------------------------------------------------
442 // deprecated wxColourDatabase methods
443 // ----------------------------------------------------------------------------
445 #if WXWIN_COMPATIBILITY_2_6
446 wxColour
*wxColourDatabase::FindColour(const wxString
& name
)
448 // This function is deprecated, use Find() instead.
449 // Formerly this function sometimes would return a deletable pointer and
450 // sometimes a non-deletable one (when returning a colour from the database).
451 // Trying to delete the latter anyway results in problems, so probably
452 // nobody ever freed the pointers. Currently it always returns a new
453 // instance, which means there will be memory leaks.
454 wxLogDebug(wxT("wxColourDataBase::FindColour():")
455 wxT(" Please use wxColourDataBase::Find() instead"));
457 // using a static variable here is not the most elegant solution but unless
458 // we want to make wxStringToColourHashMap public (i.e. move it to the
459 // header) so that we could have a member function returning
460 // wxStringToColourHashMap::iterator, there is really no good way to do it
463 // and knowing that this function is going to disappear in the next release
464 // anyhow I don't want to waste time on this
466 static wxColour s_col
;
472 return new wxColour(s_col
);
474 #endif // WXWIN_COMPATIBILITY_2_6
476 // ============================================================================
478 // ============================================================================
480 static wxStockGDI gs_wxStockGDI_instance
;
481 wxStockGDI
* wxStockGDI::ms_instance
= &gs_wxStockGDI_instance
;
482 wxObject
* wxStockGDI::ms_stockObject
[ITEMCOUNT
];
484 wxStockGDI::wxStockGDI()
488 wxStockGDI::~wxStockGDI()
492 void wxStockGDI::DeleteAll()
494 for (unsigned i
= 0; i
< ITEMCOUNT
; i
++)
496 delete ms_stockObject
[i
];
497 ms_stockObject
[i
] = NULL
;
501 const wxBrush
* wxStockGDI::GetBrush(Item item
)
503 wxBrush
* brush
= wx_static_cast(wxBrush
*, ms_stockObject
[item
]);
509 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxSOLID
);
512 brush
= new wxBrush(*GetColour(COLOUR_BLUE
), wxSOLID
);
515 brush
= new wxBrush(*GetColour(COLOUR_CYAN
), wxSOLID
);
518 brush
= new wxBrush(*GetColour(COLOUR_GREEN
), wxSOLID
);
521 brush
= new wxBrush(wxColour(wxT("GREY")), wxSOLID
);
523 case BRUSH_LIGHTGREY
:
524 brush
= new wxBrush(*GetColour(COLOUR_LIGHTGREY
), wxSOLID
);
526 case BRUSH_MEDIUMGREY
:
527 brush
= new wxBrush(wxColour(wxT("MEDIUM GREY")), wxSOLID
);
530 brush
= new wxBrush(*GetColour(COLOUR_RED
), wxSOLID
);
532 case BRUSH_TRANSPARENT
:
533 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxTRANSPARENT
);
536 brush
= new wxBrush(*GetColour(COLOUR_WHITE
), wxSOLID
);
541 ms_stockObject
[item
] = brush
;
546 const wxColour
* wxStockGDI::GetColour(Item item
)
548 wxColour
* colour
= wx_static_cast(wxColour
*, ms_stockObject
[item
]);
554 colour
= new wxColour(0, 0, 0);
557 colour
= new wxColour(0, 0, 255);
560 colour
= new wxColour(wxT("CYAN"));
563 colour
= new wxColour(0, 255, 0);
565 case COLOUR_LIGHTGREY
:
566 colour
= new wxColour(wxT("LIGHT GREY"));
569 colour
= new wxColour(255, 0, 0);
572 colour
= new wxColour(255, 255, 255);
577 ms_stockObject
[item
] = colour
;
582 const wxCursor
* wxStockGDI::GetCursor(Item item
)
584 wxCursor
* cursor
= wx_static_cast(wxCursor
*, ms_stockObject
[item
]);
590 cursor
= new wxCursor(wxCURSOR_CROSS
);
592 case CURSOR_HOURGLASS
:
593 cursor
= new wxCursor(wxCURSOR_WAIT
);
595 case CURSOR_STANDARD
:
596 cursor
= new wxCursor(wxCURSOR_ARROW
);
601 ms_stockObject
[item
] = cursor
;
606 const wxFont
* wxStockGDI::GetFont(Item item
)
608 wxFont
* font
= wx_static_cast(wxFont
*, ms_stockObject
[item
]);
614 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxROMAN
, wxITALIC
, wxNORMAL
);
617 font
= new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT
));
620 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize() - 2, wxSWISS
, wxNORMAL
, wxNORMAL
);
623 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxSWISS
, wxNORMAL
, wxNORMAL
);
628 ms_stockObject
[item
] = font
;
633 const wxPen
* wxStockGDI::GetPen(Item item
)
635 wxPen
* pen
= wx_static_cast(wxPen
*, ms_stockObject
[item
]);
641 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSOLID
);
643 case PEN_BLACKDASHED
:
644 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSHORT_DASH
);
647 pen
= new wxPen(*GetColour(COLOUR_CYAN
), 1, wxSOLID
);
650 pen
= new wxPen(*GetColour(COLOUR_GREEN
), 1, wxSOLID
);
653 pen
= new wxPen(wxColour(wxT("GREY")), 1, wxSOLID
);
656 pen
= new wxPen(*GetColour(COLOUR_LIGHTGREY
), 1, wxSOLID
);
659 pen
= new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxSOLID
);
662 pen
= new wxPen(*GetColour(COLOUR_RED
), 1, wxSOLID
);
664 case PEN_TRANSPARENT
:
665 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxTRANSPARENT
);
668 pen
= new wxPen(*GetColour(COLOUR_WHITE
), 1, wxSOLID
);
673 ms_stockObject
[item
] = pen
;
678 void wxInitializeStockLists()
680 wxTheColourDatabase
= new wxColourDatabase
;
682 wxTheBrushList
= new wxBrushList
;
683 wxThePenList
= new wxPenList
;
684 wxTheFontList
= new wxFontList
;
687 void wxDeleteStockLists()
689 wxDELETE(wxTheBrushList
);
690 wxDELETE(wxThePenList
);
691 wxDELETE(wxTheFontList
);
694 // ============================================================================
695 // wxTheXXXList stuff (semi-obsolete)
696 // ============================================================================
698 wxGDIObjListBase::wxGDIObjListBase()
702 wxGDIObjListBase::~wxGDIObjListBase()
704 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
706 delete wx_static_cast(wxObject
*, node
->GetData());
710 wxPen
*wxPenList::FindOrCreatePen (const wxColour
& colour
, int width
, int style
)
712 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
714 wxPen
*each_pen
= (wxPen
*) node
->GetData ();
716 each_pen
->GetWidth () == width
&&
717 each_pen
->GetStyle () == style
&&
718 each_pen
->GetColour ().Red () == colour
.Red () &&
719 each_pen
->GetColour ().Green () == colour
.Green () &&
720 each_pen
->GetColour ().Blue () == colour
.Blue ())
725 wxPen
penTmp(colour
, width
, style
);
728 pen
= new wxPen(penTmp
);
735 wxBrush
*wxBrushList::FindOrCreateBrush (const wxColour
& colour
, int style
)
737 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
739 wxBrush
*each_brush
= (wxBrush
*) node
->GetData ();
741 each_brush
->GetStyle () == style
&&
742 each_brush
->GetColour ().Red () == colour
.Red () &&
743 each_brush
->GetColour ().Green () == colour
.Green () &&
744 each_brush
->GetColour ().Blue () == colour
.Blue ())
748 wxBrush
* brush
= NULL
;
749 wxBrush
brushTmp(colour
, style
);
752 brush
= new wxBrush(brushTmp
);
759 wxFont
*wxFontList::FindOrCreateFont(int pointSize
,
764 const wxString
& facename
,
765 wxFontEncoding encoding
)
768 wxList::compatibility_iterator node
;
769 for (node
= list
.GetFirst(); node
; node
= node
->GetNext())
771 font
= (wxFont
*)node
->GetData();
773 font
->GetPointSize () == pointSize
&&
774 font
->GetStyle () == style
&&
775 font
->GetWeight () == weight
&&
776 font
->GetUnderlined () == underline
)
778 int fontFamily
= font
->GetFamily();
780 #if defined(__WXGTK__)
781 // under GTK the default family is wxSWISS, so looking for a font
782 // with wxDEFAULT family should return a wxSWISS one instead of
783 // creating a new one
784 bool same
= (fontFamily
== family
) ||
785 (fontFamily
== wxSWISS
&& family
== wxDEFAULT
);
787 // VZ: but why elsewhere do we require an exact match? mystery...
788 bool same
= fontFamily
== family
;
791 // empty facename matches anything at all: this is bad because
792 // depending on which fonts are already created, we might get back
793 // a different font if we create it with empty facename, but it is
794 // still better than never matching anything in the cache at all
796 if ( same
&& !facename
.empty() )
798 const wxString
& fontFace
= font
->GetFaceName();
800 // empty facename matches everything
801 same
= !fontFace
|| fontFace
== facename
;
804 if ( same
&& (encoding
!= wxFONTENCODING_DEFAULT
) )
806 // have to match the encoding too
807 same
= font
->GetEncoding() == encoding
;
817 // font not found, create the new one
819 wxFont
fontTmp(pointSize
, family
, style
, weight
, underline
, facename
, encoding
);
822 font
= new wxFont(fontTmp
);
829 #if WXWIN_COMPATIBILITY_2_6
830 void wxBrushList::AddBrush(wxBrush
*) { }
831 void wxBrushList::RemoveBrush(wxBrush
*) { }
832 void wxFontList::AddFont(wxFont
*) { }
833 void wxFontList::RemoveFont(wxFont
*) { }
834 void wxPenList::AddPen(wxPen
*) { }
835 void wxPenList::RemovePen(wxPen
*) { }
838 wxSize
wxGetDisplaySize()
841 wxDisplaySize(& x
, & y
);
845 wxRect
wxGetClientDisplayRect()
847 int x
, y
, width
, height
;
848 wxClientDisplayRect(&x
, &y
, &width
, &height
); // call plat-specific version
849 return wxRect(x
, y
, width
, height
);
852 wxSize
wxGetDisplaySizeMM()
855 wxDisplaySizeMM(& x
, & y
);
859 wxResourceCache::~wxResourceCache ()
861 wxList::compatibility_iterator node
= GetFirst ();
863 wxObject
*item
= (wxObject
*)node
->GetData();
866 node
= node
->GetNext ();