1 #if !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_)
2 #define AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_
4 /////////////////////////////////////////////////////////////////////////////
5 // CLineNumberStatic window
7 class CLineNumberStatic
: public CStatic
9 // Construction/destruction
12 virtual ~CLineNumberStatic();
16 void SetFgColor( COLORREF col
, BOOL redraw
);
17 void SetBgColor( COLORREF col
, BOOL redraw
);
18 void SetTopAndBottom( int topline
, int bottomline
);
19 void SetTopMargin( int topmargin
);
20 void SetLineNumberFormat( CString format
);
23 afx_msg BOOL
OnEraseBkgnd(CDC
* pDC
);
24 afx_msg
void OnPaint();
25 afx_msg
void OnLButtonDown( UINT nFlags
, CPoint point
);
34 int m_topmargin
; // Current top margin
35 int m_topline
; // Current top line number
36 int m_bottomline
; // Current bottom line number
40 /////////////////////////////////////////////////////////////////////////////
41 // CLineNumberEdit window
43 class CLineNumberEdit
: public CEdit
45 // Construction/destruction
48 virtual ~CLineNumberEdit();
52 void SetMarginForegroundColor( COLORREF col
, BOOL redraw
= TRUE
, BOOL bEnabled
= TRUE
);
53 void SetMarginBackgroundColor( COLORREF col
, BOOL redraw
= TRUE
, BOOL bEnabled
= TRUE
);
54 void SetLineNumberFormat( CString format
);
55 void SetLineNumberRange( UINT nMin
, UINT nMax
= 0 );
56 void UseSystemColours( BOOL bUseEnabled
= TRUE
, BOOL bUseDisabled
= TRUE
);
58 int GetLineHeight() {return m_zero
.cy
;}
61 virtual void PreSubclassWindow();
63 virtual afx_msg
void OnEnable( BOOL bEnable
);
64 virtual afx_msg
void OnSysColorChange();
65 virtual afx_msg
void OnChange();
66 virtual afx_msg
void OnVScroll(UINT nSBCode
, UINT nPos
, CScrollBar
* pScrollBar
);
67 virtual afx_msg
void OnVscroll();
68 virtual afx_msg
void OnSize(UINT nType
, int cx
, int cy
);
69 virtual afx_msg LRESULT
OnSetFont(WPARAM wParam
, LPARAM lParam
); // Maps to WM_SETFONT
70 virtual afx_msg LRESULT
OnSetText(WPARAM wParam
, LPARAM lParam
); // Maps to WM_SETTEXT
71 virtual afx_msg LRESULT
OnLineScroll(WPARAM wParam
, LPARAM lParam
); // Maps to EM_LINESCROLL
72 virtual afx_msg LRESULT
OnSelectLine(WPARAM wParam
, LPARAM lParam
);
77 int CalcLineNumberWidth();
78 void UpdateTopAndBottom();
80 // Method to set window colour only
81 void SetWindowColour( BOOL bEnable
= TRUE
);
84 BOOL m_bUseEnabledSystemColours
;
85 COLORREF m_EnabledFgCol
;
86 COLORREF m_EnabledBgCol
;
87 BOOL m_bUseDisabledSystemColours
;
88 COLORREF m_DisabledFgCol
;
89 COLORREF m_DisabledBgCol
;
91 CLineNumberStatic m_line
;
95 int m_LineDelta
; // Introduced to provide an offset to the first line number
99 #endif // !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_)