📄 ospcombobox.cpp
字号:
// OSPComboBox.cpp : 僀儞僾儕儊儞僥乕僔儑儞 僼傽僀儖
//
#include "stdafx.h"
#include "global.h"
#include "ospcombobox.h"
#ifdef _DEBUG
//#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// COSPComboBox
COSPComboBox::COSPComboBox()
{
}
COSPComboBox::~COSPComboBox()
{
if (::IsWindow(m_hWnd))
DeleteAllRows();
}
BEGIN_MESSAGE_MAP(COSPComboBox, CComboBox)
//{{AFX_MSG_MAP(COSPComboBox)
ON_WM_DRAWITEM()
ON_WM_LBUTTONUP()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// COSPComboBox 儊僢僙乕僕 僴儞僪儔
//CtrlAttachedOid*
void COSPComboBox::AddRow(int row, LPCTSTR str)
{
TRACE("Add Row (%d)\n", row);
if(::IsWindow(m_hWnd) == FALSE)
return ;
int index = InsertString(row, str);
ASSERT(index == row);
INT* obj = new INT;
VERIFY(CB_ERR != SetItemDataPtr(index, (void*) obj));
}
void
COSPComboBox::OnDrawItem( int nIDCtl, LPDRAWITEMSTRUCT lpDrawItemStruct )
{
CWnd::OnDrawItem(nIDCtl, lpDrawItemStruct );
}
void
COSPComboBox::OnLButtonUp(UINT nFlags, CPoint point)
{
CWnd::OnLButtonUp(nFlags, point);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -