PopupControlDemoDlg.cpp
上传用户:szled88
上传日期:2015-04-09
资源大小:43957k
文件大小:32k
源码类别:

对话框与窗口

开发平台:

Visual C++

  1. // PopupControlDemoDlg.cpp : implementation file
  2. //
  3. // This file is a part of the XTREME TOOLKIT PRO MFC class library.
  4. // (c)1998-2008 Codejock Software, All Rights Reserved.
  5. //
  6. // THIS SOURCE FILE IS THE PROPERTY OF CODEJOCK SOFTWARE AND IS NOT TO BE
  7. // RE-DISTRIBUTED BY ANY MEANS WHATSOEVER WITHOUT THE EXPRESSED WRITTEN
  8. // CONSENT OF CODEJOCK SOFTWARE.
  9. //
  10. // THIS SOURCE CODE CAN ONLY BE USED UNDER THE TERMS AND CONDITIONS OUTLINED
  11. // IN THE XTREME TOOLKIT PRO LICENSE AGREEMENT. CODEJOCK SOFTWARE GRANTS TO
  12. // YOU (ONE SOFTWARE DEVELOPER) THE LIMITED RIGHT TO USE THIS SOFTWARE ON A
  13. // SINGLE COMPUTER.
  14. //
  15. // CONTACT INFORMATION:
  16. // support@codejock.com
  17. // http://www.codejock.com
  18. //
  19. /////////////////////////////////////////////////////////////////////////////
  20. #include "stdafx.h"
  21. #include "PopupControlDemo.h"
  22. #include "PopupControlDemoDlg.h"
  23. #include "AboutDlg.h"
  24. #ifdef _DEBUG
  25. #define new DEBUG_NEW
  26. #undef THIS_FILE
  27. static char THIS_FILE[] = __FILE__;
  28. #endif
  29. #define ID_POPUP_CLOSE (-1)
  30. #define ID_GOTO_SITE (-2)
  31. /////////////////////////////////////////////////////////////////////////////
  32. // CPopupControlDemoDlg dialog
  33. CPopupControlDemoDlg::CPopupControlDemoDlg(CWnd* pParent /*=NULL*/)
  34. : CDialog(CPopupControlDemoDlg::IDD, pParent)
  35. {
  36. //{{AFX_DATA_INIT(CPopupControlDemoDlg)
  37. m_nTheme = 2;
  38. m_nAnimation = 1;
  39. m_uAnimDelay = 500;
  40. m_uShowDelay = 3000;
  41. m_bAllowMove = TRUE;
  42. //}}AFX_DATA_INIT
  43. // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
  44. m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  45. m_pActivePopup = NULL;
  46. m_ptPopup = CPoint(-1, -1);
  47. }
  48. CPopupControlDemoDlg::~CPopupControlDemoDlg()
  49. {
  50. while (!m_lstPopupControl.IsEmpty()) 
  51. {
  52. delete m_lstPopupControl.RemoveTail();
  53. }
  54. }
  55. void CPopupControlDemoDlg::DoDataExchange(CDataExchange* pDX)
  56. {
  57. CDialog::DoDataExchange(pDX);
  58. //{{AFX_DATA_MAP(CPopupControlDemoDlg)
  59. DDX_Control(pDX, IDC_BUTTON_MORE, m_btnMore);
  60. DDX_Control(pDX, IDC_SLIDER_TRANSPARENT, m_Slider);
  61. DDX_CBIndex(pDX, IDC_COMBO_THEME, m_nTheme);
  62. DDX_CBIndex(pDX, IDC_COMBO_ANIMATION, m_nAnimation);
  63. DDX_Text(pDX, IDC_EDIT_ANIMATIONDELAY, m_uAnimDelay);
  64. DDV_MinMaxUInt(pDX, m_uAnimDelay, 0, 60000);
  65. DDX_Text(pDX, IDC_EDIT_SHOWDELAY, m_uShowDelay);
  66. DDV_MinMaxUInt(pDX, m_uShowDelay, 0, 600000);
  67. DDX_Check(pDX, IDC_CHECK_ALLOWMOVE, m_bAllowMove);
  68. //}}AFX_DATA_MAP
  69. }
  70. BEGIN_MESSAGE_MAP(CPopupControlDemoDlg, CDialog)
  71. //{{AFX_MSG_MAP(CPopupControlDemoDlg)
  72. ON_WM_SYSCOMMAND()
  73. ON_WM_PAINT()
  74. ON_WM_QUERYDRAGICON()
  75. ON_BN_CLICKED(IDC_BUTTON_SHOW, OnButtonShow)
  76. ON_CBN_SELCHANGE(IDC_COMBO_THEME, OnSelchangeComboTheme)
  77. ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_TRANSPARENT, OnReleasedcaptureSliderTransparent)
  78. ON_CBN_SELCHANGE(IDC_COMBO_ANIMATION, OnSelchangeComboAnimation)
  79. ON_EN_CHANGE(IDC_EDIT_ANIMATIONDELAY, OnChangeEditAnimationdelay)
  80. ON_EN_CHANGE(IDC_EDIT_SHOWDELAY, OnChangeEditShowdelay)
  81. ON_BN_CLICKED(IDC_CHECK_ALLOWMOVE, OnCheckAllowMove)
  82. ON_COMMAND(ID_MORE_RTFSAMPLE, OnMoreRtfsample)
  83. ON_COMMAND(ID_MORE_MARKUPSAMPLE, OnMoreMarkupsample)
  84. ON_COMMAND(ID_MORE_LAYERSAMPLE, OnMoreLayerSample)
  85. //}}AFX_MSG_MAP
  86. ON_CBN_DROPDOWN(IDC_BUTTON_MORE, OnMoreDropDown)
  87. ON_MESSAGE(XTPWM_POPUPCONTROL_NOTIFY, OnPopUpNotify)
  88. END_MESSAGE_MAP()
  89. /////////////////////////////////////////////////////////////////////////////
  90. // CPopupControlDemoDlg message handlers
  91. BOOL CPopupControlDemoDlg::OnInitDialog()
  92. {
  93. CDialog::OnInitDialog();
  94. // Add "About..." menu item to system menu.
  95. // IDM_ABOUTBOX must be in the system command range.
  96. ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
  97. ASSERT(IDM_ABOUTBOX < 0xF000);
  98. CMenu* pSysMenu = GetSystemMenu(FALSE);
  99. if (pSysMenu != NULL)
  100. {
  101. CString strAboutMenu;
  102. strAboutMenu.LoadString(IDS_ABOUTBOX);
  103. if (!strAboutMenu.IsEmpty())
  104. {
  105. pSysMenu->AppendMenu(MF_SEPARATOR);
  106. pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
  107. }
  108. }
  109. // Set the icon for this dialog.  The framework does this automatically
  110. //  when the application's main window is not a dialog
  111. SetIcon(m_hIcon, TRUE);         // Set big icon
  112. SetIcon(m_hIcon, FALSE);        // Set small icon
  113. m_btnMore.SetPushButtonStyle(xtpButtonDropDown);
  114. //
  115. m_Slider.SetRange(0, 255, TRUE);
  116. m_Slider.SetPos(200);
  117. OnSelchangeComboTheme();
  118. return TRUE;  // return TRUE  unless you set the focus to a control
  119. }
  120. void CPopupControlDemoDlg::OnSysCommand(UINT nID, LPARAM lParam)
  121. {
  122. if ((nID & 0xFFF0) == IDM_ABOUTBOX)
  123. {
  124. CAboutDlg dlgAbout;
  125. dlgAbout.DoModal();
  126. }
  127. else
  128. {
  129. CDialog::OnSysCommand(nID, lParam);
  130. }
  131. }
  132. // If you add a minimize button to your dialog, you will need the code below
  133. //  to draw the icon.  For MFC applications using the document/view model,
  134. //  this is automatically done for you by the framework.
  135. void CPopupControlDemoDlg::OnPaint()
  136. {
  137. if (IsIconic())
  138. {
  139. CPaintDC dc(this); // device context for painting
  140. SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
  141. // Center icon in client rectangle
  142. int cxIcon = GetSystemMetrics(SM_CXICON);
  143. int cyIcon = GetSystemMetrics(SM_CYICON);
  144. CRect rect;
  145. GetClientRect(&rect);
  146. int x = (rect.Width() - cxIcon + 1) / 2;
  147. int y = (rect.Height() - cyIcon + 1) / 2;
  148. // Draw the icon
  149. dc.DrawIcon(x, y, m_hIcon);
  150. }
  151. else
  152. {
  153. CDialog::OnPaint();
  154. }
  155. }
  156. // The system calls this to obtain the cursor to display while the user drags
  157. //  the minimized window.
  158. HCURSOR CPopupControlDemoDlg::OnQueryDragIcon()
  159. {
  160. return (HCURSOR) m_hIcon;
  161. }
  162. void CPopupControlDemoDlg::FindBestPosition(CSize szPopup)
  163. {
  164. if (m_ptPopup != CPoint(-1, -1)) 
  165. m_pActivePopup->SetPopupPos(m_ptPopup);
  166. CPoint ptPopup = m_pActivePopup->GetPopupPos();
  167. CRect rcActivePopup(CPoint(ptPopup.x - szPopup.cx, ptPopup.y - szPopup.cy), szPopup);
  168. BOOL bIntersect = FALSE;
  169. do 
  170. {
  171. bIntersect = FALSE;
  172. POSITION pos = m_lstPopupControl.GetHeadPosition();
  173. while(pos)
  174. {
  175. CXTPPopupControl* pPopup = m_lstPopupControl.GetNext(pos);
  176. CRect rcPopup(CPoint(pPopup->GetPopupPos().x - pPopup->GetPopupSize().cx, 
  177. pPopup->GetPopupPos().y - pPopup->GetPopupSize().cy), pPopup->GetPopupSize());
  178. if (CRect().IntersectRect(rcPopup, rcActivePopup))
  179. {
  180. ptPopup.y =  rcPopup.top;
  181. rcActivePopup = CRect(CPoint(ptPopup.x - szPopup.cx, ptPopup.y - szPopup.cy), szPopup);
  182. bIntersect = TRUE;
  183. }
  184. }
  185. } while (bIntersect);
  186. m_pActivePopup->SetPopupPos(ptPopup);
  187. }
  188. void CPopupControlDemoDlg::OnButtonShow()
  189. {
  190. m_pActivePopup = new CXTPPopupControl();
  191. UpdateData();
  192. CSize szPopup (170, 130);
  193. if (m_nTheme == xtpPopupThemeOffice2003 || m_nTheme == xtpPopupThemeOffice2007)
  194. szPopup = CSize(329, 74);
  195. if (m_nTheme == 9)
  196. szPopup = CSize(220, 90);
  197. SetTheme();
  198. m_pActivePopup->SetPopupAnimation((XTPPopupAnimation)m_nAnimation);
  199. m_pActivePopup->SetShowDelay(m_uShowDelay);
  200. m_pActivePopup->SetAnimateDelay(m_uAnimDelay);
  201. m_pActivePopup->SetTransparency((BYTE)m_Slider.GetPos());
  202. m_pActivePopup->SetPopupSize(szPopup);
  203. FindBestPosition(szPopup);
  204. m_pActivePopup->AllowMove(m_bAllowMove);
  205. m_pActivePopup->Show(this);
  206. m_lstPopupControl.AddTail(m_pActivePopup);
  207. EnableItems(FALSE);
  208. }
  209. void CPopupControlDemoDlg::EnableItems(BOOL bEnable)
  210. {
  211. CWnd* pWnd = GetWindow(GW_CHILD);
  212. while (pWnd)
  213. {
  214. pWnd->EnableWindow(bEnable);
  215. pWnd = pWnd->GetWindow(GW_HWNDNEXT);
  216. }
  217. GetDlgItem(IDC_BUTTON_SHOW)->EnableWindow(TRUE);
  218. }
  219. void CPopupControlDemoDlg::SetDefaults()
  220. {
  221. switch (m_nTheme)
  222. {
  223. case xtpPopupThemeOffice2000:
  224. case xtpPopupThemeOfficeXP:
  225. {
  226. m_nAnimation = 1;
  227. m_uAnimDelay = 500;
  228. m_uShowDelay = 3000;
  229. m_Slider.SetPos(255);
  230. }
  231. break;
  232. case xtpPopupThemeOffice2003:
  233. case xtpPopupThemeOffice2007:
  234. {
  235. m_nAnimation = 1;
  236. m_uAnimDelay = 500;
  237. m_uShowDelay = 3000;
  238. m_Slider.SetPos(200);
  239. }
  240. break;
  241. case xtpPopupThemeMSN:
  242. case 5:
  243. case 6:
  244. case 7:
  245. case 8:
  246. {
  247. m_nAnimation = 2;
  248. m_uAnimDelay = 350;
  249. m_uShowDelay = 3000;
  250. m_Slider.SetPos(255);
  251. }
  252. break;
  253. case 9:
  254. {
  255. m_nAnimation = 3;
  256. m_uAnimDelay = 500;
  257. m_uShowDelay = 3000;
  258. m_Slider.SetPos(255);
  259. }
  260. break;
  261. }
  262. UpdateData(FALSE);
  263. }
  264. void CPopupControlDemoDlg::SetDefaultTheme()
  265. {
  266. m_pActivePopup->RemoveAllItems();
  267. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  268. new CXTPPopupItem(CRect(25, 5, 170, 19), _T("Word 2000 Theme")));
  269. pItemText->SetTextAlignment(DT_LEFT);
  270. pItemText->CalculateHeight();
  271. pItemText->CalculateWidth();
  272. pItemText->SetHyperLink(FALSE);
  273. pItemText->SetTextColor(RGB(255,255,255));
  274. CXTPPopupItem * pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  275. new CXTPPopupItem(CRect(4, 4, 20, 19)));
  276. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  277. MAKEINTRESOURCE(IDI_WORD2000), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  278. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  279. new CXTPPopupItem(CRect(14, 40, 20, 49)));
  280. pItemIcon->SetIcons(IDB_LOGOOFFICE, 0, xtpPopupItemIconNormal);
  281. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  282. new CXTPPopupItem(CRect(109, 55, 132, 78)));
  283. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  284. MAKEINTRESOURCE(IDI_OPEN), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  285. pItemIcon->CenterIcon();
  286. pItemIcon->SetButton(TRUE);
  287. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  288. new CXTPPopupItem(CRect(133, 55, 156, 78)));
  289. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  290. MAKEINTRESOURCE(IDI_SAVE), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  291. pItemIcon->CenterIcon();
  292. pItemIcon->SetButton(TRUE);
  293. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  294. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  295. pItemIcon->SetIcons(IDB_CLOSEOFFICE, 0,
  296. xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  297. pItemIcon->SetID(ID_POPUP_CLOSE);
  298. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  299. new CXTPPopupItem(CRect(104, 30, 170, 45), _T("Parameters")));
  300. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  301. new CXTPPopupItem(CRect(65, 90, 105, 110), _T("OK")));
  302. pItemText->SetButton(TRUE);
  303. pItemText->SetTextAlignment(DT_CENTER|DT_VCENTER|DT_SINGLELINE);
  304. pItemText->SetHyperLink(FALSE);
  305. pItemText->SetID(IDOK);
  306. m_pActivePopup->SetTheme(xtpPopupThemeOffice2000);
  307. m_pActivePopup->RedrawControl();
  308. }
  309. void CPopupControlDemoDlg::SetOfficeXPTheme()
  310. {
  311. m_pActivePopup->RemoveAllItems();
  312. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  313. new CXTPPopupItem(CRect(25, 5, 170, 19), _T("Word XP Theme")));
  314. pItemText->SetTextAlignment(DT_LEFT);
  315. pItemText->CalculateHeight();
  316. pItemText->CalculateWidth();
  317. pItemText->SetHyperLink(FALSE);
  318. pItemText->SetTextColor(RGB(255,255,255));
  319. CXTPPopupItem * pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  320. new CXTPPopupItem(CRect(4, 4, 20, 19)));
  321. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  322. MAKEINTRESOURCE(IDI_WORD2000), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  323. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  324. new CXTPPopupItem(CRect(14, 40, 20, 49)));
  325. pItemIcon->SetIcons(IDB_LOGOOFFICE, 0, xtpPopupItemIconNormal);
  326. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  327. new CXTPPopupItem(CRect(109, 55, 132, 78)));
  328. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  329. MAKEINTRESOURCE(IDI_OPEN), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  330. pItemIcon->CenterIcon();
  331. pItemIcon->SetButton(TRUE);
  332. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  333. new CXTPPopupItem(CRect(133, 55, 156, 78)));
  334. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  335. MAKEINTRESOURCE(IDI_SAVE), IMAGE_ICON, 16, 16, 0),xtpPopupItemIconNormal);
  336. pItemIcon->CenterIcon();
  337. pItemIcon->SetButton(TRUE);
  338. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  339. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  340. pItemIcon->SetIcons(IDB_CLOSEOFFICE, 0,
  341. xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  342. pItemIcon->SetID(ID_POPUP_CLOSE);
  343. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  344. new CXTPPopupItem(CRect(104, 30, 170, 45), _T("Parameters")));
  345. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  346. new CXTPPopupItem(CRect(65, 90, 105, 110), _T("OK")));
  347. pItemText->SetButton(TRUE);
  348. pItemText->SetTextAlignment(DT_CENTER|DT_VCENTER|DT_SINGLELINE);
  349. pItemText->SetHyperLink(FALSE);
  350. pItemText->SetID(IDOK);
  351. m_pActivePopup->SetTheme(xtpPopupThemeOfficeXP);
  352. m_pActivePopup->RedrawControl();
  353. }
  354. void CPopupControlDemoDlg::SetMSNTheme()
  355. {
  356. m_pActivePopup->RemoveAllItems();
  357. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  358. new CXTPPopupItem(CRect(25, 6, 170, 19), _T("PopupControlDemo")));
  359. pItemText->SetTextAlignment(DT_LEFT);
  360. pItemText->CalculateHeight();
  361. pItemText->CalculateWidth();
  362. pItemText->SetHyperLink(FALSE);
  363. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  364. new CXTPPopupItem(CRect(104, 27, 160, 45), _T("Options")));
  365. pItemText->SetTextAlignment(DT_RIGHT);
  366. pItemText->CalculateHeight();
  367. pItemText->CalculateWidth();
  368. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  369. new CXTPPopupItem(CRect(0, 50, 170, 100), _T("Please visit our website for additional product information including registration details.")));
  370. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  371. pItemText->CalculateHeight();
  372. pItemText->SetID(ID_GOTO_SITE);
  373. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  374. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  375. pItemIcon->SetIcons(IDB_CLOSEMSN, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  376. pItemIcon->SetID(ID_POPUP_CLOSE);
  377. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  378. new CXTPPopupItem(CRect(7, 6, 20, 19)));
  379. pItemIcon->SetIcons(IDB_CAPTIONMSN, 0, xtpPopupItemIconNormal);
  380. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  381. new CXTPPopupItem(CRect(115, 102, 160, 120)));
  382. pItemIcon->SetIcons(IDB_LOGOMSN, 0, xtpPopupItemIconNormal);
  383. m_pActivePopup->SetTheme(xtpPopupThemeMSN);
  384. m_pActivePopup->RedrawControl();
  385. }
  386. void CPopupControlDemoDlg::SetOffice2003Theme()
  387. {
  388. m_pActivePopup->RemoveAllItems();
  389. // add text items.
  390. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  391. new CXTPPopupItem(CRect(46, 16, 270, 41), _T("Peter Parker")));
  392. pItemText->SetBold(TRUE);
  393. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  394. new CXTPPopupItem(CRect(46, 29, 270, 54), _T("RE: Week reports 12/04/2004 - 17/04/2004")));
  395. pItemText->SetHyperLink(FALSE);
  396. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  397. new CXTPPopupItem(CRect(46, 42, 270, 92), _T("See comments below.nThanks.")));
  398. pItemText->SetHyperLink(FALSE);
  399. pItemText->SetTextColor(RGB(0, 61, 178));
  400. pItemText->SetTextAlignment(DT_LEFT|DT_WORDBREAK);
  401. // letter icon.
  402. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  403. new CXTPPopupItem(CRect(5, 12, 17, 24)));
  404. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  405. MAKEINTRESOURCE(IDI_LETTER), IMAGE_ICON, 32, 32, 0));
  406. pItemIcon->SetButton(FALSE);
  407. // close icon.
  408. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  409. new CXTPPopupItem(CRect(308, 14, 324, 30)));
  410. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  411. MAKEINTRESOURCE(IDI_CLOSE), IMAGE_ICON, 16, 16, 0));
  412. pItemIcon->SetButton(TRUE);
  413. pItemIcon->SetID(ID_POPUP_CLOSE);
  414. // flag icon.
  415. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  416. new CXTPPopupItem(CRect(4, 49, 20, 65)));
  417. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  418. MAKEINTRESOURCE(IDI_FLAG), IMAGE_ICON, 16, 16, 0));
  419. pItemIcon->SetButton(TRUE);
  420. // cross icon.
  421. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  422. new CXTPPopupItem(CRect(23, 49, 39, 65)));
  423. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  424. MAKEINTRESOURCE(IDI_CROSS), IMAGE_ICON, 16, 16, 0));
  425. pItemIcon->SetButton(TRUE);
  426. m_pActivePopup->SetTheme(xtpPopupThemeOffice2003);
  427. m_pActivePopup->RedrawControl();
  428. }
  429. void CPopupControlDemoDlg::SetOffice2007Theme()
  430. {
  431. SetOffice2003Theme();
  432. m_pActivePopup->SetTheme(xtpPopupThemeOffice2007);
  433. m_pActivePopup->RedrawControl();
  434. }
  435. void CPopupControlDemoDlg::SetBlueTheme()
  436. {
  437. m_pActivePopup->RemoveAllItems();
  438. m_pActivePopup->AddItem(new CXTPPopupItem(
  439. CRect(0, 0, 170, 130), NULL,  RGB(50,50,255), RGB(255,255,255)));
  440. m_pActivePopup->AddItem(new CXTPPopupItem(
  441. CRect(5, 25, 170 - 5, 130 - 5), NULL, RGB(70,70,250), RGB(200,200,200)));
  442. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  443. new CXTPPopupItem(CRect(104, 27, 170, 45), _T("more...")));
  444. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  445. new CXTPPopupItem(CRect(0, 70, 170, 100), _T("Please visit our website for additional product information including registration details.")));
  446. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  447. pItemText->SetTextColor(RGB(255,255,255));
  448. pItemText->CalculateHeight();
  449. pItemText->SetID(ID_GOTO_SITE);
  450. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  451. new CXTPPopupItem(CRect(12, 30, 12, 47)));
  452. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  453. MAKEINTRESOURCE(IDI_LETTER2), IMAGE_ICON, 32, 32, 0));
  454. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  455. new CXTPPopupItem(CRect(5, 0, 170, 25), _T("Message for You")));
  456. pItemText->SetTextAlignment(DT_LEFT|DT_SINGLELINE| DT_VCENTER);
  457. pItemText->SetTextColor(RGB(255, 255, 255));
  458. pItemText->SetBold(TRUE);
  459. pItemText->SetHyperLink(FALSE);
  460. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  461. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  462. pItemIcon->SetIcons(IDB_CLOSEMSN, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  463. pItemIcon->SetID(ID_POPUP_CLOSE);
  464. m_pActivePopup->SetTheme(new CXTPPopupPaintManager());
  465. m_pActivePopup->RedrawControl();
  466. }
  467. void CPopupControlDemoDlg::SetBlackTheme()
  468. {
  469. m_pActivePopup->RemoveAllItems();
  470. m_pActivePopup->AddItem(new CXTPPopupItem(
  471. CRect(0, 0, 170, 130), NULL, RGB(10,10,10), RGB(255,255,255)));
  472. m_pActivePopup->AddItem(new CXTPPopupItem(
  473. CRect(5, 25, 170 - 5, 130 - 5), NULL, RGB(70,70,70), RGB(200,200,200)));
  474. CXTPPopupItem* pItemText = (CXTPPopupItem*)
  475. m_pActivePopup->AddItem(new CXTPPopupItem(CRect(104, 27, 170, 45),
  476. _T("more...")));
  477. pItemText->SetTextColor(RGB(150,150,150));
  478. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  479. new CXTPPopupItem(CRect(0, 70, 170, 100), _T("Please visit our website for additional product information including registration details.")));
  480. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  481. pItemText->SetTextColor(RGB(255,255,255));
  482. pItemText->CalculateHeight();
  483. pItemText->SetID(ID_GOTO_SITE);
  484. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  485. new CXTPPopupItem(CRect(12, 30, 12, 47)));
  486. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  487. MAKEINTRESOURCE(IDI_LETTER2), IMAGE_ICON, 32, 32, 0));
  488. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  489. new CXTPPopupItem(CRect(5, 0, 170, 25), _T("Message for You")));
  490. pItemText->SetTextAlignment(DT_LEFT|DT_SINGLELINE| DT_VCENTER);
  491. pItemText->SetTextColor(RGB(255, 255, 255));
  492. pItemText->SetBold(TRUE);
  493. pItemText->SetHyperLink(FALSE);
  494. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  495. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  496. pItemIcon->SetIcons(IDB_CLOSEMSN, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  497. pItemIcon->SetID(ID_POPUP_CLOSE);
  498. m_pActivePopup->SetTheme(new CXTPPopupPaintManager());
  499. m_pActivePopup->RedrawControl();
  500. }
  501. void CPopupControlDemoDlg::SetGreenTheme()
  502. {
  503. m_pActivePopup->RemoveAllItems();
  504. m_pActivePopup->AddItem(new CXTPPopupItem(
  505. CRect(0, 0, 170, 130), NULL, RGB(30,120,30), RGB(255,255,0)));
  506. m_pActivePopup->AddItem(new CXTPPopupItem(
  507. CRect(5, 25, 170 - 5, 130 - 5), NULL, RGB(70,130,70), RGB(255,255,0)));
  508. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  509. new CXTPPopupItem(CRect(104, 27, 170, 45), _T("more...")));
  510. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  511. new CXTPPopupItem(CRect(0, 70, 170, 100), _T("Please visit our website for additional product information including registration details.")));
  512. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  513. pItemText->SetTextColor(RGB(255,255,0));
  514. pItemText->CalculateHeight();
  515. pItemText->SetID(ID_GOTO_SITE);
  516. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  517. new CXTPPopupItem(CRect(12, 30, 12, 47)));
  518. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  519. MAKEINTRESOURCE(IDI_LETTER2), IMAGE_ICON, 32, 32, 0));
  520. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  521. new CXTPPopupItem(CRect(5, 0, 170, 25), _T("Message for You")));
  522. pItemText->SetTextAlignment(DT_LEFT|DT_SINGLELINE| DT_VCENTER);
  523. pItemText->SetTextColor(RGB(255, 255, 255));
  524. pItemText->SetBold(TRUE);
  525. pItemText->SetHyperLink(FALSE);
  526. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  527. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  528. pItemIcon->SetIcons(IDB_CLOSEMSN, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  529. pItemIcon->SetID(ID_POPUP_CLOSE);
  530. m_pActivePopup->SetTheme(new CXTPPopupPaintManager());
  531. m_pActivePopup->RedrawControl();
  532. }
  533. void CPopupControlDemoDlg::SetRedTheme()
  534. {
  535. m_pActivePopup->RemoveAllItems();
  536. m_pActivePopup->AddItem(new CXTPPopupItem(
  537. CRect(0, 0, 170, 130), NULL, RGB(255,50,50), RGB(255,255,0)));
  538. m_pActivePopup->AddItem(new CXTPPopupItem(
  539. CRect(5, 25, 170 - 5, 130 - 5), NULL, RGB(230,70,70), RGB(255,255,0)));
  540. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  541. new CXTPPopupItem(CRect(104, 27, 170, 45), _T("more...")));
  542. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  543. new CXTPPopupItem(CRect(0, 70, 170, 100), _T("Please visit our website for additional product information including registration details.")));
  544. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  545. pItemText->SetTextColor(RGB(255,255,0));
  546. pItemText->CalculateHeight();
  547. pItemText->SetID(ID_GOTO_SITE);
  548. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  549. new CXTPPopupItem(CRect(12, 30, 12, 47)));
  550. pItemIcon->SetIcon((HICON)LoadImage(AfxGetInstanceHandle(),
  551. MAKEINTRESOURCE(IDI_LETTER2), IMAGE_ICON, 32, 32, 0));
  552. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  553. new CXTPPopupItem(CRect(5, 0, 170, 25), _T("Message for You")));
  554. pItemText->SetTextAlignment(DT_LEFT|DT_SINGLELINE| DT_VCENTER);
  555. pItemText->SetTextColor(RGB(255, 255, 255));
  556. pItemText->SetBold(TRUE);
  557. pItemText->SetHyperLink(FALSE);
  558. pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  559. new CXTPPopupItem(CRect(151, 6, 164, 19)));
  560. pItemIcon->SetIcons(IDB_CLOSEMSN, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  561. pItemIcon->SetID(ID_POPUP_CLOSE);
  562. m_pActivePopup->SetTheme(new CXTPPopupPaintManager());
  563. m_pActivePopup->RedrawControl();
  564. }
  565. void CPopupControlDemoDlg::SetTooltipTheme()
  566. {
  567. m_pActivePopup->RemoveAllItems();
  568. m_pActivePopup->AddItem(new CXTPPopupItem(
  569. CRect(0, 0, 220, 90), NULL, RGB(255,255,225), 0));
  570. CXTPPopupItem* pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  571. new CXTPPopupItem(CRect(20, 30, 200, 100), _T("Please visit our website for additional product information including registration details.")));
  572. pItemText->SetTextAlignment(DT_CENTER|DT_WORDBREAK);
  573. pItemText->SetID(ID_GOTO_SITE);
  574. pItemText = (CXTPPopupItem*)m_pActivePopup->AddItem(
  575. new CXTPPopupItem(CRect(5, 0, 170, 25), _T("Codejock Information")));
  576. pItemText->SetTextAlignment(DT_LEFT|DT_SINGLELINE| DT_VCENTER);
  577. pItemText->SetBold(TRUE);
  578. pItemText->SetHyperLink(FALSE);
  579. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)m_pActivePopup->AddItem(
  580. new CXTPPopupItem(CRect(220 - 20, 2, 220 - 2, 2 + 18)));
  581. pItemIcon->SetIcons(IDB_CLOSETOOLTIP, 0, xtpPopupItemIconNormal|xtpPopupItemIconSelected|xtpPopupItemIconPressed);
  582. pItemIcon->SetID(ID_POPUP_CLOSE);
  583. m_pActivePopup->SetTheme(new CXTPPopupPaintManager());
  584. m_pActivePopup->RedrawControl();
  585. }
  586. void CPopupControlDemoDlg::SetTheme()
  587. {
  588. switch (m_nTheme)
  589. {
  590. case xtpPopupThemeOffice2000:
  591. SetDefaultTheme();
  592. break;
  593. case xtpPopupThemeOfficeXP:
  594. SetOfficeXPTheme();
  595. break;
  596. case xtpPopupThemeOffice2003:
  597. SetOffice2003Theme();
  598. break;
  599. case xtpPopupThemeOffice2007:
  600. SetOffice2007Theme();
  601. break;
  602. case xtpPopupThemeMSN:
  603. SetMSNTheme();
  604. break;
  605. case 5:
  606. SetBlueTheme();
  607. break;
  608. case 6:
  609. SetBlackTheme();
  610. break;
  611. case 7:
  612. SetGreenTheme();
  613. break;
  614. case 8:
  615. SetRedTheme();
  616. break;
  617. case 9:
  618. SetTooltipTheme();
  619. break;
  620. }
  621. }
  622. void CPopupControlDemoDlg::OnCheckAllowMove()
  623. {
  624. UpdateData();
  625. }
  626. void CPopupControlDemoDlg::OnSelchangeComboTheme()
  627. {
  628. UpdateData();
  629. SetDefaults();
  630. }
  631. void CPopupControlDemoDlg::OnReleasedcaptureSliderTransparent(NMHDR* /*pNMHDR*/, LRESULT* pResult)
  632. {
  633. *pResult = 0;
  634. }
  635. void CPopupControlDemoDlg::OnSelchangeComboAnimation()
  636. {
  637. UpdateData();
  638. }
  639. void CPopupControlDemoDlg::OnChangeEditAnimationdelay()
  640. {
  641. UpdateData();
  642. }
  643. void CPopupControlDemoDlg::OnChangeEditShowdelay()
  644. {
  645. UpdateData();
  646. }
  647. void CPopupControlDemoDlg::OnMoreDropDown()
  648. {
  649. CMenu menu;
  650. VERIFY(menu.LoadMenu(IDR_MENU_MORE));
  651. CXTPWindowRect rc(GetDlgItem(IDC_BUTTON_MORE));
  652. TrackPopupMenu(menu.GetSubMenu(0)->GetSafeHmenu(), 0, rc.left, rc.bottom, 0, m_hWnd, 0);
  653. }
  654. LRESULT CPopupControlDemoDlg::OnPopUpNotify(WPARAM wParam, LPARAM lParam)
  655. {
  656. // process notify from popup wnd
  657. if(wParam == XTP_PCN_ITEMCLICK)
  658. {
  659. CXTPPopupItem* pItem = (CXTPPopupItem*)lParam;
  660. ASSERT(pItem);
  661. if(pItem->GetID() == ID_GOTO_SITE)
  662. {
  663. ::ShellExecute(NULL, _T("open"), _T("http://www.codejock.com/"), NULL, NULL, SW_SHOW);
  664. }
  665. pItem->GetPopupControl()->Close();
  666. }
  667. else if(wParam == XTP_PCN_STATECHANGED)
  668. {
  669. CXTPPopupControl* pControl = (CXTPPopupControl*)lParam;
  670. ASSERT(pControl);
  671. if(pControl->GetPopupState() == xtpPopupStateClosed)
  672. {
  673. m_lstPopupControl.RemoveAt(m_lstPopupControl.Find(pControl));
  674. m_pActivePopup = NULL;
  675. if (m_lstPopupControl.IsEmpty())
  676. {
  677. EnableItems(TRUE);
  678. }
  679. delete pControl;
  680. }
  681. }
  682. else if (wParam == XTP_PCN_POSCHANGED)
  683. {
  684. CXTPPopupControl* pControl = (CXTPPopupControl*)lParam;
  685. ASSERT(pControl);
  686. m_ptPopup = pControl->GetPopupPos();
  687. }
  688. return TRUE;
  689. }
  690. void CPopupControlDemoDlg::OnMoreRtfsample() 
  691. {
  692. CXTPPopupControl* pPopup = new CXTPPopupControl();
  693. pPopup->SetTransparency(200);
  694. pPopup->SetTheme(xtpPopupThemeOffice2003);
  695. pPopup->AllowMove(TRUE);
  696. pPopup->SetAnimateDelay(500);
  697. pPopup->SetPopupAnimation();
  698. pPopup->SetShowDelay(5000);
  699. CXTPPopupItem* pItemText = (CXTPPopupItem*)pPopup->AddItem(new CXTPPopupItem(CRect(8, 12, 500, 130)));
  700. pItemText->SetRTFText(IDR_MAINFRAME);
  701. pItemText->FitToContent();
  702. CSize sz(pItemText->GetRect().Size());
  703. // close icon.
  704. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)pPopup->AddItem(
  705. new CXTPPopupItem(CRect(sz.cx + 2, 10, sz.cx + 2 + 16, 10 + 16)));
  706. pPopup->GetImageManager()->SetIcon(IDI_POPUP_CLOSE, IDI_POPUP_CLOSE);
  707. pItemIcon->SetIconIndex(IDI_POPUP_CLOSE);
  708. pItemIcon->SetButton(TRUE);
  709. pItemIcon->SetID(XTP_ID_POPUP_CLOSE);
  710. pPopup->SetPopupSize(CSize(sz.cx + 20, sz.cy + 20));
  711. pPopup->Show(this);
  712. m_lstPopupControl.AddTail(pPopup);
  713. }
  714. void CPopupControlDemoDlg::OnMoreMarkupsample() 
  715. {
  716. CXTPPopupControl* pPopup = new CXTPPopupControl();
  717. pPopup->SetTransparency(200);
  718. pPopup->SetTheme(xtpPopupThemeOffice2003);
  719. pPopup->AllowMove(TRUE);
  720. pPopup->SetAnimateDelay(500);
  721. pPopup->SetPopupAnimation();
  722. pPopup->SetShowDelay(5000);
  723. CXTPPopupItem* pItemText = (CXTPPopupItem*)pPopup->AddItem(new CXTPPopupItem(CRect(8, 12, 500, 130)));
  724. LPCTSTR lpszMarkup = 
  725. _T("<Grid VerticalAlignment='Center' HorizontalAlignment='Center'>")
  726.     _T("    <Grid.ColumnDefinitions>")
  727.     _T("        <ColumnDefinition/>")
  728.     _T("        <ColumnDefinition/>")
  729.     _T("        <ColumnDefinition/>")
  730.     _T("        <ColumnDefinition/>")
  731.     _T("    </Grid.ColumnDefinitions>")
  732.     _T("    <Grid.RowDefinitions>")
  733.     _T("        <RowDefinition/>")
  734.     _T("        <RowDefinition/>")
  735.     _T("        <RowDefinition/>")
  736.     _T("        <RowDefinition/>")
  737.     _T("        <RowDefinition/>")
  738.     _T("        <RowDefinition/>")
  739.     _T("     </Grid.RowDefinitions>")
  740.     _T("    <Border Grid.Column='0' Grid.Row='0'><TextBlock><Hyperlink>FTSE 100</Hyperlink></TextBlock></Border>")
  741.     _T("    <Border Grid.Column='0' Grid.Row='1'><TextBlock><Hyperlink>FTSE TechMark</Hyperlink></TextBlock></Border>")
  742.     _T("    <Border Grid.Column='0' Grid.Row='2'><TextBlock><Hyperlink>Dow Jones</Hyperlink></TextBlock></Border>")
  743.     _T("    <Border Grid.Column='0' Grid.Row='3'><TextBlock><Hyperlink>S&amp;P 500</Hyperlink></TextBlock></Border>")
  744.     _T("    <Border Grid.Column='0' Grid.Row='4'><TextBlock><Hyperlink>Dollar</Hyperlink></TextBlock></Border>")
  745.     _T("    <Border Grid.Column='0' Grid.Row='5'><TextBlock><Hyperlink>Euro</Hyperlink></TextBlock></Border>")
  746.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='0'><TextBlock TextAlignment='Right'>5,990.12</TextBlock></Border>")
  747.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='1'><TextBlock TextAlignment='Right'>804.10</TextBlock></Border>")
  748.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='2'><TextBlock TextAlignment='Right'>8,322.12</TextBlock></Border>")
  749.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='3'><TextBlock TextAlignment='Right'>860</TextBlock></Border>")
  750.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='4'><TextBlock TextAlignment='Right'>1.56</TextBlock></Border>")
  751.     _T("    <Border Margin='5, 0, 5, 0' Grid.Column='1' Grid.Row='5'><TextBlock TextAlignment='Right'>1.59</TextBlock></Border>")
  752.     _T("    <Border Grid.Column='2' Grid.Row='0'><TextBlock TextAlignment='Right' Foreground='Green'>+50.1</TextBlock></Border>")
  753.     _T("    <Border Grid.Column='2' Grid.Row='1'><TextBlock TextAlignment='Right' Foreground='Red'>-0.4</TextBlock></Border>")
  754.     _T("    <Border Grid.Column='2' Grid.Row='2'><TextBlock TextAlignment='Right' Foreground='Green'>+78</TextBlock></Border>")
  755.     _T("    <Border Grid.Column='2' Grid.Row='3'><TextBlock TextAlignment='Right' Foreground='Green'>+15.43</TextBlock></Border>")
  756.     _T("    <Border Grid.Column='2' Grid.Row='4'><TextBlock TextAlignment='Right' Foreground='Green'>+0.06</TextBlock></Border>")
  757.     _T("    <Border Grid.Column='2' Grid.Row='5'><TextBlock TextAlignment='Right' Foreground='Red'>-0.11</TextBlock></Border>")
  758.     _T("</Grid>");
  759. pItemText->SetMarkupText(lpszMarkup);
  760. pItemText->FitToContent();
  761. CSize sz(pItemText->GetRect().Size());
  762. // close icon.
  763. CXTPPopupItem* pItemIcon = (CXTPPopupItem*)pPopup->AddItem(
  764. new CXTPPopupItem(CRect(sz.cx + 10, 10, sz.cx + 10 + 16, 10 + 16)));
  765. pPopup->GetImageManager()->SetIcon(IDI_POPUP_CLOSE, IDI_POPUP_CLOSE);
  766. pItemIcon->SetIconIndex(IDI_POPUP_CLOSE);
  767. pItemIcon->SetButton(TRUE);
  768. pItemIcon->SetID(XTP_ID_POPUP_CLOSE);
  769. pPopup->SetPopupSize(CSize(sz.cx + 30, sz.cy + 20));
  770. pPopup->Show(this);
  771. m_lstPopupControl.AddTail(pPopup);
  772. }
  773. void CPopupControlDemoDlg::OnMoreLayerSample() 
  774. {
  775. CXTPPopupControl* pPopup = new CXTPPopupControl();
  776. pPopup->AllowMove(TRUE);
  777. pPopup->SetAnimateDelay(500);
  778. pPopup->SetPopupAnimation();
  779. pPopup->SetShowDelay(5000);
  780. UINT nCommands[] = {100};
  781. VERIFY(pPopup->GetImageManager()->SetIcons(_T("IDB_PUSSLE"), nCommands, 1, CSize(0, 0)));
  782. pPopup->SetBackgroundBitmap(nCommands[0]);
  783. pPopup->SetPopupSize(CSize(156, 161));
  784. pPopup->Show(this);
  785. m_lstPopupControl.AddTail(pPopup);
  786. }