// Author: David Webster
// Modified by:
// Created: 10/13/99
-// RCS-ID: $Id$
// Copyright: (c) David Webster
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#define INCL_PM
#include <os2.h>
+// ----------------------------------------------------------------------------
+// constants for base class
+// ----------------------------------------------------------------------------
+
+static const int CHECK_MARK_WIDTH = 15;
+
// ----------------------------------------------------------------------------
// private functions
// ----------------------------------------------------------------------------
// implementation
// ============================================================================
-IMPLEMENT_DYNAMIC_CLASS(wxCheckListBox, wxListBox)
-
// ----------------------------------------------------------------------------
// declaration and implementation of wxCheckListBoxItem class
// ----------------------------------------------------------------------------
void Check(bool bCheck);
void Toggle(void) { Check(!IsChecked()); }
+ virtual wxString GetName() const { return m_pParent->GetString(m_nIndex); }
+
private:
bool m_bChecked;
wxCheckListBox* m_pParent;
// done in OnMeasure while they are used only in OnDraw and we
// know that there will always be OnMeasure before OnDraw
//
- SetMarginWidth(GetDefaultMarginWidth());
+ SetMarginWidth(CHECK_MARK_WIDTH);
} // end of wxCheckListBoxItem::wxCheckListBoxItem
vRect.y -= 3;
if (wxOwnerDrawn::OnDrawItem( rDc, vRect, eAct, eStat))
{
- size_t nCheckWidth = GetDefaultMarginWidth();
+ size_t nCheckWidth = CHECK_MARK_WIDTH;
size_t nCheckHeight = m_pParent->GetItemHeight();
int nParentHeight;
int nX = rRect.GetX();
}
- wxCommandEvent vEvent( wxEVT_COMMAND_CHECKLISTBOX_TOGGLED,m_pParent->GetId());
+ wxCommandEvent vEvent( wxEVT_CHECKLISTBOX,m_pParent->GetId());
vEvent.SetInt(m_nIndex);
vEvent.SetEventObject(m_pParent);
//
// Add place for the check mark
//
- pStruct->rclItem.xRight += wxOwnerDrawn::GetDefaultMarginWidth();
+ pStruct->rclItem.xRight += CHECK_MARK_WIDTH;
return long(MRFROM2SHORT((USHORT)m_nItemHeight, (USHORT)(pStruct->rclItem.xRight - pStruct->rclItem.xLeft)));
}
return 0L;
//
// Clicking on the item selects it, clicking on the checkmark toggles
//
- if (rEvent.GetX() <= wxOwnerDrawn::GetDefaultMarginWidth())
+ if (rEvent.GetX() <= CHECK_MARK_WIDTH)
{
int nParentHeight;
wxScreenDC vDc;