Update OpenVMS makefile
[wxWidgets.git] / src / os2 / listbox.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: src/os2/listbox.cpp
3 // Purpose: wxListBox
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/09/99
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 // For compilers that support precompilation, includes "wx.h".
12 #include "wx/wxprec.h"
13
14 #if wxUSE_LISTBOX
15
16 #include "wx/listbox.h"
17
18 #ifndef WX_PRECOMP
19 #include "wx/dynarray.h"
20 #include "wx/settings.h"
21 #include "wx/brush.h"
22 #include "wx/font.h"
23 #include "wx/dc.h"
24 #include "wx/dcscreen.h"
25 #include "wx/utils.h"
26 #include "wx/scrolwin.h"
27 #include "wx/log.h"
28 #include "wx/window.h"
29 #endif
30
31 #include "wx/os2/dcclient.h"
32 #include "wx/os2/private.h"
33
34 #define INCL_M
35 #include <os2.h>
36
37 #if wxUSE_OWNER_DRAWN
38 #include "wx/ownerdrw.h"
39 #endif
40
41 // ============================================================================
42 // list box item declaration and implementation
43 // ============================================================================
44
45 #if wxUSE_OWNER_DRAWN
46
47 class wxListBoxItem : public wxOwnerDrawn
48 {
49 public:
50 wxListBoxItem(wxListBox *parent)
51 { m_parent = parent; }
52
53 wxListBox *GetParent() const
54 { return m_parent; }
55
56 int GetIndex() const
57 { return m_parent->GetItemIndex(const_cast<wxListBoxItem*>(this)); }
58
59 wxString GetName() const
60 { return m_parent->GetString(GetIndex()); }
61
62 private:
63 wxListBox *m_parent;
64 };
65
66 wxOwnerDrawn* wxListBox::CreateItem( size_t WXUNUSED(n) )
67 {
68 return new wxListBoxItem(this);
69 } // end of wxListBox::CreateItem
70
71 #endif //USE_OWNER_DRAWN
72
73 // ============================================================================
74 // list box control implementation
75 // ============================================================================
76
77 // Listbox item
78 wxListBox::wxListBox()
79 {
80 m_nNumItems = 0;
81 m_nSelected = 0;
82 } // end of wxListBox::wxListBox
83
84 bool wxListBox::Create(
85 wxWindow* pParent
86 , wxWindowID vId
87 , const wxPoint& rPos
88 , const wxSize& rSize
89 , const wxArrayString& asChoices
90 , long lStyle
91 , const wxValidator& rValidator
92 , const wxString& rsName
93 )
94 {
95 wxCArrayString chs(asChoices);
96
97 return Create(pParent, vId, rPos, rSize, chs.GetCount(), chs.GetStrings(),
98 lStyle, rValidator, rsName);
99 }
100
101 bool wxListBox::Create( wxWindow* pParent,
102 wxWindowID vId,
103 const wxPoint& rPos,
104 const wxSize& rSize,
105 int n,
106 const wxString asChoices[],
107 long lStyle,
108 const wxValidator& rValidator,
109 const wxString& rsName )
110 {
111 m_nNumItems = 0;
112 m_hWnd = 0;
113 m_nSelected = 0;
114
115 SetName(rsName);
116 #if wxUSE_VALIDATORS
117 SetValidator(rValidator);
118 #endif
119
120 if (pParent)
121 pParent->AddChild(this);
122
123 wxSystemSettings vSettings;
124
125 SetBackgroundColour(vSettings.GetColour(wxSYS_COLOUR_WINDOW));
126 SetForegroundColour(pParent->GetForegroundColour());
127
128 m_windowId = (vId == -1) ? (int)NewControlId() : vId;
129
130 int nX = rPos.x;
131 int nY = rPos.y;
132 int nWidth = rSize.x;
133 int nHeight = rSize.y;
134
135 m_windowStyle = lStyle;
136
137 lStyle = WS_VISIBLE;
138
139 if (m_windowStyle & wxCLIP_SIBLINGS )
140 lStyle |= WS_CLIPSIBLINGS;
141 if (m_windowStyle & wxLB_MULTIPLE)
142 lStyle |= LS_MULTIPLESEL;
143 else if (m_windowStyle & wxLB_EXTENDED)
144 lStyle |= LS_EXTENDEDSEL;
145 if (m_windowStyle & wxLB_HSCROLL)
146 lStyle |= LS_HORZSCROLL;
147 if (m_windowStyle & wxLB_OWNERDRAW)
148 lStyle |= LS_OWNERDRAW;
149
150 //
151 // Without this style, you get unexpected heights, so e.g. constraint layout
152 // doesn't work properly
153 //
154 lStyle |= LS_NOADJUSTPOS;
155
156 m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) // Parent
157 ,WC_LISTBOX // Default Listbox class
158 ,"LISTBOX" // Control's name
159 ,lStyle // Initial Style
160 ,0, 0, 0, 0 // Position and size
161 ,GetWinHwnd(pParent) // Owner
162 ,HWND_TOP // Z-Order
163 ,(HMENU)m_windowId // Id
164 ,NULL // Control Data
165 ,NULL // Presentation Parameters
166 );
167 if (m_hWnd == 0)
168 {
169 return false;
170 }
171
172 //
173 // Subclass again for purposes of dialog editing mode
174 //
175 SubclassWin(m_hWnd);
176
177 LONG lUi;
178
179 for (lUi = 0; lUi < (LONG)n; lUi++)
180 {
181 Append(asChoices[lUi]);
182 }
183 wxFont* pTextFont = new wxFont( 10
184 ,wxMODERN
185 ,wxNORMAL
186 ,wxNORMAL
187 );
188 SetFont(*pTextFont);
189
190 //
191 // Set OS/2 system colours for Listbox items and highlighting
192 //
193 wxColour vColour;
194
195 vColour = wxSystemSettingsNative::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT);
196
197 LONG lColor = (LONG)vColour.GetPixel();
198
199 ::WinSetPresParam( m_hWnd
200 ,PP_HILITEFOREGROUNDCOLOR
201 ,sizeof(LONG)
202 ,(PVOID)&lColor
203 );
204 vColour = wxSystemSettingsNative::GetColour(wxSYS_COLOUR_HIGHLIGHT);
205 lColor = (LONG)vColour.GetPixel();
206 ::WinSetPresParam( m_hWnd
207 ,PP_HILITEBACKGROUNDCOLOR
208 ,sizeof(LONG)
209 ,(PVOID)&lColor
210 );
211
212 SetXComp(0);
213 SetYComp(0);
214 SetSize( nX
215 ,nY
216 ,nWidth
217 ,nHeight
218 );
219 delete pTextFont;
220 return true;
221 } // end of wxListBox::Create
222
223 wxListBox::~wxListBox()
224 {
225 Clear();
226 } // end of wxListBox::~wxListBox
227
228 void wxListBox::SetupColours()
229 {
230 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
231 SetForegroundColour(GetParent()->GetForegroundColour());
232 } // end of wxListBox::SetupColours
233
234 // ----------------------------------------------------------------------------
235 // implementation of wxListBoxBase methods
236 // ----------------------------------------------------------------------------
237
238 void wxListBox::DoSetFirstItem(int N)
239 {
240 wxCHECK_RET( IsValid(N),
241 wxT("invalid index in wxListBox::SetFirstItem") );
242
243 ::WinSendMsg(GetHwnd(), LM_SETTOPINDEX, MPFROMLONG(N), (MPARAM)0);
244 } // end of wxListBox::DoSetFirstItem
245
246 void wxListBox::DoDeleteOneItem(unsigned int n)
247 {
248 wxCHECK_RET( IsValid(n),
249 wxT("invalid index in wxListBox::Delete") );
250
251 #if wxUSE_OWNER_DRAWN
252 delete m_aItems[n];
253 m_aItems.RemoveAt(n);
254 #endif // wxUSE_OWNER_DRAWN
255
256 ::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)n, (MPARAM)0);
257 m_nNumItems--;
258 } // end of wxListBox::DoSetFirstItem
259
260 int wxListBox::DoInsertItems(const wxArrayStringsAdapter & items,
261 unsigned int pos,
262 void **clientData,
263 wxClientDataType type)
264 {
265 LONG lIndexType = 0;
266 bool incrementPos = false;
267
268 if (IsSorted())
269 lIndexType = LIT_SORTASCENDING;
270 else if (pos == GetCount())
271 lIndexType = LIT_END;
272 else
273 {
274 lIndexType = (LONG)pos;
275 incrementPos = true;
276 }
277
278 int n = wxNOT_FOUND;
279
280 unsigned int count = items.GetCount();
281 for (unsigned int i = 0; i < count; i++)
282 {
283 n = (int)::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)lIndexType, (MPARAM)items[i].wx_str());
284 if (n < 0)
285 {
286 wxLogLastError(wxT("WinSendMsg(LM_INSERTITEM)"));
287 n = wxNOT_FOUND;
288 break;
289 }
290 ++m_nNumItems;
291
292 #if wxUSE_OWNER_DRAWN
293 if (HasFlag(wxLB_OWNERDRAW))
294 {
295 wxOwnerDrawn* pNewItem = CreateItem(n); // dummy argument
296 pNewItem->SetFont(GetFont());
297 m_aItems.Insert(pNewItem, n);
298 }
299 #endif
300 AssignNewItemClientData(n, clientData, i, type);
301
302 if (incrementPos)
303 ++lIndexType;
304 }
305
306 return n;
307 } // end of wxListBox::DoInsertAppendItemsWithData
308
309 void wxListBox::DoClear()
310 {
311 #if wxUSE_OWNER_DRAWN
312 if ( m_windowStyle & wxLB_OWNERDRAW )
313 {
314 WX_CLEAR_ARRAY(m_aItems);
315 }
316 #endif // wxUSE_OWNER_DRAWN
317 ::WinSendMsg(GetHwnd(), LM_DELETEALL, (MPARAM)0, (MPARAM)0);
318
319 m_nNumItems = 0;
320 } // end of wxListBox::Clear
321
322 void wxListBox::DoSetSelection( int N, bool bSelect)
323 {
324 wxCHECK_RET( IsValid(N),
325 wxT("invalid index in wxListBox::SetSelection") );
326 ::WinSendMsg( GetHwnd()
327 ,LM_SELECTITEM
328 ,MPFROMLONG(N)
329 ,(MPARAM)bSelect
330 );
331 if(m_windowStyle & wxLB_OWNERDRAW)
332 Refresh();
333 } // end of wxListBox::SetSelection
334
335 bool wxListBox::IsSelected( int N ) const
336 {
337 wxCHECK_MSG( IsValid(N), false,
338 wxT("invalid index in wxListBox::Selected") );
339
340 LONG lItem;
341
342 if (GetWindowStyleFlag() & wxLB_EXTENDED)
343 {
344 if (N == 0)
345 lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
346 else
347 lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)(N - 1), (MPARAM)0));
348 }
349 else
350 {
351 lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)LIT_FIRST, (MPARAM)0));
352 }
353 return (lItem == (LONG)N && lItem != LIT_NONE);
354 } // end of wxListBox::IsSelected
355
356 void* wxListBox::DoGetItemClientData(unsigned int n) const
357 {
358 wxCHECK_MSG( IsValid(n), NULL,
359 wxT("invalid index in wxListBox::GetClientData") );
360
361 return((void *)::WinSendMsg(GetHwnd(), LM_QUERYITEMHANDLE, MPFROMLONG(n), (MPARAM)0));
362 } // end of wxListBox::DoGetItemClientData
363
364 void wxListBox::DoSetItemClientData(unsigned int n, void* pClientData)
365 {
366 wxCHECK_RET( IsValid(n),
367 wxT("invalid index in wxListBox::SetClientData") );
368
369 ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, MPFROMLONG(n), MPFROMP(pClientData));
370 } // end of wxListBox::DoSetItemClientData
371
372 bool wxListBox::HasMultipleSelection() const
373 {
374 return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
375 } // end of wxListBox::HasMultipleSelection
376
377 int wxListBox::GetSelections( wxArrayInt& raSelections ) const
378 {
379 int nCount = 0;
380 LONG lItem;
381
382
383 raSelections.Empty();
384 if (HasMultipleSelection())
385 {
386 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
387 ,LM_QUERYSELECTION
388 ,(MPARAM)LIT_FIRST
389 ,(MPARAM)0
390 )
391 );
392 if (lItem != LIT_NONE)
393 {
394 nCount++;
395 while ((lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
396 ,LM_QUERYSELECTION
397 ,(MPARAM)lItem
398 ,(MPARAM)0
399 )
400 )) != LIT_NONE)
401 {
402 nCount++;
403 }
404 raSelections.Alloc(nCount);
405 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
406 ,LM_QUERYSELECTION
407 ,(MPARAM)LIT_FIRST
408 ,(MPARAM)0
409 )
410 );
411
412 raSelections.Add((int)lItem);
413 while ((lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
414 ,LM_QUERYSELECTION
415 ,(MPARAM)lItem
416 ,(MPARAM)0
417 )
418 )) != LIT_NONE)
419 {
420 raSelections.Add((int)lItem);
421 }
422 return nCount;
423 }
424 }
425 else // single-selection listbox
426 {
427 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
428 ,LM_QUERYSELECTION
429 ,(MPARAM)LIT_FIRST
430 ,(MPARAM)0
431 )
432 );
433 raSelections.Add((int)lItem);
434 return 1;
435 }
436 return 0;
437 } // end of wxListBox::GetSelections
438
439 int wxListBox::GetSelection() const
440 {
441 wxCHECK_MSG( !HasMultipleSelection(),
442 -1,
443 wxT("GetSelection() can't be used with multiple-selection "
444 "listboxes, use GetSelections() instead.") );
445
446 return(LONGFROMMR(::WinSendMsg( GetHwnd()
447 ,LM_QUERYSELECTION
448 ,(MPARAM)LIT_FIRST
449 ,(MPARAM)0
450 )
451 ));
452 } // end of wxListBox::GetSelection
453
454 wxString wxListBox::GetString(unsigned int n) const
455 {
456 LONG lLen = 0;
457 wxChar* zBuf;
458 wxString sResult;
459
460 wxCHECK_MSG( IsValid(n), wxEmptyString,
461 wxT("invalid index in wxListBox::GetClientData") );
462
463 lLen = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)n, (MPARAM)0));
464 zBuf = new wxChar[lLen + 1];
465 ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)n, (SHORT)lLen), (MPARAM)zBuf);
466 zBuf[lLen] = '\0';
467 sResult = zBuf;
468 delete [] zBuf;
469 return sResult;
470 } // end of wxListBox::GetString
471
472 void wxListBox::SetString(unsigned int n, const wxString& rsString)
473 {
474 wxCHECK_RET( IsValid(n),
475 wxT("invalid index in wxListBox::SetString") );
476
477 //
478 // Remember the state of the item
479 //
480 bool bWasSelected = IsSelected(n);
481 void* pOldData = NULL;
482 wxClientData* pOldObjData = NULL;
483
484 if ( HasClientUntypedData() )
485 pOldData = GetClientData(n);
486 else if ( HasClientObjectData() )
487 pOldObjData = GetClientObject(n);
488
489 //
490 // Delete and recreate it
491 //
492 ::WinSendMsg( GetHwnd()
493 ,LM_DELETEITEM
494 ,(MPARAM)n
495 ,(MPARAM)0
496 );
497
498 int nNewN = n;
499
500 if (n == (m_nNumItems - 1))
501 nNewN = -1;
502
503 ::WinSendMsg( GetHwnd()
504 ,LM_INSERTITEM
505 ,(MPARAM)nNewN
506 ,(MPARAM)rsString.wx_str()
507 );
508
509 //
510 // Restore the client data
511 //
512 if (pOldData)
513 SetClientData(n, pOldData);
514 else if (pOldObjData)
515 SetClientObject(n, pOldObjData);
516
517 //
518 // We may have lost the selection
519 //
520 if (bWasSelected)
521 Select(n);
522 } // end of wxListBox::SetString
523
524 unsigned int wxListBox::GetCount() const
525 {
526 return m_nNumItems;
527 }
528
529 // ----------------------------------------------------------------------------
530 // helpers
531 // ----------------------------------------------------------------------------
532
533 wxSize wxListBox::DoGetBestSize() const
534 {
535 //
536 // Find the widest string
537 //
538 int nLine;
539 int nListbox = 0;
540 int nCx;
541 int nCy;
542 wxFont vFont = (wxFont)GetFont();
543
544 for (unsigned int i = 0; i < m_nNumItems; i++)
545 {
546 wxString vStr(GetString(i));
547
548 GetTextExtent( vStr, &nLine, NULL );
549 if (nLine > nListbox)
550 nListbox = nLine;
551 }
552
553 //
554 // Give it some reasonable default value if there are no strings in the
555 // list.
556 //
557 if (nListbox == 0)
558 nListbox = 100;
559
560 //
561 // The listbox should be slightly larger than the widest string
562 //
563 wxGetCharSize( GetHWND()
564 ,&nCx
565 ,&nCy
566 ,&vFont
567 );
568 nListbox += 3 * nCx;
569
570 int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * (wxMax(m_nNumItems, 7));
571
572 return wxSize( nListbox
573 ,hListbox
574 );
575 } // end of wxListBox::DoGetBestSize
576
577 // ----------------------------------------------------------------------------
578 // callbacks
579 // ----------------------------------------------------------------------------
580
581 bool wxListBox::OS2Command(
582 WXUINT uParam
583 , WXWORD WXUNUSED(wId))
584 {
585 wxEventType eEvtType;
586
587 if (uParam == LN_SELECT)
588 {
589 eEvtType = wxEVT_LISTBOX;
590 }
591 else if (uParam == LN_ENTER)
592 {
593 eEvtType = wxEVT_LISTBOX_DCLICK;
594 }
595 else
596 {
597 //
598 // Some event we're not interested in
599 //
600 return false;
601 }
602 wxCommandEvent vEvent( eEvtType
603 ,m_windowId
604 );
605
606 vEvent.SetEventObject(this);
607
608 wxArrayInt aSelections;
609 int n;
610 int nCount = GetSelections(aSelections);
611
612 if (nCount > 0)
613 {
614 n = aSelections[0];
615 if (HasClientObjectData())
616 vEvent.SetClientObject(GetClientObject(n));
617 else if ( HasClientUntypedData() )
618 vEvent.SetClientData(GetClientData(n));
619 vEvent.SetString(GetString(n));
620 }
621 else
622 {
623 n = -1;
624 }
625 vEvent.SetInt(n);
626 return HandleWindowEvent(vEvent);
627 } // end of wxListBox::OS2Command
628
629 // ----------------------------------------------------------------------------
630 // wxCheckListBox support
631 // ----------------------------------------------------------------------------
632
633 #if wxUSE_OWNER_DRAWN
634
635 //
636 // Drawing
637 // -------
638 //
639 #define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
640
641 long wxListBox::OS2OnMeasure(WXMEASUREITEMSTRUCT* pItem)
642 {
643 if (!pItem)
644 pItem = (WXMEASUREITEMSTRUCT*)new OWNERITEM;
645
646 POWNERITEM pMeasureStruct = (POWNERITEM)pItem;
647 wxScreenDC vDc;
648
649 //
650 // Only owner-drawn control should receive this message
651 //
652 wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE );
653
654 vDc.SetFont(GetFont());
655
656 wxCoord vHeight;
657 wxCoord vWidth;
658
659 GetSize( &vWidth
660 ,NULL
661 );
662
663 pMeasureStruct->rclItem.xRight = (USHORT)vWidth;
664 pMeasureStruct->rclItem.xLeft = 0;
665 pMeasureStruct->rclItem.yTop = 0;
666 pMeasureStruct->rclItem.yBottom = 0;
667
668 vHeight = (wxCoord)(vDc.GetCharHeight() * 2.5);
669 pMeasureStruct->rclItem.yTop = (USHORT)vHeight;
670
671 return long(MRFROM2SHORT((USHORT)vHeight, (USHORT)vWidth));
672 } // end of wxListBox::OS2OnMeasure
673
674 bool wxListBox::OS2OnDraw (
675 WXDRAWITEMSTRUCT* pItem
676 )
677 {
678 POWNERITEM pDrawStruct = (POWNERITEM)pItem;
679 int eAction = 0;
680 int eStatus = 0;
681
682 //
683 // Only owner-drawn control should receive this message
684 //
685 wxCHECK(((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), false);
686
687
688 //
689 // The item may be -1 for an empty listbox
690 //
691 if (pDrawStruct->idItem == -1L)
692 return false;
693
694 wxListBoxItem* pData = (wxListBoxItem*)m_aItems[pDrawStruct->idItem];
695
696 wxClientDC vDc(this);
697 wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl();
698 wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop );
699 wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom );
700 wxRect vRect( pt1, pt2 );
701
702 impl->SetHPS(pDrawStruct->hps);
703
704 if (pDrawStruct->fsAttribute == pDrawStruct->fsAttributeOld)
705 {
706 //
707 // Entire Item needs to be redrawn (either it has reappeared from
708 // behind another window or is being displayed for the first time
709 //
710 eAction = wxOwnerDrawn::wxODDrawAll;
711
712 if (pDrawStruct->fsAttribute & MIA_HILITED)
713 {
714 //
715 // If it is currently selected we let the system handle it
716 //
717 eStatus |= wxOwnerDrawn::wxODSelected;
718 }
719 if (pDrawStruct->fsAttribute & MIA_CHECKED)
720 {
721 //
722 // If it is currently checked we draw our own
723 //
724 eStatus |= wxOwnerDrawn::wxODChecked;
725 pDrawStruct->fsAttributeOld = pDrawStruct->fsAttribute &= ~MIA_CHECKED;
726 }
727 if (pDrawStruct->fsAttribute & MIA_DISABLED)
728 {
729 //
730 // If it is currently disabled we let the system handle it
731 //
732 eStatus |= wxOwnerDrawn::wxODDisabled;
733 }
734 //
735 // Don't really care about framed (indicationg focus) or NoDismiss
736 //
737 }
738 else
739 {
740 if (pDrawStruct->fsAttribute & MIA_HILITED)
741 {
742 eAction = wxOwnerDrawn::wxODDrawAll;
743 eStatus |= wxOwnerDrawn::wxODSelected;
744 //
745 // Keep the system from trying to highlight with its bogus colors
746 //
747 pDrawStruct->fsAttributeOld = pDrawStruct->fsAttribute &= ~MIA_HILITED;
748 }
749 else if (!(pDrawStruct->fsAttribute & MIA_HILITED))
750 {
751 eAction = wxOwnerDrawn::wxODDrawAll;
752 eStatus = 0;
753 //
754 // Keep the system from trying to highlight with its bogus colors
755 //
756 pDrawStruct->fsAttribute = pDrawStruct->fsAttributeOld &= ~MIA_HILITED;
757 }
758 else
759 {
760 //
761 // For now we don't care about anything else
762 // just ignore the entire message!
763 //
764 return true;
765 }
766 }
767 return pData->OnDrawItem( vDc
768 ,vRect
769 ,(wxOwnerDrawn::wxODAction)eAction
770 ,(wxOwnerDrawn::wxODStatus)(eStatus | wxOwnerDrawn::wxODHidePrefix)
771 );
772 } // end of wxListBox::OS2OnDraw
773
774 #endif // ndef for wxUSE_OWNER_DRAWN
775
776 #endif // wxUSE_LISTBOX