#if !defined KFMNRGN_H #define KFMNRGN_H #include "stdafx.h" #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 // CKfmnRgnDlg.h : header file // ///////////////////////////////////////////////////////////////////////////// // CKfmnRgnDlg dialog const KFMNRGNDLG_SLIDERS_NO = 4; class CKfmnRgnDlg : public CDialog { typedef struct SLIDERINFO { unsigned int uMinRange[KFMNRGNDLG_SLIDERS_NO]; unsigned int uMaxRange[KFMNRGNDLG_SLIDERS_NO]; unsigned int uDefaultValue[KFMNRGNDLG_SLIDERS_NO]; unsigned int uMaxLimitText[KFMNRGNDLG_SLIDERS_NO]; CString strDefaultValue[KFMNRGNDLG_SLIDERS_NO]; }; // Construction public: CKfmnRgnDlg(CWnd* pParent = NULL); // standard constructor void SetDlgParams(CIMGPFView * pMainView); ~CKfmnRgnDlg(); // Dialog Data //{{AFX_DATA(CDemoaaaaDlg) enum { IDD = IDD_KFMNRGNDLG }; BOOL m_bShowTrackFrame; BOOL m_bShowTemplate; //}}AFX_DATA public: HRGN m_hRgn; COLORREF m_crFrame; CProgressCtrl m_progress; BOOL m_bKillProgress; static CKfmnRgnDlg * m_pKfmnRgnDlg; static LRESULT CALLBACK MouseHookProc(int nCode, WPARAM wParam, LPARAM lParam); 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; int m_nSelectedRegion; BOOL m_bInnerRegion; unsigned int m_uThreshold[2]; unsigned int m_uBlurRadius[2]; unsigned int m_uMinThreshold[2]; unsigned int m_uMaxThreshold[2]; BOOL m_bRemoveHoles[2]; CPoint m_ptCenter[2]; unsigned int m_uPixelCount[2]; unsigned int m_nTimerID; unsigned int m_uFrameType; ILEADRaster * m_pOrgRaster; // The 1'st original Raster. BOOL m_bFirstTime; //LBitmapWindow * m_plMainLBitmapWnd; CIMGPFView * 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(int flt, TCHAR szBuff[], int nPrecise); // Overrides protected: virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support // Implementation protected: // Generated message map functions virtual BOOL OnInitDialog(); afx_msg void OnRemoveHoles(); 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 OnHelp(); afx_msg void OnPaste(); afx_msg void OnClose(); afx_msg void OnOK(); DECLARE_MESSAGE_MAP() }; #endif // KFMNRGN_H