本文整理汇总了C++中PINGLIST::erase方法的典型用法代码示例。如果您正苦于以下问题:C++ PINGLIST::erase方法的具体用法?C++ PINGLIST::erase怎么用?C++ PINGLIST::erase使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PINGLIST
的用法示例。
在下文中一共展示了PINGLIST::erase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetDlgItem
//.........这里部分代码省略.........
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int index = SendMessage(hw, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)add_edit_addr.pszLabel);
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
SendMessage(hw, LB_SETCURSEL, (WPARAM)index, 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTREM);
EnableWindow(hw, TRUE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, TRUE);
sel = temp_list.size() - 1;
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, (sel > 0));
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int count = SendMessage(hw, LB_GETCOUNT, 0, 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTDOWN);
EnableWindow(hw, (sel < count - 1));
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
}
break;
case IDC_BTN_DESTREM:
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
sel = SendMessage(hw, LB_GETCURSEL, 0, 0);
if(sel != LB_ERR) {
SendMessage(hw, LB_DELETESTRING, (WPARAM)sel, 0);
PINGLIST::iterator i = temp_list.begin();
while(sel > 0 && i != temp_list.end()) {
sel--;
i++;
}
if(i != temp_list.end())
temp_list.erase(i);
}
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTREM);
EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTEDIT);
EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, FALSE);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTDOWN);
EnableWindow(hw, FALSE);
SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
break;
case IDC_BTN_DESTDOWN:
{
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int sel2 = SendMessage(hw, LB_GETCURSEL, 0, 0);
if(sel2 != LB_ERR) {
add_edit_addr = temp_list[sel2];
temp_list[sel2] = temp_list[sel2 + 1];
temp_list[sel2 + 1] = add_edit_addr;
SendMessage(hw, LB_DELETESTRING, (WPARAM)sel2, (LPARAM)0);
SendMessage(hw, LB_INSERTSTRING, (WPARAM)sel2, (LPARAM)temp_list[sel2].pszLabel);
SendMessage(hw, LB_DELETESTRING, (WPARAM)(sel2 + 1), (LPARAM)0);
SendMessage(hw, LB_INSERTSTRING, (WPARAM)(sel2 + 1), (LPARAM)temp_list[sel2 + 1].pszLabel);
SendMessage(hw, LB_SETCURSEL, (WPARAM)(sel2 + 1), 0);
hw = GetDlgItem(hwndDlg, IDC_BTN_DESTUP);
EnableWindow(hw, (sel2 + 1 > 0));
hw = GetDlgItem(hwndDlg, IDC_LST_DEST);
int count = SendMessage(hw, LB_GETCOUNT, 0, 0);