]> git.saurik.com Git - wxWidgets.git/blob - src/os2/listbox.cpp
implemented menu drawing in the GTK theme
[wxWidgets.git] / src / os2 / listbox.cpp
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: 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 #include "wx/window.h"
16 #include "wx/os2/private.h"
17
18 #ifndef WX_PRECOMP
19 #include "wx/listbox.h"
20 #include "wx/settings.h"
21 #include "wx/brush.h"
22 #include "wx/font.h"
23 #include "wx/dc.h"
24 #include "wx/utils.h"
25 #include "wx/scrolwin.h"
26 #endif
27
28 #define INCL_M
29 #include <os2.h>
30
31 #include "wx/dynarray.h"
32 #include "wx/log.h"
33
34 #if wxUSE_LISTBOX
35
36 #if wxUSE_OWNER_DRAWN
37 #include "wx/ownerdrw.h"
38 #endif
39
40 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
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(const wxString& rsStr = "");
52 };
53
54 wxListBoxItem::wxListBoxItem(
55 const wxString& rsStr
56 )
57 : wxOwnerDrawn( rsStr
58 ,FALSE
59 )
60 {
61 //
62 // No bitmaps/checkmarks
63 //
64 SetMarginWidth(0);
65 } // end of wxListBoxItem::wxListBoxItem
66
67 wxOwnerDrawn* wxListBox::CreateItem(
68 size_t n
69 )
70 {
71 return new wxListBoxItem();
72 } // end of wxListBox::CreateItem
73
74 #endif //USE_OWNER_DRAWN
75
76 // ============================================================================
77 // list box control implementation
78 // ============================================================================
79
80 // Listbox item
81 wxListBox::wxListBox()
82 {
83 m_nNumItems = 0;
84 m_nSelected = 0;
85 } // end of wxListBox::wxListBox
86
87 bool wxListBox::Create(
88 wxWindow* pParent
89 , wxWindowID vId
90 , const wxPoint& rPos
91 , const wxSize& rSize
92 , int n
93 , const wxString asChoices[]
94 , long lStyle
95 #if wxUSE_VALIDATORS
96 , const wxValidator& rValidator
97 #endif
98 , const wxString& rsName
99 )
100 {
101 m_nNumItems = 0;
102 m_hWnd = 0;
103 m_nSelected = 0;
104
105 SetName(rsName);
106 #if wxUSE_VALIDATORS
107 SetValidator(rValidator);
108 #endif
109
110 if (pParent)
111 pParent->AddChild(this);
112
113 wxSystemSettings vSettings;
114
115 SetBackgroundColour(vSettings.GetSystemColour(wxSYS_COLOUR_WINDOW));
116 SetForegroundColour(pParent->GetForegroundColour());
117
118 m_windowId = (vId == -1) ? (int)NewControlId() : vId;
119
120 int nX = rPos.x;
121 int nY = rPos.y;
122 int nWidth = rSize.x;
123 int nHeight = rSize.y;
124
125 m_windowStyle = lStyle;
126
127 lStyle = WS_VISIBLE;
128
129 if (m_windowStyle & wxCLIP_SIBLINGS )
130 lStyle |= WS_CLIPSIBLINGS;
131 if (m_windowStyle & wxLB_MULTIPLE)
132 lStyle |= LS_MULTIPLESEL;
133 else if (m_windowStyle & wxLB_EXTENDED)
134 lStyle |= LS_EXTENDEDSEL;
135 if (m_windowStyle & wxLB_HSCROLL)
136 lStyle |= LS_HORZSCROLL;
137 if (m_windowStyle & wxLB_OWNERDRAW)
138 lStyle |= LS_OWNERDRAW;
139
140 //
141 // Without this style, you get unexpected heights, so e.g. constraint layout
142 // doesn't work properly
143 //
144 lStyle |= LS_NOADJUSTPOS;
145
146 m_hWnd = (WXHWND)::WinCreateWindow( GetWinHwnd(pParent) // Parent
147 ,WC_LISTBOX // Default Listbox class
148 ,"LISTBOX" // Control's name
149 ,lStyle // Initial Style
150 ,0, 0, 0, 0 // Position and size
151 ,GetWinHwnd(pParent) // Owner
152 ,HWND_TOP // Z-Order
153 ,(HMENU)m_windowId // Id
154 ,NULL // Control Data
155 ,NULL // Presentation Parameters
156 );
157 if (m_hWnd == 0)
158 {
159 return FALSE;
160 }
161
162 //
163 // Subclass again for purposes of dialog editing mode
164 //
165 SubclassWin(m_hWnd);
166
167 LONG lUi;
168
169 for (lUi = 0; lUi < (LONG)n; lUi++)
170 {
171 Append(asChoices[lUi]);
172 }
173 wxFont* pTextFont = new wxFont( 10
174 ,wxMODERN
175 ,wxNORMAL
176 ,wxNORMAL
177 );
178 SetFont(*pTextFont);
179
180 //
181 // Set standard wxWindows colors for Listbox items and highlighting
182 //
183 wxColour vColour;
184
185 vColour.Set(wxString("WHITE"));
186
187 LONG lColor = (LONG)vColour.GetPixel();
188
189 ::WinSetPresParam( m_hWnd
190 ,PP_HILITEFOREGROUNDCOLOR
191 ,sizeof(LONG)
192 ,(PVOID)&lColor
193 );
194 vColour.Set(wxString("NAVY"));
195 lColor = (LONG)vColour.GetPixel();
196 ::WinSetPresParam( m_hWnd
197 ,PP_HILITEBACKGROUNDCOLOR
198 ,sizeof(LONG)
199 ,(PVOID)&lColor
200 );
201
202 SetSize( nX
203 ,nY
204 ,nWidth
205 ,nHeight
206 );
207 delete pTextFont;
208 return TRUE;
209 } // end of wxListBox::Create
210
211 wxListBox::~wxListBox()
212 {
213 #if wxUSE_OWNER_DRAWN
214 size_t lUiCount = m_aItems.Count();
215
216 while (lUiCount-- != 0)
217 {
218 delete m_aItems[lUiCount];
219 }
220 #endif // wxUSE_OWNER_DRAWN
221 } // end of wxListBox::~wxListBox
222
223 void wxListBox::SetupColours()
224 {
225 SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
226 SetForegroundColour(GetParent()->GetForegroundColour());
227 } // end of wxListBox::SetupColours
228
229 // ----------------------------------------------------------------------------
230 // implementation of wxListBoxBase methods
231 // ----------------------------------------------------------------------------
232
233 void wxListBox::DoSetFirstItem(
234 int N
235 )
236 {
237 wxCHECK_RET( N >= 0 && N < m_nNumItems,
238 wxT("invalid index in wxListBox::SetFirstItem") );
239
240 ::WinSendMsg(GetHwnd(), LM_SETTOPINDEX, MPFROMLONG(N), (MPARAM)0);
241 } // end of wxListBox::DoSetFirstItem
242
243 void wxListBox::Delete(
244 int N
245 )
246 {
247 wxCHECK_RET( N >= 0 && N < m_nNumItems,
248 wxT("invalid index in wxListBox::Delete") );
249
250 #if wxUSE_OWNER_DRAWN
251 delete m_aItems[N];
252 m_aItems.RemoveAt(N);
253 #else // !wxUSE_OWNER_DRAWN
254 if (HasClientObjectData())
255 {
256 delete GetClientObject(N);
257 }
258 #endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
259
260 ::WinSendMsg(GetHwnd(), LM_DELETEITEM, (MPARAM)N, (MPARAM)0);
261 m_nNumItems--;
262 } // end of wxListBox::DoSetFirstItem
263
264 int wxListBox::DoAppend(
265 const wxString& rsItem
266 )
267 {
268 int nIndex = 0;
269 SHORT nIndexType = 0;
270
271 if (m_windowStyle & wxLB_SORT)
272 nIndexType = LIT_SORTASCENDING;
273 else
274 nIndexType = LIT_END;
275 nIndex = (int)::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)nIndexType, (MPARAM)rsItem.c_str());
276 m_nNumItems++;
277
278 #if wxUSE_OWNER_DRAWN
279 if (m_windowStyle & wxLB_OWNERDRAW)
280 {
281 wxOwnerDrawn* pNewItem = CreateItem(nIndex); // dummy argument
282
283 pNewItem->SetName(rsItem);
284 m_aItems.Add(pNewItem);
285 ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, (MPARAM)((SHORT)nIndex), MPFROMP(pNewItem));
286 pNewItem->SetFont(GetFont());
287 }
288 #endif
289 return nIndex;
290 } // end of wxListBox::DoAppend
291
292 void wxListBox::DoSetItems(
293 const wxArrayString& raChoices
294 , void** ppClientData
295 )
296 {
297 BOOL bHideAndShow = IsShown();
298 int nCount = 0;
299 int i;
300 SHORT nIndexType = 0;
301
302 if (bHideAndShow)
303 {
304 ::WinShowWindow(GetHwnd(), FALSE);
305 }
306 ::WinSendMsg(GetHwnd(), LM_DELETEALL, (MPARAM)0, (MPARAM)0);
307 m_nNumItems = raChoices.GetCount();
308 for (i = 0; i < m_nNumItems; i++)
309 {
310
311 if (m_windowStyle & wxLB_SORT)
312 nIndexType = LIT_SORTASCENDING;
313 else
314 nIndexType = LIT_END;
315 ::WinSendMsg(GetHwnd(), LM_INSERTITEM, (MPARAM)nIndexType, (MPARAM)raChoices[i].c_str());
316
317 if (ppClientData)
318 {
319 #if wxUSE_OWNER_DRAWN
320 wxASSERT_MSG(ppClientData[i] == NULL,
321 wxT("Can't use client data with owner-drawn listboxes"));
322 #else // !wxUSE_OWNER_DRAWN
323 ::WinSendMsg(WinUtil_GetHwnd(), LM_SETITEMHANDLE, MPFROMLONG(lCount), MPFROMP(ppClientData[i]));
324 #endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
325 }
326 }
327
328 #if wxUSE_OWNER_DRAWN
329 if ( m_windowStyle & wxLB_OWNERDRAW )
330 {
331 //
332 // First delete old items
333 //
334 size_t lUi = m_aItems.Count();
335
336 while (lUi-- != 0)
337 {
338 delete m_aItems[lUi];
339 }
340 m_aItems.Empty();
341
342 //
343 // Then create new ones
344 //
345 for (lUi = 0; lUi < (size_t)m_nNumItems; lUi++)
346 {
347 wxOwnerDrawn* pNewItem = CreateItem(lUi);
348
349 pNewItem->SetName(raChoices[lUi]);
350 m_aItems.Add(pNewItem);
351 ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, MPFROMLONG(lUi), MPFROMP(pNewItem));
352 }
353 }
354 #endif // wxUSE_OWNER_DRAWN
355 ::WinShowWindow(GetHwnd(), TRUE);
356 } // end of wxListBox::DoSetItems
357
358 int wxListBox::FindString(
359 const wxString& rsString
360 ) const
361 {
362 int nPos;
363 LONG lTextLength;
364 PSZ zStr;
365
366
367 for (nPos = 0; nPos < m_nNumItems; nPos++)
368 {
369 lTextLength = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)nPos, (MPARAM)0));
370 zStr = new char[lTextLength + 1];
371 ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT(nPos, (SHORT)lTextLength), (MPARAM)zStr);
372 if (rsString == (char*)zStr)
373 {
374 delete [] zStr;
375 break;
376 }
377 delete [] zStr;
378 }
379 return nPos;
380 } // end of wxListBox::FindString
381
382 void wxListBox::Clear()
383 {
384 #if wxUSE_OWNER_DRAWN
385 size_t lUiCount = m_aItems.Count();
386
387 while (lUiCount-- != 0)
388 {
389 delete m_aItems[lUiCount];
390 }
391
392 m_aItems.Clear();
393 #else // !wxUSE_OWNER_DRAWN
394 if (HasClientObjectData())
395 {
396 for (size_t n = 0; n < (size_t)m_lNumItems; n++)
397 {
398 delete GetClientObject(n);
399 }
400 }
401 #endif // wxUSE_OWNER_DRAWN/!wxUSE_OWNER_DRAWN
402 ::WinSendMsg(GetHwnd(), LM_DELETEALL, (MPARAM)0, (MPARAM)0);
403
404 m_nNumItems = 0;
405 } // end of wxListBox::Clear
406
407 void wxListBox::SetSelection(
408 int N
409 , bool bSelect
410 )
411 {
412 wxCHECK_RET( N >= 0 && N < m_nNumItems,
413 wxT("invalid index in wxListBox::SetSelection") );
414 ::WinSendMsg( GetHwnd()
415 ,LM_SELECTITEM
416 ,MPFROMLONG(N)
417 ,(MPARAM)bSelect
418 );
419 } // end of wxListBox::SetSelection
420
421 bool wxListBox::IsSelected(
422 int N
423 ) const
424 {
425 wxCHECK_MSG( N >= 0 && N < m_nNumItems, FALSE,
426 wxT("invalid index in wxListBox::Selected") );
427
428 LONG lItem;
429
430 lItem = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYSELECTION, (MPARAM)N, (MPARAM)0));
431 return (lItem != LIT_NONE);
432 } // end of wxListBox::IsSelected
433
434 wxClientData* wxListBox::DoGetItemClientObject(
435 int n
436 ) const
437 {
438 return (wxClientData *)DoGetItemClientData(n);
439 }
440
441 void* wxListBox::DoGetItemClientData(
442 int n
443 ) const
444 {
445 wxCHECK_MSG( n >= 0 && n < m_nNumItems, NULL,
446 wxT("invalid index in wxListBox::GetClientData") );
447
448 return((void *)::WinSendMsg(GetHwnd(), LM_QUERYITEMHANDLE, MPFROMLONG(n), (MPARAM)0));
449 } // end of wxListBox::DoGetItemClientData
450
451 void wxListBox::DoSetItemClientObject(
452 int n
453 , wxClientData* pClientData
454 )
455 {
456 DoSetItemClientData( n
457 ,pClientData
458 );
459 } // end of wxListBox::DoSetItemClientObject
460
461 void wxListBox::DoSetItemClientData(
462 int n
463 , void* pClientData
464 )
465 {
466 wxCHECK_RET( n >= 0 && n < m_nNumItems,
467 wxT("invalid index in wxListBox::SetClientData") );
468
469 #if wxUSE_OWNER_DRAWN
470 if ( m_windowStyle & wxLB_OWNERDRAW )
471 {
472 //
473 // Client data must be pointer to wxOwnerDrawn, otherwise we would crash
474 // in OnMeasure/OnDraw.
475 //
476 wxFAIL_MSG(wxT("Can't use client data with owner-drawn listboxes"));
477 }
478 #endif // wxUSE_OWNER_DRAWN
479
480 ::WinSendMsg(GetHwnd(), LM_SETITEMHANDLE, MPFROMLONG(n), MPFROMP(pClientData));
481 } // end of wxListBox::DoSetItemClientData
482
483 bool wxListBox::HasMultipleSelection() const
484 {
485 return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED);
486 } // end of wxListBox::HasMultipleSelection
487
488 int wxListBox::GetSelections(
489 wxArrayInt& raSelections
490 ) const
491 {
492 int nCount = 0;
493 LONG lItem;
494
495
496 raSelections.Empty();
497 if (HasMultipleSelection())
498 {
499 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
500 ,LM_QUERYSELECTION
501 ,(MPARAM)LIT_FIRST
502 ,(MPARAM)0
503 )
504 );
505 if (lItem != LIT_NONE)
506 {
507 nCount++;
508 while ((lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
509 ,LM_QUERYSELECTION
510 ,(MPARAM)lItem
511 ,(MPARAM)0
512 )
513 )) != LIT_NONE)
514 {
515 nCount++;
516 }
517 raSelections.Alloc(nCount);
518 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
519 ,LM_QUERYSELECTION
520 ,(MPARAM)LIT_FIRST
521 ,(MPARAM)0
522 )
523 );
524
525 raSelections.Add((int)lItem);
526 while ((lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
527 ,LM_QUERYSELECTION
528 ,(MPARAM)lItem
529 ,(MPARAM)0
530 )
531 )) != LIT_NONE)
532 {
533 raSelections.Add((int)lItem);
534 }
535 return nCount;
536 }
537 return 0;
538 }
539 else // single-selection listbox
540 {
541 lItem = LONGFROMMR(::WinSendMsg( GetHwnd()
542 ,LM_QUERYSELECTION
543 ,(MPARAM)LIT_FIRST
544 ,(MPARAM)0
545 )
546 );
547 raSelections.Add((int)lItem);
548 return 1;
549 }
550 return 0;
551 } // end of wxListBox::GetSelections
552
553 int wxListBox::GetSelection() const
554 {
555 wxCHECK_MSG( !HasMultipleSelection(),
556 -1,
557 wxT("GetSelection() can't be used with multiple-selection "
558 "listboxes, use GetSelections() instead.") );
559
560 return(LONGFROMMR(::WinSendMsg( GetHwnd()
561 ,LM_QUERYSELECTION
562 ,(MPARAM)LIT_FIRST
563 ,(MPARAM)0
564 )
565 ));
566 } // end of wxListBox::GetSelection
567
568 wxString wxListBox::GetString(
569 int N
570 ) const
571 {
572 LONG lLen = 0;
573 char* zBuf;
574 wxString sResult;
575
576 wxCHECK_MSG( N >= 0 && N < m_nNumItems, "",
577 wxT("invalid index in wxListBox::GetClientData") );
578
579 lLen = LONGFROMMR(::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXTLENGTH, (MPARAM)N, (MPARAM)0));
580 zBuf = new char[lLen + 1];
581 ::WinSendMsg(GetHwnd(), LM_QUERYITEMTEXT, MPFROM2SHORT((SHORT)N, (SHORT)lLen), (MPARAM)zBuf);
582 zBuf[lLen] = '\0';
583 sResult = zBuf;
584 delete [] zBuf;
585 return sResult;
586 } // end of wxListBox::GetString
587
588 void wxListBox::DoInsertItems(
589 const wxArrayString& asItems
590 , int nPos
591 )
592 {
593 wxCHECK_RET( nPos >= 0 && nPos <= m_nNumItems,
594 wxT("invalid index in wxListBox::InsertItems") );
595
596 int nItems = asItems.GetCount();
597
598 for (int i = 0; i < nItems; i++)
599 ::WinSendMsg(GetHwnd(), LM_INSERTITEM, MPFROMLONG((LONG)(i + nPos)), (MPARAM)asItems[i].c_str());
600 m_nNumItems += nItems;
601 } // end of wxListBox::DoInsertItems
602
603 void wxListBox::SetString(
604 int N
605 , const wxString& rsString
606 )
607 {
608 wxCHECK_RET( N >= 0 && N < m_nNumItems,
609 wxT("invalid index in wxListBox::SetString") );
610
611 //
612 // Remember the state of the item
613 //
614 bool bWasSelected = IsSelected(N);
615 void* pOldData = NULL;
616 wxClientData* pOldObjData = NULL;
617
618 if (m_clientDataItemsType == wxClientData_Void)
619 pOldData = GetClientData(N);
620 else if (m_clientDataItemsType == wxClientData_Object)
621 pOldObjData = GetClientObject(N);
622
623 //
624 // Delete and recreate it
625 //
626 ::WinSendMsg( GetHwnd()
627 ,LM_DELETEITEM
628 ,(MPARAM)N
629 ,(MPARAM)0
630 );
631
632 int nNewN = N;
633
634 if (N == m_nNumItems - 1)
635 nNewN = -1;
636
637 ::WinSendMsg( GetHwnd()
638 ,LM_INSERTITEM
639 ,(MPARAM)nNewN
640 ,(MPARAM)rsString.c_str()
641 );
642
643 //
644 // Restore the client data
645 //
646 if (pOldData)
647 SetClientData( N
648 ,pOldData
649 );
650 else if (pOldObjData)
651 SetClientObject( N
652 ,pOldObjData
653 );
654
655 //
656 // We may have lost the selection
657 //
658 if (bWasSelected)
659 Select(N);
660
661 #if wxUSE_OWNER_DRAWN
662 if (m_windowStyle & wxLB_OWNERDRAW)
663 //
664 // Update item's text
665 //
666 m_aItems[N]->SetName(rsString);
667 #endif //USE_OWNER_DRAWN
668 } // end of wxListBox::SetString
669
670 int wxListBox::GetCount() const
671 {
672 return m_nNumItems;
673 }
674
675 // ----------------------------------------------------------------------------
676 // helpers
677 // ----------------------------------------------------------------------------
678
679 wxSize wxListBox::DoGetBestSize() const
680 {
681 //
682 // Find the widest string
683 //
684 int nLine;
685 int nListbox = 0;
686 int nCx;
687 int nCy;
688
689 for (int i = 0; i < m_nNumItems; i++)
690 {
691 wxString vStr(GetString(i));
692
693 GetTextExtent( vStr
694 ,&nLine
695 ,NULL
696 );
697 if (nLine > nListbox)
698 nListbox = nLine;
699 }
700
701 //
702 // Give it some reasonable default value if there are no strings in the
703 // list.
704 //
705 if (nListbox == 0)
706 nListbox = 100;
707
708 //
709 // The listbox should be slightly larger than the widest string
710 //
711 wxGetCharSize( GetHWND()
712 ,&nCx
713 ,&nCy
714 ,(wxFont*)&GetFont()
715 );
716 nListbox += 3 * nCx;
717
718 int hListbox = EDIT_HEIGHT_FROM_CHAR_HEIGHT(nCy) * (wxMax(m_nNumItems, 7));
719
720 return wxSize( nListbox
721 ,hListbox
722 );
723 } // end of wxListBox::DoGetBestSize
724
725 // ----------------------------------------------------------------------------
726 // callbacks
727 // ----------------------------------------------------------------------------
728
729 bool wxListBox::OS2Command(
730 WXUINT uParam
731 , WXWORD WXUNUSED(wId))
732 {
733 wxEventType eEvtType;
734
735 if (uParam == LN_SELECT)
736 {
737 eEvtType = wxEVT_COMMAND_LISTBOX_SELECTED;
738 }
739 if (uParam == LN_ENTER)
740 {
741 eEvtType = wxEVT_COMMAND_LISTBOX_DOUBLECLICKED;
742 }
743 else
744 {
745 //
746 // Some event we're not interested in
747 //
748 return FALSE;
749 }
750 wxCommandEvent vEvent( eEvtType
751 ,m_windowId
752 );
753
754 vEvent.SetEventObject(this);
755
756 wxArrayInt aSelections;
757 int n;
758 int nCount = GetSelections(aSelections);
759
760 if (nCount > 0)
761 {
762 n = aSelections[0];
763 if (HasClientObjectData())
764 vEvent.SetClientObject(GetClientObject(n));
765 else if ( HasClientUntypedData() )
766 vEvent.SetClientData(GetClientData(n));
767 vEvent.SetString(GetString(n));
768 }
769 else
770 {
771 n = -1;
772 }
773 vEvent.m_commandInt = n;
774 return GetEventHandler()->ProcessEvent(vEvent);
775 } // end of wxListBox::OS2Command
776
777 // ----------------------------------------------------------------------------
778 // wxCheckListBox support
779 // ----------------------------------------------------------------------------
780
781 #if wxUSE_OWNER_DRAWN
782
783 //
784 // Drawing
785 // -------
786 //
787 #define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
788
789 bool wxListBox::OS2OnMeasure(WXMEASUREITEMSTRUCT *item)
790 {
791 //
792 // TODO: Get to this eventually
793 //
794 return TRUE;
795 }
796
797 bool wxListBox::OS2OnDraw(WXDRAWITEMSTRUCT *item)
798 {
799 //
800 // TODO: Get to this eventually
801 //
802 return FALSE;
803 }
804 #endif // ndef for wxUSE_OWNER_DRAWN
805
806 #endif // ndef for wxUSE_LISTBOX
807