PageTabWindow.cpp
上传用户:sesekoo
上传日期:2020-07-18
资源大小:21543k
文件大小:55k
源码类别:

界面编程

开发平台:

Visual C++

  1. // PageTabWindow.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #if (!defined __EXT_MFC_NO_TAB_CTRL)
  5. #include "profuis_controls.h"
  6. #include "PageTabWindow.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. CPageTabWindow::demo_items_data_t CPageTabWindow::g_ItemsData[] =
  13. {
  14. { _T("&DevStudio"), true  },
  15. { _T("Help &Index"), true  },
  16. { _T("Help &Search"), false },
  17. { _T("Index &Results"), false },
  18. { _T("&Contents"), false },
  19. { _T("R&eload"), true  },
  20. { _T("&Home"), false },
  21. { _T("&Browser"), false },
  22. { _T("Find Results &1"), true  },
  23. { _T("Find &Symbol Results"), false },
  24. { _T("Find Results &2"), false },
  25. { _T("Find In Files"), false },
  26. { _T("&Favorites"), true  },
  27. { _T("&Add To Favorites"), false },
  28. { _T("F&ull Screen"), true  },
  29. { _T("D&ynamic Help"), true  },
  30. { _T("Resource &View"), true  },
  31. { _T("Solution E&xplorer"), false },
  32. { _T("&Class View"), false },
  33. { _T("&Toolbox"), true  },
  34. { _T("Task &List"), false },
  35. { _T("&Open"), true  },
  36. { _T("Save &All"), false },
  37. };
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CPageTabWindow dialog
  40. /////////////////////////////////////////////////////////////////////////////
  41. CPageTabWindow::CPageTabWindow(CWnd* pParent /*=NULL*/)
  42. : CPageBase(CPageTabWindow::IDD, pParent)
  43. , m_nDemoImageListSize( sizeof( g_ItemsData ) / sizeof( g_ItemsData[0] ) )
  44. , m_nDemoImageListAddIndexInner( 0 )
  45. , m_nDemoImageListAddIndexOuter( 0 )
  46. {
  47. //{{AFX_DATA_INIT(CPageTabWindow)
  48. // NOTE: the ClassWizard will add member initialization here
  49. //}}AFX_DATA_INIT
  50. VERIFY(
  51. m_ImageList.Create(
  52. IDR_TAB_IMAGES,
  53. 16,
  54. 1,
  55. RGB(255,0,255)
  56. )
  57. );
  58. ASSERT( m_ImageList.GetImageCount() >= m_nDemoImageListSize );
  59. }
  60. void CPageTabWindow::DoDataExchange(CDataExchange* pDX)
  61. {
  62. CPageBase::DoDataExchange(pDX);
  63. //{{AFX_DATA_MAP(CPageTabWindow)
  64. DDX_Control(pDX, IDC_CHECK_SHOW_END, m_CheckShowEnd);
  65. DDX_Control(pDX, IDC_CHECK_SHOW_HOME, m_CheckShowHome);
  66. DDX_Control(pDX, IDC_TAB_STYLE_GROUP_BOX, m_wndGroupBoxStyle);
  67. DDX_Control(pDX, IDC_RADIO_STYLE_STANDARD, m_wndRadioStyleStandard);
  68. DDX_Control(pDX, IDC_RADIO_STYLE_ONENOTE, m_wndRadioStyleOneNote);
  69. DDX_Control(pDX, IDC_RADIO_STYLE_WHIDBEY, m_wndRadioStyleWhidbey);
  70. DDX_Control(pDX, IDC_RADIO_STYLE_FLAT, m_wndRadioStyleFlat);
  71. DDX_Control(pDX, IDC_RADIO_STYLE_BUTTONS, m_wndRadioStyleButtons);
  72. DDX_Control(pDX, IDC_CHECK_ITEM_DRAGGING, m_CheckItemDragging);
  73. DDX_Control(pDX, IDC_CHECK_ENABLE_TAB_LIST, m_CheckEnableTabList);
  74. DDX_Control(pDX, IDC_CHECK_SHOW_TAB_LIST, m_CheckShowTabList);
  75. DDX_Control(pDX, IDC_CHECK_FOCUS_ON_HOVER, m_CheckFocusOnHover);
  76. DDX_Control(pDX, IDC_CHECK_FULL_WIDTHS, m_CheckFullRowWidth);
  77. DDX_Control(pDX, IDC_CHECK_CENTER_TEXT, m_CheckCenterText);
  78. DDX_Control(pDX, IDC_CHECK_AUTOHIDE_SCROLL, m_CheckAutoHideScroll);
  79. DDX_Control(pDX, IDC_CHECK_ENABLE_HELP, m_CheckEnableHelp);
  80. DDX_Control(pDX, IDC_CHECK_ENABLE_CLOSE, m_CheckEnableClose);
  81. DDX_Control(pDX, IDC_CHECK_SHOW_HELP, m_CheckShowHelp);
  82. DDX_Control(pDX, IDC_CHECK_BOLD_SELECTION, m_CheckBoldSelection);
  83. DDX_Control(pDX, IDC_CHECK_SHOW_CLOSE, m_CheckShowClose);
  84. DDX_Control(pDX, IDC_CHECK_INVERT_VERT_FONT, m_CheckInvertFont);
  85. DDX_Control(pDX, IDC_CHECK_EQUAL_WIDTHS, m_CheckEqualWidth);
  86. DDX_Control(pDX, IDC_CHECK_SHOW_BORDERS, m_CheckShowBorders);
  87. DDX_Control(pDX, IDC_BUTTON_ADD_TAB_10, m_BtnAdd10);
  88. DDX_Control(pDX, IDC_BUTTON_ADD_TAB_1, m_BtnAdd1);
  89. DDX_Control(pDX, IDC_BUTTON_CLEAR_TABS, m_BtnClear);
  90. //}}AFX_DATA_MAP
  91. DDX_Control( pDX, ID_TABCTRL_OUTER_TOP_BUTTONS, m_wndTabButtonsOuterTop );
  92. DDX_Control( pDX, ID_TABCTRL_OUTER_BOTTOM_BUTTONS, m_wndTabButtonsOuterBottom );
  93. DDX_Control( pDX, ID_TABCTRL_OUTER_LEFT_BUTTONS, m_wndTabButtonsOuterLeft );
  94. DDX_Control( pDX, ID_TABCTRL_OUTER_RIGHT_BUTTONS, m_wndTabButtonsOuterRight );
  95. DDX_Control( pDX, ID_TABCTRL_INNER_TOP_BUTTONS, m_wndTabButtonsInnerTop );
  96. DDX_Control( pDX, ID_TABCTRL_INNER_BOTTOM_BUTTONS, m_wndTabButtonsInnerBottom );
  97. DDX_Control( pDX, ID_TABCTRL_INNER_LEFT_BUTTONS, m_wndTabButtonsInnerLeft );
  98. DDX_Control( pDX, ID_TABCTRL_INNER_RIGHT_BUTTONS, m_wndTabButtonsInnerRight );
  99. DDX_Control( pDX, ID_TABCTRL_OUTER_TOP_FLAT, m_wndTabFlatOuterTop );
  100. DDX_Control( pDX, ID_TABCTRL_OUTER_BOTTOM_FLAT, m_wndTabFlatOuterBottom );
  101. DDX_Control( pDX, ID_TABCTRL_OUTER_LEFT_FLAT, m_wndTabFlatOuterLeft );
  102. DDX_Control( pDX, ID_TABCTRL_OUTER_RIGHT_FLAT, m_wndTabFlatOuterRight );
  103. DDX_Control( pDX, ID_TABCTRL_INNER_TOP_FLAT, m_wndTabFlatInnerTop );
  104. DDX_Control( pDX, ID_TABCTRL_INNER_BOTTOM_FLAT, m_wndTabFlatInnerBottom );
  105. DDX_Control( pDX, ID_TABCTRL_INNER_LEFT_FLAT, m_wndTabFlatInnerLeft );
  106. DDX_Control( pDX, ID_TABCTRL_INNER_RIGHT_FLAT, m_wndTabFlatInnerRight );
  107. DDX_Control( pDX, ID_TABCTRL_OUTER_TOP_WHIDBEY, m_wndTabWhidbeyOuterTop );
  108. DDX_Control( pDX, ID_TABCTRL_OUTER_BOTTOM_WHIDBEY, m_wndTabWhidbeyOuterBottom );
  109. DDX_Control( pDX, ID_TABCTRL_OUTER_LEFT_WHIDBEY, m_wndTabWhidbeyOuterLeft );
  110. DDX_Control( pDX, ID_TABCTRL_OUTER_RIGHT_WHIDBEY, m_wndTabWhidbeyOuterRight );
  111. DDX_Control( pDX, ID_TABCTRL_INNER_TOP_WHIDBEY, m_wndTabWhidbeyInnerTop );
  112. DDX_Control( pDX, ID_TABCTRL_INNER_BOTTOM_WHIDBEY, m_wndTabWhidbeyInnerBottom );
  113. DDX_Control( pDX, ID_TABCTRL_INNER_LEFT_WHIDBEY, m_wndTabWhidbeyInnerLeft );
  114. DDX_Control( pDX, ID_TABCTRL_INNER_RIGHT_WHIDBEY, m_wndTabWhidbeyInnerRight );
  115. DDX_Control( pDX, ID_TABCTRL_OUTER_TOP_ONENOTE, m_wndTabOneNoteOuterTop );
  116. DDX_Control( pDX, ID_TABCTRL_OUTER_BOTTOM_ONENOTE, m_wndTabOneNoteOuterBottom );
  117. DDX_Control( pDX, ID_TABCTRL_OUTER_LEFT_ONENOTE, m_wndTabOneNoteOuterLeft );
  118. DDX_Control( pDX, ID_TABCTRL_OUTER_RIGHT_ONENOTE, m_wndTabOneNoteOuterRight );
  119. DDX_Control( pDX, ID_TABCTRL_INNER_TOP_ONENOTE, m_wndTabOneNoteInnerTop );
  120. DDX_Control( pDX, ID_TABCTRL_INNER_BOTTOM_ONENOTE, m_wndTabOneNoteInnerBottom );
  121. DDX_Control( pDX, ID_TABCTRL_INNER_LEFT_ONENOTE, m_wndTabOneNoteInnerLeft );
  122. DDX_Control( pDX, ID_TABCTRL_INNER_RIGHT_ONENOTE, m_wndTabOneNoteInnerRight );
  123. DDX_Control( pDX, ID_TABCTRL_OUTER_TOP, m_wndTabOuterTop );
  124. DDX_Control( pDX, ID_TABCTRL_OUTER_BOTTOM, m_wndTabOuterBottom );
  125. DDX_Control( pDX, ID_TABCTRL_OUTER_LEFT, m_wndTabOuterLeft );
  126. DDX_Control( pDX, ID_TABCTRL_OUTER_RIGHT, m_wndTabOuterRight );
  127. DDX_Control( pDX, ID_TABCTRL_INNER_TOP, m_wndTabInnerTop );
  128. DDX_Control( pDX, ID_TABCTRL_INNER_BOTTOM, m_wndTabInnerBottom );
  129. DDX_Control( pDX, ID_TABCTRL_INNER_LEFT, m_wndTabInnerLeft );
  130. DDX_Control( pDX, ID_TABCTRL_INNER_RIGHT, m_wndTabInnerRight );
  131. }
  132. BEGIN_MESSAGE_MAP(CPageTabWindow, CPageBase)
  133. //{{AFX_MSG_MAP(CPageTabWindow)
  134. ON_BN_CLICKED(IDC_BUTTON_CLEAR_TABS, OnButtonClearTabs)
  135. ON_BN_CLICKED(IDC_BUTTON_ADD_TAB_1, OnButtonAddTab1)
  136. ON_BN_CLICKED(IDC_BUTTON_ADD_TAB_10, OnButtonAddTab10)
  137. //}}AFX_MSG_MAP
  138. END_MESSAGE_MAP()
  139. /////////////////////////////////////////////////////////////////////////////
  140. // CPageTabWindow message handlers
  141. BOOL CPageTabWindow::OnInitDialog() 
  142. {
  143. if( !CPageBase::OnInitDialog() ){
  144. ASSERT( FALSE );
  145. return FALSE;
  146. }
  147. if( m_ImageList.GetSafeHandle() == NULL ){
  148. ASSERT( FALSE );
  149. return FALSE;
  150. }
  151. AddAnchor( IDC_CHECK_SHOW_BORDERS, CSize( 0,  0) );
  152. AddAnchor( IDC_CHECK_EQUAL_WIDTHS, CSize( 0,  7) );
  153. AddAnchor( IDC_CHECK_FULL_WIDTHS, CSize( 0,  14) );
  154. AddAnchor( IDC_CHECK_CENTER_TEXT, CSize( 0,  21) );
  155. AddAnchor( IDC_CHECK_INVERT_VERT_FONT, CSize( 0,  28) );
  156. AddAnchor( IDC_CHECK_BOLD_SELECTION, CSize( 0,  35) );
  157. AddAnchor( IDC_CHECK_SHOW_CLOSE, CSize( 0,  42) );
  158. AddAnchor( IDC_CHECK_ENABLE_CLOSE, CSize( 0,  42) );
  159. AddAnchor( IDC_CHECK_SHOW_HELP, CSize( 0,  49) );
  160. AddAnchor( IDC_CHECK_ENABLE_HELP, CSize( 0,  49) );
  161. AddAnchor( IDC_CHECK_SHOW_TAB_LIST, CSize( 0,  56) );
  162. AddAnchor( IDC_CHECK_ENABLE_TAB_LIST, CSize( 0,  56) );
  163. AddAnchor( IDC_CHECK_AUTOHIDE_SCROLL, CSize( 0,  63) );
  164. AddAnchor( IDC_CHECK_SHOW_HOME, CSize( 0,  70) );
  165. AddAnchor( IDC_CHECK_SHOW_END, CSize( 0,  77) );
  166. AddAnchor( IDC_CHECK_FOCUS_ON_HOVER, CSize( 0,  84) );
  167. AddAnchor( IDC_CHECK_ITEM_DRAGGING, CSize( 0,  100) );
  168. AddAnchor( IDC_BUTTON_CLEAR_TABS, __RDA_RB );
  169. AddAnchor( IDC_BUTTON_ADD_TAB_1, __RDA_LB );
  170. AddAnchor( IDC_BUTTON_ADD_TAB_10, __RDA_LB );
  171. AddAnchor( IDC_RADIO_STYLE_STANDARD, CSize( 50, 50), CSize( 50, 50) );
  172. AddAnchor( IDC_RADIO_STYLE_ONENOTE, CSize( 50, 50), CSize( 50, 50) );
  173. AddAnchor( IDC_RADIO_STYLE_WHIDBEY, CSize( 50, 50), CSize( 50, 50) );
  174. AddAnchor( IDC_RADIO_STYLE_FLAT, CSize( 50, 50), CSize( 50, 50) );
  175. AddAnchor( IDC_RADIO_STYLE_BUTTONS, CSize( 50, 50), CSize( 50, 50) );
  176. AddAnchor( IDC_TAB_STYLE_GROUP_BOX, CSize( 50, 50), CSize( 50, 50) );
  177. AddAnchor( ID_TABCTRL_OUTER_TOP, __RDA_LT, __RDA_RT );
  178. AddAnchor( ID_TABCTRL_OUTER_BOTTOM, __RDA_LB, __RDA_RB );
  179. AddAnchor( ID_TABCTRL_OUTER_LEFT, __RDA_LT, __RDA_LB );
  180. AddAnchor( ID_TABCTRL_OUTER_RIGHT, __RDA_RT, __RDA_RB );
  181. AddAnchor( ID_TABCTRL_INNER_TOP, __RDA_LT, __RDA_RT );
  182. AddAnchor( ID_TABCTRL_INNER_BOTTOM, __RDA_LB, __RDA_RB );
  183. AddAnchor( ID_TABCTRL_INNER_LEFT, __RDA_LT, __RDA_LB );
  184. AddAnchor( ID_TABCTRL_INNER_RIGHT, __RDA_RT, __RDA_RB );
  185. AddAnchor( ID_TABCTRL_OUTER_TOP_ONENOTE, __RDA_LT, __RDA_RT );
  186. AddAnchor( ID_TABCTRL_OUTER_BOTTOM_ONENOTE, __RDA_LB, __RDA_RB );
  187. AddAnchor( ID_TABCTRL_OUTER_LEFT_ONENOTE, __RDA_LT, __RDA_LB );
  188. AddAnchor( ID_TABCTRL_OUTER_RIGHT_ONENOTE, __RDA_RT, __RDA_RB );
  189. AddAnchor( ID_TABCTRL_INNER_TOP_ONENOTE, __RDA_LT, __RDA_RT );
  190. AddAnchor( ID_TABCTRL_INNER_BOTTOM_ONENOTE, __RDA_LB, __RDA_RB );
  191. AddAnchor( ID_TABCTRL_INNER_LEFT_ONENOTE, __RDA_LT, __RDA_LB );
  192. AddAnchor( ID_TABCTRL_INNER_RIGHT_ONENOTE, __RDA_RT, __RDA_RB );
  193. AddAnchor( ID_TABCTRL_OUTER_TOP_WHIDBEY, __RDA_LT, __RDA_RT );
  194. AddAnchor( ID_TABCTRL_OUTER_BOTTOM_WHIDBEY, __RDA_LB, __RDA_RB );
  195. AddAnchor( ID_TABCTRL_OUTER_LEFT_WHIDBEY, __RDA_LT, __RDA_LB );
  196. AddAnchor( ID_TABCTRL_OUTER_RIGHT_WHIDBEY, __RDA_RT, __RDA_RB );
  197. AddAnchor( ID_TABCTRL_INNER_TOP_WHIDBEY, __RDA_LT, __RDA_RT );
  198. AddAnchor( ID_TABCTRL_INNER_BOTTOM_WHIDBEY, __RDA_LB, __RDA_RB );
  199. AddAnchor( ID_TABCTRL_INNER_LEFT_WHIDBEY, __RDA_LT, __RDA_LB );
  200. AddAnchor( ID_TABCTRL_INNER_RIGHT_WHIDBEY, __RDA_RT, __RDA_RB );
  201. AddAnchor( ID_TABCTRL_OUTER_TOP_FLAT, __RDA_LT, __RDA_RT );
  202. AddAnchor( ID_TABCTRL_OUTER_BOTTOM_FLAT, __RDA_LB, __RDA_RB );
  203. AddAnchor( ID_TABCTRL_OUTER_LEFT_FLAT, __RDA_LT, __RDA_LB );
  204. AddAnchor( ID_TABCTRL_OUTER_RIGHT_FLAT, __RDA_RT, __RDA_RB );
  205. AddAnchor( ID_TABCTRL_INNER_TOP_FLAT, __RDA_LT, __RDA_RT );
  206. AddAnchor( ID_TABCTRL_INNER_BOTTOM_FLAT, __RDA_LB, __RDA_RB );
  207. AddAnchor( ID_TABCTRL_INNER_LEFT_FLAT, __RDA_LT, __RDA_LB );
  208. AddAnchor( ID_TABCTRL_INNER_RIGHT_FLAT, __RDA_RT, __RDA_RB );
  209. AddAnchor( ID_TABCTRL_OUTER_TOP_BUTTONS, __RDA_LT, __RDA_RT );
  210. AddAnchor( ID_TABCTRL_OUTER_BOTTOM_BUTTONS, __RDA_LB, __RDA_RB );
  211. AddAnchor( ID_TABCTRL_OUTER_LEFT_BUTTONS, __RDA_LT, __RDA_LB );
  212. AddAnchor( ID_TABCTRL_OUTER_RIGHT_BUTTONS, __RDA_RT, __RDA_RB );
  213. AddAnchor( ID_TABCTRL_INNER_TOP_BUTTONS, __RDA_LT, __RDA_RT );
  214. AddAnchor( ID_TABCTRL_INNER_BOTTOM_BUTTONS, __RDA_LB, __RDA_RB );
  215. AddAnchor( ID_TABCTRL_INNER_LEFT_BUTTONS, __RDA_LT, __RDA_LB );
  216. AddAnchor( ID_TABCTRL_INNER_RIGHT_BUTTONS, __RDA_RT, __RDA_RB );
  217. m_wndTabButtonsOuterTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP | __ETWS_GROUPED );
  218. m_wndTabButtonsOuterBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM | __ETWS_GROUPED );
  219. m_wndTabButtonsOuterLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT | __ETWS_GROUPED );
  220. m_wndTabButtonsOuterRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT | __ETWS_GROUPED );
  221. m_wndTabButtonsInnerTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP );
  222. m_wndTabButtonsInnerBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM );
  223. m_wndTabButtonsInnerLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT );
  224. m_wndTabButtonsInnerRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT );
  225. m_wndTabFlatOuterTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP | __ETWS_GROUPED );
  226. m_wndTabFlatOuterBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM | __ETWS_GROUPED );
  227. m_wndTabFlatOuterLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT | __ETWS_GROUPED );
  228. m_wndTabFlatOuterRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT | __ETWS_GROUPED );
  229. m_wndTabFlatInnerTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP );
  230. m_wndTabFlatInnerBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM );
  231. m_wndTabFlatInnerLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT );
  232. m_wndTabFlatInnerRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT );
  233. m_wndTabWhidbeyOuterTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP | __ETWS_GROUPED );
  234. m_wndTabWhidbeyOuterBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM | __ETWS_GROUPED );
  235. m_wndTabWhidbeyOuterLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT | __ETWS_GROUPED );
  236. m_wndTabWhidbeyOuterRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT | __ETWS_GROUPED );
  237. m_wndTabWhidbeyInnerTop.ModifyTabWndStyle( 0, __ETWS_HIDE_ICONS | __ETWS_ORIENT_TOP );
  238. m_wndTabWhidbeyInnerBottom.ModifyTabWndStyle( 0, __ETWS_HIDE_ICONS | __ETWS_ORIENT_BOTTOM );
  239. m_wndTabWhidbeyInnerLeft.ModifyTabWndStyle( 0, __ETWS_HIDE_ICONS | __ETWS_ORIENT_LEFT );
  240. m_wndTabWhidbeyInnerRight.ModifyTabWndStyle( 0, __ETWS_HIDE_ICONS | __ETWS_ORIENT_RIGHT );
  241. m_wndTabOneNoteOuterTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP | __ETWS_GROUPED );
  242. m_wndTabOneNoteOuterBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM | __ETWS_GROUPED );
  243. m_wndTabOneNoteOuterLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT | __ETWS_GROUPED );
  244. m_wndTabOneNoteOuterRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT | __ETWS_GROUPED );
  245. m_wndTabOneNoteInnerTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP );
  246. m_wndTabOneNoteInnerBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM );
  247. m_wndTabOneNoteInnerLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT );
  248. m_wndTabOneNoteInnerRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT );
  249. m_wndTabOuterTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP | __ETWS_GROUPED );
  250. m_wndTabOuterBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM | __ETWS_GROUPED );
  251. m_wndTabOuterLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT | __ETWS_GROUPED );
  252. m_wndTabOuterRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT | __ETWS_GROUPED );
  253. m_wndTabInnerTop.ModifyTabWndStyle( 0, __ETWS_ORIENT_TOP );
  254. m_wndTabInnerBottom.ModifyTabWndStyle( 0, __ETWS_ORIENT_BOTTOM );
  255. m_wndTabInnerLeft.ModifyTabWndStyle( 0, __ETWS_ORIENT_LEFT );
  256. m_wndTabInnerRight.ModifyTabWndStyle( 0, __ETWS_ORIENT_RIGHT );
  257. CWnd * pWndChild = GetWindow( GW_CHILD );
  258. for( ; pWndChild != NULL; pWndChild = pWndChild->GetWindow( GW_HWNDNEXT ) )
  259. {
  260. CExtTabWnd * pWndTab = DYNAMIC_DOWNCAST( CExtTabWnd, pWndChild );
  261. if( pWndTab != NULL )
  262. pWndTab->ModifyTabWndStyle( 0, __ETWS_CENTERED_TEXT | __ETWS_BOLD_SELECTION );
  263. } // for( ; pWndChild != NULL; pWndChild = pWndChild->GetWindow( GW_HWNDNEXT ) )
  264. //////////////////////////////////////////////////////////////////////////
  265. ::CheckDlgButton( 
  266. this->GetSafeHwnd(), 
  267. IDC_CHECK_EQUAL_WIDTHS, 
  268. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_EQUAL_WIDTHS
  269. ? BST_CHECKED
  270. : BST_UNCHECKED
  271. );
  272. ::CheckDlgButton( 
  273. this->GetSafeHwnd(), 
  274. IDC_CHECK_FULL_WIDTHS, 
  275. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_FULL_WIDTH
  276. ? BST_CHECKED
  277. : BST_UNCHECKED
  278. );
  279. ::CheckDlgButton( 
  280. this->GetSafeHwnd(), 
  281. IDC_CHECK_CENTER_TEXT, 
  282. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_CENTERED_TEXT
  283. ? BST_CHECKED
  284. : BST_UNCHECKED
  285. );
  286. ::CheckDlgButton( 
  287. this->GetSafeHwnd(), 
  288. IDC_CHECK_INVERT_VERT_FONT, 
  289. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_INVERT_VERT_FONT
  290. ? BST_CHECKED
  291. : BST_UNCHECKED
  292. );
  293. ::CheckDlgButton( 
  294. this->GetSafeHwnd(), 
  295. IDC_CHECK_BOLD_SELECTION, 
  296. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_BOLD_SELECTION
  297. ? BST_CHECKED
  298. : BST_UNCHECKED
  299. );
  300. ::CheckDlgButton( 
  301. this->GetSafeHwnd(), 
  302. IDC_CHECK_SHOW_CLOSE, 
  303. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_CLOSE
  304. ? BST_CHECKED
  305. : BST_UNCHECKED
  306. );
  307. GetDlgItem( IDC_CHECK_ENABLE_CLOSE )->EnableWindow( 
  308. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_CLOSE 
  309. );
  310. ::CheckDlgButton( 
  311. this->GetSafeHwnd(), 
  312. IDC_CHECK_ENABLE_CLOSE, 
  313. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_ENABLED_BTN_CLOSE
  314. ? BST_CHECKED
  315. : BST_UNCHECKED
  316. );
  317. ::CheckDlgButton( 
  318. this->GetSafeHwnd(), 
  319. IDC_CHECK_SHOW_HELP, 
  320. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_HELP
  321. ? BST_CHECKED
  322. : BST_UNCHECKED
  323. );
  324. GetDlgItem( IDC_CHECK_ENABLE_HELP )->EnableWindow( 
  325. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_HELP 
  326. );
  327. ::CheckDlgButton( 
  328. this->GetSafeHwnd(), 
  329. IDC_CHECK_ENABLE_HELP, 
  330. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_ENABLED_BTN_HELP
  331. ? BST_CHECKED
  332. : BST_UNCHECKED
  333. );
  334. ::CheckDlgButton( 
  335. this->GetSafeHwnd(), 
  336. IDC_CHECK_SHOW_TAB_LIST, 
  337. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_TAB_LIST
  338. ? BST_CHECKED
  339. : BST_UNCHECKED
  340. );
  341. GetDlgItem( IDC_CHECK_ENABLE_TAB_LIST )->EnableWindow( 
  342. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_TAB_LIST 
  343. );
  344. ::CheckDlgButton( 
  345. this->GetSafeHwnd(), 
  346. IDC_CHECK_ENABLE_TAB_LIST, 
  347. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_ENABLED_BTN_TAB_LIST
  348. ? BST_CHECKED
  349. : BST_UNCHECKED
  350. );
  351. ::CheckDlgButton( 
  352. this->GetSafeHwnd(), 
  353. IDC_CHECK_AUTOHIDE_SCROLL, 
  354. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_AUTOHIDE_SCROLL
  355. ? BST_CHECKED
  356. : BST_UNCHECKED
  357. );
  358. ::CheckDlgButton( 
  359. this->GetSafeHwnd(), 
  360. IDC_CHECK_FOCUS_ON_HOVER, 
  361. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_HOVER_FOCUS
  362. ? BST_CHECKED
  363. : BST_UNCHECKED
  364. );
  365. ::CheckDlgButton( 
  366. this->GetSafeHwnd(), 
  367. IDC_CHECK_ITEM_DRAGGING, 
  368. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_ITEM_DRAGGING
  369. ? BST_CHECKED
  370. : BST_UNCHECKED
  371. );
  372. ::CheckDlgButton( 
  373. this->GetSafeHwnd(), 
  374. IDC_CHECK_SHOW_HOME, 
  375. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_SCROLL_HOME
  376. ? BST_CHECKED
  377. : BST_UNCHECKED
  378. );
  379. ::CheckDlgButton( 
  380. this->GetSafeHwnd(), 
  381. IDC_CHECK_SHOW_END, 
  382. m_wndTabOuterTop.GetTabWndStyle() & __ETWS_SHOW_BTN_SCROLL_END
  383. ? BST_CHECKED
  384. : BST_UNCHECKED
  385. );
  386. m_wndTabButtonsOuterTop.ShowWindow( SW_HIDE );
  387. m_wndTabButtonsOuterBottom.ShowWindow( SW_HIDE );
  388. m_wndTabButtonsOuterLeft.ShowWindow( SW_HIDE );
  389. m_wndTabButtonsOuterRight.ShowWindow( SW_HIDE );
  390. m_wndTabButtonsInnerTop.ShowWindow( SW_HIDE );
  391. m_wndTabButtonsInnerBottom.ShowWindow( SW_HIDE );
  392. m_wndTabButtonsInnerLeft.ShowWindow( SW_HIDE );
  393. m_wndTabButtonsInnerRight.ShowWindow( SW_HIDE );
  394. m_wndTabFlatOuterTop.ShowWindow( SW_HIDE );
  395. m_wndTabFlatOuterBottom.ShowWindow( SW_HIDE );
  396. m_wndTabFlatOuterLeft.ShowWindow( SW_HIDE );
  397. m_wndTabFlatOuterRight.ShowWindow( SW_HIDE );
  398. m_wndTabFlatInnerTop.ShowWindow( SW_HIDE );
  399. m_wndTabFlatInnerBottom.ShowWindow( SW_HIDE );
  400. m_wndTabFlatInnerLeft.ShowWindow( SW_HIDE );
  401. m_wndTabFlatInnerRight.ShowWindow( SW_HIDE );
  402. m_wndTabWhidbeyOuterTop.ShowWindow( SW_HIDE );
  403. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_HIDE );
  404. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_HIDE );
  405. m_wndTabWhidbeyOuterRight.ShowWindow( SW_HIDE );
  406. m_wndTabWhidbeyInnerTop.ShowWindow( SW_HIDE );
  407. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_HIDE );
  408. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_HIDE );
  409. m_wndTabWhidbeyInnerRight.ShowWindow( SW_HIDE );
  410. m_wndTabOneNoteOuterTop.ShowWindow( SW_HIDE );
  411. m_wndTabOneNoteOuterBottom.ShowWindow( SW_HIDE );
  412. m_wndTabOneNoteOuterLeft.ShowWindow( SW_HIDE );
  413. m_wndTabOneNoteOuterRight.ShowWindow( SW_HIDE );
  414. m_wndTabOneNoteInnerTop.ShowWindow( SW_HIDE );
  415. m_wndTabOneNoteInnerBottom.ShowWindow( SW_HIDE );
  416. m_wndTabOneNoteInnerLeft.ShowWindow( SW_HIDE );
  417. m_wndTabOneNoteInnerRight.ShowWindow( SW_HIDE );
  418. m_wndRadioStyleStandard.SetCheck( BST_CHECKED );
  419. OnButtonAddTab10();
  420. return TRUE;  // return TRUE unless you set the focus to a control
  421.               // EXCEPTION: OCX Property Pages should return FALSE
  422. }
  423. //////////////////////////////////////////////////////////////////////////
  424. BOOL CPageTabWindow::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
  425. {
  426. if( nCode == CN_COMMAND )
  427. {
  428. DWORD dwTabWndStyleRemove = 0;
  429. DWORD dwTabWndStyleAdd = 0;
  430. switch( nID )
  431. {
  432. case IDC_RADIO_STYLE_STANDARD:
  433. m_wndTabButtonsOuterTop.ShowWindow( SW_HIDE );
  434. m_wndTabButtonsOuterBottom.ShowWindow( SW_HIDE );
  435. m_wndTabButtonsOuterLeft.ShowWindow( SW_HIDE );
  436. m_wndTabButtonsOuterRight.ShowWindow( SW_HIDE );
  437. m_wndTabButtonsInnerTop.ShowWindow( SW_HIDE );
  438. m_wndTabButtonsInnerBottom.ShowWindow( SW_HIDE );
  439. m_wndTabButtonsInnerLeft.ShowWindow( SW_HIDE );
  440. m_wndTabButtonsInnerRight.ShowWindow( SW_HIDE );
  441. m_wndTabFlatOuterTop.ShowWindow( SW_HIDE );
  442. m_wndTabFlatOuterBottom.ShowWindow( SW_HIDE );
  443. m_wndTabFlatOuterLeft.ShowWindow( SW_HIDE );
  444. m_wndTabFlatOuterRight.ShowWindow( SW_HIDE );
  445. m_wndTabFlatInnerTop.ShowWindow( SW_HIDE );
  446. m_wndTabFlatInnerBottom.ShowWindow( SW_HIDE );
  447. m_wndTabFlatInnerLeft.ShowWindow( SW_HIDE );
  448. m_wndTabFlatInnerRight.ShowWindow( SW_HIDE );
  449. m_wndTabWhidbeyOuterTop.ShowWindow( SW_HIDE );
  450. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_HIDE );
  451. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_HIDE );
  452. m_wndTabWhidbeyOuterRight.ShowWindow( SW_HIDE );
  453. m_wndTabWhidbeyInnerTop.ShowWindow( SW_HIDE );
  454. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_HIDE );
  455. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_HIDE );
  456. m_wndTabWhidbeyInnerRight.ShowWindow( SW_HIDE );
  457. m_wndTabOneNoteOuterTop.ShowWindow( SW_HIDE );
  458. m_wndTabOneNoteOuterBottom.ShowWindow( SW_HIDE );
  459. m_wndTabOneNoteOuterLeft.ShowWindow( SW_HIDE );
  460. m_wndTabOneNoteOuterRight.ShowWindow( SW_HIDE );
  461. m_wndTabOneNoteInnerTop.ShowWindow( SW_HIDE );
  462. m_wndTabOneNoteInnerBottom.ShowWindow( SW_HIDE );
  463. m_wndTabOneNoteInnerLeft.ShowWindow( SW_HIDE );
  464. m_wndTabOneNoteInnerRight.ShowWindow( SW_HIDE );
  465. m_wndTabOuterTop.ShowWindow( SW_SHOW );
  466. m_wndTabOuterBottom.ShowWindow( SW_SHOW );
  467. m_wndTabOuterLeft.ShowWindow( SW_SHOW );
  468. m_wndTabOuterRight.ShowWindow( SW_SHOW );
  469. m_wndTabInnerTop.ShowWindow( SW_SHOW );
  470. m_wndTabInnerBottom.ShowWindow( SW_SHOW );
  471. m_wndTabInnerLeft.ShowWindow( SW_SHOW );
  472. m_wndTabInnerRight.ShowWindow( SW_SHOW );
  473. return TRUE;
  474. case IDC_RADIO_STYLE_ONENOTE:
  475. m_wndTabButtonsOuterTop.ShowWindow( SW_HIDE );
  476. m_wndTabButtonsOuterBottom.ShowWindow( SW_HIDE );
  477. m_wndTabButtonsOuterLeft.ShowWindow( SW_HIDE );
  478. m_wndTabButtonsOuterRight.ShowWindow( SW_HIDE );
  479. m_wndTabButtonsInnerTop.ShowWindow( SW_HIDE );
  480. m_wndTabButtonsInnerBottom.ShowWindow( SW_HIDE );
  481. m_wndTabButtonsInnerLeft.ShowWindow( SW_HIDE );
  482. m_wndTabButtonsInnerRight.ShowWindow( SW_HIDE );
  483. m_wndTabFlatOuterTop.ShowWindow( SW_HIDE );
  484. m_wndTabFlatOuterBottom.ShowWindow( SW_HIDE );
  485. m_wndTabFlatOuterLeft.ShowWindow( SW_HIDE );
  486. m_wndTabFlatOuterRight.ShowWindow( SW_HIDE );
  487. m_wndTabFlatInnerTop.ShowWindow( SW_HIDE );
  488. m_wndTabFlatInnerBottom.ShowWindow( SW_HIDE );
  489. m_wndTabFlatInnerLeft.ShowWindow( SW_HIDE );
  490. m_wndTabFlatInnerRight.ShowWindow( SW_HIDE );
  491. m_wndTabWhidbeyOuterTop.ShowWindow( SW_HIDE );
  492. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_HIDE );
  493. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_HIDE );
  494. m_wndTabWhidbeyOuterRight.ShowWindow( SW_HIDE );
  495. m_wndTabWhidbeyInnerTop.ShowWindow( SW_HIDE );
  496. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_HIDE );
  497. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_HIDE );
  498. m_wndTabWhidbeyInnerRight.ShowWindow( SW_HIDE );
  499. m_wndTabOuterTop.ShowWindow( SW_HIDE );
  500. m_wndTabOuterBottom.ShowWindow( SW_HIDE );
  501. m_wndTabOuterLeft.ShowWindow( SW_HIDE );
  502. m_wndTabOuterRight.ShowWindow( SW_HIDE );
  503. m_wndTabInnerTop.ShowWindow( SW_HIDE );
  504. m_wndTabInnerBottom.ShowWindow( SW_HIDE );
  505. m_wndTabInnerLeft.ShowWindow( SW_HIDE );
  506. m_wndTabInnerRight.ShowWindow( SW_HIDE );
  507. m_wndTabOneNoteOuterTop.ShowWindow( SW_SHOW );
  508. m_wndTabOneNoteOuterBottom.ShowWindow( SW_SHOW );
  509. m_wndTabOneNoteOuterLeft.ShowWindow( SW_SHOW );
  510. m_wndTabOneNoteOuterRight.ShowWindow( SW_SHOW );
  511. m_wndTabOneNoteInnerTop.ShowWindow( SW_SHOW );
  512. m_wndTabOneNoteInnerBottom.ShowWindow( SW_SHOW );
  513. m_wndTabOneNoteInnerLeft.ShowWindow( SW_SHOW );
  514. m_wndTabOneNoteInnerRight.ShowWindow( SW_SHOW );
  515. return TRUE;
  516. case IDC_RADIO_STYLE_WHIDBEY:
  517. m_wndTabButtonsOuterTop.ShowWindow( SW_HIDE );
  518. m_wndTabButtonsOuterBottom.ShowWindow( SW_HIDE );
  519. m_wndTabButtonsOuterLeft.ShowWindow( SW_HIDE );
  520. m_wndTabButtonsOuterRight.ShowWindow( SW_HIDE );
  521. m_wndTabButtonsInnerTop.ShowWindow( SW_HIDE );
  522. m_wndTabButtonsInnerBottom.ShowWindow( SW_HIDE );
  523. m_wndTabButtonsInnerLeft.ShowWindow( SW_HIDE );
  524. m_wndTabButtonsInnerRight.ShowWindow( SW_HIDE );
  525. m_wndTabFlatOuterTop.ShowWindow( SW_HIDE );
  526. m_wndTabFlatOuterBottom.ShowWindow( SW_HIDE );
  527. m_wndTabFlatOuterLeft.ShowWindow( SW_HIDE );
  528. m_wndTabFlatOuterRight.ShowWindow( SW_HIDE );
  529. m_wndTabFlatInnerTop.ShowWindow( SW_HIDE );
  530. m_wndTabFlatInnerBottom.ShowWindow( SW_HIDE );
  531. m_wndTabFlatInnerLeft.ShowWindow( SW_HIDE );
  532. m_wndTabFlatInnerRight.ShowWindow( SW_HIDE );
  533. m_wndTabOuterTop.ShowWindow( SW_HIDE );
  534. m_wndTabOuterBottom.ShowWindow( SW_HIDE );
  535. m_wndTabOuterLeft.ShowWindow( SW_HIDE );
  536. m_wndTabOuterRight.ShowWindow( SW_HIDE );
  537. m_wndTabInnerTop.ShowWindow( SW_HIDE );
  538. m_wndTabInnerBottom.ShowWindow( SW_HIDE );
  539. m_wndTabInnerLeft.ShowWindow( SW_HIDE );
  540. m_wndTabInnerRight.ShowWindow( SW_HIDE );
  541. m_wndTabOneNoteOuterTop.ShowWindow( SW_HIDE );
  542. m_wndTabOneNoteOuterBottom.ShowWindow( SW_HIDE );
  543. m_wndTabOneNoteOuterLeft.ShowWindow( SW_HIDE );
  544. m_wndTabOneNoteOuterRight.ShowWindow( SW_HIDE );
  545. m_wndTabOneNoteInnerTop.ShowWindow( SW_HIDE );
  546. m_wndTabOneNoteInnerBottom.ShowWindow( SW_HIDE );
  547. m_wndTabOneNoteInnerLeft.ShowWindow( SW_HIDE );
  548. m_wndTabOneNoteInnerRight.ShowWindow( SW_HIDE );
  549. m_wndTabWhidbeyOuterTop.ShowWindow( SW_SHOW );
  550. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_SHOW );
  551. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_SHOW );
  552. m_wndTabWhidbeyOuterRight.ShowWindow( SW_SHOW );
  553. m_wndTabWhidbeyInnerTop.ShowWindow( SW_SHOW );
  554. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_SHOW );
  555. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_SHOW );
  556. m_wndTabWhidbeyInnerRight.ShowWindow( SW_SHOW );
  557. return TRUE;
  558. case IDC_RADIO_STYLE_FLAT:
  559. m_wndTabButtonsOuterTop.ShowWindow( SW_HIDE );
  560. m_wndTabButtonsOuterBottom.ShowWindow( SW_HIDE );
  561. m_wndTabButtonsOuterLeft.ShowWindow( SW_HIDE );
  562. m_wndTabButtonsOuterRight.ShowWindow( SW_HIDE );
  563. m_wndTabButtonsInnerTop.ShowWindow( SW_HIDE );
  564. m_wndTabButtonsInnerBottom.ShowWindow( SW_HIDE );
  565. m_wndTabButtonsInnerLeft.ShowWindow( SW_HIDE );
  566. m_wndTabButtonsInnerRight.ShowWindow( SW_HIDE );
  567. m_wndTabWhidbeyOuterTop.ShowWindow( SW_HIDE );
  568. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_HIDE );
  569. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_HIDE );
  570. m_wndTabWhidbeyOuterRight.ShowWindow( SW_HIDE );
  571. m_wndTabWhidbeyInnerTop.ShowWindow( SW_HIDE );
  572. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_HIDE );
  573. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_HIDE );
  574. m_wndTabWhidbeyInnerRight.ShowWindow( SW_HIDE );
  575. m_wndTabOuterTop.ShowWindow( SW_HIDE );
  576. m_wndTabOuterBottom.ShowWindow( SW_HIDE );
  577. m_wndTabOuterLeft.ShowWindow( SW_HIDE );
  578. m_wndTabOuterRight.ShowWindow( SW_HIDE );
  579. m_wndTabInnerTop.ShowWindow( SW_HIDE );
  580. m_wndTabInnerBottom.ShowWindow( SW_HIDE );
  581. m_wndTabInnerLeft.ShowWindow( SW_HIDE );
  582. m_wndTabInnerRight.ShowWindow( SW_HIDE );
  583. m_wndTabOneNoteOuterTop.ShowWindow( SW_HIDE );
  584. m_wndTabOneNoteOuterBottom.ShowWindow( SW_HIDE );
  585. m_wndTabOneNoteOuterLeft.ShowWindow( SW_HIDE );
  586. m_wndTabOneNoteOuterRight.ShowWindow( SW_HIDE );
  587. m_wndTabOneNoteInnerTop.ShowWindow( SW_HIDE );
  588. m_wndTabOneNoteInnerBottom.ShowWindow( SW_HIDE );
  589. m_wndTabOneNoteInnerLeft.ShowWindow( SW_HIDE );
  590. m_wndTabOneNoteInnerRight.ShowWindow( SW_HIDE );
  591. m_wndTabFlatOuterTop.ShowWindow( SW_SHOW );
  592. m_wndTabFlatOuterBottom.ShowWindow( SW_SHOW );
  593. m_wndTabFlatOuterLeft.ShowWindow( SW_SHOW );
  594. m_wndTabFlatOuterRight.ShowWindow( SW_SHOW );
  595. m_wndTabFlatInnerTop.ShowWindow( SW_SHOW );
  596. m_wndTabFlatInnerBottom.ShowWindow( SW_SHOW );
  597. m_wndTabFlatInnerLeft.ShowWindow( SW_SHOW );
  598. m_wndTabFlatInnerRight.ShowWindow( SW_SHOW );
  599. return TRUE;
  600. case IDC_RADIO_STYLE_BUTTONS:
  601. m_wndTabFlatOuterTop.ShowWindow( SW_HIDE );
  602. m_wndTabFlatOuterBottom.ShowWindow( SW_HIDE );
  603. m_wndTabFlatOuterLeft.ShowWindow( SW_HIDE );
  604. m_wndTabFlatOuterRight.ShowWindow( SW_HIDE );
  605. m_wndTabFlatInnerTop.ShowWindow( SW_HIDE );
  606. m_wndTabFlatInnerBottom.ShowWindow( SW_HIDE );
  607. m_wndTabFlatInnerLeft.ShowWindow( SW_HIDE );
  608. m_wndTabFlatInnerRight.ShowWindow( SW_HIDE );
  609. m_wndTabWhidbeyOuterTop.ShowWindow( SW_HIDE );
  610. m_wndTabWhidbeyOuterBottom.ShowWindow( SW_HIDE );
  611. m_wndTabWhidbeyOuterLeft.ShowWindow( SW_HIDE );
  612. m_wndTabWhidbeyOuterRight.ShowWindow( SW_HIDE );
  613. m_wndTabWhidbeyInnerTop.ShowWindow( SW_HIDE );
  614. m_wndTabWhidbeyInnerBottom.ShowWindow( SW_HIDE );
  615. m_wndTabWhidbeyInnerLeft.ShowWindow( SW_HIDE );
  616. m_wndTabWhidbeyInnerRight.ShowWindow( SW_HIDE );
  617. m_wndTabOuterTop.ShowWindow( SW_HIDE );
  618. m_wndTabOuterBottom.ShowWindow( SW_HIDE );
  619. m_wndTabOuterLeft.ShowWindow( SW_HIDE );
  620. m_wndTabOuterRight.ShowWindow( SW_HIDE );
  621. m_wndTabInnerTop.ShowWindow( SW_HIDE );
  622. m_wndTabInnerBottom.ShowWindow( SW_HIDE );
  623. m_wndTabInnerLeft.ShowWindow( SW_HIDE );
  624. m_wndTabInnerRight.ShowWindow( SW_HIDE );
  625. m_wndTabOneNoteOuterTop.ShowWindow( SW_HIDE );
  626. m_wndTabOneNoteOuterBottom.ShowWindow( SW_HIDE );
  627. m_wndTabOneNoteOuterLeft.ShowWindow( SW_HIDE );
  628. m_wndTabOneNoteOuterRight.ShowWindow( SW_HIDE );
  629. m_wndTabOneNoteInnerTop.ShowWindow( SW_HIDE );
  630. m_wndTabOneNoteInnerBottom.ShowWindow( SW_HIDE );
  631. m_wndTabOneNoteInnerLeft.ShowWindow( SW_HIDE );
  632. m_wndTabOneNoteInnerRight.ShowWindow( SW_HIDE );
  633. m_wndTabButtonsOuterTop.ShowWindow( SW_SHOW );
  634. m_wndTabButtonsOuterBottom.ShowWindow( SW_SHOW );
  635. m_wndTabButtonsOuterLeft.ShowWindow( SW_SHOW );
  636. m_wndTabButtonsOuterRight.ShowWindow( SW_SHOW );
  637. m_wndTabButtonsInnerTop.ShowWindow( SW_SHOW );
  638. m_wndTabButtonsInnerBottom.ShowWindow( SW_SHOW );
  639. m_wndTabButtonsInnerLeft.ShowWindow( SW_SHOW );
  640. m_wndTabButtonsInnerRight.ShowWindow( SW_SHOW );
  641. return TRUE;
  642. case IDC_CHECK_SHOW_BORDERS:
  643. {
  644. DWORD dwAddExBorderStyles = WS_EX_STATICEDGE;
  645. DWORD dwRemoveExBorderStyles = WS_EX_STATICEDGE;
  646. if( m_CheckShowBorders.GetCheck() )
  647. dwRemoveExBorderStyles = 0;
  648. else
  649. dwAddExBorderStyles = 0;
  650. m_wndTabOuterTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  651. m_wndTabOuterBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  652. m_wndTabOuterLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  653. m_wndTabOuterRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  654. m_wndTabInnerTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  655. m_wndTabInnerBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  656. m_wndTabInnerLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  657. m_wndTabInnerRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  658. m_wndTabOneNoteOuterTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  659. m_wndTabOneNoteOuterBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  660. m_wndTabOneNoteOuterLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  661. m_wndTabOneNoteOuterRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  662. m_wndTabOneNoteInnerTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  663. m_wndTabOneNoteInnerBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  664. m_wndTabOneNoteInnerLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  665. m_wndTabOneNoteInnerRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  666. m_wndTabWhidbeyOuterTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  667. m_wndTabWhidbeyOuterBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  668. m_wndTabWhidbeyOuterLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  669. m_wndTabWhidbeyOuterRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  670. m_wndTabWhidbeyInnerTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  671. m_wndTabWhidbeyInnerBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  672. m_wndTabWhidbeyInnerLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  673. m_wndTabWhidbeyInnerRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  674. m_wndTabFlatOuterTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  675. m_wndTabFlatOuterBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  676. m_wndTabFlatOuterLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  677. m_wndTabFlatOuterRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  678. m_wndTabFlatInnerTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  679. m_wndTabFlatInnerBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  680. m_wndTabFlatInnerLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  681. m_wndTabFlatInnerRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  682. m_wndTabButtonsOuterTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  683. m_wndTabButtonsOuterBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  684. m_wndTabButtonsOuterLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  685. m_wndTabButtonsOuterRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  686. m_wndTabButtonsInnerTop.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  687. m_wndTabButtonsInnerBottom.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  688. m_wndTabButtonsInnerLeft.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  689. m_wndTabButtonsInnerRight.ModifyStyleEx( dwRemoveExBorderStyles, dwAddExBorderStyles );
  690. UINT nSetWindowPosFlags =
  691. SWP_NOMOVE|SWP_NOSIZE
  692. |SWP_NOZORDER|SWP_NOOWNERZORDER
  693. |SWP_NOACTIVATE
  694. |SWP_FRAMECHANGED
  695. ;
  696. m_wndTabOuterTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  697. m_wndTabOuterBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  698. m_wndTabOuterLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  699. m_wndTabOuterRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  700. m_wndTabInnerTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  701. m_wndTabInnerBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  702. m_wndTabInnerLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  703. m_wndTabInnerRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  704. m_wndTabOneNoteOuterTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  705. m_wndTabOneNoteOuterBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  706. m_wndTabOneNoteOuterLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  707. m_wndTabOneNoteOuterRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  708. m_wndTabOneNoteInnerTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  709. m_wndTabOneNoteInnerBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  710. m_wndTabOneNoteInnerLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  711. m_wndTabOneNoteInnerRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  712. m_wndTabWhidbeyOuterTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  713. m_wndTabWhidbeyOuterBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  714. m_wndTabWhidbeyOuterLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  715. m_wndTabWhidbeyOuterRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  716. m_wndTabWhidbeyInnerTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  717. m_wndTabWhidbeyInnerBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  718. m_wndTabWhidbeyInnerLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  719. m_wndTabWhidbeyInnerRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  720. m_wndTabFlatOuterTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  721. m_wndTabFlatOuterBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  722. m_wndTabFlatOuterLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  723. m_wndTabFlatOuterRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  724. m_wndTabFlatInnerTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  725. m_wndTabFlatInnerBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  726. m_wndTabFlatInnerLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  727. m_wndTabFlatInnerRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  728. m_wndTabButtonsOuterTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  729. m_wndTabButtonsOuterBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  730. m_wndTabButtonsOuterLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  731. m_wndTabButtonsOuterRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  732. m_wndTabButtonsInnerTop.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  733. m_wndTabButtonsInnerBottom.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  734. m_wndTabButtonsInnerLeft.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  735. m_wndTabButtonsInnerRight.SetWindowPos(NULL,0,0,0,0,nSetWindowPosFlags);
  736. }
  737. break;
  738. case IDC_CHECK_EQUAL_WIDTHS:
  739. m_CheckEqualWidth.GetCheck() != 0 
  740. ? dwTabWndStyleAdd = __ETWS_EQUAL_WIDTHS
  741. : dwTabWndStyleRemove = __ETWS_EQUAL_WIDTHS;
  742. break;
  743. case IDC_CHECK_FULL_WIDTHS:
  744. m_CheckFullRowWidth.GetCheck() != 0 
  745. ? dwTabWndStyleAdd = __ETWS_FULL_WIDTH
  746. : dwTabWndStyleRemove = __ETWS_FULL_WIDTH;
  747. break;
  748. case IDC_CHECK_CENTER_TEXT:
  749. m_CheckCenterText.GetCheck() != 0 
  750. ? dwTabWndStyleAdd = __ETWS_CENTERED_TEXT
  751. : dwTabWndStyleRemove = __ETWS_CENTERED_TEXT;
  752. break;
  753. case IDC_CHECK_INVERT_VERT_FONT:
  754. m_CheckInvertFont.GetCheck() != 0 
  755. ? dwTabWndStyleAdd = __ETWS_INVERT_VERT_FONT
  756. : dwTabWndStyleRemove = __ETWS_INVERT_VERT_FONT;
  757. break;
  758. case IDC_CHECK_BOLD_SELECTION:
  759. m_CheckBoldSelection.GetCheck() != 0 
  760. ? dwTabWndStyleAdd = __ETWS_BOLD_SELECTION
  761. : dwTabWndStyleRemove = __ETWS_BOLD_SELECTION;
  762. break;
  763. case IDC_CHECK_SHOW_CLOSE:
  764. m_CheckShowClose.GetCheck() != 0 
  765. ? dwTabWndStyleAdd = __ETWS_SHOW_BTN_CLOSE
  766. : dwTabWndStyleRemove = __ETWS_SHOW_BTN_CLOSE;
  767. GetDlgItem( IDC_CHECK_ENABLE_CLOSE )->EnableWindow( IsDlgButtonChecked( nID ) );
  768. break;
  769. case IDC_CHECK_ENABLE_CLOSE:
  770. m_CheckEnableClose.GetCheck() != 0 
  771. ? dwTabWndStyleAdd = __ETWS_ENABLED_BTN_CLOSE
  772. : dwTabWndStyleRemove = __ETWS_ENABLED_BTN_CLOSE;
  773. break;
  774. case IDC_CHECK_SHOW_HELP:
  775. m_CheckShowHelp.GetCheck() != 0 
  776. ? dwTabWndStyleAdd = __ETWS_SHOW_BTN_HELP
  777. : dwTabWndStyleRemove = __ETWS_SHOW_BTN_HELP;
  778. GetDlgItem( IDC_CHECK_ENABLE_HELP )->EnableWindow( IsDlgButtonChecked( nID ) );
  779. break;
  780. case IDC_CHECK_ENABLE_HELP:
  781. m_CheckEnableHelp.GetCheck() != 0 
  782. ? dwTabWndStyleAdd = __ETWS_ENABLED_BTN_HELP
  783. : dwTabWndStyleRemove = __ETWS_ENABLED_BTN_HELP;
  784. break;
  785. case IDC_CHECK_SHOW_TAB_LIST:
  786. m_CheckShowTabList.GetCheck() != 0 
  787. ? dwTabWndStyleAdd = __ETWS_SHOW_BTN_TAB_LIST
  788. : dwTabWndStyleRemove = __ETWS_SHOW_BTN_TAB_LIST;
  789. GetDlgItem( IDC_CHECK_ENABLE_TAB_LIST )->EnableWindow( IsDlgButtonChecked( nID ) );
  790. break;
  791. case IDC_CHECK_ENABLE_TAB_LIST:
  792. m_CheckEnableTabList.GetCheck() != 0 
  793. ? dwTabWndStyleAdd = __ETWS_ENABLED_BTN_TAB_LIST
  794. : dwTabWndStyleRemove = __ETWS_ENABLED_BTN_TAB_LIST;
  795. break;
  796. case IDC_CHECK_AUTOHIDE_SCROLL:
  797. m_CheckAutoHideScroll.GetCheck() != 0 
  798. ? dwTabWndStyleAdd = __ETWS_AUTOHIDE_SCROLL
  799. : dwTabWndStyleRemove = __ETWS_AUTOHIDE_SCROLL;
  800. break;
  801. case IDC_CHECK_FOCUS_ON_HOVER:
  802. m_CheckFocusOnHover.GetCheck() != 0 
  803. ? dwTabWndStyleAdd = __ETWS_HOVER_FOCUS
  804. : dwTabWndStyleRemove = __ETWS_HOVER_FOCUS;
  805. break;
  806. case IDC_CHECK_ITEM_DRAGGING:
  807. m_CheckItemDragging.GetCheck() != 0 
  808. ? dwTabWndStyleAdd = __ETWS_ITEM_DRAGGING
  809. : dwTabWndStyleRemove = __ETWS_ITEM_DRAGGING;
  810. break;
  811. case IDC_CHECK_SHOW_HOME:
  812. m_CheckShowHome.GetCheck() != 0 
  813. ? dwTabWndStyleAdd = __ETWS_SHOW_BTN_SCROLL_HOME
  814. : dwTabWndStyleRemove = __ETWS_SHOW_BTN_SCROLL_HOME;
  815. break;
  816. case IDC_CHECK_SHOW_END:
  817. m_CheckShowEnd.GetCheck() != 0 
  818. ? dwTabWndStyleAdd = __ETWS_SHOW_BTN_SCROLL_END
  819. : dwTabWndStyleRemove = __ETWS_SHOW_BTN_SCROLL_END;
  820. break;
  821. default:
  822. return CPageBase::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
  823. }
  824. m_wndTabOuterTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  825. m_wndTabOuterBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  826. m_wndTabOuterLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  827. m_wndTabOuterRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  828. m_wndTabInnerTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  829. m_wndTabInnerBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  830. m_wndTabInnerLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  831. m_wndTabInnerRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  832. m_wndTabOneNoteOuterTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  833. m_wndTabOneNoteOuterBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  834. m_wndTabOneNoteOuterLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  835. m_wndTabOneNoteOuterRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  836. m_wndTabOneNoteInnerTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  837. m_wndTabOneNoteInnerBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  838. m_wndTabOneNoteInnerLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  839. m_wndTabOneNoteInnerRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  840. m_wndTabWhidbeyOuterTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  841. m_wndTabWhidbeyOuterBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  842. m_wndTabWhidbeyOuterLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  843. m_wndTabWhidbeyOuterRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  844. m_wndTabWhidbeyInnerTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  845. m_wndTabWhidbeyInnerBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  846. m_wndTabWhidbeyInnerLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  847. m_wndTabWhidbeyInnerRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  848. m_wndTabFlatOuterTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  849. m_wndTabFlatOuterBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  850. m_wndTabFlatOuterLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  851. m_wndTabFlatOuterRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  852. m_wndTabFlatInnerTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  853. m_wndTabFlatInnerBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  854. m_wndTabFlatInnerLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  855. m_wndTabFlatInnerRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  856. m_wndTabButtonsOuterTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  857. m_wndTabButtonsOuterBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  858. m_wndTabButtonsOuterLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  859. m_wndTabButtonsOuterRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  860. m_wndTabButtonsInnerTop.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  861. m_wndTabButtonsInnerBottom.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  862. m_wndTabButtonsInnerLeft.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  863. m_wndTabButtonsInnerRight.ModifyTabWndStyle( dwTabWndStyleRemove, dwTabWndStyleAdd, true );
  864. return TRUE;
  865. }
  866. return CPageBase::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
  867. }
  868. //////////////////////////////////////////////////////////////////////////
  869. void CPageTabWindow::OnButtonClearTabs() 
  870. {
  871. m_BtnClear.EnableWindow( FALSE );
  872. if( ! m_BtnAdd1.IsWindowEnabled() )
  873. {
  874. m_BtnAdd1.EnableWindow( TRUE );
  875. m_BtnAdd10.EnableWindow( TRUE );
  876. }
  877. m_wndTabOuterTop.ItemRemoveAll(true);
  878. m_wndTabOuterBottom.ItemRemoveAll(true);
  879. m_wndTabOuterLeft.ItemRemoveAll(true);
  880. m_wndTabOuterRight.ItemRemoveAll(true);
  881. m_wndTabInnerTop.ItemRemoveAll(true);
  882. m_wndTabInnerBottom.ItemRemoveAll(true);
  883. m_wndTabInnerLeft.ItemRemoveAll(true);
  884. m_wndTabInnerRight.ItemRemoveAll(true);
  885. m_wndTabOneNoteOuterTop.ItemRemoveAll(true);
  886. m_wndTabOneNoteOuterBottom.ItemRemoveAll(true);
  887. m_wndTabOneNoteOuterLeft.ItemRemoveAll(true);
  888. m_wndTabOneNoteOuterRight.ItemRemoveAll(true);
  889. m_wndTabOneNoteInnerTop.ItemRemoveAll(true);
  890. m_wndTabOneNoteInnerBottom.ItemRemoveAll(true);
  891. m_wndTabOneNoteInnerLeft.ItemRemoveAll(true);
  892. m_wndTabOneNoteInnerRight.ItemRemoveAll(true);
  893. m_wndTabWhidbeyOuterTop.ItemRemoveAll(true);
  894. m_wndTabWhidbeyOuterBottom.ItemRemoveAll(true);
  895. m_wndTabWhidbeyOuterLeft.ItemRemoveAll(true);
  896. m_wndTabWhidbeyOuterRight.ItemRemoveAll(true);
  897. m_wndTabWhidbeyInnerTop.ItemRemoveAll(true);
  898. m_wndTabWhidbeyInnerBottom.ItemRemoveAll(true);
  899. m_wndTabWhidbeyInnerLeft.ItemRemoveAll(true);
  900. m_wndTabWhidbeyInnerRight.ItemRemoveAll(true);
  901. m_wndTabFlatOuterTop.ItemRemoveAll(true);
  902. m_wndTabFlatOuterBottom.ItemRemoveAll(true);
  903. m_wndTabFlatOuterLeft.ItemRemoveAll(true);
  904. m_wndTabFlatOuterRight.ItemRemoveAll(true);
  905. m_wndTabFlatInnerTop.ItemRemoveAll(true);
  906. m_wndTabFlatInnerBottom.ItemRemoveAll(true);
  907. m_wndTabFlatInnerLeft.ItemRemoveAll(true);
  908. m_wndTabFlatInnerRight.ItemRemoveAll(true);
  909. m_wndTabButtonsOuterTop.ItemRemoveAll(true);
  910. m_wndTabButtonsOuterBottom.ItemRemoveAll(true);
  911. m_wndTabButtonsOuterLeft.ItemRemoveAll(true);
  912. m_wndTabButtonsOuterRight.ItemRemoveAll(true);
  913. m_wndTabButtonsInnerTop.ItemRemoveAll(true);
  914. m_wndTabButtonsInnerBottom.ItemRemoveAll(true);
  915. m_wndTabButtonsInnerLeft.ItemRemoveAll(true);
  916. m_wndTabButtonsInnerRight.ItemRemoveAll(true);
  917. }
  918. //////////////////////////////////////////////////////////////////////////
  919. void CPageTabWindow::OnButtonAddTab1() 
  920. {
  921. _DoAdd1(true);
  922. }
  923. //////////////////////////////////////////////////////////////////////////
  924. void CPageTabWindow::OnButtonAddTab10() 
  925. {
  926. for( INT i=0; i < 10; i++ ){
  927. bool bUpdateTabWnd = ( i == 9 ) ? true : false;
  928. _DoAdd1(bUpdateTabWnd);
  929. }
  930. }
  931. //////////////////////////////////////////////////////////////////////////
  932. void CPageTabWindow::_DoAdd1( bool bUpdateTabWnd )
  933. {
  934. ASSERT( m_ImageList.GetSafeHandle() != NULL );
  935. ASSERT( m_nDemoImageListSize > 0 );
  936. if( ! m_BtnClear.IsWindowEnabled() )
  937. m_BtnClear.EnableWindow( TRUE );
  938. // insert 1 item into inner (non-grouped) tab controls
  939. ASSERT( m_nDemoImageListAddIndexInner <= m_nDemoImageListSize );
  940. if( m_nDemoImageListAddIndexInner == (m_nDemoImageListSize-1) )
  941. m_nDemoImageListAddIndexInner = 0;
  942. LPCTSTR strTabItemText = g_ItemsData[m_nDemoImageListAddIndexInner].m_sItemText;
  943. ASSERT( strTabItemText != NULL );
  944. HICON hIconInner = m_ImageList.ExtractIcon( m_nDemoImageListAddIndexInner );
  945. ASSERT( hIconInner != NULL );
  946. m_wndTabInnerTop.ItemInsert(
  947. strTabItemText,
  948. hIconInner
  949. );
  950. m_wndTabInnerBottom.ItemInsert(
  951. strTabItemText,
  952. hIconInner
  953. );
  954. m_wndTabInnerLeft.ItemInsert(
  955. strTabItemText,
  956. hIconInner
  957. );
  958. m_wndTabInnerRight.ItemInsert(
  959. strTabItemText,
  960. hIconInner
  961. );
  962. m_wndTabOneNoteInnerTop.ItemInsert(
  963. strTabItemText,
  964. hIconInner
  965. );
  966. m_wndTabOneNoteInnerBottom.ItemInsert(
  967. strTabItemText,
  968. hIconInner
  969. );
  970. m_wndTabOneNoteInnerLeft.ItemInsert(
  971. strTabItemText,
  972. hIconInner
  973. );
  974. m_wndTabOneNoteInnerRight.ItemInsert(
  975. strTabItemText,
  976. hIconInner
  977. );
  978. m_wndTabWhidbeyInnerTop.ItemInsert(
  979. strTabItemText,
  980. hIconInner
  981. );
  982. m_wndTabWhidbeyInnerBottom.ItemInsert(
  983. strTabItemText,
  984. hIconInner
  985. );
  986. m_wndTabWhidbeyInnerLeft.ItemInsert(
  987. strTabItemText,
  988. hIconInner
  989. );
  990. m_wndTabWhidbeyInnerRight.ItemInsert(
  991. strTabItemText,
  992. hIconInner
  993. );
  994. m_wndTabFlatInnerTop.ItemInsert(
  995. strTabItemText,
  996. hIconInner
  997. );
  998. m_wndTabFlatInnerBottom.ItemInsert(
  999. strTabItemText,
  1000. hIconInner
  1001. );
  1002. m_wndTabFlatInnerLeft.ItemInsert(
  1003. strTabItemText,
  1004. hIconInner
  1005. );
  1006. m_wndTabFlatInnerRight.ItemInsert(
  1007. strTabItemText,
  1008. hIconInner
  1009. );
  1010. m_wndTabButtonsInnerTop.ItemInsert(
  1011. strTabItemText,
  1012. hIconInner
  1013. );
  1014. m_wndTabButtonsInnerBottom.ItemInsert(
  1015. strTabItemText,
  1016. hIconInner
  1017. );
  1018. m_wndTabButtonsInnerLeft.ItemInsert(
  1019. strTabItemText,
  1020. hIconInner
  1021. );
  1022. m_wndTabButtonsInnerRight.ItemInsert(
  1023. strTabItemText,
  1024. hIconInner
  1025. );
  1026. ::DestroyIcon( hIconInner );
  1027. m_nDemoImageListAddIndexInner++;
  1028. // insert 1 group into outer (grouped) tab controls
  1029. ASSERT( m_nDemoImageListAddIndexOuter <= m_nDemoImageListSize );
  1030. if( m_nDemoImageListAddIndexOuter == (m_nDemoImageListSize-1) )
  1031. m_nDemoImageListAddIndexOuter = 0;
  1032. for( INT nAddedToOuter = 0; true ; nAddedToOuter++ )
  1033. {
  1034. bool bGroupStart = 
  1035. g_ItemsData[m_nDemoImageListAddIndexOuter].m_bGroupStart;
  1036. if( nAddedToOuter != 0 && bGroupStart )
  1037. break;
  1038. DWORD dwItemStyle = 0;
  1039. if( bGroupStart )
  1040. dwItemStyle |= __ETWI_GROUP_START | __ETWI_IN_GROUP_ACTIVE;
  1041. HICON hIconOuter = m_ImageList.ExtractIcon( m_nDemoImageListAddIndexOuter );
  1042. ASSERT( hIconOuter != NULL );
  1043. ASSERT( g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText != NULL );
  1044. m_wndTabOuterTop.ItemInsert(
  1045. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1046. hIconOuter,
  1047. true,
  1048. dwItemStyle
  1049. );
  1050. m_wndTabOuterBottom.ItemInsert(
  1051. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1052. hIconOuter,
  1053. true,
  1054. dwItemStyle
  1055. );
  1056. m_wndTabOuterLeft.ItemInsert(
  1057. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1058. hIconOuter,
  1059. true,
  1060. dwItemStyle
  1061. );
  1062. m_wndTabOuterRight.ItemInsert(
  1063. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1064. hIconOuter,
  1065. true,
  1066. dwItemStyle
  1067. );
  1068. m_wndTabOneNoteOuterTop.ItemInsert(
  1069. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1070. hIconOuter,
  1071. true,
  1072. dwItemStyle
  1073. );
  1074. m_wndTabOneNoteOuterBottom.ItemInsert(
  1075. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1076. hIconOuter,
  1077. true,
  1078. dwItemStyle
  1079. );
  1080. m_wndTabOneNoteOuterLeft.ItemInsert(
  1081. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1082. hIconOuter,
  1083. true,
  1084. dwItemStyle
  1085. );
  1086. m_wndTabOneNoteOuterRight.ItemInsert(
  1087. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1088. hIconOuter,
  1089. true,
  1090. dwItemStyle
  1091. );
  1092. m_wndTabWhidbeyOuterTop.ItemInsert(
  1093. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1094. hIconOuter,
  1095. true,
  1096. dwItemStyle
  1097. );
  1098. m_wndTabWhidbeyOuterBottom.ItemInsert(
  1099. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1100. hIconOuter,
  1101. true,
  1102. dwItemStyle
  1103. );
  1104. m_wndTabWhidbeyOuterLeft.ItemInsert(
  1105. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1106. hIconOuter,
  1107. true,
  1108. dwItemStyle
  1109. );
  1110. m_wndTabWhidbeyOuterRight.ItemInsert(
  1111. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1112. hIconOuter,
  1113. true,
  1114. dwItemStyle
  1115. );
  1116. m_wndTabFlatOuterTop.ItemInsert(
  1117. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1118. hIconOuter,
  1119. true,
  1120. dwItemStyle
  1121. );
  1122. m_wndTabFlatOuterBottom.ItemInsert(
  1123. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1124. hIconOuter,
  1125. true,
  1126. dwItemStyle
  1127. );
  1128. m_wndTabFlatOuterLeft.ItemInsert(
  1129. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1130. hIconOuter,
  1131. true,
  1132. dwItemStyle
  1133. );
  1134. m_wndTabFlatOuterRight.ItemInsert(
  1135. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1136. hIconOuter,
  1137. true,
  1138. dwItemStyle
  1139. );
  1140. m_wndTabButtonsOuterTop.ItemInsert(
  1141. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1142. hIconOuter,
  1143. true,
  1144. dwItemStyle
  1145. );
  1146. m_wndTabButtonsOuterBottom.ItemInsert(
  1147. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1148. hIconOuter,
  1149. true,
  1150. dwItemStyle
  1151. );
  1152. m_wndTabButtonsOuterLeft.ItemInsert(
  1153. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1154. hIconOuter,
  1155. true,
  1156. dwItemStyle
  1157. );
  1158. m_wndTabButtonsOuterRight.ItemInsert(
  1159. g_ItemsData[m_nDemoImageListAddIndexOuter].m_sItemText,
  1160. hIconOuter,
  1161. true,
  1162. dwItemStyle
  1163. );
  1164. ::DestroyIcon( hIconOuter );
  1165. if( m_nDemoImageListAddIndexOuter == (m_nDemoImageListSize-1) )
  1166. m_nDemoImageListAddIndexOuter = 0;
  1167. else
  1168. m_nDemoImageListAddIndexOuter++;
  1169. } // for( INT nAddedToOuter = 0; true ; nAddedToOuter++ )
  1170. // update or delay-update all tab controls
  1171. m_wndTabInnerTop.UpdateTabWnd( bUpdateTabWnd );
  1172. m_wndTabInnerBottom.UpdateTabWnd( bUpdateTabWnd );
  1173. m_wndTabInnerLeft.UpdateTabWnd( bUpdateTabWnd );
  1174. m_wndTabInnerRight.UpdateTabWnd( bUpdateTabWnd );
  1175. m_wndTabOuterTop.UpdateTabWnd( bUpdateTabWnd );
  1176. m_wndTabOuterBottom.UpdateTabWnd( bUpdateTabWnd );
  1177. m_wndTabOuterLeft.UpdateTabWnd( bUpdateTabWnd );
  1178. m_wndTabOuterRight.UpdateTabWnd( bUpdateTabWnd );
  1179. m_wndTabOneNoteInnerTop.UpdateTabWnd( bUpdateTabWnd );
  1180. m_wndTabOneNoteInnerBottom.UpdateTabWnd( bUpdateTabWnd );
  1181. m_wndTabOneNoteInnerLeft.UpdateTabWnd( bUpdateTabWnd );
  1182. m_wndTabOneNoteInnerRight.UpdateTabWnd( bUpdateTabWnd );
  1183. m_wndTabOneNoteOuterTop.UpdateTabWnd( bUpdateTabWnd );
  1184. m_wndTabOneNoteOuterBottom.UpdateTabWnd( bUpdateTabWnd );
  1185. m_wndTabOneNoteOuterLeft.UpdateTabWnd( bUpdateTabWnd );
  1186. m_wndTabOneNoteOuterRight.UpdateTabWnd( bUpdateTabWnd );
  1187. m_wndTabWhidbeyInnerTop.UpdateTabWnd( bUpdateTabWnd );
  1188. m_wndTabWhidbeyInnerBottom.UpdateTabWnd( bUpdateTabWnd );
  1189. m_wndTabWhidbeyInnerLeft.UpdateTabWnd( bUpdateTabWnd );
  1190. m_wndTabWhidbeyInnerRight.UpdateTabWnd( bUpdateTabWnd );
  1191. m_wndTabWhidbeyOuterTop.UpdateTabWnd( bUpdateTabWnd );
  1192. m_wndTabWhidbeyOuterBottom.UpdateTabWnd( bUpdateTabWnd );
  1193. m_wndTabWhidbeyOuterLeft.UpdateTabWnd( bUpdateTabWnd );
  1194. m_wndTabWhidbeyOuterRight.UpdateTabWnd( bUpdateTabWnd );
  1195. m_wndTabFlatInnerTop.UpdateTabWnd( bUpdateTabWnd );
  1196. m_wndTabFlatInnerBottom.UpdateTabWnd( bUpdateTabWnd );
  1197. m_wndTabFlatInnerLeft.UpdateTabWnd( bUpdateTabWnd );
  1198. m_wndTabFlatInnerRight.UpdateTabWnd( bUpdateTabWnd );
  1199. m_wndTabFlatOuterTop.UpdateTabWnd( bUpdateTabWnd );
  1200. m_wndTabFlatOuterBottom.UpdateTabWnd( bUpdateTabWnd );
  1201. m_wndTabFlatOuterLeft.UpdateTabWnd( bUpdateTabWnd );
  1202. m_wndTabFlatOuterRight.UpdateTabWnd( bUpdateTabWnd );
  1203. m_wndTabButtonsInnerTop.UpdateTabWnd( bUpdateTabWnd );
  1204. m_wndTabButtonsInnerBottom.UpdateTabWnd( bUpdateTabWnd );
  1205. m_wndTabButtonsInnerLeft.UpdateTabWnd( bUpdateTabWnd );
  1206. m_wndTabButtonsInnerRight.UpdateTabWnd( bUpdateTabWnd );
  1207. m_wndTabButtonsOuterTop.UpdateTabWnd( bUpdateTabWnd );
  1208. m_wndTabButtonsOuterBottom.UpdateTabWnd( bUpdateTabWnd );
  1209. m_wndTabButtonsOuterLeft.UpdateTabWnd( bUpdateTabWnd );
  1210. m_wndTabButtonsOuterRight.UpdateTabWnd( bUpdateTabWnd );
  1211. if( m_wndTabInnerTop.ItemGetCount() >= 100 )
  1212. {
  1213. if( m_BtnAdd1.IsWindowEnabled() )
  1214. {
  1215. m_BtnAdd1.EnableWindow( FALSE );
  1216. m_BtnAdd10.EnableWindow( FALSE );
  1217. }
  1218. }
  1219. }
  1220. #endif // (!defined __EXT_MFC_NO_TAB_CTRL)