Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

90 lines
2.3 KiB

  1. /****************************************************************************
  2. Copyright (c) 1998-1999 Microsoft Corporation
  3. Module Name: cpllocationps.cpp
  4. Author: toddb - 10/06/98
  5. ****************************************************************************/
  6. // Property Sheet stuff for the main page
  7. #include "cplPreComp.h"
  8. #include "cplLocationPS.h"
  9. CLocationPropSheet::CLocationPropSheet(BOOL bNew, CLocation * pLoc, CLocations * pLocList, LPCWSTR pwszAdd)
  10. {
  11. m_bNew = bNew;
  12. m_pLoc = pLoc;
  13. m_pLocList = pLocList;
  14. m_dwCountryID = 0;
  15. m_pRule = NULL;
  16. m_pCard = NULL;
  17. m_bWasApplied = FALSE;
  18. m_bShowPIN = FALSE;
  19. m_pwszAddress = pwszAdd;
  20. }
  21. CLocationPropSheet::~CLocationPropSheet()
  22. {
  23. }
  24. LONG CLocationPropSheet::DoPropSheet(HWND hwndParent)
  25. {
  26. PROPSHEETHEADER psh;
  27. PROPSHEETPAGE psp;
  28. HPROPSHEETPAGE hpsp[3];
  29. // Initialize the header:
  30. psh.dwSize = sizeof(psh);
  31. psh.dwFlags = PSH_DEFAULT;
  32. psh.hwndParent = hwndParent;
  33. psh.hInstance = GetUIInstance();
  34. psh.hIcon = NULL;
  35. psh.pszCaption = MAKEINTRESOURCE(m_bNew?IDS_NEWLOCATION:IDS_EDITLOCATION);
  36. psh.nPages = 3;
  37. psh.nStartPage = 0;
  38. psh.pfnCallback = NULL;
  39. psh.phpage = hpsp;
  40. // Now setup the Property Sheet Page
  41. psp.dwSize = sizeof(psp);
  42. psp.dwFlags = PSP_DEFAULT;
  43. psp.hInstance = GetUIInstance();
  44. psp.lParam = (LPARAM)this;
  45. PSPINFO aData[3] =
  46. {
  47. { IDD_LOC_GENERAL, CLocationPropSheet::General_DialogProc },
  48. { IDD_LOC_AREACODERULES, CLocationPropSheet::AreaCode_DialogProc },
  49. { IDD_LOC_CALLINGCARD, CLocationPropSheet::CallingCard_DialogProc },
  50. };
  51. for (int i=0; i<3; i++)
  52. {
  53. psp.pszTemplate = MAKEINTRESOURCE(aData[i].iDlgID);
  54. psp.pfnDlgProc = aData[i].pfnDlgProc;
  55. hpsp[i] = CreatePropertySheetPage( &psp );
  56. }
  57. PropertySheet( &psh );
  58. return m_bWasApplied?PSN_APPLY:PSN_RESET;
  59. }
  60. BOOL CLocationPropSheet::OnNotify(HWND hwndDlg, LPNMHDR pnmhdr)
  61. {
  62. switch (pnmhdr->code)
  63. {
  64. case PSN_APPLY: // user pressed OK or Apply
  65. case PSN_RESET: // user pressed Cancel
  66. case PSN_KILLACTIVE: // user is switching pages
  67. HideToolTip();
  68. return TRUE;
  69. }
  70. return FALSE;
  71. }