Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/mpc-hc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCasimir666 <casimir666@users.sourceforge.net>2006-06-25 01:37:43 +0400
committerCasimir666 <casimir666@users.sourceforge.net>2006-06-25 01:37:43 +0400
commit0868305e78da2b0742c2ce349efa041d5622ae21 (patch)
tree663fd93132c7927910ba7c13188d6332b2e3e5b2 /src/apps/mplayerc/LineNumberEdit.h
parent43c8656956a0460fc4551e3ea7a39b9f3094a3e3 (diff)
git-svn-id: https://mpc-hc.svn.sourceforge.net/svnroot/mpc-hc/trunk@14 10f7b99b-c216-0410-bff0-8a66a9350fd8
Diffstat (limited to 'src/apps/mplayerc/LineNumberEdit.h')
-rw-r--r--src/apps/mplayerc/LineNumberEdit.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/apps/mplayerc/LineNumberEdit.h b/src/apps/mplayerc/LineNumberEdit.h
new file mode 100644
index 000000000..4794ead44
--- /dev/null
+++ b/src/apps/mplayerc/LineNumberEdit.h
@@ -0,0 +1,99 @@
+#if !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_)
+#define AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_
+
+/////////////////////////////////////////////////////////////////////////////
+// CLineNumberStatic window
+
+class CLineNumberStatic : public CStatic
+{
+// Construction/destruction
+public:
+ CLineNumberStatic();
+ virtual ~CLineNumberStatic();
+
+// Operations
+public:
+ void SetFgColor( COLORREF col, BOOL redraw );
+ void SetBgColor( COLORREF col, BOOL redraw );
+ void SetTopAndBottom( int topline, int bottomline );
+ void SetTopMargin( int topmargin );
+ void SetLineNumberFormat( CString format );
+
+protected:
+ afx_msg BOOL OnEraseBkgnd(CDC* pDC);
+ afx_msg void OnPaint();
+ afx_msg void OnLButtonDown( UINT nFlags, CPoint point );
+ DECLARE_MESSAGE_MAP()
+
+private:
+// Attributes
+ COLORREF m_fgcol;
+ COLORREF m_bgcol;
+ CString m_format;
+
+ int m_topmargin; // Current top margin
+ int m_topline; // Current top line number
+ int m_bottomline; // Current bottom line number
+};
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CLineNumberEdit window
+
+class CLineNumberEdit : public CEdit
+{
+// Construction/destruction
+public:
+ CLineNumberEdit();
+ virtual ~CLineNumberEdit();
+
+// Operations
+public:
+ void SetMarginForegroundColor( COLORREF col, BOOL redraw = TRUE, BOOL bEnabled = TRUE );
+ void SetMarginBackgroundColor( COLORREF col, BOOL redraw = TRUE, BOOL bEnabled = TRUE );
+ void SetLineNumberFormat( CString format );
+ void SetLineNumberRange( UINT nMin, UINT nMax = 0 );
+ void UseSystemColours( BOOL bUseEnabled = TRUE, BOOL bUseDisabled = TRUE );
+
+ int GetLineHeight() {return m_zero.cy;}
+
+protected:
+ virtual void PreSubclassWindow();
+
+ virtual afx_msg void OnEnable( BOOL bEnable );
+ virtual afx_msg void OnSysColorChange();
+ virtual afx_msg void OnChange();
+ virtual afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
+ virtual afx_msg void OnVscroll();
+ virtual afx_msg void OnSize(UINT nType, int cx, int cy);
+ virtual afx_msg LRESULT OnSetFont(WPARAM wParam, LPARAM lParam); // Maps to WM_SETFONT
+ virtual afx_msg LRESULT OnSetText(WPARAM wParam, LPARAM lParam); // Maps to WM_SETTEXT
+ virtual afx_msg LRESULT OnLineScroll(WPARAM wParam, LPARAM lParam); // Maps to EM_LINESCROLL
+ virtual afx_msg LRESULT OnSelectLine(WPARAM wParam, LPARAM lParam);
+ DECLARE_MESSAGE_MAP()
+
+private:
+ void Prepare();
+ int CalcLineNumberWidth();
+ void UpdateTopAndBottom();
+
+ // Method to set window colour only
+ void SetWindowColour( BOOL bEnable = TRUE );
+
+// Attributes
+ BOOL m_bUseEnabledSystemColours;
+ COLORREF m_EnabledFgCol;
+ COLORREF m_EnabledBgCol;
+ BOOL m_bUseDisabledSystemColours;
+ COLORREF m_DisabledFgCol;
+ COLORREF m_DisabledBgCol;
+
+ CLineNumberStatic m_line;
+ CSize m_zero;
+ int m_maxval;
+ CString m_format;
+ int m_LineDelta; // Introduced to provide an offset to the first line number
+
+};
+
+#endif // !defined(AFX_LINENUMBEREDIT_H__CAB7A465_709C_42B8_80D0_2B0AF6D25AD4__INCLUDED_)