Example #1
0
// fillSuggestionsList:
// Fill the suggestions list with suggestions for the current word.
void CSpellingDlg::fillSuggestionsList() {
	CWaitCursor busy;

	SSCE_CHAR problemWord[SSCE_MAX_WORD_SZ];
	GetDlgItemText(IDC_PROBLEMWORD, (TCHAR *)problemWord, sizeof(problemWord));

	const int maxSuggestions = 16;
	SSCE_CHAR suggestions[maxSuggestions * SSCE_MAX_WORD_SZ];
	SSCE_S16 scores[maxSuggestions];
    SSCE_Suggest(SSCE_GetSid(), problemWord, suggestionDepth,
      suggestions, sizeof(suggestions), scores, maxSuggestions);

	CListBox *suggestionsList = (CListBox *)GetDlgItem(IDC_SUGGESTIONSLIST);
	suggestionsList->ResetContent();
    for (const SSCE_CHAR *p = suggestions; *p != _T('\0');
	  p += lstrlen((TCHAR *)p) + 1) {
		suggestionsList->AddString((TCHAR *)p);
	}

    // Select the first suggestion and copy it to the Change To field.
    if (suggestionsList->GetCount() > 0) {
		suggestionsList->SetSel(0);
		CString word1;
		suggestionsList->GetText(0, word1);
		SetDlgItemText(IDC_CHANGETO, word1);
    }
}
Example #2
0
void KG3DAnimationContainer::FillAnimationList(CListBox& ListBox, enuFillListBoxType Type)
{
    ListBox.ResetContent();
    LPCTSTR pszName = NULL;
    for(int i = 0; i < static_cast<int>(m_Clips.size()); i++)
    {

        switch(Type)
        {
        case ENUM_FILL_WITH_ANINAME:
        {
            m_Clips[i]->GetName(&pszName);
            ListBox.InsertString(i, pszName);
            ListBox.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_Clips[i]));
            break;
        }
        case ENUM_FILL_WITH_FILENAME:
        {
            m_Clips[i]->GetPathName(&pszName);
            ListBox.InsertString(i, pszName);
            ListBox.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_Clips[i]));
            break;
        }
        }
    }
}
void CDlgReplaceBox::BuildSearchList()
{
	// Build the list box
	CListBox* theListBox = (CListBox*) GetDlgItem( FINDGET_LIST );
	theListBox->ResetContent();

	// Ensure the string is in Lower case for searching
	m_search_string.MakeLower();

	CLibraryCollection::FillMatchingSymbols( theListBox, m_search_string, NULL );

	// Try and find the selected symbol in the list
	int i;
	for (i = 0; i < theListBox->GetCount(); i++)
	{
		if (theListBox->GetItemDataPtr( i ) == m_Symbol)
		{
			theListBox->SetCurSel( i );
			break;
		}
	}
	if (i == theListBox->GetCount())
	{
		m_Symbol = NULL;
		GetDlgItem( IDC_SHOW_SYMBOL )->RedrawWindow();
	}
}
Example #4
0
void CDizzyDialog::OnClearButton() 
{
	UpdateData(true);
	CListBox* pListBox = (CListBox*) GetDlgItem(IDC_INPUT_LIST);
	pListBox->ResetContent();	
	RecalculateRotation();
	UpdateData(false);
}
void CChangeOrderDlg::OnEditRandom() {
  m_editList.shuffle();
  CListBox *lb = getListBox();
  lb->ResetContent();
  for(size_t i = 0; i < m_editList.size(); i++) {
    insertMediaFileIntoListBox(i,m_editList[i]);
  }
  lb->InsertString((int)m_mediaQueue.size(),EMPTYSTRING);
}
Example #6
0
void CUserListDlg::RefreshUserList() {
	vector<string> userList = storage.GetUserList();
	CListBox* userListBox = (CListBox*)GetDlgItem( IDC_USERLIST );
	if ( userListBox ) {
		userListBox->ResetContent();
		for ( int i=0; i<userList.size(); i++ ) {
			userListBox->AddString( userList[i].c_str() );
		}
	}
}
Example #7
0
//关闭
void CTCPServerDlg::OnBnClickedBtnClose()
{
	CListBox * pLstConn = (CListBox*)GetDlgItem(IDC_LST_CONN);
	ASSERT(pLstConn != NULL);
	
	CListBox * pLstRecv = (CListBox*)GetDlgItem(IDC_LST_RECV);
	ASSERT(pLstRecv != NULL);
	
	//
	if (m_tcpServer.Close() <=0)
	{
		AfxMessageBox(_T("关闭TCP服务器失败"));
		return;
	}
	
	//清空列表
	pLstConn->ResetContent();
	pLstRecv->ResetContent();
}
Example #8
0
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);
	}
}
static void setGroupListBoxValues(CListBox &GroupListBox, const CGroupList &GroupList) {
	GroupListBox.ResetContent();
	CGroupList::EConstIterator it;
	for (it = GroupList.Begin(); !it.IsDone(); it++) {
		CString tmpCStr;
		tmpCStr = _TEXT("[");
		tmpCStr += ((*it).m_Label);
		tmpCStr += _TEXT("] ");
		GroupListBox.AddString(tmpCStr);
	}
}
Example #10
0
void CQuoteTesterDlg::OnBnClickedButton8()
{
	// TODO: Add your control notification handler code here
	CListBox   *pListBox   =   (CListBox *)GetDlgItem(IDC_LIST); 
	pListBox->ResetContent();

	CComboBox   *pComboBox   =   (CComboBox *)GetDlgItem(IDC_COMBO_KLine); 
	int nType = pComboBox->GetCurSel();

	m_nType = 4;
}
Example #11
0
void CBerkeleyView::OnBnClickedButton1()
{
	CString csDbFile;
	GetDlgItem(IDC_DB_FILE)->GetWindowTextW(csDbFile);

	if (!csDbFile.IsEmpty())
	{
		if (m_spDb.get() != NULL)
		{
			m_spDb->DestroyDb();
		}

		m_spDb.reset(new CDbLayer_Test());
		m_spDb->InitDb(csDbFile);

		CComboBox* pBox = (CComboBox*)GetDlgItem(IDC_DATA_TYPE);
		m_spDb->SetDecoder((DataDecoder::DataEncodeType)pBox->GetItemData(pBox->GetCurSel()));

		CListBox* pList = (CListBox*)GetDlgItem(IDC_LIST_DB_CONTENT);
		pList->ResetContent();

		std::vector<tstring> data = m_spDb->GetFirstData();
		if (data.size() > 0)
		{
			tstring line = _T("1 ");
			for(int i = 0; i < data.size(); ++i)
			{
				line.append(data[i].size() > 50 ? data[i].substr(0, 50) + _T("...") : data[i]);
				line.append(_T(" "));
			}

			pList->AddString(line.c_str());
		}

		int nLine = 1;
		data = m_spDb->GetNextData();
		while(nLine < 1000 && data.size() > 0)
		{
			CString csNum;
			csNum.Format(_T("%d "), nLine+1);
			tstring line = csNum;
			for(int i = 0; i < data.size(); ++i)
			{
				line.append(data[i].size() > 50 ? data[i].substr(0, 50) + _T("...") : data[i]);
				line.append(_T(" "));
			}

			pList->AddString(line.c_str());
			data = m_spDb->GetNextData();
			++nLine;
		}
	}
}
Example #12
0
void CSystemTestDlg::OnBnClickedRefreshImageList()
{
	CFileFind finder;
	CListBox* list = (CListBox*)GetDlgItem(IDC_IMAGE_LIST);
	list->ResetContent();
	BOOL bWorking = finder.FindFile(TEXT("img\\screenshot\\*.bmp"));
	while(bWorking) {
		bWorking = finder.FindNextFile();
		list->AddString(finder.GetFileName());
	}
	_out(TEXT("Refresh done."));
}
Example #13
0
void CSystemTestDlg::OnBnClickedRefreshMatchList()
{
	CFileFind finder;
	CListBox* list = (CListBox*)GetDlgItem(IDC_MATCH_LIST);
	list->ResetContent();
	BOOL bWorking = finder.FindFile(TEXT("img\\match\\*.bmp"));
	while(bWorking) {
		bWorking = finder.FindNextFile();
		list->AddString(finder.GetFileName());
	}
	_out(TEXT("Refresh Match list done."));
}
Example #14
0
void CModelPropPage::PopulatePCJList(void)
{
	CListBox *pListBox = (CListBox *) GetDlgItem(IDC_LIST_PCJ);
	if (pListBox)
	{
		pListBox->ResetContent();

		for (int i = 0; i<m_PCJList.size(); i++)
		{
			pListBox->InsertString(-1, (LPCSTR) m_PCJList[i]);
		}
	}
}
Example #15
0
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);
	}


}
Example #16
0
HRESULT AddGraphFiltersToList (IGraphBuilder *pGB, CListBox& m_ListFilters) 
{
    HRESULT hr;
    IEnumFilters *pEnum = NULL;
    IBaseFilter *pFilter = NULL;
    ULONG cFetched;

    // Clear filters list box
    m_ListFilters.ResetContent();
    
    // Verify graph builder interface
    if (!pGB)
        return E_NOINTERFACE;

    // Get filter enumerator
    hr = pGB->EnumFilters(&pEnum);
    if (FAILED(hr))
    {
        m_ListFilters.AddString(TEXT("<ERROR>"));
        return hr;
    }

    // Enumerate all filters in the graph
    while(pEnum->Next(1, &pFilter, &cFetched) == S_OK)
    {
        FILTER_INFO FilterInfo;
        TCHAR szName[256];
        
        hr = pFilter->QueryFilterInfo(&FilterInfo);
        if (FAILED(hr))
        {
            m_ListFilters.AddString(TEXT("<ERROR>"));
        }
        else
        {
            USES_CONVERSION;

            // Add the filter name to the filters listbox
            lstrcpy(szName, W2T(FilterInfo.achName));
            m_ListFilters.AddString(szName);

            // Must release filter graph reference
            FilterInfo.pGraph->Release();
        }       
        pFilter->Release();
    }
    pEnum->Release();

    return hr;
}
Example #17
0
static inline void ReadRegexTexts(const gzFile& f, CListBox& list)
{
	int size;
	gzread(f, &size, sizeof(int)); // 长度
	list.ResetContent();
	CString strBuf;
	for (int i = 0; i < size; i++)
	{
		int isRegex;
		gzread(f, &isRegex, sizeof(int)); // 是正则
		ReadText(f, strBuf);
		list.AddString((isRegex != 0 ? IS_REGEX_PREFIX : NOT_REGEX_PREFIX) + strBuf);
	}
}
Example #18
0
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.
	}
}
void
ArxDbgUtils::fillListBox(const SdStrList& slist, CListBox& lb, int defIndex)
{
    BOOL addedOne = FALSE;

    lb.ResetContent();
    SdStrListIterator iter(slist);
    for(; !iter.done(); iter.next()) {
        addedOne = TRUE;
        lb.AddString(iter.item());
    }

    if ( addedOne )
        lb.SetCurSel(defIndex);
}
Example #20
0
void CFanmotorDlg::ErrorMsg(int r) 
{
	CString msg = Bridge->GetStatusMsg(r);
    AfxMessageBox(msg, MB_ICONERROR | MB_OK, 0);
    if (r == 7) // If device is busy by another application
    {
		CListBox* listBoxBridges = (CListBox*)GetDlgItem(IDC_BRIDGE_LISTBOX);
		listBoxBridges->SetCurSel(-1);
		CListBox* listBoxDevices = (CListBox*)GetDlgItem(IDC_DEVICE_LISTBOX);
        listBoxDevices->ResetContent();
	//	ResetPowerSettings();
	//	ResetSpeedSettings();
        Bridge->AbortTransfer(); // Deactivate any Bridge (free port handle)
    }
}
void
ArxDbgUtils::fillListBox(const SdStrObjIdList& slist, CListBox& lb, int defIndex)
{
    lb.ResetContent();
    SdStrObjIdListIterator iter(slist);

    CString str;
    AcDbObjectId objId;
    for(; !iter.done(); iter.next()){
        iter.item(str, objId);
        lb.AddString(str);
    }

    int retCode = lb.SetCurSel(defIndex);
    ASSERT(retCode != LB_ERR);
}
Example #22
0
void DLGSkill::upDate()
{
    CListBox* pLB = (CListBox*) GetDlgItem(IDC_SkillList);
    int oriSel = pLB->GetCurSel();
    pLB->ResetContent();

    char buf[256];
    for(int i = 0; CSkill::getInfoCount() > i; i++)
    {
        CSkillInfo* pInfo = CSkill::getInfo(i);
        sprintf_s(buf, sizeof(buf), "[%d] %s", i, pInfo->getName().c_str());
        CString str;
        str = buf;
        pLB->AddString(str);
    }

    pLB->SetCurSel(oriSel);
}
Example #23
0
void CSoundAnimDlg::updateSounds()
{
	if (_SelectedMarker != 0)
	{
		vector<NLMISC::TStringId> sounds;

		_SelectedMarker->getSounds(sounds);

		CListBox* list = (CListBox*) GetDlgItem(IDC_SOUND_ANIM_LIST);
		list->ResetContent();

		vector<NLMISC::TStringId>::iterator iter;

		for (iter = sounds.begin(); iter != sounds.end(); iter++)
		{
			list->AddString(CStringMapper::unmap(*iter).c_str());
		}

		list->UpdateData();
	}
}
Example #24
0
void virus::display(CListBox &lbox, CListBox &dbox)
{
	lbox.ResetContent();//resets live box
	node* temp;
	CString vacine="";
	char convert[20]="";
	if((head==NULL)&&(tail==NULL))//special case for if there is nothing in the list box
	{
		return;
	}
	else
	{
		for(temp=head; temp->next != NULL; temp=temp->next)//rolls through all the nodes
		{
			if(temp->vacinated==TRUE)//stuff for vaccinated
			{
				vacine="Yes";
			}else
			{
				vacine="No";//stuff for not vaccinated
			}
			_itoa(temp->age, convert, 10);//putting strings together
			lbox.AddString("Name: "+temp->name+" Age: "+convert);
			lbox.AddString("Vaccinated: "+vacine);//puttin stuff together
			lbox.AddString("********************");
		}
		if(temp->vacinated==TRUE)//special case
			{
				vacine="Yes";
			}else
			{
				vacine="No";
			}
			_itoa(temp->age, convert, 10);
			lbox.AddString("Name: "+temp->name+" Age: "+convert);
			lbox.AddString("Vaccinated: "+vacine);
			lbox.AddString("********************");

	}
}
Example #25
0
void CQuoteTesterDlg::OnBnClickedButton5()
{
	// TODO: Add your control notification handler code here

	int		nCode = 0;
	short	sPageNo = 1;

	m_nType = 2;

	CListBox   *pListBox   =   (CListBox *)GetDlgItem(IDC_LIST); 
	pListBox->ResetContent();

	CEdit* pEdit; 
    pEdit = (CEdit*) GetDlgItem(IDC_EDIT_Ticks); 
	CString strText;
	pEdit->GetWindowTextW(strText);
	
	CStringA strTempA(strText);
	char*   caText   =   strTempA.GetBuffer(strTempA.GetLength()); 
	
	SKQuoteLib_RequestTicks(&sPageNo,caText);
}
Example #26
0
void CConnDlg :: OnRefresh()
{
    CWysApp* pApp = (CWysApp*)AfxGetApp();

    // clear listbox
    CListBox* pListBox = (CListBox*)GetDlgItem(IDC_LSTCONN);
    pListBox->ResetContent();

    // iterate through sockets
    // displaying connected items
    for (INT i = 0, j = 0; i < MAXCONN; i++) {
        if (pApp->pSockets[i]->State == CONNECTED) {
            // set IP address
            pListBox->AddString(pApp->pSockets[i]->IPAddress);

            // set socket descriptor value
            pListBox->SetItemData(j, pApp->pSockets[i]->m_hSocket);
            j++;
        }
    }
    return;
}
Example #27
0
// display parts with same usemask
void CPartDlg::OnBnClickedUsem0()
{
	// compute currently displayed umask
	unsigned short umask = 0;
	for (int i=0;i<16;i++) 
	{
		CButton *cbb = (CButton *)CWnd::GetDlgItem(IDC_USEM0+i);
		umask += cbb->GetCheck()?(1<<i):0;
	}

	CListBox *clb = (CListBox *)CWnd::GetDlgItem(IDC_UMLIST);
	clb->ResetContent();
	// get all parts that use umask
	for (int j=0;j<pcore->cl_Parts.GetSize();j++)
	{
		PtrCorePart pp = pcore->cl_Parts.GetAt(j);
		if ((pp->type == ppart->type) && (!pp->isspec))
		{
			bool IsUpgrade = false;
			for (int jj=0;jj<pcore->cl_Parts.GetSize();jj++)
			{
				PtrCorePart ppart2 = pcore->cl_Parts.GetAt(jj);
				if (ppart2->overriding_uid == pp->uid)
				{
					IsUpgrade = true;
					break;
				}
			}
			if (!IsUpgrade)
			{
				if (pp->usemask & umask)
				{
					clb->AddString(pp->name);
				}
			}
		}
	}

}
Example #28
0
void CItemPicker::FillList(int restype, CListBox &list)
{
  POSITION pos;
  CString key;
  loc_entry fileloc;
  int idx;
  
  list.ResetContent();
  idx=determinetype(restype);
  if(!idx)
  {
    MessageBox("Internal error (no method for filling listbox)","Error",MB_OK);
    return;
  }
  else pos=resources[idx]->GetStartPosition();
  while(pos)
  {
    resources[idx]->GetNextAssoc(pos,key,fileloc);
    ResolveKey(key,fileloc,restype);
    list.AddString(key);
  }
}
Example #29
0
BOOL CDeviceDialog::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	vl_getDeviceList(m_deviceList);

	CListBox* pListBox = (CListBox*)GetDlgItem( IDC_DEVICE_LISTBOX );
	
	if(pListBox)
	{
		pListBox->ResetContent();

		for(int ii = 0;ii < m_deviceList.size();ii++)
		{
			// Store the entry into the list
			pListBox->InsertString(ii, m_deviceList[ii]->getDeviceName());
		}			
	}

	return TRUE;	// return TRUE unless you set the focus to a control
						// EXCEPTION: OCX Property Pages should return FALSE
}
Example #30
0
void CReactorTool::InitLBTargets ()
{
    if (!GetMine ())
        return;
    CListBox *plb = LBTargets ();
    m_iTarget = plb->GetCurSel ();
    plb->ResetContent ();
    if (m_pTrigger) {
        m_nTargets = m_pTrigger->num_links;
        int i;
        for (i = 0; i < m_nTargets ; i++) {
            sprintf (m_szTarget, "   %d, %d", m_pTrigger->seg [i], m_pTrigger->side [i] + 1);
            plb->AddString (m_szTarget);
        }
        if ((m_iTarget < 0) || (m_iTarget >= m_nTargets))
            m_iTarget = 0;
        *m_szTarget = '\0';
    }
    else
        m_nTargets =
            m_iTarget = 0;
    plb->SetCurSel (m_iTarget);
}