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"
29 #include "wx/bitmap.h"
30 #include "wx/colour.h"
34 WXDLLIMPEXP_DATA_CORE(wxBrushList
*) wxTheBrushList
;
35 WXDLLIMPEXP_DATA_CORE(wxFontList
*) wxTheFontList
;
36 WXDLLIMPEXP_DATA_CORE(wxPenList
*) wxThePenList
;
38 WXDLLIMPEXP_DATA_CORE(wxColourDatabase
*) wxTheColourDatabase
;
40 WXDLLIMPEXP_DATA_CORE(wxBitmap
) wxNullBitmap
;
41 WXDLLIMPEXP_DATA_CORE(wxBrush
) wxNullBrush
;
42 WXDLLIMPEXP_DATA_CORE(wxColour
) wxNullColour
;
43 WXDLLIMPEXP_DATA_CORE(wxCursor
) wxNullCursor
;
44 WXDLLIMPEXP_DATA_CORE(wxFont
) wxNullFont
;
45 WXDLLIMPEXP_DATA_CORE(wxIcon
) wxNullIcon
;
46 WXDLLIMPEXP_DATA_CORE(wxPen
) wxNullPen
;
48 WXDLLIMPEXP_DATA_CORE(wxPalette
) wxNullPalette
;
51 const wxSize
wxDefaultSize(wxDefaultCoord
, wxDefaultCoord
);
52 const wxPoint
wxDefaultPosition(wxDefaultCoord
, wxDefaultCoord
);
54 #if wxUSE_EXTENDED_RTTI
58 template<> void wxStringReadValue(const wxString
&s
, wxPoint
&data
)
60 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
63 template<> void wxStringWriteValue(wxString
&s
, const wxPoint
&data
)
65 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
68 wxCUSTOM_TYPE_INFO(wxPoint
, wxToStringConverter
<wxPoint
> , wxFromStringConverter
<wxPoint
>)
70 template<> void wxStringReadValue(const wxString
&s
, wxSize
&data
)
72 wxSscanf(s
, wxT("%d,%d"), &data
.x
, &data
.y
) ;
75 template<> void wxStringWriteValue(wxString
&s
, const wxSize
&data
)
77 s
= wxString::Format(wxT("%d,%d"), data
.x
, data
.y
) ;
80 wxCUSTOM_TYPE_INFO(wxSize
, wxToStringConverter
<wxSize
> , wxFromStringConverter
<wxSize
>)
84 wxRect::wxRect(const wxPoint
& point1
, const wxPoint
& point2
)
88 width
= point2
.x
- point1
.x
;
89 height
= point2
.y
- point1
.y
;
106 bool wxRect::operator==(const wxRect
& rect
) const
108 return ((x
== rect
.x
) &&
110 (width
== rect
.width
) &&
111 (height
== rect
.height
));
114 wxRect
wxRect::operator+(const wxRect
& rect
) const
116 int x1
= wxMin(this->x
, rect
.x
);
117 int y1
= wxMin(this->y
, rect
.y
);
118 int y2
= wxMax(y
+height
, rect
.height
+rect
.y
);
119 int x2
= wxMax(x
+width
, rect
.width
+rect
.x
);
120 return wxRect(x1
, y1
, x2
-x1
, y2
-y1
);
123 wxRect
& wxRect::Union(const wxRect
& rect
)
125 // ignore empty rectangles: union with an empty rectangle shouldn't extend
126 // this one to (0, 0)
127 if ( !width
|| !height
)
131 else if ( rect
.width
&& rect
.height
)
133 int x1
= wxMin(x
, rect
.x
);
134 int y1
= wxMin(y
, rect
.y
);
135 int y2
= wxMax(y
+ height
, rect
.height
+ rect
.y
);
136 int x2
= wxMax(x
+ width
, rect
.width
+ rect
.x
);
143 //else: we're not empty and rect is empty
148 wxRect
& wxRect::Inflate(wxCoord dx
, wxCoord dy
)
152 // Don't allow deflate to eat more width than we have,
153 // a well-defined rectangle cannot have negative width.
159 // The inflate is valid.
166 // Don't allow deflate to eat more height than we have,
167 // a well-defined rectangle cannot have negative height.
173 // The inflate is valid.
181 bool wxRect::Inside(int cx
, int cy
) const
183 return ( (cx
>= x
) && (cy
>= y
)
184 && ((cy
- y
) < height
)
185 && ((cx
- x
) < width
)
189 bool wxRect::Inside(const wxRect
& rect
) const
191 return Inside(rect
.GetTopLeft()) && Inside(rect
.GetBottomRight());
194 wxRect
& wxRect::Intersect(const wxRect
& rect
)
203 if ( x2
> rect
.GetRight() )
204 x2
= rect
.GetRight();
205 if ( y2
> rect
.GetBottom() )
206 y2
= rect
.GetBottom();
211 if ( width
<= 0 || height
<= 0 )
220 bool wxRect::Intersects(const wxRect
& rect
) const
222 wxRect r
= Intersect(rect
);
224 // if there is no intersection, both width and height are 0
228 // ============================================================================
230 // ============================================================================
232 // ----------------------------------------------------------------------------
233 // wxColourDatabase ctor/dtor
234 // ----------------------------------------------------------------------------
236 wxColourDatabase::wxColourDatabase ()
238 // will be created on demand in Initialize()
242 wxColourDatabase::~wxColourDatabase ()
246 WX_CLEAR_HASH_MAP(wxStringToColourHashMap
, *m_map
);
252 delete [] m_palTable
;
256 // Colour database stuff
257 void wxColourDatabase::Initialize()
261 // already initialized
265 m_map
= new wxStringToColourHashMap
;
267 static const struct wxColourDesc
274 {wxT("AQUAMARINE"),112, 219, 147},
275 {wxT("BLACK"),0, 0, 0},
276 {wxT("BLUE"), 0, 0, 255},
277 {wxT("BLUE VIOLET"), 159, 95, 159},
278 {wxT("BROWN"), 165, 42, 42},
279 {wxT("CADET BLUE"), 95, 159, 159},
280 {wxT("CORAL"), 255, 127, 0},
281 {wxT("CORNFLOWER BLUE"), 66, 66, 111},
282 {wxT("CYAN"), 0, 255, 255},
283 {wxT("DARK GREY"), 47, 47, 47}, // ?
285 {wxT("DARK GREEN"), 47, 79, 47},
286 {wxT("DARK OLIVE GREEN"), 79, 79, 47},
287 {wxT("DARK ORCHID"), 153, 50, 204},
288 {wxT("DARK SLATE BLUE"), 107, 35, 142},
289 {wxT("DARK SLATE GREY"), 47, 79, 79},
290 {wxT("DARK TURQUOISE"), 112, 147, 219},
291 {wxT("DIM GREY"), 84, 84, 84},
292 {wxT("FIREBRICK"), 142, 35, 35},
293 {wxT("FOREST GREEN"), 35, 142, 35},
294 {wxT("GOLD"), 204, 127, 50},
295 {wxT("GOLDENROD"), 219, 219, 112},
296 {wxT("GREY"), 128, 128, 128},
297 {wxT("GREEN"), 0, 255, 0},
298 {wxT("GREEN YELLOW"), 147, 219, 112},
299 {wxT("INDIAN RED"), 79, 47, 47},
300 {wxT("KHAKI"), 159, 159, 95},
301 {wxT("LIGHT BLUE"), 191, 216, 216},
302 {wxT("LIGHT GREY"), 192, 192, 192},
303 {wxT("LIGHT STEEL BLUE"), 143, 143, 188},
304 {wxT("LIME GREEN"), 50, 204, 50},
305 {wxT("LIGHT MAGENTA"), 255, 0, 255},
306 {wxT("MAGENTA"), 255, 0, 255},
307 {wxT("MAROON"), 142, 35, 107},
308 {wxT("MEDIUM AQUAMARINE"), 50, 204, 153},
309 {wxT("MEDIUM GREY"), 100, 100, 100},
310 {wxT("MEDIUM BLUE"), 50, 50, 204},
311 {wxT("MEDIUM FOREST GREEN"), 107, 142, 35},
312 {wxT("MEDIUM GOLDENROD"), 234, 234, 173},
313 {wxT("MEDIUM ORCHID"), 147, 112, 219},
314 {wxT("MEDIUM SEA GREEN"), 66, 111, 66},
315 {wxT("MEDIUM SLATE BLUE"), 127, 0, 255},
316 {wxT("MEDIUM SPRING GREEN"), 127, 255, 0},
317 {wxT("MEDIUM TURQUOISE"), 112, 219, 219},
318 {wxT("MEDIUM VIOLET RED"), 219, 112, 147},
319 {wxT("MIDNIGHT BLUE"), 47, 47, 79},
320 {wxT("NAVY"), 35, 35, 142},
321 {wxT("ORANGE"), 204, 50, 50},
322 {wxT("ORANGE RED"), 255, 0, 127},
323 {wxT("ORCHID"), 219, 112, 219},
324 {wxT("PALE GREEN"), 143, 188, 143},
325 {wxT("PINK"), 188, 143, 234},
326 {wxT("PLUM"), 234, 173, 234},
327 {wxT("PURPLE"), 176, 0, 255},
328 {wxT("RED"), 255, 0, 0},
329 {wxT("SALMON"), 111, 66, 66},
330 {wxT("SEA GREEN"), 35, 142, 107},
331 {wxT("SIENNA"), 142, 107, 35},
332 {wxT("SKY BLUE"), 50, 153, 204},
333 {wxT("SLATE BLUE"), 0, 127, 255},
334 {wxT("SPRING GREEN"), 0, 255, 127},
335 {wxT("STEEL BLUE"), 35, 107, 142},
336 {wxT("TAN"), 219, 147, 112},
337 {wxT("THISTLE"), 216, 191, 216},
338 {wxT("TURQUOISE"), 173, 234, 234},
339 {wxT("VIOLET"), 79, 47, 79},
340 {wxT("VIOLET RED"), 204, 50, 153},
341 {wxT("WHEAT"), 216, 216, 191},
342 {wxT("WHITE"), 255, 255, 255},
343 {wxT("YELLOW"), 255, 255, 0},
344 {wxT("YELLOW GREEN"), 153, 204, 50}
349 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
351 const wxColourDesc
& cc
= wxColourTable
[n
];
352 (*m_map
)[cc
.name
] = new wxColour(cc
.r
, cc
.g
, cc
.b
);
356 m_palTable
= new long[n
];
357 for ( n
= 0; n
< WXSIZEOF(wxColourTable
); n
++ )
359 const wxColourDesc
& cc
= wxColourTable
[n
];
360 m_palTable
[n
] = OS2RGB(cc
.r
,cc
.g
,cc
.b
);
366 // ----------------------------------------------------------------------------
367 // wxColourDatabase operations
368 // ----------------------------------------------------------------------------
370 void wxColourDatabase::AddColour(const wxString
& name
, const wxColour
& colour
)
374 // canonicalize the colour names before using them as keys: they should be
376 wxString colName
= name
;
379 // ... and we also allow both grey/gray
380 wxString colNameAlt
= colName
;
381 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
383 // but in this case it is not necessary so avoid extra search below
387 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
388 if ( it
== m_map
->end() && !colNameAlt
.empty() )
389 it
= m_map
->find(colNameAlt
);
390 if ( it
!= m_map
->end() )
392 *(it
->second
) = colour
;
396 (*m_map
)[colName
] = new wxColour(colour
);
400 wxColour
wxColourDatabase::Find(const wxString
& colour
) const
402 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
405 // make the comparaison case insensitive and also match both grey and gray
406 wxString colName
= colour
;
408 wxString colNameAlt
= colName
;
409 if ( !colNameAlt
.Replace(_T("GRAY"), _T("GREY")) )
412 wxStringToColourHashMap::iterator it
= m_map
->find(colName
);
413 if ( it
== m_map
->end() && !colNameAlt
.empty() )
414 it
= m_map
->find(colNameAlt
);
415 if ( it
!= m_map
->end() )
416 return *(it
->second
);
418 // we did not find any result in existing colours:
419 // we won't use wxString -> wxColour conversion because the
420 // wxColour::Set(const wxString &) function which does that conversion
421 // internally uses this function (wxColourDatabase::Find) and we want
422 // to avoid infinite recursion !
426 wxString
wxColourDatabase::FindName(const wxColour
& colour
) const
428 wxColourDatabase
* const self
= wxConstCast(this, wxColourDatabase
);
431 typedef wxStringToColourHashMap::iterator iterator
;
433 for ( iterator it
= m_map
->begin(), en
= m_map
->end(); it
!= en
; ++it
)
435 if ( *(it
->second
) == colour
)
439 return wxEmptyString
;
442 // ----------------------------------------------------------------------------
443 // deprecated wxColourDatabase methods
444 // ----------------------------------------------------------------------------
446 #if WXWIN_COMPATIBILITY_2_6
447 wxColour
*wxColourDatabase::FindColour(const wxString
& name
)
449 // This function is deprecated, use Find() instead.
450 // Formerly this function sometimes would return a deletable pointer and
451 // sometimes a non-deletable one (when returning a colour from the database).
452 // Trying to delete the latter anyway results in problems, so probably
453 // nobody ever freed the pointers. Currently it always returns a new
454 // instance, which means there will be memory leaks.
455 wxLogDebug(wxT("wxColourDataBase::FindColour():")
456 wxT(" Please use wxColourDataBase::Find() instead"));
458 // using a static variable here is not the most elegant solution but unless
459 // we want to make wxStringToColourHashMap public (i.e. move it to the
460 // header) so that we could have a member function returning
461 // wxStringToColourHashMap::iterator, there is really no good way to do it
464 // and knowing that this function is going to disappear in the next release
465 // anyhow I don't want to waste time on this
467 static wxColour s_col
;
473 return new wxColour(s_col
);
475 #endif // WXWIN_COMPATIBILITY_2_6
477 // ============================================================================
479 // ============================================================================
481 static wxStockGDI gs_wxStockGDI_instance
;
482 wxStockGDI
* wxStockGDI::ms_instance
= &gs_wxStockGDI_instance
;
483 wxObject
* wxStockGDI::ms_stockObject
[ITEMCOUNT
];
485 wxStockGDI::wxStockGDI()
489 wxStockGDI::~wxStockGDI()
493 void wxStockGDI::DeleteAll()
495 for (unsigned i
= 0; i
< ITEMCOUNT
; i
++)
497 delete ms_stockObject
[i
];
498 ms_stockObject
[i
] = NULL
;
502 const wxBrush
* wxStockGDI::GetBrush(Item item
)
504 wxBrush
* brush
= wx_static_cast(wxBrush
*, ms_stockObject
[item
]);
510 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxSOLID
);
513 brush
= new wxBrush(*GetColour(COLOUR_BLUE
), wxSOLID
);
516 brush
= new wxBrush(*GetColour(COLOUR_CYAN
), wxSOLID
);
519 brush
= new wxBrush(*GetColour(COLOUR_GREEN
), wxSOLID
);
522 brush
= new wxBrush(wxColour(wxT("GREY")), wxSOLID
);
524 case BRUSH_LIGHTGREY
:
525 brush
= new wxBrush(*GetColour(COLOUR_LIGHTGREY
), wxSOLID
);
527 case BRUSH_MEDIUMGREY
:
528 brush
= new wxBrush(wxColour(wxT("MEDIUM GREY")), wxSOLID
);
531 brush
= new wxBrush(*GetColour(COLOUR_RED
), wxSOLID
);
533 case BRUSH_TRANSPARENT
:
534 brush
= new wxBrush(*GetColour(COLOUR_BLACK
), wxTRANSPARENT
);
537 brush
= new wxBrush(*GetColour(COLOUR_WHITE
), wxSOLID
);
542 ms_stockObject
[item
] = brush
;
547 const wxColour
* wxStockGDI::GetColour(Item item
)
549 wxColour
* colour
= wx_static_cast(wxColour
*, ms_stockObject
[item
]);
555 colour
= new wxColour(0, 0, 0);
558 colour
= new wxColour(0, 0, 255);
561 colour
= new wxColour(wxT("CYAN"));
564 colour
= new wxColour(0, 255, 0);
566 case COLOUR_LIGHTGREY
:
567 colour
= new wxColour(wxT("LIGHT GREY"));
570 colour
= new wxColour(255, 0, 0);
573 colour
= new wxColour(255, 255, 255);
578 ms_stockObject
[item
] = colour
;
583 const wxCursor
* wxStockGDI::GetCursor(Item item
)
585 wxCursor
* cursor
= wx_static_cast(wxCursor
*, ms_stockObject
[item
]);
591 cursor
= new wxCursor(wxCURSOR_CROSS
);
593 case CURSOR_HOURGLASS
:
594 cursor
= new wxCursor(wxCURSOR_WAIT
);
596 case CURSOR_STANDARD
:
597 cursor
= new wxCursor(wxCURSOR_ARROW
);
602 ms_stockObject
[item
] = cursor
;
607 const wxFont
* wxStockGDI::GetFont(Item item
)
609 wxFont
* font
= wx_static_cast(wxFont
*, ms_stockObject
[item
]);
615 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxROMAN
, wxITALIC
, wxNORMAL
);
618 font
= new wxFont(wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT
));
621 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize() - 2, wxSWISS
, wxNORMAL
, wxNORMAL
);
624 font
= new wxFont(GetFont(FONT_NORMAL
)->GetPointSize(), wxSWISS
, wxNORMAL
, wxNORMAL
);
629 ms_stockObject
[item
] = font
;
634 const wxPen
* wxStockGDI::GetPen(Item item
)
636 wxPen
* pen
= wx_static_cast(wxPen
*, ms_stockObject
[item
]);
642 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSOLID
);
644 case PEN_BLACKDASHED
:
645 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxSHORT_DASH
);
648 pen
= new wxPen(*GetColour(COLOUR_CYAN
), 1, wxSOLID
);
651 pen
= new wxPen(*GetColour(COLOUR_GREEN
), 1, wxSOLID
);
654 pen
= new wxPen(wxColour(wxT("GREY")), 1, wxSOLID
);
657 pen
= new wxPen(*GetColour(COLOUR_LIGHTGREY
), 1, wxSOLID
);
660 pen
= new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxSOLID
);
663 pen
= new wxPen(*GetColour(COLOUR_RED
), 1, wxSOLID
);
665 case PEN_TRANSPARENT
:
666 pen
= new wxPen(*GetColour(COLOUR_BLACK
), 1, wxTRANSPARENT
);
669 pen
= new wxPen(*GetColour(COLOUR_WHITE
), 1, wxSOLID
);
674 ms_stockObject
[item
] = pen
;
679 void wxInitializeStockLists()
681 wxTheColourDatabase
= new wxColourDatabase
;
683 wxTheBrushList
= new wxBrushList
;
684 wxThePenList
= new wxPenList
;
685 wxTheFontList
= new wxFontList
;
688 void wxDeleteStockLists()
690 wxDELETE(wxTheBrushList
);
691 wxDELETE(wxThePenList
);
692 wxDELETE(wxTheFontList
);
695 // ============================================================================
696 // wxTheXXXList stuff (semi-obsolete)
697 // ============================================================================
699 wxGDIObjListBase::wxGDIObjListBase()
703 wxGDIObjListBase::~wxGDIObjListBase()
705 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
707 delete wx_static_cast(wxObject
*, node
->GetData());
711 wxPen
*wxPenList::FindOrCreatePen (const wxColour
& colour
, int width
, int style
)
713 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
715 wxPen
*each_pen
= (wxPen
*) node
->GetData ();
717 each_pen
->GetWidth () == width
&&
718 each_pen
->GetStyle () == style
&&
719 each_pen
->GetColour ().Red () == colour
.Red () &&
720 each_pen
->GetColour ().Green () == colour
.Green () &&
721 each_pen
->GetColour ().Blue () == colour
.Blue ())
726 wxPen
penTmp(colour
, width
, style
);
729 pen
= new wxPen(penTmp
);
736 wxBrush
*wxBrushList::FindOrCreateBrush (const wxColour
& colour
, int style
)
738 for (wxList::compatibility_iterator node
= list
.GetFirst(); node
; node
= node
->GetNext())
740 wxBrush
*each_brush
= (wxBrush
*) node
->GetData ();
742 each_brush
->GetStyle () == style
&&
743 each_brush
->GetColour ().Red () == colour
.Red () &&
744 each_brush
->GetColour ().Green () == colour
.Green () &&
745 each_brush
->GetColour ().Blue () == colour
.Blue ())
749 wxBrush
* brush
= NULL
;
750 wxBrush
brushTmp(colour
, style
);
753 brush
= new wxBrush(brushTmp
);
760 wxFont
*wxFontList::FindOrCreateFont(int pointSize
,
765 const wxString
& facename
,
766 wxFontEncoding encoding
)
769 wxList::compatibility_iterator node
;
770 for (node
= list
.GetFirst(); node
; node
= node
->GetNext())
772 font
= (wxFont
*)node
->GetData();
774 font
->GetPointSize () == pointSize
&&
775 font
->GetStyle () == style
&&
776 font
->GetWeight () == weight
&&
777 font
->GetUnderlined () == underline
)
779 int fontFamily
= font
->GetFamily();
781 #if defined(__WXGTK__)
782 // under GTK the default family is wxSWISS, so looking for a font
783 // with wxDEFAULT family should return a wxSWISS one instead of
784 // creating a new one
785 bool same
= (fontFamily
== family
) ||
786 (fontFamily
== wxSWISS
&& family
== wxDEFAULT
);
788 // VZ: but why elsewhere do we require an exact match? mystery...
789 bool same
= fontFamily
== family
;
792 // empty facename matches anything at all: this is bad because
793 // depending on which fonts are already created, we might get back
794 // a different font if we create it with empty facename, but it is
795 // still better than never matching anything in the cache at all
797 if ( same
&& !facename
.empty() )
799 const wxString
& fontFace
= font
->GetFaceName();
801 // empty facename matches everything
802 same
= !fontFace
|| fontFace
== facename
;
805 if ( same
&& (encoding
!= wxFONTENCODING_DEFAULT
) )
807 // have to match the encoding too
808 same
= font
->GetEncoding() == encoding
;
818 // font not found, create the new one
820 wxFont
fontTmp(pointSize
, family
, style
, weight
, underline
, facename
, encoding
);
823 font
= new wxFont(fontTmp
);
830 #if WXWIN_COMPATIBILITY_2_6
831 void wxBrushList::AddBrush(wxBrush
*) { }
832 void wxBrushList::RemoveBrush(wxBrush
*) { }
833 void wxFontList::AddFont(wxFont
*) { }
834 void wxFontList::RemoveFont(wxFont
*) { }
835 void wxPenList::AddPen(wxPen
*) { }
836 void wxPenList::RemovePen(wxPen
*) { }
839 wxSize
wxGetDisplaySize()
842 wxDisplaySize(& x
, & y
);
846 wxRect
wxGetClientDisplayRect()
848 int x
, y
, width
, height
;
849 wxClientDisplayRect(&x
, &y
, &width
, &height
); // call plat-specific version
850 return wxRect(x
, y
, width
, height
);
853 wxSize
wxGetDisplaySizeMM()
856 wxDisplaySizeMM(& x
, & y
);
860 wxResourceCache::~wxResourceCache ()
862 wxList::compatibility_iterator node
= GetFirst ();
864 wxObject
*item
= (wxObject
*)node
->GetData();
867 node
= node
->GetNext ();