コード例 #1
0
ファイル: RecipePanel.cpp プロジェクト: MisatoTremor/aoia
unsigned int RecipePanel::getCharId() const
{

    unsigned int toonid = 0;

    WTL::CComboBox tooncb = GetDlgItem(IDC_CHARACTERCOMBO);
    if (tooncb.GetCurSel() > 0)
    {
        toonid = (unsigned int)tooncb.GetItemData(tooncb.GetCurSel());
    }

    return toonid;
}
コード例 #2
0
ファイル: RecipePanel.cpp プロジェクト: MisatoTremor/aoia
std::set<Item> RecipePanel::getItemList(const std::list<Item>& itemsInDatabase) const {
    WTL::CComboBox templatecb = GetDlgItem(IDC_RECIPECOMBO);
    if (templatecb.GetCurSel() > 0) {
        TCHAR buf[256] = {0};
        templatecb.GetLBText(templatecb.GetCurSel(), buf);
        std::tstring recipe(buf);

        const RecipeList* const r = m_recipeLoader.getRecipe(recipe);
        if (r == NULL)
            return std::set<Item>();
        else
            return r->getItemList(itemsInDatabase);
    }
    else
        return std::set<Item>();
}
コード例 #3
0
ファイル: RecipePanel.cpp プロジェクト: MisatoTremor/aoia
std::list<unsigned int> RecipePanel::getDesiredItemRefs() const {
    WTL::CComboBox templatecb = GetDlgItem(IDC_RECIPECOMBO);
    if (templatecb.GetCurSel() > 0) {
        TCHAR buf[256] = {0};
        templatecb.GetLBText(templatecb.GetCurSel(), buf);
        std::tstring recipe(buf);

        const RecipeList* const r = m_recipeLoader.getRecipe(recipe);
        if (r == NULL)
            return std::list<unsigned int>();
        else
            return r->getDesiredItemRefs();
    }
    else
        return std::list<unsigned int>();
}
コード例 #4
0
ファイル: MainDlg.cpp プロジェクト: madruslan/MeasurSpectr
void CMainDlg::ThreadConnectFn( ) 
{
	WTL::CComboBox port ;
	port.Attach( GetDlgItem( IDC_COMBO_RS232 ) ) ;
	int sel = port.GetCurSel( ) ;
	if ( sel == -1 ){
		MessageBox( "Выберите ком-порт" , "Внимание" , MB_OK | MB_ICONWARNING ) ;
		port.Detach() ;
		_endthread( ) ;
	}
	char szPortName[ 1024 ] ;
	*szPortName = NULL ;
	if ( port.GetLBTextLen( sel ) < 1 ) {
		MessageBox( "Выбрано пустое имя, выберите имя порта, начинающееся с COM.." , 
			"Внимание" , MB_OK | MB_ICONWARNING ) ;
		port.Detach( ) ;
		_endthread( ) ;
	}
	port.GetLBText( sel , szPortName ) ;
	port.Detach( ) ;

	char status[ 1024 ] ;
	*status = NULL ;
	sprintf( status , "Попытка подключиться к %s ..." , szPortName ) ;
	Status( status ) ;

	BOOL ok = FALSE ;
	ok = Connect( szPortName ) ;

	if ( !ok ){
		Disconnect() ;
		sprintf( status , "FAILED!Не могу подкл-ся к %s !!!" , szPortName ) ;
		StatusAppendLine( status ) ;
		_endthread( ) ;
	}else{
		sprintf( status , "OK! Подключиться к %s удалось успешно!" , szPortName ) ;
		StatusAppendLine( status ) ;
	}
	
	/*
	вставить обработку отсутствия АЦП
	if ( AdcGetCount( ) < 1 ){
		sprintf( status , "WARN! Не найдено ни одного модуля АЦП" ) ;
		StatusAppendLine( status ) ;
		Disconnect( ) ;
		sprintf( status , "OK! Произведено отключение от %s" , szPortName ) ;
		StatusAppendLine( status ) ;
		_endthread( ) ;
	}*/

	m_status = CONNECTED ;
	UpdateControls( ) ;

	HANDLE h = TableGetHandle( 0 ) ;
	if ( h ) TableCallback( h , UpdatePos ) ;

	_endthread( ) ;

}
コード例 #5
0
ファイル: RecipePanel.cpp プロジェクト: MisatoTremor/aoia
std::tstring RecipePanel::getRecipeName() const {

    WTL::CComboBox templatecb = GetDlgItem(IDC_RECIPECOMBO);
    if (templatecb.GetCurSel() > 0) {
        TCHAR buf[256] = {0};
        templatecb.GetLBText(templatecb.GetCurSel(), buf);
        std::tstring recipe(buf);

        const RecipeList* const r = m_recipeLoader.getRecipe(recipe);
        if (r == NULL)
            return _T("Unknown recipe??");
        else
            return r->getName();
    }
    else
        return _T("Unknown recipe??");
}
コード例 #6
0
ファイル: FindPanel.cpp プロジェクト: jellyfunk/aoia-hack
LRESULT FindView::onDimensionFocus(WORD/*wNotifyCode*/, WORD/*wID*/, HWND/*hWndCtl*/, BOOL&/*bHandled*/)
{
    KillTimer(1);

    WTL::CComboBox cb = GetDlgItem(IDC_DIMENSION_COMBO);
    int oldselection = cb.GetCurSel();

    updateDimensionList();

    if (oldselection >= 0)
    {
        cb.SetCurSel(oldselection);
    }
    else if (oldselection == -1)
    {
        cb.SetCurSel(0);
    }

    return 0;
}