From f30ff8a25348dd9c59f10a76283a4764046a20fe Mon Sep 17 00:00:00 2001 From: katsuhisa yuasa Date: Wed, 28 Apr 2021 07:02:54 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E3=82=A2=E3=82=A6=E3=83=88=E3=83=A9?= =?UTF-8?q?=E3=82=A4=E3=83=B3=E8=A7=A3=E6=9E=90=E3=82=A6=E3=82=A3=E3=83=B3?= =?UTF-8?q?=E3=83=89=E3=82=A6=E3=81=AE=E3=83=84=E3=83=AA=E3=83=BC=E3=83=93?= =?UTF-8?q?=E3=83=A5=E3=83=BC=E3=81=AE=E8=A8=AD=E5=AE=9A=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AE=E9=AB=98=E9=80=9F=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CDlgFuncList::SetTree においてアイテムを追加するループの前後で WM_SETREDRAW メッセージを使用する事で描画の抑制 ソート種別が SORTTYPE_DEFAULT もしくは SORTTYPE_DEFAULT_DESC の場合は、ツリービューへのデータ追加方法を調整する事で CDlgFuncList::SortTree の呼び出しを行う必要が無くして高速化 --- sakura_core/outline/CDlgFuncList.cpp | 66 +++++++++++++--------------- sakura_core/outline/CDlgFuncList.h | 4 +- 2 files changed, 33 insertions(+), 37 deletions(-) diff --git a/sakura_core/outline/CDlgFuncList.cpp b/sakura_core/outline/CDlgFuncList.cpp index 4a3bd9002b..f789a518b8 100644 --- a/sakura_core/outline/CDlgFuncList.cpp +++ b/sakura_core/outline/CDlgFuncList.cpp @@ -431,52 +431,53 @@ void CDlgFuncList::SetData() ListView_DeleteAllItems( hwndList ); TreeView_DeleteAllItems( hwndTree ); ::ShowWindow( GetItemHwnd(IDC_BUTTON_SETTING), SW_HIDE ); + const HTREEITEM hInsertAfter = (m_nSortType == SORTTYPE_DEFAULT_DESC) ? TVI_FIRST : TVI_LAST; SetDocLineFuncList(); if( OUTLINE_C_CPP == m_nListType || OUTLINE_CPP == m_nListType ){ /* C++メソッドリスト */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), TRUE ); // Jan. 04, 2002 genta Java Method Treeに統合 + SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); // Jan. 04, 2002 genta Java Method Treeに統合 ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_CPP) ); } else if( OUTLINE_FILE == m_nListType ){ //@@@ 2002.04.01 YAZAKI アウトライン解析にルールファイル導入 m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_RULE) ); } else if( OUTLINE_WZTXT == m_nListType ){ //@@@ 2003.05.20 zenryaku 階層付テキストアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_WZ) ); // 2003.06.22 Moca 名前変更 } else if( OUTLINE_HTML == m_nListType ){ //@@@ 2003.05.20 zenryaku HTMLアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), L"HTML" ); } else if( OUTLINE_TEX == m_nListType ){ //@@@ 2003.07.20 naoh TeXアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), L"TeX" ); } else if( OUTLINE_TEXT == m_nListType ){ /* テキスト・トピックリスト */ m_nViewType = VIEWTYPE_TREE; - SetTree(); //@@@ 2002.04.01 YAZAKI テキストトピックツリーも、汎用SetTreeを呼ぶように変更。 + SetTree(hwndTree, hInsertAfter); //@@@ 2002.04.01 YAZAKI テキストトピックツリーも、汎用SetTreeを呼ぶように変更。 ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_TEXT) ); } else if( OUTLINE_JAVA == m_nListType ){ /* Javaメソッドツリー */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), TRUE ); + SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_JAVA) ); } // 2007.02.08 genta Python追加 else if( OUTLINE_PYTHON == m_nListType ){ /* Python メソッドツリー */ m_nViewType = VIEWTYPE_TREE; - SetTree( true ); + SetTree( hwndTree, hInsertAfter, true ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_PYTHON) ); } else if( OUTLINE_COBOL == m_nListType ){ /* COBOL アウトライン */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), FALSE ); + SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, FALSE ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_COBOL) ); } else if( OUTLINE_VB == m_nListType ){ /* VisualBasic アウトライン */ @@ -486,7 +487,7 @@ void CDlgFuncList::SetData() } else if( OUTLINE_XML == m_nListType ){ // XMLツリー m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), L"XML" ); } else if ( OUTLINE_FILETREE == m_nListType ){ @@ -496,17 +497,17 @@ void CDlgFuncList::SetData() } else if( OUTLINE_TREE == m_nListType ){ /* 汎用ツリー */ m_nViewType = VIEWTYPE_TREE; - SetTree(); + SetTree(hwndTree, hInsertAfter); ::SetWindowText( GetHwnd(), L"" ); } else if( OUTLINE_TREE_TAGJUMP == m_nListType ){ /* 汎用ツリー(タグジャンプ付き) */ m_nViewType = VIEWTYPE_TREE; - SetTree( true ); + SetTree( hwndTree, hInsertAfter, true ); ::SetWindowText( GetHwnd(), L"" ); } else if( OUTLINE_CLSTREE == m_nListType ){ /* 汎用クラスツリー */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), TRUE ); + SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); ::SetWindowText( GetHwnd(), L"" ); } else{ @@ -700,13 +701,6 @@ void CDlgFuncList::SetData() ::EnableWindow( GetItemHwnd( IDC_CHECK_bFunclistSetFocusOnJump ), TRUE ); } - //2002.02.08 hor - //(IDC_LIST_FLもIDC_TREE_FLも常に存在していて、m_nViewTypeによって、どちらを表示するかを選んでいる) - HWND hwndShow = (VIEWTYPE_LIST == m_nViewType)? hwndList: hwndTree; - ::ShowWindow( hwndShow, SW_SHOW ); - if( ::GetForegroundWindow() == MyGetAncestor( GetHwnd(), GA_ROOT ) && IsChild( GetHwnd(), GetFocus()) ) - ::SetFocus( hwndShow ); - //2002.02.08 hor //空行をどう扱うかのチェックボックスはブックマーク一覧のときだけ表示する if(OUTLINE_BOOKMARK == m_nListType){ @@ -743,8 +737,8 @@ void CDlgFuncList::SetData() Combo_AddString( hWnd_Combo_Sort , LS(STR_DLGFNCLST_SORTTYPE2_2)); // SORTTYPE_ZTOA Combo_SetCurSel( hWnd_Combo_Sort , m_nSortType ); ::ShowWindow( GetItemHwnd( IDC_STATIC_nSortType ), SW_SHOW ); - // 2002.11.10 Moca 追加 ソートする - SortTree(GetItemHwnd( IDC_TREE_FL),TVI_ROOT); + if (m_nSortType != SORTTYPE_DEFAULT && m_nSortType != SORTTYPE_DEFAULT_DESC) + SortTree(hwndTree, TVI_ROOT); }else if( m_nListType == OUTLINE_FILETREE ){ ::ShowWindow( GetItemHwnd(IDC_COMBO_nSortType), SW_HIDE ); ::ShowWindow( GetItemHwnd(IDC_STATIC_nSortType), SW_HIDE ); @@ -756,6 +750,13 @@ void CDlgFuncList::SetData() //ListView_SortItems( hwndList, CompareFunc_Asc, (LPARAM)this ); // 2005.04.05 zenryaku ソート状態を保持 SortListView( hwndList, m_nSortCol ); // 2005.04.23 genta 関数化(ヘッダ書き換えのため) } + + //2002.02.08 hor + //(IDC_LIST_FLもIDC_TREE_FLも常に存在していて、m_nViewTypeによって、どちらを表示するかを選んでいる) + HWND hwndShow = (VIEWTYPE_LIST == m_nViewType) ? hwndList : hwndTree; + ::ShowWindow(hwndShow, SW_SHOW); + if (::GetForegroundWindow() == MyGetAncestor(GetHwnd(), GA_ROOT) && IsChild(GetHwnd(), GetFocus())) + ::SetFocus(hwndShow); } bool CDlgFuncList::GetTreeFileFullName(HWND hwndTree, HTREEITEM target, std::wstring* pPath, int* pnItem) @@ -890,11 +891,10 @@ int CDlgFuncList::GetData( void ) @date 2002.01.04 genta C++ツリーを統合 @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ -void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) +void CDlgFuncList::SetTreeJava( HWND hwndDlg, HWND hwndTree, HTREEITEM hInsertAfter, BOOL bAddClass ) { int i; const CFuncInfo* pcFuncInfo; - HWND hwndTree; int bSelected; CLayoutInt nFuncLineOld; CLayoutInt nFuncColOld; @@ -916,8 +916,6 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) m_vecDummylParams.clear(); int nlParamCount = 0; - hwndTree = GetItemHwnd( IDC_TREE_FL ); - m_cmemClipText.SetString( L"" ); { const int nBuffLenTag = 13 + wcslen(m_pcFuncInfoArr->m_szFilePath); @@ -1061,7 +1059,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) strClassName += m_pcFuncInfoArr->GetAppendText(FL_OBJ_CLASS); } tvis.hParent = htiParent; - tvis.hInsertAfter = TVI_LAST; + tvis.hInsertAfter = hInsertAfter; tvis.item.mask = TVIF_TEXT | TVIF_PARAM; tvis.item.pszText = const_cast(strClassName.c_str()); // 2016.03.06 item.lParamは登録順の連番に変更 @@ -1098,7 +1096,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) ::ZeroMemory( &tvg, sizeof(tvg)); tvg.hParent = TVI_ROOT; - tvg.hInsertAfter = TVI_LAST; + tvg.hInsertAfter = hInsertAfter; tvg.item.mask = TVIF_TEXT | TVIF_PARAM; //tvg.item.pszText = const_cast(L"グローバル"); tvg.item.pszText = const_cast(sGlobal.c_str()); @@ -1125,7 +1123,7 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, BOOL bAddClass ) /* 該当クラス名のアイテムの子として、メソッドのアイテムを登録 */ tvis.hParent = htiClass; - tvis.hInsertAfter = TVI_LAST; + tvis.hInsertAfter = hInsertAfter; tvis.item.mask = TVIF_TEXT | TVIF_PARAM; tvis.item.pszText = const_cast(strFuncName.c_str()); tvis.item.lParam = nlParamCount; @@ -1379,10 +1377,8 @@ void CDlgFuncList::SetListVB (void) @date 2014.06.06 Moca 他ファイルへのタグジャンプ機能を追加 @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ -void CDlgFuncList::SetTree(bool tagjump, bool nolabel) +void CDlgFuncList::SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump, bool nolabel) { - HWND hwndTree = GetItemHwnd( IDC_TREE_FL ); - int i; int nFuncInfoArrNum = m_pcFuncInfoArr->GetNum(); int nStackPointer = 0; @@ -1409,6 +1405,7 @@ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nCount ); } + ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); for (i = 0; i < nFuncInfoArrNum; i++){ CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i); @@ -1418,8 +1415,7 @@ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) HTREEITEM hItem; TV_INSERTSTRUCT cTVInsertStruct; cTVInsertStruct.hParent = phParentStack[ nStackPointer ]; - // 2016.04.24 TVI_LASTは要素数が多いとすごく遅い。TVI_FIRSTを使い後でソートしなおす - cTVInsertStruct.hInsertAfter = TVI_FIRST; + cTVInsertStruct.hInsertAfter = hInsertAfter; cTVInsertStruct.item.mask = TVIF_TEXT | TVIF_PARAM; cTVInsertStruct.item.pszText = pcFuncInfo->m_cmemFuncName.GetStringPtr(); cTVInsertStruct.item.lParam = i; // あとでこの数値(=m_pcFuncInfoArrの何番目のアイテムか)を見て、目的地にジャンプするぜ!!。 @@ -1490,7 +1486,7 @@ void CDlgFuncList::SetTree(bool tagjump, bool nolabel) } end_of_func:; - + ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)TRUE, 0); ::EnableWindow( GetItemHwnd( IDC_BUTTON_COPY ), TRUE ); free( phParentStack ); diff --git a/sakura_core/outline/CDlgFuncList.h b/sakura_core/outline/CDlgFuncList.h index 7a046080c3..c4e8a4e6ce 100644 --- a/sakura_core/outline/CDlgFuncList.h +++ b/sakura_core/outline/CDlgFuncList.h @@ -137,8 +137,8 @@ class CDlgFuncList final : public CDialog || 実装ヘルパ関数 */ BOOL OnJump( bool bCheckAutoClose = true, bool bFileJump = true ); // bCheckAutoClose:「このダイアログを自動的に閉じる」をチェックするかどうか - void SetTreeJava(HWND hwndDlg, BOOL bAddClass); /* ツリーコントロールの初期化:Javaメソッドツリー */ - void SetTree(bool tagjump = false, bool nolabel = false); /* ツリーコントロールの初期化:汎用品 */ + void SetTreeJava(HWND hwndDlg, HWND hwndTree, HTREEITEM hInsertAfter, BOOL bAddClass); /* ツリーコントロールの初期化:Javaメソッドツリー */ + void SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump = false, bool nolabel = false); /* ツリーコントロールの初期化:汎用品 */ void SetTreeFile(); // ツリーコントロールの初期化:ファイルツリー void SetListVB( void ); /* リストビューコントロールの初期化:VisualBasic */ // Jul 10, 2003 little YOSHI void SetDocLineFuncList(); From ad15b1a52de10547d503ce6af9fd839902ad60cc Mon Sep 17 00:00:00 2001 From: katsuhisa yuasa Date: Sat, 1 May 2021 05:17:01 +0900 Subject: [PATCH 2/3] =?UTF-8?q?SetTreeJava=20=E3=81=A8=20SetTree=20?= =?UTF-8?q?=E3=81=AE=E5=BC=95=E6=95=B0=E3=81=AB=20hwndTree=20=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E3=81=99=E3=82=8B=E5=A4=89=E6=9B=B4=E3=82=92?= =?UTF-8?q?=E3=82=84=E3=82=81=E3=82=8B=20hwndList=20=E3=81=A8=20hwndTree?= =?UTF-8?q?=20=E3=82=92=E9=9D=9E=E8=A1=A8=E7=A4=BA=E3=81=AB=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=82=BF=E3=82=A4=E3=83=9F=E3=83=B3=E3=82=B0=E3=81=AE?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=20hwndList=20=E3=81=A8=20hwndTree=20?= =?UTF-8?q?=E3=81=AE=E6=8F=8F=E7=94=BB=E3=82=92=20WM=5FSETREDRAW=E3=80=80?= =?UTF-8?q?=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E3=81=A7=E6=8A=91?= =?UTF-8?q?=E3=81=88=E3=82=8B=E7=AF=84=E5=9B=B2=E3=82=92=E5=BA=83=E3=81=92?= =?UTF-8?q?=E3=82=8B=20=E9=81=B8=E6=8A=9E=E7=8A=B6=E6=85=8B=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=87=A6=E7=90=86=E3=81=AF=E6=9C=80=E5=BE=8C=E3=81=AB?= =?UTF-8?q?=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=EF=BC=88WM=5FSETREDRAW=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC?= =?UTF-8?q?=E3=82=B8=E3=81=A7=E6=8F=8F=E7=94=BB=E3=82=92=E6=8A=91=E3=81=88?= =?UTF-8?q?=E3=81=A6=E3=81=84=E3=82=8B=E9=96=93=E3=81=AF=E6=A9=9F=E8=83=BD?= =?UTF-8?q?=E3=81=97=E3=81=AA=E3=81=84=E6=A8=A1=E6=A7=98=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/outline/CDlgFuncList.cpp | 64 ++++++++++++++++------------ sakura_core/outline/CDlgFuncList.h | 4 +- 2 files changed, 38 insertions(+), 30 deletions(-) diff --git a/sakura_core/outline/CDlgFuncList.cpp b/sakura_core/outline/CDlgFuncList.cpp index f789a518b8..b2354a24d2 100644 --- a/sakura_core/outline/CDlgFuncList.cpp +++ b/sakura_core/outline/CDlgFuncList.cpp @@ -426,8 +426,8 @@ void CDlgFuncList::SetData() m_vecDummylParams.clear(); //2002.02.08 hor 隠しといてアイテム削除→あとで表示 - ::ShowWindow( hwndList, SW_HIDE ); - ::ShowWindow( hwndTree, SW_HIDE ); + ::SendMessage(hwndList, WM_SETREDRAW, (WPARAM)FALSE, 0); + ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); ListView_DeleteAllItems( hwndList ); TreeView_DeleteAllItems( hwndTree ); ::ShowWindow( GetItemHwnd(IDC_BUTTON_SETTING), SW_HIDE ); @@ -436,48 +436,48 @@ void CDlgFuncList::SetData() SetDocLineFuncList(); if( OUTLINE_C_CPP == m_nListType || OUTLINE_CPP == m_nListType ){ /* C++メソッドリスト */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); // Jan. 04, 2002 genta Java Method Treeに統合 + SetTreeJava( GetHwnd(), hInsertAfter, TRUE ); // Jan. 04, 2002 genta Java Method Treeに統合 ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_CPP) ); } else if( OUTLINE_FILE == m_nListType ){ //@@@ 2002.04.01 YAZAKI アウトライン解析にルールファイル導入 m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_RULE) ); } else if( OUTLINE_WZTXT == m_nListType ){ //@@@ 2003.05.20 zenryaku 階層付テキストアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_WZ) ); // 2003.06.22 Moca 名前変更 } else if( OUTLINE_HTML == m_nListType ){ //@@@ 2003.05.20 zenryaku HTMLアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), L"HTML" ); } else if( OUTLINE_TEX == m_nListType ){ //@@@ 2003.07.20 naoh TeXアウトライン解析 m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), L"TeX" ); } else if( OUTLINE_TEXT == m_nListType ){ /* テキスト・トピックリスト */ m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); //@@@ 2002.04.01 YAZAKI テキストトピックツリーも、汎用SetTreeを呼ぶように変更。 + SetTree(hInsertAfter); //@@@ 2002.04.01 YAZAKI テキストトピックツリーも、汎用SetTreeを呼ぶように変更。 ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_TEXT) ); } else if( OUTLINE_JAVA == m_nListType ){ /* Javaメソッドツリー */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); + SetTreeJava( GetHwnd(), hInsertAfter, TRUE ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_JAVA) ); } // 2007.02.08 genta Python追加 else if( OUTLINE_PYTHON == m_nListType ){ /* Python メソッドツリー */ m_nViewType = VIEWTYPE_TREE; - SetTree( hwndTree, hInsertAfter, true ); + SetTree( hInsertAfter, true ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_PYTHON) ); } else if( OUTLINE_COBOL == m_nListType ){ /* COBOL アウトライン */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, FALSE ); + SetTreeJava( GetHwnd(), hInsertAfter, FALSE ); ::SetWindowText( GetHwnd(), LS(STR_DLGFNCLST_TITLE_COBOL) ); } else if( OUTLINE_VB == m_nListType ){ /* VisualBasic アウトライン */ @@ -487,7 +487,7 @@ void CDlgFuncList::SetData() } else if( OUTLINE_XML == m_nListType ){ // XMLツリー m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), L"XML" ); } else if ( OUTLINE_FILETREE == m_nListType ){ @@ -497,17 +497,17 @@ void CDlgFuncList::SetData() } else if( OUTLINE_TREE == m_nListType ){ /* 汎用ツリー */ m_nViewType = VIEWTYPE_TREE; - SetTree(hwndTree, hInsertAfter); + SetTree(hInsertAfter); ::SetWindowText( GetHwnd(), L"" ); } else if( OUTLINE_TREE_TAGJUMP == m_nListType ){ /* 汎用ツリー(タグジャンプ付き) */ m_nViewType = VIEWTYPE_TREE; - SetTree( hwndTree, hInsertAfter, true ); + SetTree( hInsertAfter, true ); ::SetWindowText( GetHwnd(), L"" ); } else if( OUTLINE_CLSTREE == m_nListType ){ /* 汎用クラスツリー */ m_nViewType = VIEWTYPE_TREE; - SetTreeJava( GetHwnd(), hwndTree, hInsertAfter, TRUE ); + SetTreeJava( GetHwnd(), hInsertAfter, TRUE ); ::SetWindowText( GetHwnd(), L"" ); } else{ @@ -675,12 +675,6 @@ void CDlgFuncList::SetData() ListView_SetExtendedListViewStyle( hwndList, dwExStyle ); } - // 選択状態更新 - 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 ); /* アウトライン ブックマーク一覧で空行を無視する */ @@ -754,7 +748,16 @@ void CDlgFuncList::SetData() //2002.02.08 hor //(IDC_LIST_FLもIDC_TREE_FLも常に存在していて、m_nViewTypeによって、どちらを表示するかを選んでいる) HWND hwndShow = (VIEWTYPE_LIST == m_nViewType) ? hwndList : hwndTree; + ::ShowWindow(hwndTree, SW_HIDE); + ::ShowWindow(hwndList, SW_HIDE); ::ShowWindow(hwndShow, SW_SHOW); + ::SendMessage(hwndList, WM_SETREDRAW, (WPARAM)TRUE, 0); + ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)TRUE, 0); + // 選択状態更新 + int nFuncInfoIndex = -1; + if (GetFuncInfoIndex(m_nCurLine, m_nCurCol, &nFuncInfoIndex)) { + SetItemSelection(nFuncInfoIndex, true); + } if (::GetForegroundWindow() == MyGetAncestor(GetHwnd(), GA_ROOT) && IsChild(GetHwnd(), GetFocus())) ::SetFocus(hwndShow); } @@ -891,10 +894,11 @@ int CDlgFuncList::GetData( void ) @date 2002.01.04 genta C++ツリーを統合 @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ -void CDlgFuncList::SetTreeJava( HWND hwndDlg, HWND hwndTree, HTREEITEM hInsertAfter, BOOL bAddClass ) +void CDlgFuncList::SetTreeJava( HWND hwndDlg, HTREEITEM hInsertAfter, BOOL bAddClass ) { int i; const CFuncInfo* pcFuncInfo; + HWND hwndTree; int bSelected; CLayoutInt nFuncLineOld; CLayoutInt nFuncColOld; @@ -916,6 +920,8 @@ void CDlgFuncList::SetTreeJava( HWND hwndDlg, HWND hwndTree, HTREEITEM hInsertAf m_vecDummylParams.clear(); int nlParamCount = 0; + hwndTree = GetItemHwnd( IDC_TREE_FL ); + m_cmemClipText.SetString( L"" ); { const int nBuffLenTag = 13 + wcslen(m_pcFuncInfoArr->m_szFilePath); @@ -1377,8 +1383,10 @@ void CDlgFuncList::SetListVB (void) @date 2014.06.06 Moca 他ファイルへのタグジャンプ機能を追加 @date 2020.09.12 選択処理をGetFuncInfoIndex,SetItemSelectionへ移動 */ -void CDlgFuncList::SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump, bool nolabel) +void CDlgFuncList::SetTree(HTREEITEM hInsertAfter, bool tagjump, bool nolabel) { + HWND hwndTree = GetItemHwnd( IDC_TREE_FL ); + int i; int nFuncInfoArrNum = m_pcFuncInfoArr->GetNum(); int nStackPointer = 0; @@ -1405,7 +1413,6 @@ void CDlgFuncList::SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump, m_cmemClipText.AllocStringBuffer( nBuffLen + nBuffLenTag * nCount ); } - ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); for (i = 0; i < nFuncInfoArrNum; i++){ CFuncInfo* pcFuncInfo = m_pcFuncInfoArr->GetAt(i); @@ -1486,7 +1493,7 @@ void CDlgFuncList::SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump, } end_of_func:; - ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)TRUE, 0); + ::EnableWindow( GetItemHwnd( IDC_BUTTON_COPY ), TRUE ); free( phParentStack ); @@ -2338,7 +2345,10 @@ BOOL CDlgFuncList::OnCbnSelEndOk( HWND hwndCtl, int wID ) type->m_nOutlineSortType = m_nSortType; SetTypeConfig( CTypeConfig(m_nDocType), *type ); delete type; - SortTree(GetItemHwnd(IDC_TREE_FL),TVI_ROOT); + HWND hWndTree = GetItemHwnd(IDC_TREE_FL); + ::SendMessageAny(hWndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); + SortTree(hWndTree,TVI_ROOT); + ::SendMessageAny(hWndTree, WM_SETREDRAW, (WPARAM)TRUE, 0); } return TRUE; } @@ -2400,9 +2410,7 @@ void CDlgFuncList::SortTree(HWND hWndTree,HTREEITEM htiParent) size = m_nTreeItemCount; } data.m_vecText.resize(size); - ::SendMessageAny(hWndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); SortTree_Sub(hWndTree, htiParent, data, m_nSortType); - ::SendMessageAny(hWndTree, WM_SETREDRAW, (WPARAM)TRUE, 0); } bool CDlgFuncList::TagJumpTimer( const WCHAR* pFile, CMyPoint point, bool bCheckAutoClose ) diff --git a/sakura_core/outline/CDlgFuncList.h b/sakura_core/outline/CDlgFuncList.h index c4e8a4e6ce..057eda54e9 100644 --- a/sakura_core/outline/CDlgFuncList.h +++ b/sakura_core/outline/CDlgFuncList.h @@ -137,8 +137,8 @@ class CDlgFuncList final : public CDialog || 実装ヘルパ関数 */ BOOL OnJump( bool bCheckAutoClose = true, bool bFileJump = true ); // bCheckAutoClose:「このダイアログを自動的に閉じる」をチェックするかどうか - void SetTreeJava(HWND hwndDlg, HWND hwndTree, HTREEITEM hInsertAfter, BOOL bAddClass); /* ツリーコントロールの初期化:Javaメソッドツリー */ - void SetTree(HWND hwndTree, HTREEITEM hInsertAfter, bool tagjump = false, bool nolabel = false); /* ツリーコントロールの初期化:汎用品 */ + void SetTreeJava(HWND hwndDlg, HTREEITEM hInsertAfter, BOOL bAddClass); /* ツリーコントロールの初期化:Javaメソッドツリー */ + void SetTree(HTREEITEM hInsertAfter, bool tagjump = false, bool nolabel = false); /* ツリーコントロールの初期化:汎用品 */ void SetTreeFile(); // ツリーコントロールの初期化:ファイルツリー void SetListVB( void ); /* リストビューコントロールの初期化:VisualBasic */ // Jul 10, 2003 little YOSHI void SetDocLineFuncList(); From bf7f72c399d2eed6e359a83ed17b87debabde262 Mon Sep 17 00:00:00 2001 From: katsuhisa yuasa Date: Sat, 1 May 2021 17:22:51 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E5=8F=A4=E3=81=84=E3=82=B3=E3=83=A1?= =?UTF-8?q?=E3=83=B3=E3=83=88=E3=81=AE=E5=89=8A=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sakura_core/outline/CDlgFuncList.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/sakura_core/outline/CDlgFuncList.cpp b/sakura_core/outline/CDlgFuncList.cpp index b2354a24d2..d7a7dfeb3a 100644 --- a/sakura_core/outline/CDlgFuncList.cpp +++ b/sakura_core/outline/CDlgFuncList.cpp @@ -425,7 +425,6 @@ void CDlgFuncList::SetData() m_bDummyLParamMode = false; m_vecDummylParams.clear(); - //2002.02.08 hor 隠しといてアイテム削除→あとで表示 ::SendMessage(hwndList, WM_SETREDRAW, (WPARAM)FALSE, 0); ::SendMessage(hwndTree, WM_SETREDRAW, (WPARAM)FALSE, 0); ListView_DeleteAllItems( hwndList );