本文整理汇总了C++中CListBox::GetSel方法的典型用法代码示例。如果您正苦于以下问题:C++ CListBox::GetSel方法的具体用法?C++ CListBox::GetSel怎么用?C++ CListBox::GetSel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CListBox
的用法示例。
在下文中一共展示了CListBox::GetSel方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnDownButtonClicked
void CSelectDialog::OnDownButtonClicked() {
CListBox* chosenList = (CListBox*)GetDlgItem( IDC_CHOSENLIST );
for ( int i=chosenList->GetCount()-2; i>=0; i-- ) {
if ( chosenList->GetSel( i ) ) {
if ( !chosenList->GetSel( i+1 ) ) {
char temp[4000];
chosenList->GetText( i+1, temp );
chosenList->InsertString( i, temp );
chosenList->SetSel( i+2, TRUE );
chosenList->DeleteString( i+2 );
}
}
}
}
示例2: OnUpButtonClicked
void CSelectDialog::OnUpButtonClicked() {
CListBox* chosenList = (CListBox*)GetDlgItem( IDC_CHOSENLIST );
for ( int i=1; i<chosenList->GetCount(); i++ ) {
if ( chosenList->GetSel( i ) ) {
char temp[4000];
if ( !chosenList->GetSel( i-1 ) ) {
chosenList->GetText( i, temp );
chosenList->InsertString( i-1, temp );
chosenList->SetSel( i-1, TRUE );
chosenList->DeleteString( i+1 );
}
}
}
}
示例3: UpdateSelectedItems
void CategoryDlg::UpdateSelectedItems(const CListBox& box, bool value)
{
int count = box.GetCount();
for (int i = 0; i < count; ++i)
{
if (box.GetSel(i))
m_categories[Str(GetListBoxText(box, i))] = value;
}
}
示例4: OnRemoveButtonClicked
void CSelectDialog::OnRemoveButtonClicked() {
CListBox* fieldList = (CListBox*)GetDlgItem( IDC_FIELDLIST );
CListBox* chosenList = (CListBox*)GetDlgItem( IDC_CHOSENLIST );
for ( int i=chosenList->GetCount()-1; i>=0; i-- ) {
if ( chosenList->GetSel( i ) ) {
CString temp;
chosenList->GetText( i, temp );
fieldList->AddString( temp );
chosenList->DeleteString( i );
}
}
}
示例5: OnButtonRemove
void CSaveMovieDialog::OnButtonRemove()
{
CListBox * pListBox = (CListBox *)GetDlgItem(IDC_LIST_BITMAP_FILENAME);
for (int i=0;i < pListBox->GetCount();i++)
{
if ( pListBox->GetSel(i) > 0 )
{
// selected.
pListBox->DeleteString(i);
i--;
}
}
}
示例6: GetFlags
int DlgGuardFlags::GetFlags()
{
CListBox *lb;
int new_flags = 0;
lb = (CListBox*)GetDlgItem(IDC_GUARD_FLAGS);
for(int i = 0; i < GuardBitCount(); i++)
{
if(lb->GetSel(i))
SET_BIT(new_flags, lb->GetItemData(i));
else
REMOVE_BIT(new_flags, lb->GetItemData(i));
}
return new_flags;
}