WTL Controls
Back to the WTL Controls Home Page.
Bevel.h
Go to the documentation of this file.
1 #pragma once
2 #include "stdafx.h"
3 
4 //--------------------------------------------------------------------------------------
5 //--------------------------------------------------------------------------------------
6 //
7 //
8 // WTL Control Library
9 // by
10 // Bright Ideas Software®
11 // Copyright © 2018 by Bright Ideas Software.
12 //
13 //
14 //
15 //--------------------------------------------------------------------------------------
16 //--------------------------------------------------------------------------------------
17 
18 namespace BIS_WTL_CONTROLS
19 {
20 
23 
47  //----------------------------------------------------------------------------------------------
48  class CBevel : public CWindowImpl<CBevel, CStatic>
49  {
50 
51  public:
52 
54  DECLARE_WND_SUPERCLASS(_T("CBevel"), CStatic::GetWndClassName())
55 
56 
57  CBevel() noexcept;
58  virtual ~CBevel();
59 
60 
61  void SubclassStatic(HWND hwnd);
62  void UnSubclassStatic();
63 
64  void SetBevelStyle(CBevelStyle value);
65  CBevelStyle GetBevelStyle() const;
66 
67  void SetBevelMode (CBevelMode mode);
68  CBevelMode GetBevelMode() const;
69 
70  private:
71 
72 
73  void UpdatePens();
74  void DeletePens();
75 
76  CBevelStyle m_bsBevel;
77  CBevelMode m_bmMode;
78 
79  HPEN m_hLitePen, m_hDarkPen;
80 
81  LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
82  BOOL OnEraseBkgnd(CDCHandle dc);
83  void OnSysColorChange();
84 
85  BEGIN_MSG_MAP_EX(CBevel)
86  MESSAGE_HANDLER(WM_PAINT, OnPaint)
87  MSG_WM_ERASEBKGND(OnEraseBkgnd)
88  MSG_WM_SYSCOLORCHANGE(OnSysColorChange)
89  MSG_WM_THEMECHANGED(OnSysColorChange)
90  END_MSG_MAP()
91 
92  };
93  //----------------------------------------------------------------------------------------------
94 };
void SetBevelStyle(CBevelStyle value)
Set a new CBevelStyle value.
Definition: Bevel.cpp:93
void UnSubclassStatic()
Un-subclass the window and release GDI resources.
Definition: Bevel.cpp:65
void SetBevelMode(CBevelMode mode)
Load a new bevel mode.
Definition: Bevel.cpp:120
A CStatic descendant which creates a single or two-tone beveled line, oriented horizontally or vertic...
Definition: Bevel.h:48
CBevelMode GetBevelMode() const
Default: CBevelMode::bmHorizontal.
Definition: Bevel.cpp:106
CBevelStyle GetBevelStyle() const
Default: CBevelStyle::bsSunken.
Definition: Bevel.cpp:79
void SubclassStatic(HWND hwnd)
Subclass a static control window; modify window style to provide the intended graphical appearance...
Definition: Bevel.cpp:50