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

界面编程

开发平台:

Visual C++

  1. // ChildFormView.cpp : implementation file
  2. //
  3. #include "stdafx.h"
  4. #include "ThemeColorizer.h"
  5. #include "ChildFormView.h"
  6. #include "MainFrm.h"
  7. #ifdef _DEBUG
  8. #define new DEBUG_NEW
  9. #undef THIS_FILE
  10. static char THIS_FILE[] = __FILE__;
  11. #endif
  12. /////////////////////////////////////////////////////////////////////////////
  13. // CChildFormView
  14. IMPLEMENT_DYNCREATE(CChildFormView, CFormView)
  15. CChildFormView::CChildFormView()
  16. : CExtWS < CExtAFV < CFormView > > ( CChildFormView::IDD, ((CWnd *)NULL) )
  17. {
  18. //{{AFX_DATA_INIT(CChildFormView)
  19. //}}AFX_DATA_INIT
  20. m_bInitComplete = false;
  21. }
  22. CChildFormView::~CChildFormView()
  23. {
  24. }
  25. void CChildFormView::DoDataExchange(CDataExchange* pDX)
  26. {
  27. CFormView::DoDataExchange(pDX);
  28. //{{AFX_DATA_MAP(CChildFormView)
  29. DDX_Control(pDX, IDC_STATIC_COLOR_THEME, m_wndLabelColorTheme);
  30. DDX_Control(pDX, IDC_STATIC_SEL_TYPE, m_wndLabelSelType);
  31. DDX_Control(pDX, IDC_BUTTON_COLOR2, m_wndColor2);
  32. DDX_Control(pDX, IDC_BUTTON_COLOR1, m_wndColor1);
  33. DDX_Control(pDX, IDC_GROUP_BOX2, m_wndGroupBox2);
  34. DDX_Control(pDX, IDC_GROUP_BOX1, m_wndGroupBox1);
  35. DDX_Control(pDX, IDC_COMBO_SEL_TYPE, m_wndColorCtrlType);
  36. DDX_Control(pDX, IDC_COMBO_COLOR_THEME, m_wndColorTheme);
  37. //}}AFX_DATA_MAP
  38. }
  39. BEGIN_MESSAGE_MAP(CChildFormView, CFormView)
  40. //{{AFX_MSG_MAP(CChildFormView)
  41. ON_CBN_SELENDOK(IDC_COMBO_SEL_TYPE, OnSelendokComboSelType)
  42. ON_CBN_SELENDOK(IDC_COMBO_COLOR_THEME, OnSelendokComboColorTheme)
  43. //}}AFX_MSG_MAP
  44. ON_REGISTERED_MESSAGE(
  45. CExtColorCtrl::g_nMsgColorChanged,
  46. OnColorChanged
  47. )
  48. ON_REGISTERED_MESSAGE(
  49. CExtPopupColorMenuWnd::g_nMsgNotifyColorChangedFinally,
  50. OnColorChangedFinally
  51. )
  52. ON_REGISTERED_MESSAGE(
  53. CExtPopupColorMenuWnd::g_nMsgNotifyCustColor,
  54. OnColorSelectCustom
  55. )
  56. END_MESSAGE_MAP()
  57. /////////////////////////////////////////////////////////////////////////////
  58. // CChildFormView diagnostics
  59. #ifdef _DEBUG
  60. void CChildFormView::AssertValid() const
  61. {
  62. CFormView::AssertValid();
  63. }
  64. void CChildFormView::Dump(CDumpContext& dc) const
  65. {
  66. CFormView::Dump(dc);
  67. }
  68. #endif //_DEBUG
  69. /////////////////////////////////////////////////////////////////////////////
  70. // CChildFormView message handlers
  71. BOOL CChildFormView::PreCreateWindow(CREATESTRUCT& cs) 
  72. {
  73. if (!CFormView::PreCreateWindow(cs))
  74. return FALSE;
  75. cs.dwExStyle &= ~(WS_EX_CLIENTEDGE|WS_EX_STATICEDGE);
  76. cs.style &= ~WS_BORDER;
  77. cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW|CS_VREDRAW|CS_DBLCLKS, 
  78. ::LoadCursor(NULL, IDC_ARROW), HBRUSH(COLOR_WINDOW+1), NULL);
  79. return TRUE;
  80. }
  81. BOOL CChildFormView::OnCmdMsg(UINT nID, int nCode, void* pExtra, AFX_CMDHANDLERINFO* pHandlerInfo) 
  82. {
  83. BOOL bRetVal = CFormView::OnCmdMsg(nID, nCode, pExtra, pHandlerInfo);
  84. if( nCode == CN_UPDATE_COMMAND_UI
  85. && ( nID == ID_FILE_NEW
  86. || nID == ID_FILE_OPEN
  87. || nID == ID_FILE_SAVE 
  88. || nID == ID_EDIT_CUT
  89. || nID == ID_EDIT_COPY
  90. || nID == ID_EDIT_PASTE
  91. || nID == ID_FILE_PRINT
  92. || nID == ID_APP_ABOUT
  93. || nID == ID_CONTEXT_HELP
  94. || nID == ID_MYEXTBTN_SLIDER
  95. || nID == ID_MYEXTBTN_SCROLLER
  96. || nID == ID_IED_TOOL_RECT_SELECTION
  97. || nID == ID_IED_TOOL_COLOR_SELECTION
  98. || nID == ID_IED_TOOL_FILL
  99. || nID == ID_IED_TOOL_MAGNIFICATION
  100. || nID == ID_IED_TOOL_PENCIL
  101. || nID == ID_IED_TOOL_BRUSH
  102. || nID == ID_IED_TOOL_AIR_BRUSH
  103. || nID == ID_IED_TOOL_LINE
  104. || nID == ID_IED_TOOL_RECTANGLE
  105. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE
  106. || nID == ID_IED_TOOL_FILLED_RECTANGLE
  107. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE
  108. || nID == ID_IED_TOOL_ROUNDED_OUTLINED_RECTANGLE
  109. || nID == ID_IED_TOOL_ROUNDED_FILLED_RECTANGLE
  110. || nID == ID_IED_TOOL_ELLIPSE
  111. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE
  112. || nID == ID_IED_TOOL_FILLED_ELLIPSE
  113. || nID == ID_IED_TOOL_RECT_SELECTION
  114. || nID == ID_IED_TOOL_COLOR_SELECTION
  115. || nID == ID_IED_TOOL_FILL
  116. || nID == ID_IED_TOOL_MAGNIFICATION
  117. || nID == ID_IED_TOOL_PENCIL
  118. || nID == ID_IED_TOOL_BRUSH
  119. || nID == ID_IED_TOOL_AIR_BRUSH
  120. || nID == ID_IED_TOOL_LINE
  121. || nID == ID_IED_TOOL_RECTANGLE
  122. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE
  123. || nID == ID_IED_TOOL_FILLED_RECTANGLE
  124. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE
  125. || nID == ID_IED_TOOL_ROUNDED_OUTLINED_RECTANGLE
  126. || nID == ID_IED_TOOL_ROUNDED_FILLED_RECTANGLE
  127. || nID == ID_IED_TOOL_ELLIPSE           
  128. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE 
  129. || nID == ID_IED_TOOL_FILLED_ELLIPSE     
  130. || nID == ID_IED_TOOL_MAGNIFICATION_01X  
  131. || nID == ID_IED_TOOL_MAGNIFICATION_02X  
  132. || nID == ID_IED_TOOL_MAGNIFICATION_03X  
  133. || nID == ID_IED_TOOL_MAGNIFICATION_04X  
  134. || nID == ID_IED_TOOL_MAGNIFICATION_05X  
  135. || nID == ID_IED_TOOL_MAGNIFICATION_06X  
  136. || nID == ID_IED_TOOL_MAGNIFICATION_07X  
  137. || nID == ID_IED_TOOL_MAGNIFICATION_08X  
  138. || nID == ID_IED_TOOL_MAGNIFICATION_09X  
  139. || nID == ID_IED_TOOL_MAGNIFICATION_10X  
  140. || nID == ID_IED_TOOL_MAGNIFICATION_11X  
  141. || nID == ID_IED_TOOL_MAGNIFICATION_12X  
  142. || nID == ID_IED_TOOL_MAGNIFICATION_13X  
  143. || nID == ID_IED_TOOL_MAGNIFICATION_14X  
  144. || nID == ID_IED_TOOL_MAGNIFICATION_15X  
  145. || nID == ID_IED_TOOL_MAGNIFICATION_16X  
  146. || nID == ID_IED_TOOL_BRUSH_CIRCLE_SMALL 
  147. || nID == ID_IED_TOOL_BRUSH_CIRCLE_MEDIUM
  148. || nID == ID_IED_TOOL_BRUSH_CIRCLE_LARGE 
  149. || nID == ID_IED_TOOL_BRUSH_SQUARE_SMALL 
  150. || nID == ID_IED_TOOL_BRUSH_SQUARE_MEDIUM
  151. || nID == ID_IED_TOOL_BRUSH_SQUARE_LARGE 
  152. || nID == ID_IED_TOOL_BRUSH_LINE_LD_SMALL
  153. || nID == ID_IED_TOOL_BRUSH_LINE_LD_MEDIUM
  154. || nID == ID_IED_TOOL_BRUSH_LINE_LD_LARGE 
  155. || nID == ID_IED_TOOL_BRUSH_LINE_RD_SMALL 
  156. || nID == ID_IED_TOOL_BRUSH_LINE_RD_MEDIUM
  157. || nID == ID_IED_TOOL_BRUSH_LINE_RD_LARGE 
  158. || nID == ID_IED_TOOL_AIR_BRUSH_SMALL     
  159. || nID == ID_IED_TOOL_AIR_BRUSH_MEDIUM    
  160. || nID == ID_IED_TOOL_AIR_BRUSH_LARGE     
  161. || nID == ID_IED_TOOL_LINE_CIRCLE_SMALL   
  162. || nID == ID_IED_TOOL_LINE_CIRCLE_MEDIUM  
  163. || nID == ID_IED_TOOL_LINE_CIRCLE_LARGE   
  164. || nID == ID_IED_TOOL_LINE_SQUARE_SMALL   
  165. || nID == ID_IED_TOOL_LINE_SQUARE_MEDIUM  
  166. || nID == ID_IED_TOOL_LINE_SQUARE_LARGE   
  167. || nID == ID_IED_TOOL_LINE_LINE_LD_SMALL  
  168. || nID == ID_IED_TOOL_LINE_LINE_LD_MEDIUM 
  169. || nID == ID_IED_TOOL_LINE_LINE_LD_LARGE  
  170. || nID == ID_IED_TOOL_LINE_LINE_RD_SMALL  
  171. || nID == ID_IED_TOOL_LINE_LINE_RD_MEDIUM 
  172. || nID == ID_IED_TOOL_LINE_LINE_RD_LARGE  
  173. || nID == ID_IED_TOOL_RECTANGLE_SMALLER   
  174. || nID == ID_IED_TOOL_RECTANGLE_SMALL     
  175. || nID == ID_IED_TOOL_RECTANGLE_MEDIUM    
  176. || nID == ID_IED_TOOL_RECTANGLE_LARGE     
  177. || nID == ID_IED_TOOL_RECTANGLE_LARGER    
  178. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE_SMALLER
  179. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE_SMALL
  180. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE_MEDIUM 
  181. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE_LARGE
  182. || nID == ID_IED_TOOL_OUTLINED_RECTANGLE_LARGER 
  183. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE_SMALLER
  184. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE_SMALL
  185. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE_MEDIUM
  186. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE_LARGE
  187. || nID == ID_IED_TOOL_ROUNDED_RECTANGLE_LARGER
  188. || nID == ID_IED_TOOL_ELLIPSE_SMALLER
  189. || nID == ID_IED_TOOL_ELLIPSE_SMALL
  190. || nID == ID_IED_TOOL_ELLIPSE_MEDIUM 
  191. || nID == ID_IED_TOOL_ELLIPSE_LARGE  
  192. || nID == ID_IED_TOOL_ELLIPSE_LARGER 
  193. || nID == ID_IED_TOOL_OUTLINED_ROUNDED_RECTANGLE_SMALLER
  194. || nID == ID_IED_TOOL_OUTLINED_ROUNDED_RECTANGLE_SMALL
  195. || nID == ID_IED_TOOL_OUTLINED_ROUNDED_RECTANGLE_MEDIUM 
  196. || nID == ID_IED_TOOL_OUTLINED_ROUNDED_RECTANGLE_LARGE
  197. || nID == ID_IED_TOOL_OUTLINED_ROUNDED_RECTANGLE_LARGER 
  198. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE_SMALLER
  199. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE_SMALL
  200. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE_MEDIUM
  201. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE_LARGE
  202. || nID == ID_IED_TOOL_OUTLINED_ELLIPSE_LARGER
  203. )
  204. )
  205. {
  206. CCmdUI * pCmdUI = (CCmdUI *)pExtra;
  207. ASSERT( pCmdUI != NULL );
  208. pCmdUI->Enable();
  209. return TRUE;
  210. }
  211. return bRetVal;
  212. }
  213. //////////////////////////////////////////////////////////////////////////
  214. void CChildFormView::OnInitialUpdate() 
  215. {
  216. CFormView::OnInitialUpdate();
  217. ShowSizeGrip(FALSE);
  218. m_wndColorCtrlType.ResetContent();
  219. ASSERT( m_wndColorCtrlType.GetCount() == 0 );
  220. for( int i = int(CExtColorCtrl::MODE_NAMED_MIN);
  221. i <= int(CExtColorCtrl::MODE_NAMED_MAX);
  222. i++
  223. )
  224. m_wndColorCtrlType.AddString(
  225. CExtColorCtrl::GetColorModeName(
  226. CExtColorCtrl::e_mode_t(i)
  227. )
  228. );
  229. m_wndColorCtrlType.SetCurSel( (int)(CExtColorCtrl::e_mode_t)m_wndColorCtrl1 );
  230. VERIFY(
  231. m_wndColorCtrl1.SubclassDlgItem(
  232. IDC_STATIC_HEX_FULL1,
  233. this
  234. )
  235. );
  236. VERIFY(
  237. m_wndColorCtrl2.SubclassDlgItem(
  238. IDC_STATIC_HEX_FULL2,
  239. this
  240. )
  241. );
  242. m_wndGroupBox1.SetStyle( CExtGroupBox::STYLE_ROUNDED );
  243. m_wndGroupBox2.SetStyle( CExtGroupBox::STYLE_ROUNDED );
  244. m_wndColor1.SetFlat( TRUE );
  245. m_wndColor1.SetDrawBorder( TRUE );
  246. m_wndColor1.SetDrawFocusRect( FALSE );
  247. m_wndColor1.m_lParamCookie = LPARAM(IDC_BUTTON_COLOR1);
  248. m_wndColor1.m_bEnableBtnColorDefault = false;
  249. m_wndColor2.SetFlat( TRUE );
  250. m_wndColor2.SetDrawBorder( TRUE );
  251. m_wndColor2.SetDrawFocusRect( FALSE );
  252. m_wndColor2.m_lParamCookie = LPARAM(IDC_BUTTON_COLOR2);
  253. m_wndColor2.m_bEnableBtnColorDefault = false;
  254. //////////////////////////////////////////////////////////////////////////
  255. CMainFrame * pMainFrame = STATIC_DOWNCAST( CMainFrame, ::AfxGetMainWnd() );
  256. ASSERT_VALID( pMainFrame->m_pPaintManager );
  257. //  m_wndColorCtrl1.m_selClrs.m_clrCurrent = 
  258. //  m_wndColorCtrl1.m_selClrs.m_clrPrev = 
  259. //  m_wndColorCtrl1.m_selClrs.m_clrNew =
  260. //  pMainFrame->m_pPaintManager->m_clrFillHint;
  261. // 
  262. //  m_wndColorCtrl2.m_selClrs.m_clrCurrent = 
  263. //  m_wndColorCtrl2.m_selClrs.m_clrPrev = 
  264. //  m_wndColorCtrl2.m_selClrs.m_clrNew =
  265. //  pMainFrame->m_pPaintManager->m_clrAccentHint;
  266. // 
  267. //  OnColorChanged(
  268. //  (WPARAM)m_wndColorCtrl1.GetSafeHwnd(),
  269. //  (LPARAM)&m_wndColorCtrl1.m_selClrs
  270. //  );
  271. //  OnColorChanged(
  272. //  (WPARAM)m_wndColorCtrl2.GetSafeHwnd(),
  273. //  (LPARAM)&m_wndColorCtrl2.m_selClrs
  274. //  );
  275. m_wndColorCtrl1.SetupColor(
  276. pMainFrame->m_pPaintManager->m_clrFillHint,
  277. true
  278. );
  279. m_wndColorCtrl2.SetupColor(
  280. pMainFrame->m_pPaintManager->m_clrAccentHint,
  281. true
  282. );
  283. //////////////////////////////////////////////////////////////////////////
  284. int nItem = 0;
  285. nItem = m_wndColorTheme.AddString( _T("Luna Blue") );
  286. m_wndColorTheme.SetItemData( nItem, ThemeLunaBlue );
  287. nItem = m_wndColorTheme.AddString( _T("Luna Olive") );
  288. m_wndColorTheme.SetItemData( nItem, ThemeLunaOlive );
  289. nItem = m_wndColorTheme.AddString( _T("Luna Silver") );
  290. m_wndColorTheme.SetItemData( nItem, ThemeLunaSilver );
  291. nItem = m_wndColorTheme.AddString( _T("Visual Studio 2005") );
  292. m_wndColorTheme.SetItemData( nItem, ThemeStudio2005 );
  293. nItem = m_wndColorTheme.AddString( _T("Pumpkin") );
  294. m_wndColorTheme.SetItemData( nItem, ThemePumpkin );
  295. nItem = m_wndColorTheme.AddString( _T("Rose") );
  296. m_wndColorTheme.SetItemData( nItem, ThemeRose );
  297. nItem = m_wndColorTheme.AddString( _T("Eggplant") );
  298. m_wndColorTheme.SetItemData( nItem, ThemeEggplant );
  299. nItem = m_wndColorTheme.AddString( _T("Rainy Day") );
  300. m_wndColorTheme.SetItemData( nItem, ThemeRainyDay );
  301. nItem = m_wndColorTheme.AddString( _T("Spruce") );
  302. m_wndColorTheme.SetItemData( nItem, ThemeSpruce );
  303. nItem = m_wndColorTheme.AddString( _T("Lilac") );
  304. m_wndColorTheme.SetItemData( nItem, ThemeLilac );
  305. m_bInitComplete = true;
  306. }
  307. void CChildFormView::OnSelendokComboSelType() 
  308. {
  309. if( !m_bInitComplete )
  310. return;
  311. CExtColorCtrl::e_mode_t eMode =
  312. (CExtColorCtrl::e_mode_t)m_wndColorCtrlType.GetCurSel();
  313. m_wndColorCtrl1 = eMode;
  314. m_wndColorCtrl2 = eMode;
  315. }
  316. LRESULT CChildFormView::OnColorChanged(WPARAM wParam,LPARAM lParam)
  317. {
  318. CExtColorCtrl::selection_colors_t * pClrs =
  319. (CExtColorCtrl::selection_colors_t *)lParam;
  320. ASSERT( pClrs != NULL );
  321. CMainFrame * pMainFrame = STATIC_DOWNCAST( CMainFrame, ::AfxGetMainWnd() );
  322. ASSERT_VALID( pMainFrame->m_pPaintManager );
  323. if( (HWND)wParam == m_wndColorCtrl1.GetSafeHwnd() )
  324. {
  325. m_wndColor1.m_clrSelected = pClrs->m_clrNew;
  326. m_wndColor1.Invalidate();
  327. pMainFrame->m_pPaintManager->SetThemeColors(
  328. pClrs->m_clrNew,
  329. pMainFrame->m_pPaintManager->m_clrAccentHint
  330. );
  331. }
  332. else if( (HWND)wParam == m_wndColorCtrl2.GetSafeHwnd() )
  333. {
  334. m_wndColor2.m_clrSelected = pClrs->m_clrNew;
  335. m_wndColor2.Invalidate();
  336. pMainFrame->m_pPaintManager->SetThemeColors(
  337. pMainFrame->m_pPaintManager->m_clrFillHint,
  338. pClrs->m_clrNew
  339. );
  340. }
  341. return 0;
  342. }
  343. //////////////////////////////////////////////////////////////////////////
  344. LRESULT CChildFormView::OnColorChangedFinally(WPARAM wParam, LPARAM lParam)
  345. {
  346. COLORREF clrColorCtrl = COLORREF(wParam);
  347. switch( lParam )
  348. {
  349. case IDC_BUTTON_COLOR1:
  350. if( clrColorCtrl == COLORREF(-1) )
  351. {
  352. }
  353. else
  354. m_wndColorCtrl1.SetupColor( clrColorCtrl, true );
  355. break;
  356. case IDC_BUTTON_COLOR2:
  357. if( clrColorCtrl == COLORREF(-1) )
  358. {
  359. }
  360. else
  361. m_wndColorCtrl2.SetupColor( clrColorCtrl, true );
  362. break;
  363. } // switch( lParam )
  364. return 0;
  365. }
  366. //////////////////////////////////////////////////////////////////////////
  367. LRESULT CChildFormView::OnColorSelectCustom(WPARAM wParam, LPARAM lParam)
  368. {
  369. wParam;
  370. if( lParam == IDC_BUTTON_COLOR1 
  371. || lParam == IDC_BUTTON_COLOR2
  372. )
  373. {
  374. COLORREF clrNew;
  375. CExtColorDlg dlgColor;
  376. if( dlgColor.DoModal() != IDOK )
  377. return 0;
  378. clrNew = dlgColor.m_clrNew;
  379. OnColorChangedFinally((WPARAM)clrNew, lParam);
  380. }
  381. return 0;
  382. }
  383. //////////////////////////////////////////////////////////////////////////
  384. void CChildFormView::OnSelendokComboColorTheme() 
  385. {
  386. int nIndex = m_wndColorTheme.GetCurSel();
  387. if(LB_ERR != nIndex)
  388. {
  389. COLORREF clrFillHint = NULL;
  390. COLORREF clrAccentHint = NULL;
  391. e_ColorThemes_t eColorTheme = (e_ColorThemes_t)m_wndColorTheme.GetItemData(nIndex);
  392. switch(eColorTheme) 
  393. {
  394. case ThemeLunaBlue:
  395. clrFillHint = 
  396. CExtBitmap::stat_HLS_Adjust(
  397. RGB(151, 190, 244),
  398. 0.00, -0.07, -0.10
  399. );
  400. clrAccentHint = RGB(255, 200, 91);
  401. break;
  402. case ThemeLunaOlive:
  403. clrFillHint = 
  404. CExtBitmap::stat_HLS_Adjust(
  405. RGB(207, 215, 180),
  406. 0.00, -0.07, -0.10
  407. );
  408. clrAccentHint = RGB(242, 195, 115);;
  409. break;
  410. case ThemeLunaSilver:
  411. clrFillHint = 
  412. CExtBitmap::stat_HLS_Adjust(
  413. RGB(188, 189, 207),
  414. 0.00, -0.07, -0.10
  415. );
  416. clrAccentHint = RGB(255, 200, 91);
  417. break;
  418. case ThemeStudio2005:
  419. clrFillHint = 
  420. CExtBitmap::stat_HLS_Adjust(
  421. RGB(225, 225, 210),
  422. 0.00, -0.05, -0.05
  423. );
  424. clrAccentHint = RGB(49, 106, 197);
  425. break;
  426. case ThemePumpkin:
  427. clrFillHint = RGB(248,219,148);
  428. clrAccentHint = RGB(147,32,205);
  429. break;
  430. case ThemeRose:
  431. clrFillHint = RGB(202,166,179);
  432. clrAccentHint = RGB(164,118,143);
  433. break;
  434. case ThemeEggplant:
  435. clrFillHint = RGB(128,175,164);
  436. clrAccentHint = RGB(114,144,150);
  437. break;
  438. case ThemeRainyDay:
  439. clrFillHint = RGB(131,163,191);
  440. clrAccentHint = RGB(101,135,174);
  441. break;
  442. case ThemeSpruce:
  443. clrFillHint = RGB(147,192,149);
  444. clrAccentHint = RGB(89,165,102);
  445. break;
  446. case ThemeLilac:
  447. clrFillHint = RGB(146,139,197);
  448. clrAccentHint = RGB(112,109,177);
  449. break;
  450. default:
  451. return;
  452. }
  453. m_wndColorCtrl1.m_selClrs.m_clrCurrent = 
  454. m_wndColorCtrl1.m_selClrs.m_clrPrev = 
  455. m_wndColorCtrl1.m_selClrs.m_clrNew = clrFillHint;
  456. m_wndColorCtrl1.SetupColor( clrFillHint, false );
  457. m_wndColorCtrl2.m_selClrs.m_clrCurrent = 
  458. m_wndColorCtrl2.m_selClrs.m_clrPrev = 
  459. m_wndColorCtrl2.m_selClrs.m_clrNew = clrAccentHint;
  460. m_wndColorCtrl2.SetupColor( clrAccentHint, false );
  461. OnColorChanged(
  462. (WPARAM)m_wndColorCtrl1.GetSafeHwnd(),
  463. (LPARAM)&m_wndColorCtrl1.m_selClrs
  464. );
  465. OnColorChanged(
  466. (WPARAM)m_wndColorCtrl2.GetSafeHwnd(),
  467. (LPARAM)&m_wndColorCtrl2.m_selClrs
  468. );
  469. }
  470. }