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.

144 lines
5.2 KiB

  1. /****************************************************************************
  2. * @doc INTERNAL PROPEDIT
  3. *
  4. * @module PropEdit.h | Header file for the <c CPropertyEditor>
  5. * class used to implement behavior of a single property to be displayed
  6. * in a property page.
  7. *
  8. * @comm This code tests the Ks interface handlers. This code is only
  9. * compiled if USE_PROPERTY_PAGES is defined.
  10. ***************************************************************************/
  11. /****************************************************************************
  12. * @doc INTERNAL CPROPEDITCLASS
  13. *
  14. * @class CPropertyEditor | This class implements behavior of a single
  15. * property to be displayed in a property page.
  16. *
  17. * @mdata ULONG | CPropertyEditor | m_IDProperty | Property ID
  18. *
  19. * @mdata LONG | CPropertyEditor | m_CurrentValue | Property current value
  20. *
  21. * @mdata LONG | CPropertyEditor | m_Min | Property minimum value
  22. *
  23. * @mdata LONG | CPropertyEditor | m_Max | Property maximum value
  24. *
  25. * @mdata LONG | CPropertyEditor | m_SteppingDelta | Property stepping delta
  26. *
  27. * @mdata LONG | CPropertyEditor | m_DefaultValue | Property default value
  28. *
  29. * @mdata BOOL | CPropertyEditor | m_Active | Set to TRUE after all property values have been initialized
  30. *
  31. * @mdata LONG | CPropertyEditor | m_OriginalValue | Backup of the original value
  32. *
  33. * @mdata HWND | CPropertyEditor | m_hDlg | Window handle to the Parent dialog
  34. *
  35. * @mdata HWND | CPropertyEditor | m_hWndMin | Window handle to the Minimum dialog item
  36. *
  37. * @mdata HWND | CPropertyEditor | m_hWndMax | Window handle to the Maximum dialog item
  38. *
  39. * @mdata HWND | CPropertyEditor | m_hWndDefault | Window handle to the Default dialog item
  40. *
  41. * @mdata HWND | CPropertyEditor | m_hWndStep | Window handle to the Stepping Delta dialog item
  42. *
  43. * @mdata HWND | CPropertyEditor | m_hWndEdit | Window handle to the Target dialog item
  44. *
  45. * @mdata HWND | CPropertyEditor | m_hWndTrackbar | Window handle to the slide bar
  46. *
  47. * @mdata HWND | CPropertyEditor | m_hWndProgress | Window handle to the progress bar
  48. *
  49. * @mdata ULONG | CPropertyEditor | m_IDLabel | Resource ID of the property label
  50. *
  51. * @mdata ULONG | CPropertyEditor | m_IDMinControl | Resource ID of the Minimum dialog item
  52. *
  53. * @mdata ULONG | CPropertyEditor | m_IDMaxControl | Resource ID of the Maximum dialog item
  54. *
  55. * @mdata ULONG | CPropertyEditor | m_IDStepControl | Resource ID of the Stepping Delta dialog item
  56. *
  57. * @mdata ULONG | CPropertyEditor | m_IDDefaultControl | Resource ID of the Default dialog item
  58. *
  59. * @mdata ULONG | CPropertyEditor | m_IDEditControl | Resource ID of the Target dialog item
  60. *
  61. * @mdata ULONG | CPropertyEditor | m_IDTrackbarControl | Resource ID of the slide bar
  62. *
  63. * @mdata ULONG | CPropertyEditor | m_IDProgressControl | Resource ID of the progress bar
  64. ***************************************************************************/
  65. class CPropertyEditor
  66. {
  67. public:
  68. CPropertyEditor(HWND hDlg, ULONG IDLabel, ULONG IDMinControl, ULONG IDMaxControl, ULONG IDDefaultControl, ULONG IDStepControl, ULONG IDEditControl, ULONG IDTrackbarControl, ULONG IDProgressControl, ULONG IDProperty, ULONG IDAutoControl);
  69. virtual ~CPropertyEditor();
  70. BOOL Init();
  71. HWND GetTrackbarHWnd();
  72. HWND GetProgressHWnd();
  73. HWND GetEditHWnd();
  74. HWND GetAutoHWnd();
  75. BOOL UpdateEditBox();
  76. BOOL UpdateTrackbar();
  77. BOOL UpdateProgress();
  78. BOOL UpdateAuto();
  79. BOOL OnApply();
  80. BOOL OnDefault();
  81. BOOL OnScroll(ULONG nCommand, WPARAM wParam, LPARAM lParam);
  82. BOOL OnEdit(ULONG nCommand, WPARAM wParam, LPARAM lParam);
  83. BOOL OnAuto(ULONG nCommand, WPARAM wParam, LPARAM lParam);
  84. BOOL HasChanged();
  85. protected:
  86. BOOL CanAutoControl(void);
  87. BOOL GetAuto(void);
  88. BOOL SetAuto(BOOL fAuto);
  89. // Pure virtual functions to set/get actual property values, and the ranges
  90. virtual HRESULT GetValue(void) PURE;
  91. virtual HRESULT SetValue(void) PURE;
  92. virtual HRESULT GetRange(void) PURE;
  93. ULONG m_IDProperty; // Property ID
  94. // The following are used by GetValue and SetValue
  95. LONG m_CurrentValue;
  96. LONG m_CurrentFlags;
  97. // The following must be set by GetRange
  98. LONG m_Min;
  99. LONG m_Max;
  100. LONG m_SteppingDelta;
  101. LONG m_DefaultValue;
  102. LONG m_DefaultFlags;
  103. TAPIControlFlags m_CapsFlags;
  104. private:
  105. BOOL m_Active;
  106. BOOL m_fCheckBox;
  107. LONG m_OriginalValue;
  108. LONG m_OriginalFlags;
  109. HWND m_hDlg; // Parent
  110. HWND m_hWndMin; // Min window
  111. HWND m_hWndMax; // Max window
  112. HWND m_hWndDefault; // Default window
  113. HWND m_hWndStep; // Step window
  114. HWND m_hWndEdit; // Edit window
  115. HWND m_hWndTrackbar; // Slider
  116. HWND m_hWndProgress; // Progress
  117. HWND m_hWndAuto; // Auto checkbox
  118. ULONG m_IDLabel; // ID of label
  119. ULONG m_IDMinControl; // ID of min control
  120. ULONG m_IDMaxControl; // ID of max control
  121. ULONG m_IDStepControl; // ID of step control
  122. ULONG m_IDDefaultControl; // ID of default control
  123. ULONG m_IDEditControl; // ID of edit control
  124. ULONG m_IDTrackbarControl;// ID of trackbar
  125. ULONG m_IDProgressControl;// ID of trackbar
  126. ULONG m_IDAutoControl; // ID of auto checkbox
  127. LONG m_TrackbarOffset; // Handles negative trackbar offsets
  128. LONG m_ProgressOffset; // Handles negative trackbar offsets
  129. BOOL m_CanAutoControl;
  130. };