⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bcgpproplist.h

📁 远程网络监视程序的源码
💻 H
📖 第 1 页 / 共 2 页
字号:
	// File open dialog atributes:
	BOOL	m_bOpenFileDialog;	// TRUE - use "File Open/Save" diaog; otherwise - folder selection dialog
	DWORD	m_dwFileOpenFlags;
	CString	m_strDefExt;
	CString m_strFilter;
};

/////////////////////////////////////////////////////////////////////////////
// CBCGPFontProp object

class BCGCBPRODLLEXPORT CBCGPFontProp : public CBCGPProp
{
	DECLARE_DYNAMIC(CBCGPFontProp)

// Construction
public:
	CBCGPFontProp(	const CString& strName, LOGFONT& lf, 
					DWORD dwFontDialogFlags = CF_EFFECTS | CF_SCREENFONTS, 
					LPCTSTR lpszDescr = NULL, DWORD dwData = 0);
	virtual ~CBCGPFontProp();

// Overrides
public:
	virtual void OnClickButton (CPoint point);
	virtual CString FormatProperty ();

// Attributes
public:
	LPLOGFONT GetLogFont ()
	{
		return &m_lf;
	}

protected:
	LOGFONT	m_lf;
	DWORD	m_dwFontDialogFlags;
};

/////////////////////////////////////////////////////////////////////////////
// CBCGPDateTimeProp object

class BCGCBPRODLLEXPORT CBCGPDateTimeProp : public CBCGPProp
{
	DECLARE_DYNAMIC(CBCGPDateTimeProp)

// Construction
public:
	CBCGPDateTimeProp(const CString& strName, const COleDateTime& date, 
		LPCTSTR lpszDescr = NULL, DWORD dwData = 0,
		UINT nFlags = CBCGPDateTimeCtrl::DTM_DATE | CBCGPDateTimeCtrl::DTM_TIME);

	virtual ~CBCGPDateTimeProp();

// Overrides
public:
	virtual void OnDrawValue (CDC* pDC, CRect rect);
	virtual CWnd* CreateInPlaceEdit (CRect rectEdit, BOOL& bDefaultFormat);
	virtual void OnPosSizeChanged (CRect rectOld);
	virtual BOOL OnUpdateValue ();

	virtual void OnSetSelection (CBCGPProp* pOldSel);
	virtual void OnKillSelection (CBCGPProp* pNewSel);

	virtual BOOL PushChar (UINT nChar);

// Attributes
public:
	void SetDate (COleDateTime date);
	COleDateTime GetDate () const
	{
		return (COleDateTime) (DATE) m_varValue;
	}

protected:
	UINT				m_nFlags;
	CBCGPDateTimeCtrl	m_wndDateTime;

	void SetState (CBCGPDateTimeCtrl& wnd);
};

/////////////////////////////////////////////////////////////////////////////
// CBCGPPropList window

#define BCGPROPLIST_ID_INPLACE 3

BCGCBPRODLLEXPORT extern UINT BCGM_PROPERTY_CHANGED;

class BCGCBPRODLLEXPORT CBCGPPropList : public CWnd
{
	DECLARE_DYNAMIC(CBCGPPropList)

	friend class CBCGPProp;
	friend class CBCGPColorProp;

// Construction
public:
	CBCGPPropList();

// Attributes
public:
	void EnableHeaderCtrl (BOOL bEnable = TRUE,
		LPCTSTR lpszLeftColumn = _T("Property"), 
		LPCTSTR lpszRightColumn = _T("Name"));
	BOOL IsHeaderCtrl () const
	{
		return m_bHeaderCtrl;
	}

	void EnableDescriptionArea (BOOL bEnable = TRUE);
	BOOL IsDescriptionArea () const
	{
		return m_bDescriptionArea;
	}

	int GetDescriptionHeight () const
	{
		return m_nDescrHeight;
	}

	void SetAlphabeticMode (BOOL bSet = TRUE);
	BOOL IsAlphabeticMode () const
	{
		return m_bAlphabeticMode;
	}

	void SetVSDotNetLook (BOOL bSet = TRUE);
	BOOL IsVSDotNetLook () const
	{
		return m_bVSDotNetLook;
	}

	void SetBoolLabels (LPCTSTR lpszTrue, LPCTSTR lpszFalse);

	CRect GetListRect () const
	{
		return m_rectList; 
	}

	int GetPropertyColumnWidth () const 
	{ 
		return m_nLeftColumnWidth; 
	}

	int GetHeaderHeight () const
	{
		return m_nHeaderHeight;
	}

	int	GetRowHeight () const
	{
		return m_nRowHeight;
	}

	virtual CBCGPHeaderCtrl& GetHeaderCtrl ()
	{
		return m_wndHeader;
	}

	BOOL IsGroupNameFullWidth () const
	{
		return m_bGroupNameFullWidth;
	}

	void SetGroupNameFullWidth (BOOL bGroupNameFullWidth = TRUE, BOOL bRedraw = TRUE);

	BOOL IsShowDragContext () const
	{
		return m_bShowDragContext;
	}

	void SetShowDragContext (BOOL bShowDragContext = TRUE)
	{
		m_bShowDragContext = bShowDragContext;
	}

protected:
	CBCGPHeaderCtrl	m_wndHeader;			// Property list header control
	BOOL		m_bHeaderCtrl;			// Is header control visible?

	BOOL		m_bDescriptionArea;		// Does description area enabled?
	int			m_nDescrHeight;			// Description area height

	CToolTipCtrl	m_ToolTip;			// Tooltip control
	int			m_nTooltipsCount;		// Number of tooltip items

	BOOL		m_bAlphabeticMode;		// Use property list in alphabetic (non-"tree") mode
	BOOL		m_bVSDotNetLook;		// Provide MS Visual Studio.NET look (gray groups, flat look)

	CString		m_strTrue;				// Customized boolean value (e.g. "Yes")
	CString		m_strFalse;				// Customized boolean value (e.g. "No")

	CScrollBar	m_wndScrollVert;		// Vertical scroll bar
	HFONT		m_hFont;				// Property list regular font
	CFont		m_fontBold;				// Property list bold font

	int			m_nBorderSize;			// Control border size

	int			m_nHeaderHeight;		// Header control height
	CRect		m_rectList;				// Properies area
	int			m_nRowHeight;			// Height of the single row
	int			m_nLeftColumnWidth;		// Width of the left ("Name") column

	int			m_nVertScrollOffset;	// In rows
	int			m_nVertScrollTotal;
	int			m_nVertScrollPage;

	// Tracking attributes: used for the vertical and description area splitters tracking:
	CRect		m_rectTrackHeader;
	CRect		m_rectTrackDescr;
	BOOL		m_bTracking;
	BOOL		m_bTrackingDescr;

	CList<CBCGPProp*, CBCGPProp*>	m_lstProps;			// List of top-level properties
	CList<CBCGPProp*, CBCGPProp*>	m_lstTerminalProps;	// List of terminal properties

	CBCGPProp*	m_pSel;					// Current selection
	
	BOOL		m_bFocused;				// Control has focus

	COLORREF	m_clrGray;				// Special gray color

	BOOL		m_bControlBarColors;
	BOOL		m_bGroupNameFullWidth;
	BOOL		m_bShowDragContext;

// Operations
public:
	int AddProperty (CBCGPProp* pProp, BOOL bRedraw = TRUE);
	void RemoveAll ();

	CBCGPProp* GetProperty (int nIndex) const;
	int GetPropertyCount () const
	{
		return m_lstProps.GetCount ();
	}

	CBCGPProp* FindItemByData (DWORD dwData, BOOL bSearchSubItems = TRUE) const;

	CBCGPProp* HitTest (CPoint pt, CBCGPProp::ClickArea* pnArea = NULL) const;

	void SetCurSel (CBCGPProp* pProp, BOOL bRedraw = TRUE);
	CBCGPProp* GetCurSel () const
	{
		return m_pSel;
	}

	void EnsureVisible (CBCGPProp* pProp);

	void CloseColorPopup ();
	void UpdateColor (COLORREF color);

// Overrides
	virtual void OnPropertyChanged (CBCGPProp* pProp) const;

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBCGPPropList)
	public:
	virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID);
	virtual BOOL PreTranslateMessage(MSG* pMsg);
	virtual CScrollBar* GetScrollBarCtrl(int nBar) const;
	protected:
	virtual void PreSubclassWindow();
	virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
	//}}AFX_VIRTUAL

public:
	virtual void OnChangeSelection (CBCGPProp* /*pNewSel*/, CBCGPProp* /*pOldSel*/) {}

	virtual BOOL EditItem (CBCGPProp* pProp, LPPOINT lptClick = NULL);
	virtual void OnClickButton (CPoint point);
	virtual BOOL EndEditItem (BOOL bUpdateData = TRUE);
	virtual BOOL ValidateItemData (CBCGPProp* /*pProp*/)
	{
		return TRUE;
	}

	virtual int OnDrawProperty (CDC* pDC, CBCGPProp* pProp) const;
	virtual void InitHeader ();

protected:
	virtual void Init ();
	virtual void AdjustLayout ();

	virtual void OnDrawBorder (CDC* pDC);
	virtual void OnDrawList (CDC* pDC);
	virtual void OnDrawDescription (CDC* pDC, CRect rect);

// Implementation
public:
	virtual ~CBCGPPropList();

	// Generated message map functions
protected:
	//{{AFX_MSG(CBCGPPropList)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnSettingChange(UINT uFlags, LPCTSTR lpszSection);
	afx_msg void OnPaint();
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnCancelMode();
	afx_msg void OnKillFocus(CWnd* pNewWnd);
	afx_msg UINT OnGetDlgCode();
	afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
	afx_msg BOOL OnMouseWheel(UINT nFlags, short zDelta, CPoint pt);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnSetFocus(CWnd* pOldWnd);
	afx_msg HBRUSH OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor);
	afx_msg void OnDestroy();
	afx_msg void OnMouseMove(UINT nFlags, CPoint point);
	afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
	afx_msg void OnNcPaint();
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	//}}AFX_MSG
	afx_msg LRESULT OnSetFont (WPARAM, LPARAM);
	afx_msg LRESULT OnGetFont (WPARAM, LPARAM);
	afx_msg void OnHeaderItemChanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnHeaderTrack(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnHeaderEndTrack(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnStyleChanging(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
	afx_msg void OnStyleChanged(int nStyleType, LPSTYLESTRUCT lpStyleStruct);
	afx_msg void OnSelectCombo();
	afx_msg void OnCloseCombo();
	afx_msg BOOL OnNeedTipText(UINT id, NMHDR* pNMH, LRESULT* pResult);
	DECLARE_MESSAGE_MAP()

	//------------------
	// Internal helpres:
	//------------------
	HFONT SetFont (CDC* pDC);
	void TrackHeader (int nOffset);
	void TrackDescr (int nOffset);

	void SetScrollSizes ();

	int GetTotalItems () const;
	void ReposProperties ();

	void CreateBoldFont ();
};

#define GetDesciption		 GetDescription
#define SetDesciption		 SetDescription
#define m_bDesciptionArea	 m_bDescriptionArea
#define GetDesciptionHeight	 GetDescriptionHeight
#define OnDrawDesciption	 OnDrawDescription
#define EnableDesciptionArea EnableDescriptionArea
#define IsDesciptionArea	 IsDescriptionArea
#define GetDesciptionHeight	 GetDescriptionHeight

/////////////////////////////////////////////////////////////////////////////

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BCGPPROPLIST_H__F6054FED_0317_4829_B7BF_4EBBDC27DF01__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -