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