A Fast Bresenham Type Algorithm For Drawing Ellipses by John Kennedy
[xy_vsfilter.git] / src / apps / mplayerc / LineNumberEdit.h
blob4794ead446f68e13df67be699f371d96908d9051
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
10 public:
11 CLineNumberStatic();
12 virtual ~CLineNumberStatic();
14 // Operations
15 public:
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 );
22 protected:
23 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
24 afx_msg void OnPaint();
25 afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
26 DECLARE_MESSAGE_MAP()
28 private:
29 // Attributes
30 COLORREF m_fgcol;
31 COLORREF m_bgcol;
32 CString m_format;
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
46 public:
47 CLineNumberEdit();
48 virtual ~CLineNumberEdit();
50 // Operations
51 public:
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;}
60 protected:
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);
73 DECLARE_MESSAGE_MAP()
75 private:
76 void Prepare();
77 int CalcLineNumberWidth();
78 void UpdateTopAndBottom();
80 // Method to set window colour only
81 void SetWindowColour( BOOL bEnable = TRUE );
83 // Attributes
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;
92 CSize m_zero;
93 int m_maxval;
94 CString m_format;
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_)