本文整理汇总了C++中CListBox::SetRedraw方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::SetRedraw方法的具体用法?C++ CListBox::SetRedraw怎么用?C++ CListBox::SetRedraw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::SetRedraw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BuildList
void CLabelTypeDialog::BuildList(void)
{
int nType = IsDlgButtonChecked(IDC_LABEL_TYPE_LASER)
? CPaperInfo::PAPER_CutSheet
: CPaperInfo::PAPER_Continuous;
/*
// Get the name to match.
*/
CString csOldName;
if (m_pOldInfo != NULL)
{
csOldName = m_pOldInfo->GetName();
}
int nNewSel = 0;
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_LABEL_LIST)) != NULL)
{
pList->SetRedraw(FALSE);
pList->ResetContent();
int nLabels = m_List.Labels();
for (int nLabel = 0; nLabel < nLabels; nLabel++)
{
CLabelData* pLabel = m_List.Label(nLabel);
ASSERT(pLabel != NULL);
if (pLabel != NULL && pLabel->Type() == nType)
{
int nIndex = pList->AddString(pLabel->GetName());
if (nIndex >= 0)
{
pList->SetItemData(nIndex, (DWORD)pLabel);
if (pLabel->GetName() == csOldName)
{
nNewSel = nIndex;
}
}
}
}
/*
// Set the initial entry as necessary.
*/
if (pList->GetCount() > 0)
{
pList->SetCurSel(nNewSel);
OnSelchangeLabelList();
}
pList->SetRedraw(TRUE);
}
}
示例2: BuildList
void CPhotoProjectsTypeDlg::BuildList(void)
{
/*
// Get the name to match.
*/
CString csOldName;
if (m_pOldInfo != NULL)
{
csOldName = m_pOldInfo->GetName();
}
int nNewSel = 0;
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_PHOTOPROJECTS_LIST)) != NULL)
{
pList->SetRedraw(FALSE);
pList->ResetContent();
int nPhotoPrjs = m_List.PhotoProjects();
for (int nPhotoPrj = 0; nPhotoPrj < nPhotoPrjs; nPhotoPrj++)
{
CPhotoPrjData* pPhotoPrj = (CPhotoPrjData*)m_List.PhotoProject(nPhotoPrj);
ASSERT(pPhotoPrj != NULL);
int nIndex = pList->AddString(pPhotoPrj->m_pSubAreaData[0]->GetName());
if (nIndex >= 0)
{
pList->SetItemData(nIndex, (DWORD)pPhotoPrj);
if (pPhotoPrj->m_pSubAreaData[0]->GetName() == csOldName)
{
nNewSel = nIndex;
}
}
}
/*
// Set the initial entry as necessary.
*/
if (pList->GetCount() > 0)
{
pList->SetCurSel(nNewSel);
OnSelchangePhotoProjectsList();
}
pList->SetRedraw(TRUE);
}
}
示例3: BuildList
void CEnvelopeTypeDialog::BuildList(void)
{
CListBox* pList;
if ((pList = (CListBox*)GetDlgItem(IDC_ENVELOPE_LIST)) != NULL)
{
/*
// Get the name to match.
*/
CString csOldName;
if (m_pOldInfo != NULL)
{
csOldName = m_pOldInfo->GetName();
}
int nNewSel = 0;
pList->SetRedraw(FALSE);
pList->ResetContent();
int nLabels = m_List.Labels();
for (int nLabel = 0; nLabel < nLabels; nLabel++)
{
CLabelData* pLabel = m_List.Label(nLabel);
ASSERT(pLabel != NULL);
if (pLabel != NULL)
{
int nIndex = pList->AddString(pLabel->GetName());
if (nIndex >= 0)
{
pList->SetItemData(nIndex, (DWORD)pLabel);
/*
// If the label matches the name coming in,
// remember its position.
*/
if (pLabel->GetName() == csOldName)
{
nNewSel = nIndex;
}
}
}
}
// Always start with the first label.
pList->SetCurSel(nNewSel);
pList->SetRedraw(TRUE);
OnSelchangeEnvelopeList(); // Do this by hand.
}
}