#include "wx/brush.h"
#include "wx/font.h"
#include "wx/dc.h"
+#include "wx/dcscreen.h"
#include "wx/utils.h"
#include "wx/scrolwin.h"
#endif
, int n
, const wxString asChoices[]
, long lStyle
-#if wxUSE_VALIDATORS
, const wxValidator& rValidator
-#endif
, const wxString& rsName
)
{
if (m_windowStyle & wxLB_OWNERDRAW)
{
wxOwnerDrawn* pNewItem = CreateItem(nIndex); // dummy argument
+ wxScreenDC vDc;
+ wxCoord vHeight;
+
pNewItem->SetName(rsItem);
m_aItems.Insert(pNewItem, nIndex);
//
#define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
-bool wxListBox::OS2OnMeasure(
+long wxListBox::OS2OnMeasure(
WXMEASUREITEMSTRUCT* pItem
)
{
vDc.SetFont(GetFont());
wxCoord vHeight;
+ wxCoord vWidth;
- pMeasureStruct->rclItem.xRight = 0;
+ GetSize( &vWidth
+ ,NULL
+ );
+
+ pMeasureStruct->rclItem.xRight = (USHORT)vWidth;
pMeasureStruct->rclItem.xLeft = 0;
pMeasureStruct->rclItem.yTop = 0;
pMeasureStruct->rclItem.yBottom = 0;
vHeight = vDc.GetCharHeight() * 2.5;
- pMeasureStruct->rclItem.yTop = vHeight;
+ pMeasureStruct->rclItem.yTop = (USHORT)vHeight;
- ::WinSendMsg( GetHWND()
- ,LM_SETITEMHEIGHT
- ,MPFROMLONG(vHeight)
- ,MPFROMLONG(pMeasureStruct->idItem)
- );
- return TRUE;
+ return long(MRFROM2SHORT((USHORT)vHeight, (USHORT)vWidth));
} // end of wxListBox::OS2OnMeasure
bool wxListBox::OS2OnDraw (