Exemple #1
0
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 );
			}
		}
	}
}
Exemple #2
0
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 );
			}
		}
	}
}
Exemple #3
0
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;
	}
}
Exemple #4
0
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 );
		}
	}
}
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--;
		}
	}
}
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;
}