//検索ボックスを更新 void CMainToolBar::AcceptSharedSearchKey() { if( m_hwndSearchBox ) { int i; // 2013.05.28 Combo_ResetContentだとちらつくのでDeleteStringでリストだけ削除 while (Combo_GetCount(m_hwndSearchBox) > 0) { Combo_DeleteString(m_hwndSearchBox, 0); } int nSize = GetDllShareData().m_sSearchKeywords.m_aSearchKeys.size(); for( i = 0; i < nSize; i++ ) { Combo_AddString( m_hwndSearchBox, GetDllShareData().m_sSearchKeywords.m_aSearchKeys[i] ); } const wchar_t* pszText; if( GetDllShareData().m_Common.m_sSearch.m_bInheritKeyOtherView && m_pOwner->GetActiveView().m_nCurSearchKeySequence < GetDllShareData().m_Common.m_sSearch.m_nSearchKeySequence || 0 == m_pOwner->GetActiveView().m_strCurSearchKey.size() ){ if( 0 < nSize ){ pszText = GetDllShareData().m_sSearchKeywords.m_aSearchKeys[0]; }else{ pszText = L""; } }else{ pszText = m_pOwner->GetActiveView().m_strCurSearchKey.c_str(); } std::wstring strText; GetSearchKey(strText); if( 0 < nSize && 0 != wcscmp(strText.c_str(), pszText) ){ ::SetWindowText(m_hwndSearchBox, to_tchar(pszText)); } } }
/*! 検索ボックスでの処理 */ void CMainToolBar::ProcSearchBox( MSG *msg ) { if( msg->message == WM_KEYDOWN /* && ::GetParent( msg->hwnd ) == m_hwndSearchBox */ ) { if( msg->wParam == VK_RETURN ) //リターンキー { //検索キーワードを取得 std::wstring strText; if( 0 < GetSearchKey(strText) ) //キー文字列がある { if( strText.size() < _MAX_PATH ){ //検索キーを登録 CSearchKeywordManager().AddToSearchKeyArr( strText.c_str() ); } m_pOwner->GetActiveView().m_strCurSearchKey = strText; m_pOwner->GetActiveView().m_bCurSearchUpdate = true; m_pOwner->GetActiveView().ChangeCurRegexp(); //検索ボックスを更新 // 2010/6/6 Uchi AcceptSharedSearchKey(); //::SetFocus( m_hWnd ); //先にフォーカスを移動しておかないとキャレットが消える m_pOwner->GetActiveView().SetFocus(); // 検索開始時のカーソル位置登録条件を変更 02/07/28 ai start m_pOwner->GetActiveView().m_ptSrchStartPos_PHY = m_pOwner->GetActiveView().GetCaret().GetCaretLogicPos(); // 02/07/28 ai end //次を検索 m_pOwner->OnCommand( (WORD)0 /*メニュー*/, (WORD)F_SEARCH_NEXT, (HWND)0 ); } } else if( msg->wParam == VK_TAB ) //タブキー { //フォーカスを移動 // 2004.10.27 MIK IME表示位置のずれ修正 ::SetFocus( m_pOwner->GetHwnd() ); } } }
YSRESULT YsShell::SaveSrf( class YsTextOutputStream &textOut, YSSIZE_T nNoShadingPolygon,const YsShellPolygonHandle noShadingPolygon[], YSSIZE_T nRoundVtx,const YsShellVertexHandle roundVtx[]) const { YsShellVertexHandle vtHd,tstVtHd; YsShellPolygonHandle plHd,tstPlHd; YsHashTable <YsShellVertexHandle> roundVtxTable(nRoundVtx+1); YsHashTable <YsShellPolygonHandle> noShadingPolygonTable(nNoShadingPolygon+1); int i; if(noShadingPolygon!=NULL) { for(i=0; i<nNoShadingPolygon; i++) { noShadingPolygonTable.AddElement(GetSearchKey(noShadingPolygon[i]),noShadingPolygon[i]); } } if(roundVtx!=NULL) { for(i=0; i<nRoundVtx; i++) { roundVtxTable.AddElement(GetSearchKey(roundVtx[i]),roundVtx[i]); } } Encache(); textOut.Printf("SURF\n"); vtHd=NULL; while((vtHd=FindNextVertex(vtHd))!=NULL) { YsVec3 pos; GetVertexPosition(pos,vtHd); if(roundVtxTable.FindElement(tstVtHd,GetSearchKey(vtHd))!=YSOK) { textOut.Printf("V %lf %lf %lf\n",pos.x(),pos.y(),pos.z()); } else { textOut.Printf("V %lf %lf %lf R\n",pos.x(),pos.y(),pos.z()); } } plHd=NULL; while((plHd=FindNextPolygon(plHd))!=NULL) { int i,n; YsVec3 cen,nom,pos; const YsShellVertexHandle *plVtHd; n=GetNumVertexOfPolygon(plHd); plVtHd=GetVertexListOfPolygon(plHd); textOut.Printf("F\n"); if(noShadingPolygonTable.FindElement(tstPlHd,GetSearchKey(plHd))==YSOK) { textOut.Printf("B\n"); } cen.Set(0.0,0.0,0.0); for(i=0; i<n; i++) { if(i%8==0) { textOut.Printf("V"); } textOut.Printf(" %d",GetVertexIdFromHandle(plVtHd[i])); if(i%8==7 || i==n-1) { textOut.Printf("\n"); } GetVertexPosition(pos,plVtHd[i]); cen+=pos; } cen/=double(n); GetNormalOfPolygon(nom,plHd); YsColor col; // unsigned int r,g,b; GetColorOfPolygon(col,plHd); // r=YsBound(int(col.Rd()*31.0),0,31); // g=YsBound(int(col.Gd()*31.0),0,31); // b=YsBound(int(col.Bd()*31.0),0,31); // textOut.Printf("C %d\n",g*1024+r*32+b); textOut.Printf("C %d\n",col.Get15BitColor()); textOut.Printf("N %lf %lf %lf %lf %lf %lf\n",cen.x(),cen.y(),cen.z(),nom.x(),nom.y(),nom.z()); textOut.Printf("E\n"); } textOut.Printf("E\n"); return YSOK; }