Leaked source code of windows server 2003
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.

95 lines
2.5 KiB

  1. //Copyright (c) 1997-2000 Microsoft Corporation
  2. #ifndef _INC_PGLOKPRV_H
  3. #define _INC_PGLOKPRV_H
  4. #include "pgbase.h"
  5. class CLookPreviewPg : public WizardPage
  6. {
  7. public:
  8. CLookPreviewPg(LPPROPSHEETPAGE ppsp, int dwPageId, int nIdTitle, int nIdSubTitle, int nIdValueString);
  9. ~CLookPreviewPg(VOID);
  10. protected: // Virtual functions
  11. // Override this if the values are not stored in a string table
  12. virtual void LoadValueArray();
  13. // This must be overridden so that the dialog knows what item to select as the default
  14. virtual int GetCurrentValue(NONCLIENTMETRICS *pncm) = 0;
  15. // If the dialog is using a list box, the user MUST override this function
  16. virtual void GetValueItemText(int nIndex, LPTSTR lpszBuffer, int nLen) {_ASSERTE(FALSE);}
  17. // Must be overridden to set ncm to appropriate values based on Value array index
  18. virtual void ModifyMyNonClientMetrics(NONCLIENTMETRICS &ncm) = 0;
  19. protected:
  20. void UpdatePreview(int nActionCtl);
  21. int m_nIdValueString;
  22. HWND m_hwndSlider;
  23. HWND m_hwndListBox;
  24. int m_nCountValues;
  25. int m_rgnValues[MAX_DISTINCT_VALUES];
  26. int m_nCurValueIndex;
  27. int m_nOrigValueIndex;
  28. void ResetColors();
  29. void UpdateControls();
  30. LRESULT OnInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam);
  31. LRESULT OnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam);
  32. LRESULT HandleMsg(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  33. LRESULT OnPSN_WizNext(HWND hwnd, INT idCtl, LPPSHNOTIFY pnmh);
  34. private:
  35. };
  36. /////////////////////////////////////////////////////////////
  37. // Color page
  38. class CLookPreviewColorPg : public CLookPreviewPg
  39. {
  40. public:
  41. CLookPreviewColorPg(LPPROPSHEETPAGE ppsp)
  42. : CLookPreviewPg( ppsp,
  43. IDD_PREV_COLOR,
  44. IDS_LKPREV_COLORTITLE,
  45. IDS_LKPREV_COLORSUBTITLE,
  46. 0) {};
  47. virtual void LoadValueArray()
  48. {
  49. // For colors, we just use 0 to GetSchemeCount()
  50. m_nCountValues = GetSchemeCount() + 1;
  51. for(int i=0;i<m_nCountValues;i++)
  52. m_rgnValues[i] = i;
  53. }
  54. virtual int GetCurrentValue(NONCLIENTMETRICS *pncm) {return 0;}; // Always return value of 0
  55. virtual void GetValueItemText(int nIndex, LPTSTR lpszBuffer, int nLen)
  56. {
  57. _ASSERTE(nIndex < GetSchemeCount() + 1);
  58. if(0 == nIndex)
  59. {
  60. LoadString(g_hInstDll, IDS_SCHEME_CURRENTCOLORSCHEME, lpszBuffer, nLen);
  61. }
  62. else
  63. GetSchemeName(nIndex - 1, lpszBuffer, nLen);
  64. }
  65. virtual void ModifyMyNonClientMetrics(NONCLIENTMETRICS &ncm)
  66. {
  67. ResetColors();
  68. }
  69. };
  70. #endif // _INC_PGLOKPRV_H