// --- void CSelectInterfacesDlg::OnChangeOutputDir() { UpdateData( TRUE ); m_rcPublicDir = m_PublicDir; CGT::SCodeGenItem* pCacheItem = CGT::s_CodeGens.GetGenCacheItem(m_rCLSID); ASSERT(NULL != pCacheItem); BOOL bImplementation = !m_nRegime; if(!bImplementation) { pCacheItem->m_strPublicDir = m_rcPublicDir; pCacheItem->m_strPublicDir = m_rcPrivateDir; } else { CString strPluginName = CGT::GetPluginName(m_hImpData); CGT::SCodeGenPlugin* pPlugin = pCacheItem->FindPluginData(strPluginName); if(!pPlugin) { pPlugin = pCacheItem->AddNewPluginData(); pPlugin->m_strPluginName = strPluginName; } pPlugin->m_strPublicDir = m_rcPublicDir = m_PublicDir; pPlugin->m_strPrivateDir = m_rcPrivateDir = m_PrivateDir; } UpdateButtonsState(); }
// --- void CSelectInterfacesDlg::OnUnregGenerator() { CCLItemsArray* pItems = m_Objects.GetItemsArray(); if ( !pItems || (m_nSelected >= pItems->GetSize()) ) return; CCheckListItem *item = (*pItems)[m_nSelected]; if ( !item ) return; LPOLESTR wstr; ::StringFromCLSID( CGPPD(item)->m_CLSID, &wstr ); char pFileName[_MAX_PATH]; char skey[MAX_PATH]; ::lstrcpy( skey, _T("CLSID\\") ); DWORD len = ::lstrlen( skey ); ::wcstombs( skey+len, wstr, sizeof(skey)-len ); ::CoTaskMemFree( wstr ); ::lstrcat( skey, "\\InprocServer32" ); CRegStorage rcRegStorage( HKEY_CLASSES_ROOT, skey ); len = sizeof(pFileName); if ( !rcRegStorage.GetValue(0,pFileName,len) ) return; if ( !CGT::UnregisterCOM(pFileName) ) return; CGT::s_CodeGens.LoadCodeGenItemsCache(TRUE); FillGeneratorsList(); UpdateButtonsState(); }
//--- void CSelectInterfacesDlg::OnNewOptionsFile( LPCTSTR i_strFileName ) { // this can be from new_session and save_options sequence, BOOL bOptFileLoadedAlready = CString(i_strFileName) == CString(CGT::s_OptFile.GetPathname()); if(!bOptFileLoadedAlready){ // set status - we are trying to load m_FileName.Empty(); m_LoadStatus.LoadString( IDS_CGOF_NOTLOADED ); UpdateData( FALSE ); // load optfile and check its proper structure BOOL bSucceededLoad = CGT::s_OptFile.Load(i_strFileName, !m_nRegime); if(!bSucceededLoad){ CString rcString; rcString.Format( IDS_ERR_READFILE, i_strFileName ); ::DlgMessageBox(this, rcString ); return; } } m_FileName = m_rcFileName = i_strFileName; m_LoadStatus.LoadString( IDS_CGOF_LOADED ); m_RegStorage.PutValue( g_RegValueNameTable[m_nRegime][1], LPCSTR(m_FileName) ); if(!bOptFileLoadedAlready) UpdateGeneratorsOutputDir(); UpdateButtonsState(); UpdateData(FALSE); }
// --- void CSelectInterfacesDlg::OnAddGenerator() { CString rcFileName; if ( SelectGeneratorModule(rcFileName) && CGT::RegisterCOM(rcFileName) ) { CGT::s_CodeGens.LoadCodeGenItemsCache(TRUE); FillGeneratorsList(); UpdateButtonsState(); } }
// —ообщение об намерении установить Checked // WPARAM - LPBOOL - указатель на результат - не используетс¤ // LPARAM - указатель на экземпл¤р структуры CTTMessageInfo // m_Value.m_bSetRemove - TRUE - установить, FALSE - сн¤ть // LRESULT - не используетс¤ // --- LRESULT CSelectInterfacesDlg::OnCTTCheckedChanging( WPARAM wParam, LPARAM lParam ) { CTTMessageInfo *info = (CTTMessageInfo *)lParam; CCTItemsArray &items = *m_CTTControl.GetItemsArray(); int nItemInd = info->m_nItemIndex; CCheckTreeItem *item = items[nItemInd]; HDATA hData = CPPD(item)->m_hData; HPROP hProp = CPPD(item)->m_hProp; // Check InterfaceName if ( ::IsIDProlog(m_CTTControl, nItemInd, VE_PID_IF_INTERFACENAME_ID) ) { HPROP hCheckedProp = ::DATA_Find_Prop( hData, NULL, VE_PID_IF_SELECTED ); if ( hCheckedProp ) ::PROP_Set_Val( hCheckedProp, AVP_dword(info->m_Value.m_bSetRemove), 0 ); else ::DATA_Add_Prop( hData, NULL, VE_PID_IF_SELECTED, AVP_dword(info->m_Value.m_bSetRemove), 0 ); UpdateButtonsState(); return 0; } // plugin if( ::IsIDProlog(m_CTTControl, nItemInd, VE_PID_IF_SELECTED_ID) ){ HPROP hCheckedProp = ::DATA_Find_Prop( hData, NULL, VE_PID_IF_SELECTED ); if ( hCheckedProp ) ::PROP_Set_Val( hCheckedProp, AVP_dword(info->m_Value.m_bSetRemove), 0 ); else ::DATA_Add_Prop( hData, NULL, VE_PID_IF_SELECTED, AVP_dword(info->m_Value.m_bSetRemove), 0 ); UpdateButtonsState(); return 0; } return 0; }
// --- void CSelectInterfacesDlg::OnUseFile() { TCHAR strName[_MAX_PATH] = {0}; m_RegStorage.GetValue( g_RegValueNameTable[m_nRegime][1], strName, _MAX_PATH ); m_FileNameEdit.EnableWindow( TRUE ); m_BrowseBtn.EnableWindow( TRUE ); if ( lstrlen(strName) ) OnNewOptionsFile( strName ); m_bNewSession = FALSE; m_RegStorage.PutValue( g_RegValueNameTable[m_nRegime][0], DWORD(m_bNewSession) ); UpdateButtonsState(); }
void OvrPanoMenu::OnItemEvent_Impl( App * app, VRMenuId_t const itemId, VRMenuEvent const & event ) { if ( ButtonCoolDown <= 0.0f ) { ButtonCoolDown = BUTTON_COOL_DOWN_SECONDS; if ( Photos->AllowPanoInput() ) { if ( itemId.Get() == ID_BROWSER_BUTTON.Get() ) { Photos->SetMenuState( Oculus360Photos::MENU_BROWSER ); } else if ( itemId.Get() == ID_FAVORITES_BUTTON.Get() ) { const TagAction actionTaken = static_cast< TagAction >( Photos->ToggleCurrentAsFavorite() ); const bool forceShowSwipeIndicators = ( actionTaken == TAG_REMOVED ) && ( Photos->GetNumPanosInActiveCategory() == 1 ); UpdateButtonsState( Photos->GetActivePano( ), forceShowSwipeIndicators ); } } } }
// --- void CSelectInterfacesDlg::OnItemChanged(NMHDR* pNMHDR, LRESULT* pResult) { *pResult = 0; NM_LISTVIEW* pNMListView = (NM_LISTVIEW*)pNMHDR; if ( !(pNMListView->uChanged & LVIF_STATE) || !(pNMListView->uNewState & LVIS_FOCUSED) || pNMListView->uOldState ) return; m_nSelected = pNMListView->iItem; CCLItemsArray *pItems = m_Objects.GetItemsArray(); if ( !pItems || m_nSelected >= pItems->GetSize() ) return; // change current generator CCheckListItem *item = (*pItems)[m_nSelected]; m_rCLSID = CGPPD(item)->m_CLSID; // change output dir for selected generator UpdateCurrentGeneratorOutputDir(); UpdateButtonsState(); }
// --- void CSelectInterfacesDlg::OnNewSession() { m_FileName = m_rcFileName = ""; CGT::s_OptFile.Close(); m_FileNameEdit.EnableWindow( FALSE ); m_BrowseBtn.EnableWindow( FALSE ); m_LoadStatus = _T(""); UpdateData( FALSE ); CFAutomaton *pAutomat = dynamic_cast<CFAutomaton *>(m_pParentWnd); if ( pAutomat ) (*pAutomat->GetParamArray())[2]->SetState( !m_bNewSession ? ps_nrm : ps_und ); m_bNewSession = TRUE; m_RegStorage.PutValue( g_RegValueNameTable[m_nRegime][0], DWORD(m_bNewSession) ); // clear output dirs CGT::s_CodeGens.UpdateGeneratorsOptions(CGT::s_OptFile, ""); UpdateCurrentGeneratorOutputDir(); UpdateButtonsState(); }
// --- void CSelectInterfacesDlg::OnCgUpdateGeneratorList() { CGT::s_CodeGens.LoadCodeGenItemsCache(TRUE); FillGeneratorsList(); UpdateButtonsState(); }