@@ -951,15 +951,7 @@ namespace WTL
951
951
bool boolNotify = newDefaultPane != this ->defaultFocusPane ;
952
952
953
953
if ( boolNotify )
954
- {
955
- // if defaultFocusPane is not a window
956
- // then defaultFocusPane has been split
957
- // pane0 is used as new previousFocusPane
958
- if ( this ->defaultFocusPane ->pane0 )
959
- this ->previousFocusPane = this ->defaultFocusPane ->pane0 ;
960
- else
961
- this ->previousFocusPane = this ->defaultFocusPane ;
962
- }
954
+ this ->previousFocusPane = this ->defaultFocusPane ;
963
955
964
956
this ->defaultFocusPane = newDefaultPane;
965
957
if ( bAppActive && newDefaultPane && ::IsWindow (newDefaultPane->window ) )
@@ -994,6 +986,44 @@ namespace WTL
994
986
return false ;
995
987
}
996
988
989
+ bool Split (HWND windowPane1, CMultiSplitPane::SPLITTYPE splitType)
990
+ {
991
+ if ( this ->defaultFocusPane == nullptr )
992
+ return false ;
993
+
994
+ CMultiSplitPane* pane1 = this ->defaultFocusPane ->split (
995
+ windowPane1,
996
+ splitType);
997
+
998
+ if ( pane1 == nullptr )
999
+ return false ;
1000
+
1001
+ // defaultFocusPane has been split
1002
+ // pane0 must be used as new previousFocusPane
1003
+ this ->defaultFocusPane = this ->defaultFocusPane ->pane0 ;
1004
+ this ->SetDefaultFocusPane (pane1);
1005
+
1006
+ return true ;
1007
+ }
1008
+
1009
+ bool Remove ()
1010
+ {
1011
+ #ifdef _DEBUG
1012
+ ATLTRACE (L" %p-TabView::CloseView tree\n " , ::GetCurrentThreadId ());
1013
+ this ->tree .dump (0 , 0 );
1014
+ ATLTRACE (L" %p-TabView::CloseView defaultFocusPane\n " , ::GetCurrentThreadId ());
1015
+ if ( this ->defaultFocusPane )
1016
+ this ->defaultFocusPane ->dump (0 , this ->defaultFocusPane ->parent );
1017
+ #endif
1018
+
1019
+ if ( this ->defaultFocusPane )
1020
+ this ->SetDefaultFocusPane (this ->defaultFocusPane ->remove ());
1021
+ else
1022
+ return false ;
1023
+
1024
+ return true ;
1025
+ }
1026
+
997
1027
virtual void OnPaneChanged (void )
998
1028
{
999
1029
}
0 commit comments