diff --git a/sakura_core/doc/CDocEditor.cpp b/sakura_core/doc/CDocEditor.cpp index 1cb80474f0..8d21c9b712 100644 --- a/sakura_core/doc/CDocEditor.cpp +++ b/sakura_core/doc/CDocEditor.cpp @@ -55,6 +55,10 @@ CDocEditor::CDocEditor(CEditDoc* pcDoc) */ void CDocEditor::SetModified( bool flag, bool redraw) { + if( redraw ){ + m_pcDocRef->m_pcEditWnd->m_cDlgFuncList.NotifyDocModification(); + } + if( m_bIsDocModified == flag ) // 変更がなければ何もしない return; diff --git a/sakura_core/outline/CDlgFuncList.cpp b/sakura_core/outline/CDlgFuncList.cpp index 75542335d9..3c2866ec84 100644 --- a/sakura_core/outline/CDlgFuncList.cpp +++ b/sakura_core/outline/CDlgFuncList.cpp @@ -346,6 +346,7 @@ HWND CDlgFuncList::DoModeless( CEditView* pcEditView=(CEditView*)lParam; if( !pcEditView ) return NULL; m_pcFuncInfoArr = pcFuncInfoArr; /* 関数情報配列 */ + m_bFuncInfoArrIsUpToDate = true; m_nCurLine = nCurLine; /* 現在行 */ m_nCurCol = nCurCol; /* 現在桁 */ m_nOutlineType = nOutlineType; /* アウトライン解析の種別 */ @@ -545,14 +546,6 @@ void CDlgFuncList::SetData() WCHAR szText[2048]; const CFuncInfo* pcFuncInfo; LV_ITEM item; - bool bSelected; - CLayoutInt nFuncLineOld(-1); - CLayoutInt nFuncColOld(-1); - CLayoutInt nFuncLineTop(INT_MAX); - CLayoutInt nFuncColTop(INT_MAX); - int nSelectedLineTop = 0; - int nSelectedLine = 0; - RECT rc; m_cmemClipText.SetString(L""); /* クリップボードコピー用テキスト */ { @@ -567,33 +560,7 @@ void CDlgFuncList::SetData() } ::EnableWindow( GetItemHwnd( IDC_BUTTON_COPY ), TRUE ); - bSelected = false; - for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){ - pcFuncInfo = m_pcFuncInfoArr->GetAt( i ); - if( !bSelected ){ - if( pcFuncInfo->m_nFuncLineLAYOUT < nFuncLineTop - || (pcFuncInfo->m_nFuncLineLAYOUT == nFuncLineTop && pcFuncInfo->m_nFuncColLAYOUT <= nFuncColTop) ){ - nFuncLineTop = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColTop = pcFuncInfo->m_nFuncColLAYOUT; - nSelectedLineTop = i; - } - } - { - if( (nFuncLineOld < pcFuncInfo->m_nFuncLineLAYOUT - || (nFuncLineOld == pcFuncInfo->m_nFuncColLAYOUT && nFuncColOld <= pcFuncInfo->m_nFuncColLAYOUT)) - && (pcFuncInfo->m_nFuncLineLAYOUT < m_nCurLine - || (pcFuncInfo->m_nFuncLineLAYOUT == m_nCurLine && pcFuncInfo->m_nFuncColLAYOUT <= m_nCurCol)) ){ - nFuncLineOld = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColOld = pcFuncInfo->m_nFuncColLAYOUT; - bSelected = true; - nSelectedLine = i; - } - } - } - if( 0 < m_pcFuncInfoArr->GetNum() && !bSelected ){ - bSelected = true; - nSelectedLine = nSelectedLineTop; - } + for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){ /* 現在の解析結果要素 */ pcFuncInfo = m_pcFuncInfoArr->GetAt( i ); @@ -698,13 +665,14 @@ void CDlgFuncList::SetData() DWORD dwExStyle = ListView_GetExtendedListViewStyle( hwndList ); dwExStyle |= LVS_EX_FULLROWSELECT; ListView_SetExtendedListViewStyle( hwndList, dwExStyle ); + } - if( bSelected ){ - ListView_GetItemRect( hwndList, 0, &rc, LVIR_BOUNDS ); - ListView_Scroll( hwndList, 0, nSelectedLine * ( rc.bottom - rc.top ) ); - ListView_SetItemState( hwndList, nSelectedLine, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED ); - } + // 選択状態更新 + int nFuncInfoIndex = -1; + if( GetFuncInfoIndex( m_nCurLine, m_nCurCol, &nFuncInfoIndex ) ){ + SetItemSelection( nFuncInfoIndex, true ); } + /* アウトライン ダイアログを自動的に閉じる */ ::CheckDlgButton( GetHwnd(), IDC_CHECK_bAutoCloseDlgFuncList, m_pShareData->m_Common.m_sOutline.m_bAutoCloseDlgFuncList ); /* アウトライン ブックマーク一覧で空行を無視する */ @@ -913,6 +881,7 @@ int CDlgFuncList::GetData( void ) Java Method Treeの構築: 関数リストを元にTreeControlを初期化する。 @date 2002.01.04 genta C++ツリーを統合 + @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) { @@ -1171,26 +1140,6 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) m_cmemClipText.AppendString(FL_OBJ_DECLARE == pcFuncInfo->m_nInfo ? m_pcFuncInfoArr->GetAppendText( FL_OBJ_DECLARE ).c_str() : L"" ); // Jan. 04, 2001 genta C++で使用 m_cmemClipText.AppendString(L"\r\n"); - /* 現在カーソル位置のメソッドかどうか調べる */ - if( !bSelected ){ - if( pcFuncInfo->m_nFuncLineLAYOUT < nFuncLineTop - || (pcFuncInfo->m_nFuncLineLAYOUT == nFuncLineTop && pcFuncInfo->m_nFuncColLAYOUT <= nFuncColTop) ){ - nFuncLineTop = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColTop = pcFuncInfo->m_nFuncColLAYOUT; - htiSelectedTop = htiItem; - } - } - { - if( (nFuncLineOld < pcFuncInfo->m_nFuncLineLAYOUT - || (nFuncLineOld == pcFuncInfo->m_nFuncColLAYOUT && nFuncColOld <= pcFuncInfo->m_nFuncColLAYOUT)) - && (pcFuncInfo->m_nFuncLineLAYOUT < m_nCurLine - || (pcFuncInfo->m_nFuncLineLAYOUT == m_nCurLine && pcFuncInfo->m_nFuncColLAYOUT <= m_nCurCol)) ){ - nFuncLineOld = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColOld = pcFuncInfo->m_nFuncColLAYOUT; - bSelected = TRUE; - htiSelected = htiItem; - } - } // Jan. 04, 2001 genta // deleteはその都度行うのでここでは不要 } @@ -1202,12 +1151,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) TreeView_Expand( hwndTree, htiClass, TVE_EXPAND ); htiClass = TreeView_GetNextSibling( hwndTree, htiClass ); } - /* 現在カーソル位置のメソッドを選択状態にする */ - if( bSelected ){ - TreeView_SelectItem( hwndTree, htiSelected ); - }else{ - TreeView_SelectItem( hwndTree, htiSelectedTop ); - } + // GetTreeTextNext( hwndTree, NULL, 0 ); m_nTreeItemCount = nlParamCount; return; @@ -1218,6 +1162,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) 長くなったので独立させました。 @date Jul 10, 2003 little YOSHI + @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ void CDlgFuncList::SetListVB (void) { @@ -1227,11 +1172,6 @@ void CDlgFuncList::SetListVB (void) const CFuncInfo* pcFuncInfo; LV_ITEM item; HWND hwndList; - int bSelected; - CLayoutInt nFuncLineOld; - CLayoutInt nFuncColOld; - int nSelectedLine = 0; - RECT rc; ::EnableWindow( GetItemHwnd( IDC_BUTTON_COPY ), TRUE ); @@ -1249,39 +1189,6 @@ void CDlgFuncList::SetListVB (void) m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nNum ); } - nFuncLineOld = CLayoutInt(-1); - nFuncColOld = CLayoutInt(-1); - CLayoutInt nFuncLineTop(INT_MAX); - CLayoutInt nFuncColTop(INT_MAX); - int nSelectedLineTop = 0; - bSelected = FALSE; - for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){ - pcFuncInfo = m_pcFuncInfoArr->GetAt( i ); - if( !bSelected ){ - if( pcFuncInfo->m_nFuncLineLAYOUT < nFuncLineTop - || (pcFuncInfo->m_nFuncLineLAYOUT == nFuncLineTop && pcFuncInfo->m_nFuncColLAYOUT <= nFuncColTop) ){ - nFuncLineTop = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColTop = pcFuncInfo->m_nFuncColLAYOUT; - nSelectedLineTop = i; - } - } - { - if( (nFuncLineOld < pcFuncInfo->m_nFuncLineLAYOUT - || (nFuncLineOld == pcFuncInfo->m_nFuncColLAYOUT && nFuncColOld <= pcFuncInfo->m_nFuncColLAYOUT)) - && (pcFuncInfo->m_nFuncLineLAYOUT < m_nCurLine - || (pcFuncInfo->m_nFuncLineLAYOUT == m_nCurLine && pcFuncInfo->m_nFuncColLAYOUT <= m_nCurCol)) ){ - nFuncLineOld = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColOld = pcFuncInfo->m_nFuncColLAYOUT; - bSelected = TRUE; - nSelectedLine = i; - } - } - } - if( 0 < m_pcFuncInfoArr->GetNum() && !bSelected ){ - bSelected = TRUE; - nSelectedLine = nSelectedLineTop; - } - WCHAR szText[2048]; for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){ /* 現在の解析結果要素 */ @@ -1450,11 +1357,6 @@ void CDlgFuncList::SetListVB (void) ListView_SetColumnWidth( hwndList, FL_COL_COL, ListView_GetColumnWidth( hwndList, FL_COL_COL ) + 16 ); ListView_SetColumnWidth( hwndList, FL_COL_NAME, ListView_GetColumnWidth( hwndList, FL_COL_NAME ) + 16 ); ListView_SetColumnWidth( hwndList, FL_COL_REMARK, ListView_GetColumnWidth( hwndList, FL_COL_REMARK ) + 16 ); - if( bSelected ){ - ListView_GetItemRect( hwndList, 0, &rc, LVIR_BOUNDS ); - ListView_Scroll( hwndList, 0, nSelectedLine * ( rc.bottom - rc.top ) ); - ListView_SetItemState( hwndList, nSelectedLine, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED ); - } return; } @@ -1468,11 +1370,10 @@ void CDlgFuncList::SetListVB (void) @date 2007.02.25 genta クリップボード出力をタブジャンプ可能な書式に変更 @date 2007.03.04 genta タブジャンプ可能な書式に変更するかどうかのフラグを追加 @date 2014.06.06 Moca 他ファイルへのタグジャンプ機能を追加 + @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) { - HTREEITEM hItemSelected = NULL; - HTREEITEM hItemSelectedTop = NULL; HWND hwndTree = GetItemHwnd( IDC_TREE_FL ); int i; @@ -1482,11 +1383,6 @@ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) HTREEITEM* phParentStack; phParentStack = (HTREEITEM*)malloc( nStackDepth * sizeof( HTREEITEM ) ); phParentStack[ nStackPointer ] = TVI_ROOT; - CLayoutInt nFuncLineOld(-1); - CLayoutInt nFuncColOld(-1); - CLayoutInt nFuncLineTop(INT_MAX); - CLayoutInt nFuncColTop(INT_MAX); - bool bSelected = false; m_cmemClipText.SetString(L""); { @@ -1545,36 +1441,6 @@ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) hItem = TreeView_InsertItem( hwndTree, &cTVInsertStruct ); phParentStack[ nStackPointer+1 ] = hItem; - /* pcFuncInfoに登録されている行数、桁を確認して、選択するアイテムを考える - */ - bool bFileSelect = false; - if( pcFuncInfo->m_cmemFileName.GetStringPtr() && m_pcFuncInfoArr->m_szFilePath[0] ){ - if( 0 == wmemicmp( pcFuncInfo->m_cmemFileName.GetStringPtr(), m_pcFuncInfoArr->m_szFilePath.c_str() ) ){ - bFileSelect = true; - } - }else{ - bFileSelect = true; - } - if( bFileSelect ){ - if( !bSelected ){ - if( pcFuncInfo->m_nFuncLineLAYOUT < nFuncLineTop - || (pcFuncInfo->m_nFuncLineLAYOUT == nFuncLineTop && pcFuncInfo->m_nFuncColLAYOUT <= nFuncColTop) ){ - nFuncLineTop = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColTop = pcFuncInfo->m_nFuncColLAYOUT; - hItemSelectedTop = hItem; - } - } - if( (nFuncLineOld < pcFuncInfo->m_nFuncLineLAYOUT - || (nFuncLineOld == pcFuncInfo->m_nFuncColLAYOUT && nFuncColOld <= pcFuncInfo->m_nFuncColLAYOUT)) - && (pcFuncInfo->m_nFuncLineLAYOUT < m_nCurLine - || (pcFuncInfo->m_nFuncLineLAYOUT == m_nCurLine && pcFuncInfo->m_nFuncColLAYOUT <= m_nCurCol)) ){ - nFuncLineOld = pcFuncInfo->m_nFuncLineLAYOUT; - nFuncColOld = pcFuncInfo->m_nFuncColLAYOUT; - hItemSelected = hItem; - bSelected = true; - } - } - /* クリップボードコピー用テキストを作成する */ // 2003.06.22 Moca dummy要素はツリーに入れるがTAGJUMPには加えない if( pcFuncInfo->IsAddClipText() ){ @@ -1620,13 +1486,6 @@ end_of_func:; ::EnableWindow( GetItemHwnd( IDC_BUTTON_COPY ), TRUE ); - if( NULL != hItemSelected ){ - /* 現在カーソル位置のメソッドを選択状態にする */ - TreeView_SelectItem( hwndTree, hItemSelected ); - }else if( NULL != hItemSelectedTop ){ - TreeView_SelectItem( hwndTree, hItemSelectedTop ); - } - free( phParentStack ); } @@ -2695,6 +2554,7 @@ void CDlgFuncList::Redraw( int nOutLineType, int nListType, CFuncInfoArr* pcFunc m_nOutlineType = nOutLineType; m_nListType = nListType; m_pcFuncInfoArr = pcFuncInfoArr; /* 関数情報配列 */ + m_bFuncInfoArrIsUpToDate = true; m_nCurLine = nCurLine; /* 現在行 */ m_nCurCol = nCurCol; /* 現在桁 */ @@ -4043,3 +3903,205 @@ void CDlgFuncList::LoadFileTreeSetting( CFileTreeSetting& data, SFilePath& IniDi } } } + +/*! + キャレットの移動を通知 + @param[in] nCurLine 移動後の行 + @param[in] nCurCol 移動後の桁 +*/ +void CDlgFuncList::NotifyCaretMovement( CLayoutInt nCurLine, CLayoutInt nCurCol ) +{ + if( !::IsWindowVisible( this->GetHwnd() ) ){ + return; + } + + if( !m_bFuncInfoArrIsUpToDate ){ + return; + } + + if( m_nCurLine == nCurLine && m_nCurCol == nCurCol ){ + return; + } + + m_nCurLine = nCurLine; + m_nCurCol = nCurCol; + + int nFuncInfoIndex = -1; + if( GetFuncInfoIndex( nCurLine, nCurCol, &nFuncInfoIndex ) ){ + SetItemSelection( nFuncInfoIndex, false ); + } + + return; +} + +/*! + ドキュメントの変更を通知 +*/ +void CDlgFuncList::NotifyDocModification() +{ + // もう最新ではなくなりました + m_bFuncInfoArrIsUpToDate = false; +} + +/*! + リスト/ツリービュー上のアイテムを選択または選択解除 + @param[in] nFuncInfoIndex 選択対象とする関数情報配列のインデックス(-1の場合は選択解除) + @param[in] bAllowExpand 選択対象を含むノードを展開するかどうか(ツリービュー以外では無視) +*/ +void CDlgFuncList::SetItemSelection( int nFuncInfoIndex, bool bAllowExpand ) +{ + if( m_nViewType == VIEWTYPE_TREE ){ + HWND hwndTree = GetItemHwnd( IDC_TREE_FL ); + SetItemSelectionForTreeView( hwndTree, nFuncInfoIndex, bAllowExpand ); + }else if( m_nViewType == VIEWTYPE_LIST ){ + HWND hwndList = GetItemHwnd( IDC_LIST_FL ); + SetItemSelectionForListView( hwndList, nFuncInfoIndex ); + }else{ + ; + } + + return; +} + +/*! + ツリービュー上のアイテムを選択または選択解除 + @param[in] hwndTree 対象とするツリービューのハンドル + @param[in] nFuncInfoIndex 選択対象とする関数情報配列のインデックス(-1の場合は選択解除) + @param[in] bAllowExpand 選択対象を含むノードを展開するかどうか +*/ +void CDlgFuncList::SetItemSelectionForTreeView( HWND hwndTree, int nFuncInfoIndex, bool bAllowExpand ) +{ + if( nFuncInfoIndex == -1 ){ + TreeView_SelectItem( hwndTree, NULL ); + return; + } + + std::vector htiStack; + HTREEITEM htiFound = NULL; + htiStack.reserve( TreeView_GetCount( hwndTree ) ); + htiStack.push_back( TreeView_GetRoot( hwndTree ) ); + size_t nStackIndex = 0; + while( htiFound == NULL && nStackIndex < htiStack.size() ){ + HTREEITEM htiCurrent = htiStack[nStackIndex]; + for( ; NULL != htiCurrent ; htiCurrent = TreeView_GetNextSibling( hwndTree, htiCurrent ) ){ + TVITEM tvItem = {}; + tvItem.mask = TVIF_HANDLE | TVIF_PARAM; + tvItem.hItem = htiCurrent; + TreeView_GetItem( hwndTree, &tvItem ); + if( nFuncInfoIndex == TreeDummylParamToFuncInfoIndex( m_vecDummylParams, tvItem.lParam ) ){ + // 発見 + htiFound = htiCurrent; + break; + } + + HTREEITEM htiChild = TreeView_GetChild( hwndTree, htiCurrent ); + if( htiChild != NULL ){ + htiStack.push_back( htiChild ); + } + } + ++nStackIndex; + } + + if( htiFound != NULL ){ + HTREEITEM htiSelect = htiFound; + if( !bAllowExpand ){ + // 未展開のアイテムは勝手に開けないよう気を付けて選択 + + HTREEITEM htiParent = TreeView_GetParent( hwndTree, htiFound ); + if( htiParent == NULL || (TreeView_GetItemState( hwndTree, htiParent, TVIS_EXPANDED ) & TVIS_EXPANDED) != 0 ){ + htiSelect = htiFound; + }else{ + // [A] 展開 + // +-[B] 未展開 <<< ここを探します + // +-[C] 未展開 + // +-[htiFound] + do{ + htiSelect = htiParent; + htiParent = TreeView_GetParent( hwndTree, htiParent ); + }while( htiParent != NULL && (TreeView_GetItemState( hwndTree, htiParent, TVIS_EXPANDED ) & TVIS_EXPANDED) == 0 ); + } + } + TreeView_SelectItem( hwndTree, htiSelect ); + TreeView_EnsureVisible( hwndTree, htiSelect ); + } + + return; +} + +/*! + リストビュー上のアイテムを選択または選択解除 + @param[in] hwndList 対象とするリストビューのハンドル + @param[in] nFuncInfoIndex 選択対象とする関数情報配列のインデックス(-1の場合は選択解除) +*/ +void CDlgFuncList::SetItemSelectionForListView( HWND hwndList, int nFuncInfoIndex ) +{ + if( nFuncInfoIndex != -1 ){ + ListView_SetItemState( hwndList, nFuncInfoIndex, LVIS_SELECTED | LVIS_FOCUSED, LVIS_SELECTED | LVIS_FOCUSED ); + ListView_EnsureVisible( hwndList, nFuncInfoIndex, FALSE ); + }else{ + ListView_SetItemState( hwndList, nFuncInfoIndex, 0, LVIS_SELECTED | LVIS_FOCUSED ); + } + + return; +} + +/*! + 指定した位置に該当する関数情報のインデックスを取得 + @param[in] nCurLine 行 + @param[in] nCurCol 桁 + @param[out] pnIndexOut 該当する関数情報のインデックスを格納 + @retval true 該当あり + @retval false 該当なし(出力引数には何も設定せず) +*/ +bool CDlgFuncList::GetFuncInfoIndex( CLayoutInt nCurLine, CLayoutInt nCurCol, int* pnIndexOut ) +{ + const CFuncInfo* pcFuncInfo = NULL; + CLayoutInt nFuncLineOld(-1); + CLayoutInt nFuncColOld(-1); + CLayoutInt nFuncLineTop(INT_MAX); + CLayoutInt nFuncColTop(INT_MAX); + int nFoundIndex = -1; + int i; + + if( m_pcFuncInfoArr == NULL || pnIndexOut == NULL ){ + return false; + } + + // SetTree,SetTreeJava,SetListVB,SetDataにあった処理を持ってきました + + for( i = 0; i < m_pcFuncInfoArr->GetNum(); ++i ){ + pcFuncInfo = m_pcFuncInfoArr->GetAt( i ); + + if( (pcFuncInfo->m_cmemFileName.GetStringPtr() && m_pcFuncInfoArr->m_szFilePath[0]) ){ + if( 0 != wmemicmp( pcFuncInfo->m_cmemFileName.GetStringPtr(), m_pcFuncInfoArr->m_szFilePath.c_str() ) ){ + continue; + } + } + + if( nFoundIndex == -1 ){ + if( pcFuncInfo->m_nFuncLineLAYOUT < nFuncLineTop + || (pcFuncInfo->m_nFuncLineLAYOUT == nFuncLineTop && pcFuncInfo->m_nFuncColLAYOUT <= nFuncColTop) ){ + nFuncLineTop = pcFuncInfo->m_nFuncLineLAYOUT; + nFuncColTop = pcFuncInfo->m_nFuncColLAYOUT; + nFoundIndex = i; + } + }else{ + if( (nFuncLineOld < pcFuncInfo->m_nFuncLineLAYOUT + || (nFuncLineOld == pcFuncInfo->m_nFuncLineLAYOUT && nFuncColOld <= pcFuncInfo->m_nFuncColLAYOUT)) + && (pcFuncInfo->m_nFuncLineLAYOUT < m_nCurLine + || (pcFuncInfo->m_nFuncLineLAYOUT == m_nCurLine && pcFuncInfo->m_nFuncColLAYOUT <= m_nCurCol)) ){ + nFuncLineOld = pcFuncInfo->m_nFuncLineLAYOUT; + nFuncColOld = pcFuncInfo->m_nFuncColLAYOUT; + nFoundIndex = i; + } + } + } + + if( nFoundIndex == -1 ){ + return false; + } + + *pnIndexOut = nFoundIndex; + + return true; +} diff --git a/sakura_core/outline/CDlgFuncList.h b/sakura_core/outline/CDlgFuncList.h index 03c6012ea6..0c2a7d6f11 100644 --- a/sakura_core/outline/CDlgFuncList.h +++ b/sakura_core/outline/CDlgFuncList.h @@ -101,6 +101,8 @@ class CDlgFuncList final : public CDialog void SetWindowText( const WCHAR* szTitle ); //ダイアログタイトルの設定 EFunctionCode GetFuncCodeRedraw(int outlineType); void LoadFileTreeSetting( CFileTreeSetting& data, SFilePath& IniDirPath ); + void NotifyCaretMovement( CLayoutInt nCurLine, CLayoutInt nCurCol ); + void NotifyDocModification(); protected: bool m_bInChangeLayout; @@ -139,6 +141,10 @@ class CDlgFuncList final : public CDialog void SetTreeFile(); // ツリーコントロールの初期化:ファイルツリー void SetListVB( void ); /* リストビューコントロールの初期化:VisualBasic */ // Jul 10, 2003 little YOSHI void SetDocLineFuncList(); + void SetItemSelection( int nSelectItemIndex, bool allowExpand ); + void SetItemSelectionForTreeView( HWND hwndTree, int nSelectItemIndex, bool allowExpand ); + void SetItemSelectionForListView( HWND hwndList, int nSelectItemIndex ); + bool GetFuncInfoIndex( CLayoutInt nCurLine, CLayoutInt nCurCol, int* pIndexOut ); void SetTreeFileSub(HTREEITEM hParent, const WCHAR* pszFile); // 2002/11/1 frozen @@ -222,5 +228,7 @@ class CDlgFuncList final : public CDialog POINT m_ptDefaultSize; POINT m_ptDefaultSizeClient; RECT m_rcItems[12]; + + bool m_bFuncInfoArrIsUpToDate; }; #endif /* SAKURA_CDLGFUNCLIST_B22A3877_572A_49B7_B683_50ECA451A6F8_H_ */ diff --git a/sakura_core/view/CCaret.cpp b/sakura_core/view/CCaret.cpp index bf501ea97b..1b62d7e0e3 100644 --- a/sakura_core/view/CCaret.cpp +++ b/sakura_core/view/CCaret.cpp @@ -376,6 +376,10 @@ CLayoutInt CCaret::MoveCursor( m_pEditView->DrawBracketPair( true ); // 02/09/18 対括弧の強調表示 ai End 03/02/18 ai mod E + // アウトライン表示の選択位置を更新 + CLayoutPoint poCaret = GetCaretLayoutPos(); + m_pEditDoc->m_pcEditWnd->m_cDlgFuncList.NotifyCaretMovement( poCaret.GetY2() + 1, poCaret.GetX2() + 1 ); + return nScrollRowNum; }