]> git.saurik.com Git - wxWidgets.git/blame - src/motif/listbox.cpp
Implemented wxToggleButton under Motif.
[wxWidgets.git] / src / motif / listbox.cpp
CommitLineData
4bb6408c
JS
1///////////////////////////////////////////////////////////////////////////////
2// Name: listbox.cpp
3// Purpose: wxListBox
4// Author: Julian Smart
5// Modified by:
6// Created: 17/09/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
9// Licence: wxWindows licence
10///////////////////////////////////////////////////////////////////////////////
11
12#ifdef __GNUG__
29006414 13 #pragma implementation "listbox.h"
4bb6408c
JS
14#endif
15
4dff3400
JJ
16#ifdef __VMS
17#define XtParent XTPARENT
18#define XtDisplay XTDISPLAY
19#endif
20
21# include "wx/listbox.h"
4bb6408c
JS
22#include "wx/settings.h"
23#include "wx/dynarray.h"
24#include "wx/log.h"
f97c9854
JS
25#include "wx/utils.h"
26
338dd992
JJ
27#ifdef __VMS__
28#pragma message disable nosimpint
29#endif
f97c9854 30#include <Xm/List.h>
338dd992
JJ
31#ifdef __VMS__
32#pragma message enable nosimpint
33#endif
f97c9854 34#include "wx/motif/private.h"
4bb6408c 35
29006414 36 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
4bb6408c 37
29006414
VZ
38static void wxListBoxCallback(Widget w,
39 XtPointer clientData,
40 XmListCallbackStruct * cbs);
f97c9854 41
99ab3e3f
MB
42// ----------------------------------------------------------------------------
43// wxSizeKeeper
44// ----------------------------------------------------------------------------
45
46// helper class to reduce code duplication
47class wxSizeKeeper
48{
49 int m_x, m_y;
50 wxWindow* m_w;
51public:
52 wxSizeKeeper( wxWindow* w )
53 : m_w( w )
54 {
55 m_w->GetSize( &m_x, &m_y );
56 }
57
58 void Restore()
59 {
60 int x, y;
61
62 m_w->GetSize( &x, &y );
63 if( x != m_x || y != m_y )
64 m_w->SetSize( -1, -1, m_x, m_y );
65 }
66};
67
4bb6408c
JS
68// ============================================================================
69// list box control implementation
70// ============================================================================
71
72// Listbox item
99ab3e3f 73wxListBox::wxListBox()
4bb6408c 74{
f97c9854 75 m_noItems = 0;
4bb6408c
JS
76}
77
78bool wxListBox::Create(wxWindow *parent, wxWindowID id,
79 const wxPoint& pos,
80 const wxSize& size,
81 int n, const wxString choices[],
82 long style,
83 const wxValidator& validator,
84 const wxString& name)
85{
99ab3e3f
MB
86 if( !wxControl::CreateControl( parent, id, pos, size, style,
87 validator, name ) )
88 return FALSE;
89
f97c9854 90 m_noItems = n;
94b49b93 91 m_backgroundColour = * wxWHITE;
29006414 92
f97c9854 93 Widget parentWidget = (Widget) parent->GetClientWidget();
29006414 94
f97c9854 95 Arg args[3];
99ab3e3f
MB
96 int count = 0;
97 XtSetArg( args[0], XmNlistSizePolicy, XmCONSTANT ); ++count;
98 XtSetArg( args[1], XmNselectionPolicy,
99 ( m_windowStyle & wxLB_MULTIPLE ) ? XmMULTIPLE_SELECT :
100 ( m_windowStyle & wxLB_EXTENDED ) ? XmEXTENDED_SELECT :
101 XmBROWSE_SELECT );
102 ++count;
103 if( m_windowStyle & wxLB_ALWAYS_SB )
f97c9854 104 {
99ab3e3f
MB
105 XtSetArg( args[2], XmNscrollBarDisplayPolicy, XmSTATIC );
106 ++count;
f97c9854 107 }
29006414 108
ef41d80c
MB
109 Widget listWidget = XmCreateScrolledList(parentWidget,
110 (char*)name.c_str(), args, count);
29006414 111
f97c9854 112 m_mainWidget = (WXWidget) listWidget;
29006414 113
a4294b78 114 Set(n, choices);
29006414 115
f97c9854 116 XtManageChild (listWidget);
29006414 117
f97c9854
JS
118 long width = size.x;
119 long height = size.y;
120 if (width == -1)
121 width = 150;
122 if (height == -1)
123 height = 80;
29006414 124
ef41d80c
MB
125 XtAddCallback (listWidget,
126 XmNbrowseSelectionCallback,
127 (XtCallbackProc) wxListBoxCallback,
128 (XtPointer) this);
129 XtAddCallback (listWidget,
130 XmNextendedSelectionCallback,
131 (XtCallbackProc) wxListBoxCallback,
132 (XtPointer) this);
133 XtAddCallback (listWidget,
134 XmNmultipleSelectionCallback,
135 (XtCallbackProc) wxListBoxCallback,
136 (XtPointer) this);
137 XtAddCallback (listWidget,
138 XmNdefaultActionCallback,
139 (XtCallbackProc) wxListBoxCallback,
140 (XtPointer) this);
29006414 141
4b5f3fe6 142 ChangeFont(FALSE);
29006414 143
15d5ab67 144 SetCanAddEventHandler(TRUE);
ef41d80c
MB
145 AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
146 pos.x, pos.y, width, height);
29006414 147
0d57be45 148 ChangeBackgroundColour();
29006414 149
f97c9854 150 return TRUE;
4bb6408c
JS
151}
152
153wxListBox::~wxListBox()
154{
99ab3e3f
MB
155 if( HasClientObjectData() )
156 m_clientDataDict.DestroyData();
157}
158
159void wxListBox::SetSelectionPolicy()
160{
161 Widget listBox = (Widget)m_mainWidget;
162 Arg args[3];
163
164 XtSetArg( args[0], XmNlistSizePolicy, XmCONSTANT );
165
166 XtSetArg( args[1], XmNselectionPolicy,
167 ( m_windowStyle & wxLB_MULTIPLE ) ? XmMULTIPLE_SELECT :
168 ( m_windowStyle & wxLB_EXTENDED ) ? XmEXTENDED_SELECT :
169 XmBROWSE_SELECT );
170
171 XtSetValues( listBox, args, 2 );
4bb6408c
JS
172}
173
ef41d80c 174void wxListBox::DoSetFirstItem( int N )
4bb6408c 175{
2d120f83 176 int count, length;
29006414 177
2d120f83
JS
178 if (N < 0)
179 return;
180 XtVaGetValues ((Widget) m_mainWidget,
29006414
VZ
181 XmNvisibleItemCount, &count,
182 XmNitemCount, &length,
183 NULL);
2d120f83
JS
184 if ((N + count) >= length)
185 N = length - count;
186 XmListSetPos ((Widget) m_mainWidget, N + 1);
4bb6408c
JS
187}
188
4bb6408c
JS
189void wxListBox::Delete(int N)
190{
99ab3e3f 191 wxSizeKeeper sk( this );
2d120f83 192 Widget listBox = (Widget) m_mainWidget;
29006414 193
2d120f83 194 bool managed = XtIsManaged(listBox);
29006414 195
2d120f83
JS
196 if (managed)
197 XtUnmanageChild (listBox);
29006414 198
2d120f83 199 XmListDeletePos (listBox, N + 1);
29006414 200
2d120f83
JS
201 if (managed)
202 XtManageChild (listBox);
29006414 203
99ab3e3f
MB
204 sk.Restore();
205 m_clientDataDict.Delete(N, HasClientObjectData());
2d120f83 206 m_noItems --;
4bb6408c
JS
207}
208
ef41d80c 209int wxListBox::DoAppend(const wxString& item)
4bb6408c 210{
99ab3e3f 211 wxSizeKeeper sk( this );
2d120f83 212 Widget listBox = (Widget) m_mainWidget;
29006414 213
2d120f83 214 bool managed = XtIsManaged(listBox);
29006414 215
2d120f83
JS
216 if (managed)
217 XtUnmanageChild (listBox);
218 int n;
219 XtVaGetValues (listBox, XmNitemCount, &n, NULL);
99ab3e3f 220 wxXmString text( item );
2d120f83 221 // XmListAddItem(listBox, text, n + 1);
99ab3e3f 222 XmListAddItemUnselected (listBox, text(), 0);
29006414 223
2d120f83
JS
224 // It seems that if the list is cleared, we must re-ask for
225 // selection policy!!
99ab3e3f 226 SetSelectionPolicy();
29006414 227
2d120f83
JS
228 if (managed)
229 XtManageChild (listBox);
29006414 230
99ab3e3f 231 sk.Restore();
2d120f83 232 m_noItems ++;
ef41d80c
MB
233
234 return GetCount() - 1;
4bb6408c
JS
235}
236
ef41d80c 237void wxListBox::DoSetItems(const wxArrayString& items, void** clientData)
4bb6408c 238{
99ab3e3f 239 wxSizeKeeper sk( this );
2d120f83 240 Widget listBox = (Widget) m_mainWidget;
99ab3e3f
MB
241
242 if( HasClientObjectData() )
243 m_clientDataDict.DestroyData();
ef41d80c
MB
244
245 bool managed = XtIsManaged(listBox);
29006414 246
2d120f83
JS
247 if (managed)
248 XtUnmanageChild (listBox);
ef41d80c
MB
249 XmString *text = new XmString[items.GetCount()];
250 size_t i;
251 for (i = 0; i < items.GetCount(); ++i)
252 text[i] = XmStringCreateSimple ((char*)items[i].c_str());
29006414 253
ef41d80c
MB
254 if ( clientData )
255 for (i = 0; i < items.GetCount(); ++i)
99ab3e3f 256 m_clientDataDict.Set(i, (wxClientData*)clientData[i], FALSE);
ef41d80c
MB
257
258 XmListAddItems (listBox, text, items.GetCount(), 0);
259 for (i = 0; i < items.GetCount(); i++)
260 XmStringFree (text[i]);
261 delete[] text;
29006414 262
2d120f83
JS
263 // It seems that if the list is cleared, we must re-ask for
264 // selection policy!!
99ab3e3f 265 SetSelectionPolicy();
29006414 266
2d120f83
JS
267 if (managed)
268 XtManageChild (listBox);
29006414 269
99ab3e3f 270 sk.Restore();
29006414 271
ef41d80c 272 m_noItems = items.GetCount();
4bb6408c
JS
273}
274
9b1bd0c6 275int wxDoFindStringInList(Widget w, const wxString& s)
4bb6408c 276{
99ab3e3f 277 wxXmString str( s );
2d120f83
JS
278 int *positions = NULL;
279 int no_positions = 0;
9b1bd0c6 280 bool success = XmListGetMatchPos (w, str(),
ef41d80c 281 &positions, &no_positions);
99ab3e3f 282
2d120f83 283 if (success)
f97c9854 284 {
2d120f83
JS
285 int pos = positions[0];
286 if (positions)
287 XtFree ((char *) positions);
288 return pos - 1;
f97c9854 289 }
2d120f83
JS
290 else
291 return -1;
4bb6408c
JS
292}
293
9b1bd0c6
MB
294int wxListBox::FindString(const wxString& s) const
295{
296 return wxDoFindStringInList( (Widget)m_mainWidget, s );
297}
298
4bb6408c
JS
299void wxListBox::Clear()
300{
2d120f83
JS
301 if (m_noItems <= 0)
302 return;
29006414 303
99ab3e3f 304 wxSizeKeeper sk( this );
2d120f83 305 Widget listBox = (Widget) m_mainWidget;
29006414 306
2d120f83 307 XmListDeleteAllItems (listBox);
99ab3e3f
MB
308 if( HasClientObjectData() )
309 m_clientDataDict.DestroyData();
29006414 310
99ab3e3f 311 sk.Restore();
29006414 312
2d120f83 313 m_noItems = 0;
4bb6408c
JS
314}
315
316void wxListBox::SetSelection(int N, bool select)
317{
2d120f83
JS
318 m_inSetValue = TRUE;
319 if (select)
f97c9854 320 {
29006414
VZ
321#if 0
322 if (m_windowStyle & wxLB_MULTIPLE)
323 {
324 int *selections = NULL;
325 int n = GetSelections (&selections);
326
ef41d80c
MB
327 // This hack is supposed to work, to make it possible
328 // to select more than one item, but it DOESN'T under Motif 1.1.
29006414 329
ef41d80c
MB
330 XtVaSetValues ((Widget) m_mainWidget,
331 XmNselectionPolicy, XmMULTIPLE_SELECT,
332 NULL);
29006414
VZ
333
334 int i;
335 for (i = 0; i < n; i++)
ef41d80c
MB
336 XmListSelectPos ((Widget) m_mainWidget,
337 selections[i] + 1, FALSE);
29006414
VZ
338
339 XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
340
ef41d80c
MB
341 XtVaSetValues ((Widget) m_mainWidget,
342 XmNselectionPolicy, XmEXTENDED_SELECT,
343 NULL);
29006414
VZ
344 }
345 else
346#endif // 0
2d120f83 347 XmListSelectPos ((Widget) m_mainWidget, N + 1, FALSE);
29006414 348
f97c9854 349 }
2d120f83
JS
350 else
351 XmListDeselectPos ((Widget) m_mainWidget, N + 1);
29006414 352
2d120f83 353 m_inSetValue = FALSE;
4bb6408c
JS
354}
355
d7d38ea4 356bool wxListBox::IsSelected(int N) const
4bb6408c 357{
2d120f83
JS
358 // In Motif, no simple way to determine if the item is selected.
359 wxArrayInt theSelections;
360 int count = GetSelections (theSelections);
361 if (count == 0)
362 return FALSE;
363 else
364 {
365 int j;
366 for (j = 0; j < count; j++)
367 if (theSelections[j] == N)
368 return TRUE;
369 }
4bb6408c
JS
370 return FALSE;
371}
372
ef41d80c
MB
373void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
374{
99ab3e3f 375 m_clientDataDict.Set(n, clientData, FALSE);
ef41d80c
MB
376}
377
378wxClientData* wxListBox::DoGetItemClientObject(int n) const
4bb6408c 379{
99ab3e3f 380 return m_clientDataDict.Get(n);
4bb6408c
JS
381}
382
ef41d80c 383void *wxListBox::DoGetItemClientData(int N) const
4bb6408c 384{
99ab3e3f 385 return (void*)m_clientDataDict.Get(N);
4bb6408c
JS
386}
387
ef41d80c 388void wxListBox::DoSetItemClientData(int N, void *Client_data)
4bb6408c 389{
99ab3e3f 390 m_clientDataDict.Set(N, (wxClientData*)Client_data, FALSE);
4bb6408c
JS
391}
392
393// Return number of selections and an array of selected integers
394int wxListBox::GetSelections(wxArrayInt& aSelections) const
395{
2d120f83 396 aSelections.Empty();
29006414 397
2d120f83
JS
398 Widget listBox = (Widget) m_mainWidget;
399 int *posList = NULL;
400 int posCnt = 0;
401 bool flag = XmListGetSelectedPos (listBox, &posList, &posCnt);
402 if (flag)
403 {
404 if (posCnt > 0)
405 {
406 aSelections.Alloc(posCnt);
29006414 407
2d120f83
JS
408 int i;
409 for (i = 0; i < posCnt; i++)
410 aSelections.Add(posList[i] - 1);
29006414 411
2d120f83
JS
412 XtFree ((char *) posList);
413 return posCnt;
414 }
415 else
416 return 0;
4bb6408c 417 }
2d120f83
JS
418 else
419 return 0;
4bb6408c
JS
420}
421
422// Get single selection, for single choice list items
9b1bd0c6 423int wxDoGetSelectionInList(Widget listBox)
4bb6408c 424{
f97c9854
JS
425 int *posList = NULL;
426 int posCnt = 0;
427 bool flag = XmListGetSelectedPos (listBox, &posList, &posCnt);
428 if (flag)
429 {
430 int id = -1;
431 if (posCnt > 0)
432 id = posList[0] - 1;
433 XtFree ((char *) posList);
434 return id;
435 }
436 else
437 return -1;
4bb6408c
JS
438}
439
9b1bd0c6
MB
440int wxListBox::GetSelection() const
441{
442 return wxDoGetSelectionInList((Widget) m_mainWidget);
443}
444
4bb6408c
JS
445// Find string for position
446wxString wxListBox::GetString(int N) const
447{
f97c9854
JS
448 Widget listBox = (Widget) m_mainWidget;
449 XmString *strlist;
450 int n;
451 XtVaGetValues (listBox, XmNitemCount, &n, XmNitems, &strlist, NULL);
452 if (N <= n && N >= 0)
453 {
454 char *txt;
455 if (XmStringGetLtoR (strlist[N], XmSTRING_DEFAULT_CHARSET, &txt))
456 {
457 wxString str(txt);
458 XtFree (txt);
459 return str;
460 }
461 else
462 return wxEmptyString;
463 }
464 else
465 return wxEmptyString;
4bb6408c
JS
466}
467
ef41d80c 468void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
4bb6408c 469{
99ab3e3f 470 wxSizeKeeper sk( this );
f97c9854 471 Widget listBox = (Widget) m_mainWidget;
29006414 472
f97c9854 473 bool managed = XtIsManaged(listBox);
29006414 474
f97c9854
JS
475 if (managed)
476 XtUnmanageChild(listBox);
29006414 477
ef41d80c
MB
478 XmString *text = new XmString[items.GetCount()];
479 size_t i;
2d120f83
JS
480 // Steve Hammes: Motif 1.1 compatibility
481 // #if XmVersion > 1100
482 // Corrected by Sergey Krasnov from Steve Hammes' code
f97c9854 483#if XmVersion > 1001
ef41d80c
MB
484 for (i = 0; i < items.GetCount(); i++)
485 text[i] = XmStringCreateSimple((char*)items[i].c_str());
486 XmListAddItemsUnselected(listBox, text, items.GetCount(), pos+1);
f97c9854 487#else
ef41d80c 488 for (i = 0; i < items.GetCount(); i++)
f97c9854 489 {
ef41d80c
MB
490 text[i] = XmStringCreateSimple((char*)items[i].c_str());
491 // Another Sergey correction
492 XmListAddItemUnselected(listBox, text[i], pos+i+1);
f97c9854
JS
493 }
494#endif
ef41d80c 495 for (i = 0; i < items.GetCount(); i++)
f97c9854 496 XmStringFree(text[i]);
f97c9854 497 delete[] text;
29006414 498
f97c9854
JS
499 // It seems that if the list is cleared, we must re-ask for
500 // selection policy!!
99ab3e3f 501 SetSelectionPolicy();
29006414 502
f97c9854
JS
503 if (managed)
504 XtManageChild(listBox);
29006414 505
99ab3e3f 506 sk.Restore();
29006414 507
ef41d80c 508 m_noItems += items.GetCount();
4bb6408c
JS
509}
510
511void wxListBox::SetString(int N, const wxString& s)
512{
99ab3e3f 513 wxSizeKeeper sk( this );
f97c9854 514 Widget listBox = (Widget) m_mainWidget;
29006414 515
99ab3e3f 516 wxXmString text( s );
29006414
VZ
517
518 // delete the item and add it again.
519 // FIXME isn't there a way to change it in place?
f97c9854 520 XmListDeletePos (listBox, N+1);
99ab3e3f 521 XmListAddItem (listBox, text(), N+1);
29006414 522
99ab3e3f 523 sk.Restore();
4bb6408c
JS
524}
525
4bb6408c
JS
526void wxListBox::Command (wxCommandEvent & event)
527{
f97c9854
JS
528 if (event.m_extraLong)
529 SetSelection (event.m_commandInt);
530 else
531 {
532 Deselect (event.m_commandInt);
533 return;
534 }
535 ProcessCommand (event);
536}
537
af111fc3 538void wxListBoxCallback (Widget WXUNUSED(w), XtPointer clientData,
2d120f83 539 XmListCallbackStruct * cbs)
f97c9854 540{
f97c9854 541 wxListBox *item = (wxListBox *) clientData;
29006414 542
a4294b78 543 if (item->InSetValue())
f97c9854 544 return;
29006414 545
ef41d80c
MB
546 wxEventType evtType;
547
548 if( cbs->reason == XmCR_DEFAULT_ACTION )
549 evtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
550 else
551 evtType = wxEVT_COMMAND_LISTBOX_SELECTED;
552
553 int n = cbs->item_position - 1;
554 wxCommandEvent event (evtType, item->GetId());
555 if ( item->HasClientObjectData() )
556 event.SetClientObject( item->GetClientObject(n) );
557 else if ( item->HasClientUntypedData() )
558 event.SetClientData( item->GetClientData(n) );
559 event.m_commandInt = n;
560 event.m_extraLong = TRUE;
561 event.SetEventObject(item);
562 event.SetString( item->GetString( n ) );
563
564 int x = -1;
2b5f62a0 565 if( NULL != cbs->event && cbs->event->type == ButtonRelease )
ef41d80c
MB
566 {
567 XButtonEvent* evt = (XButtonEvent*)cbs->event;
568
569 x = evt->x;
570 }
571
f97c9854 572 switch (cbs->reason)
4bb6408c 573 {
2d120f83
JS
574 case XmCR_MULTIPLE_SELECT:
575 case XmCR_BROWSE_SELECT:
ef41d80c
MB
576#if wxUSE_CHECKLISTBOX
577 item->DoToggleItem( n, x );
578#endif
579 case XmCR_DEFAULT_ACTION:
580 item->GetEventHandler()->ProcessEvent(event);
581 break;
2d120f83 582 case XmCR_EXTENDED_SELECT:
ef41d80c 583 switch (cbs->selection_type)
f97c9854 584 {
ef41d80c
MB
585 case XmINITIAL:
586 case XmADDITION:
587 case XmMODIFICATION:
588 item->DoToggleItem( n, x );
589 item->GetEventHandler()->ProcessEvent(event);
f97c9854
JS
590 break;
591 }
ef41d80c 592 break;
4bb6408c 593 }
4bb6408c
JS
594}
595
89c7e962
JS
596WXWidget wxListBox::GetTopWidget() const
597{
2d120f83 598 return (WXWidget) XtParent( (Widget) m_mainWidget );
89c7e962 599}
0d57be45 600
0d57be45
JS
601void wxListBox::ChangeBackgroundColour()
602{
321db4b6 603 wxWindow::ChangeBackgroundColour();
29006414 604
02800301
JS
605 Widget parent = XtParent ((Widget) m_mainWidget);
606 Widget hsb, vsb;
29006414 607
02800301 608 XtVaGetValues (parent,
2d120f83
JS
609 XmNhorizontalScrollBar, &hsb,
610 XmNverticalScrollBar, &vsb,
611 NULL);
29006414 612
a91b47e8
JS
613 /* TODO: should scrollbars be affected? Should probably have separate
614 * function to change them (by default, taken from wxSystemSettings)
2d120f83 615 */
a756f210 616 wxColour backgroundColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
94b49b93
JS
617 DoChangeBackgroundColour((WXWidget) hsb, backgroundColour, TRUE);
618 DoChangeBackgroundColour((WXWidget) vsb, backgroundColour, TRUE);
15d5ab67
JS
619
620 XtVaSetValues (hsb,
621 XmNtroughColor, backgroundColour.AllocColour(XtDisplay(hsb)),
622 NULL);
623 XtVaSetValues (vsb,
624 XmNtroughColor, backgroundColour.AllocColour(XtDisplay(vsb)),
625 NULL);
29006414 626
02800301 627 DoChangeBackgroundColour((WXWidget) parent, m_backgroundColour, TRUE);
0d57be45
JS
628}
629
630void wxListBox::ChangeForegroundColour()
631{
321db4b6 632 wxWindow::ChangeForegroundColour();
29006414 633
02800301
JS
634 Widget parent = XtParent ((Widget) m_mainWidget);
635 Widget hsb, vsb;
29006414
VZ
636
637 XtVaGetValues(parent,
638 XmNhorizontalScrollBar, &hsb,
639 XmNverticalScrollBar, &vsb,
640 NULL);
641
642 /* TODO: should scrollbars be affected? Should probably have separate
643 function to change them (by default, taken from wxSystemSettings)
644
2d120f83
JS
645 DoChangeForegroundColour((WXWidget) hsb, m_foregroundColour);
646 DoChangeForegroundColour((WXWidget) vsb, m_foregroundColour);
647 DoChangeForegroundColour((WXWidget) parent, m_foregroundColour);
02800301 648 */
0d57be45
JS
649}
650
6adaedf0
JS
651int wxListBox::GetCount() const
652{
ef41d80c 653 return m_noItems;
6adaedf0 654}