?? sliderctrl.h
字號:
#if !defined(AFX_SLIDERCTRL_H__76F7155D_8D24_40D4_AB0A_FE7306512A00__INCLUDED_)#define AFX_SLIDERCTRL_H__76F7155D_8D24_40D4_AB0A_FE7306512A00__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000/////////////////////////////////////////////////////////////////////////////// RxSliderCtrl window// Window Extended Style#define RXSC_BT_THICK 0x00000001L // Bar Thickness : Thick#define RXSC_BT_THIN 0x00000002L // Thin#define RXSC_GA_BOTH 0x00000010L // Grip Arrow : Both#define RXSC_GA_UP 0x00000020L // Up Arrow#define RXSC_GA_DOWN 0x00000040L // Down Arrow#define RXSC_BS_OVER 0x00000100L // Border Style : Over-layout style#define RXSC_BS_UNDER 0x00000200L // Under-layout style#define RXSC_CD_SHOW 0x00001000L // Count Display : Show#define RXSC_GC_SINGLE 0x00010000L // Grip Count : 1#define RXSC_GC_MULTI 0x00020000L // 2#define RXSC_GC_MULTI_EX 0x00040000L // 3// Mouse Click Event Message#define RXSC_MOUSE_GRIP_LEFT 100 // Left Grip 康開#define RXSC_MOUSE_GRIP_RIGHT 110 // Right Grip 康開#define RXSC_MOUSE_GRIP_CENTER 120 // Center Grip 康開 #define RXSC_MOUSE_GRIP_REGION 130 // Grip苞 Grip 葷撈狼 康開// Size constant#define RXSC_MARGIN 4#define RXSC_TOOLTIP_MARGIN 12#define RXSC_GRIP_WIDTH 11#define RXSC_GRIP_HEIGHT 20class RxSliderCtrl : public CWnd{// Constructionpublic: RxSliderCtrl();// Attributesprivate: DWORD m_dwExStyle; UINT m_nSelGrip; // 泅犁 急琶登絹瘤絆 促矯 弊妨瘤扁 困茄 Grip ID UINT m_nSelGripOld; // 付快膠 榮闌 葷儈竅扁 困秦 彌輛利欄肺 急琶登絹柳 Grip ID UINT m_nSelText; int m_nBarThickness; // 吝繳綿 滴膊 : RXSC_THICK, RXSC_THIN int m_nPixelMin; int m_nPixelMax; int m_nPixelLeft; int m_nPixelRight; int m_nPixelCenter; int m_nPosMin; int m_nPosMax; int m_nPosLeft; int m_nPosRight; int m_nPosCenter;// Operationsprivate: int EraseBkgnd(int nIndex = 0); // 0 : left, 1 : right, 2 : Center, 3 : left-center, 4 : center-right, 5 : left-right-center void DrawBack(CDC *pDC, CRect rect); // Style : Thick, Thin void DrawGrip(CDC *pDC, CRect rect, BOOL bCheck = FALSE); // Style : Both, Up, Down void DrawCenterGrip(CDC *pDC, CRect rect, BOOL bCheck = FALSE); // the Center Grip represents position void DrawGripPosition(CDC *pDC, int nPixel, int nPos, BOOL bFocus = FALSE); // right grip belong to left grip int PosToPixel(int nValue, int nPixelMin, int nPixelMax, BOOL bPosToPixel = TRUE); int HitTest(CPoint point); CRect GetGripRect(int nPixel, BOOL bCenter = FALSE);public: COLORREF m_crBkgnd; // Background Color COLORREF m_crNFace, m_crDFace; // Face Color : Normal, Disable COLORREF m_crNSel, m_crDSel; // Selected Region : Normal, Disable COLORREF m_crNGrip, m_crSGrip, m_crDGrip; // Grip Color : Normal, Select, Disable COLORREF m_crNCGrip, m_crSCGrip, m_crDCGrip; // Center Grip Color : Normal, Select, Disable void RecalcLayout(); BOOL Increase(); BOOL Decrease(); void SetSelGripOld(UINT nIndex); void SetRange(int nMin, int nMax, BOOL bRedraw = TRUE); void SetLeftPos(int nPosLeft, BOOL bRedraw = TRUE); void SetRightPos(int nPosRight, BOOL bRedraw = TRUE); void SetCenterPos(int nPosCenter, BOOL bRedraw = TRUE); void SetPos(int nPosLeft, int nPosRight, BOOL bRedraw); void SetPos(int nPosLeft, int nPosRight, int nPosCenter, BOOL bRedraw); UINT GetSelGripOld(); int GetLeftPos(); int GetCenterPos(); int GetRightPos(); int GetRangeMin(); int GetRangeMax();// Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(RxSliderCtrl) //}}AFX_VIRTUAL virtual BOOL Create(DWORD dwStyle, DWORD dwExStyle, const RECT &rect, CWnd *pParentWnd, UINT nID); virtual void EnableWindow(BOOL bEnable = TRUE);// Implementationpublic: virtual ~RxSliderCtrl(); // Generated message map functionsprotected: //{{AFX_MSG(RxSliderCtrl) afx_msg int OnMouseActivate(CWnd* pDesktopWnd, UINT nHitTest, UINT message); afx_msg void OnLButtonDown(UINT nFlags, CPoint point); afx_msg BOOL OnEraseBkgnd(CDC* pDC); afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt); afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); //}}AFX_MSG DECLARE_MESSAGE_MAP()};///////////////////////////////////////////////////////////////////////////////{{AFX_INSERT_LOCATION}}// Microsoft Visual C++ will insert additional declarations immediately before the previous line.#endif // !defined(AFX_SLIDERCTRL_H__76F7155D_8D24_40D4_AB0A_FE7306512A00__INCLUDED_)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -