aduiThemedStatic.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // AdUiThemedStatic.h : header file
  12. //
  13. //
  14. // DESCRIPTION:
  15. //
  16. ////////////////////////////////////////////////////////////////////////////
  17. // Architectural notes
  18. //
  19. #if !defined(_ADUITHEMEDSTATIC_H__)
  20. #define _ADUITHEMEDSTATIC_H__
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif // _MSC_VER > 1000
  24. ///////////////////////////////////////////////////////////////////////////////
  25. /// class CAdUiThemedStatic
  26. ///////////////////////////////////////////////////////////////////////////////
  27. /// <summary>
  28. /// AdUiThemedStatic class is a static control that respects the
  29. /// specified theme for when drawing its background and contents.
  30. /// </summary>
  31. class ADUI_PORT CAdUiThemedStatic : public CStatic
  32. {
  33. DECLARE_DYNAMIC(CAdUiThemedStatic)
  34. public:
  35. /// <summary>
  36. /// Default constructor
  37. /// Creates a AdUiThemedStatic object. The text and
  38. /// the background colors from the PALETTE_SET_THEME
  39. /// will be used to draw its contents.
  40. /// </summary>
  41. CAdUiThemedStatic();
  42. /// <summary>
  43. /// Creates a new AdUiThemedStatic object with theme name
  44. /// The text and the background colors from the PALETTE_SET_THEME
  45. /// will be used to draw its contents.
  46. /// </summary>
  47. /// <param name="themeName">
  48. /// Specify themeName string.
  49. /// </param>
  50. CAdUiThemedStatic(const CString & themeName);
  51. /// <summary>
  52. /// Destructor - Destroys this AdUiThemedStatic object.
  53. /// </summary>
  54. virtual ~CAdUiThemedStatic();
  55. /// <summary>
  56. /// Get mThemeName value.
  57. /// </summary>
  58. /// <returns>
  59. /// Reture mThemeName.
  60. /// </returns>
  61. CString GetThemeName() const;
  62. /// <summary>
  63. /// Set mThemeName value.
  64. /// </summary>
  65. /// <param name="themeName">
  66. /// Specify themeName string.
  67. /// </param>
  68. /// <returns>
  69. /// If success, return true. Otherwise, return false.
  70. /// </returns>
  71. bool SetThemeName(const CString & themeName);
  72. protected:
  73. /// <summary>
  74. /// The framework calls this member function when a child control is about to be drawn.
  75. /// </summary>
  76. /// <param name="pDC">
  77. /// Contains a pointer to the display context.
  78. /// </param>
  79. /// <param name="nCtlColor">
  80. /// Specify the type of control.
  81. /// </param>
  82. /// <returns>
  83. /// return a handle to the brush that is to be used for painting the control background.
  84. /// </returns>
  85. afx_msg HBRUSH CtlColor(CDC* pDC, UINT nCtlColor);
  86. //}}AFX_MSG
  87. DECLARE_MESSAGE_MAP()
  88. private:
  89. CString mThemeName; // defaults to PALETTE_SET_THEME
  90. CBrush mBackgroundBrush;
  91. };
  92. //{{AFX_INSERT_LOCATION}}
  93. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  94. #endif // !defined(_ADUITHEMEDSTATIC_H__)