#if !defined KFMNRGN_H #define KFMNRGN_H #include "stdafx.h" #include "clipf32.h" #include "MainFrm.h" #include "CLIPF32View.h" #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // CKfmnRgnDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CKfmnRgnDlg dialog const CLIPF_KFMNRGNDLG_SLIDERS_NO = 4; class CKfmnRgnDlg : public CDialog { typedef struct SLIDERINFO { L_UINT32 uMinRange[CLIPF_KFMNRGNDLG_SLIDERS_NO]; L_UINT32 uMaxRange[CLIPF_KFMNRGNDLG_SLIDERS_NO]; L_UINT32 uDefaultValue[CLIPF_KFMNRGNDLG_SLIDERS_NO]; L_UINT uMaxLimitText[CLIPF_KFMNRGNDLG_SLIDERS_NO]; CString strDefaultValue[CLIPF_KFMNRGNDLG_SLIDERS_NO]; }; private: L_UINT m_uTimerID; // Construction public: CKfmnRgnDlg(CWnd* pParent = NULL); // standard constructor void SetDlgParams(CCLIPF32View * pMainView); ~CKfmnRgnDlg(); public: HRGN m_hRgn; COLORREF m_crFrame; CProgressCtrl m_progress; BOOL m_bKillProgress; BOOL m_bShowTrackFrame; static CKfmnRgnDlg * m_pKfmnRgnDlg; static LRESULT CALLBACK MouseHookProc(L_INT nCode, WPARAM wParam, LPARAM lParam); void Btmp_Timer(); private: CButton m_rbInnerRegion; CButton m_rbOuterRegion; CButton m_chkShowTemplate; CButton m_chkShowTrackFrame; CSliderCtrl m_sldrThreshold; CEdit m_edtThreshold; CSliderCtrl m_sldrBlurRadius; CEdit m_edtBlurRadius; CSliderCtrl m_sldrMinThreshold; CEdit m_edtMinThreshold; CSliderCtrl m_sldrMaxThreshold; CEdit m_edtMaxThreshold; CButton m_chkRemoveHoles; CStatic m_stcInnerText; CStatic m_stcOuterText; CStatic m_stcArea; CButton m_btnHelp; L_INT m_nSelectedRegion; BOOL m_bInnerRegion; BOOL m_bShowTemplate; L_UINT32 m_uThreshold[2]; L_UINT m_uBlurRadius[2]; L_UINT32 m_uMinThreshold[2]; L_UINT32 m_uMaxThreshold[2]; BOOL m_bRemoveHoles[2]; CPoint m_ptCenter[2]; L_UINT32 m_uPixelCount[2]; L_UINT m_nTimerID; L_UINT m_uFrameType; LBitmap m_lOrgBitmap; // The 1'st original bitmap. BOOL m_bFirstTime; CCLIPF32View * m_pMainView; HHOOK m_hMouseHook; BOOL m_bInProcess; SLIDERINFO m_SlidersControlsInfo; private: BOOL m_fAcceptNewValues; void ApplyFunction(); void UpdateControls(); void UpdateRgnTextInfo(); void CalculatePercentage(); void DrawColoredFrame(HWND hWnd, HDC hDC); void ConvertFloatToString(L_INT flt, L_TCHAR szBuff[], L_INT nPrecise); // Overrides protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: // Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnInnerRgn(); afx_msg void OnOuterRgn(); afx_msg void OnShowTemplate(); afx_msg void OnShowTrackFrame(); afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar); afx_msg void OnThresholdChanged(); afx_msg void OnKillFocusThresholdEdit(); afx_msg void OnBlurRadiusChanged(); afx_msg void OnKillFocusBlurRadiusEdit(); afx_msg void OnMinThresholdChanged(); afx_msg void OnKillFocusMinThresholdEdit(); afx_msg void OnMaxThresholdChanged(); afx_msg void OnKillFocusMaxThresholdEdit(); afx_msg void OnRemoveHoles(); afx_msg void OnHelp(); afx_msg void OnTimer(UINT nIDEvent); afx_msg void OnDestroy(); DECLARE_MESSAGE_MAP() }; #endif // KFMNRGN_H