Filter Library Camera Interface Physics

FilterDlg.h

00001 /*
00002  * FilterDlg.h - base class for filter dialogs.
00003  *
00004  * This file is part of the Camera Filter Library.
00005  * Computer Aided Measurement Environment for Realtime Atomic imaging (Camera)
00006  *
00007  * Copyright (C) 2004, Leiden Probe Microscopy.
00008  * Copyright (C) 2004, Universiteit Leiden.
00009  *
00010  * Original author(s): ?
00011  *
00012  * $Id: FilterDlg.h 219 2005-06-13 11:07:15Z moene $
00013  */
00014 
00015 #ifndef CFL_FILTERDLG_H
00016 #define CFL_FILTERDLG_H
00017 
00018 #if _MSC_VER > 1000
00019 #pragma once
00020 #endif // _MSC_VER > 1000
00021 
00022 DECLARE_CLASS( CScanView );
00023 DECLARE_CLASS( CScanFilter );
00024 DECLARE_CLASS( CScanBaseBuffer );
00025 
00026 /**
00027  * \addtogroup cfl_dialog
00028  *
00029 
00030 This is the group documentation.
00031 
00032  *
00033  * @{
00034  */
00035 
00036 DECLARE_CLASS( CFilterDlg );
00037 
00038 /**
00039  * base class for scan filters dialogs.
00040  */
00041 
00042 class CFilterDlg : public CDialog
00043 {
00044 public:
00045    ///
00046    /// \name Constructors
00047    /// @{
00048 
00049    /**
00050     * (default) constructor.
00051     */
00052    CFilterDlg( CWnd* pParent = NULL );
00053 
00054    /**
00055     * destructor: remove mouse message hook.
00056     */
00057    virtual ~CFilterDlg( );
00058 
00059    /// @}
00060 
00061    /**
00062     * set filter and document.
00063     */
00064    void SetParameters( CScanFilterPtr pFilter, CDocument* pDoc );
00065 
00066    /**
00067     * update the view and in Edit mode also update the stored filter settings.
00068     */
00069    void UpdateView();
00070 
00071    /**
00072     * true if in EditModeless().
00073     */
00074    bool InEditModeless();
00075 
00076    /**
00077     * dialog is being used for EditModeless.
00078     */
00079    void SetEditModeless();
00080 
00081    /**
00082     * diable the input and output buffer controls for EditModeless().
00083     */
00084    void DisableBufferControls();
00085 
00086 protected:
00087    /**
00088     * set embedded help for given uId.
00089     */
00090    virtual void SetEmbeddedHelp( UINT uId );
00091 
00092    /**
00093     * set embedded help to given string.
00094     */
00095    virtual void SetEmbeddedHelp( LPCTSTR lpString );
00096 
00097    // ClassWizard generated virtual function overrides
00098    //{{AFX_VIRTUAL(CFilterDlg)
00099    virtual void DoDataExchange( CDataExchange* pDX );    ///< DDX/DDV support
00100    //}}AFX_VIRTUAL
00101 
00102 protected:
00103    // Generated message map functions
00104    //{{AFX_MSG(CFilterDlg)
00105    virtual void OnOK();                 ///< Ok handler, update filter settings in registry
00106    virtual void OnCancel();             ///< Cancel handler
00107    virtual BOOL OnInitDialog();         ///< initialize dialog handler
00108    afx_msg void OnHelp();               ///< Help handler
00109    afx_msg void OnKillfocusBufferoutname(); ///< Output buffer name handler
00110    afx_msg void OnTimer(UINT nIDEvent); ///< handler for embedded help timer
00111    afx_msg void OnDestroy();            ///< handler to remove embedded help timer
00112    //}}AFX_MSG
00113 
00114    /**
00115     * get the (help) id of the dialog's control under the mouse cursor.
00116     */
00117    LRESULT OnRelayEvent( WPARAM wParam, LPARAM lParam );
00118 
00119    DECLARE_MESSAGE_MAP()
00120 
00121    /**
00122     * user interface to select a buffer.
00123     */
00124    CScanBaseBufferPtr BrowseForScanBuffer();
00125 
00126 protected:
00127    /**
00128     * the filter.
00129     */
00130    CScanFilter* m_pFilter;
00131 
00132    /**
00133     * the document.
00134     */
00135    CDocument* m_pDoc;
00136 
00137    /**
00138     * dialog is a ModalEdit.
00139     */
00140    bool m_bInEditModeless;
00141 
00142    /**
00143     * dialog initialization has completed.
00144     */
00145    bool m_bInitialized;
00146 
00147    /**
00148     * keep track of current mouse-over help id.
00149     */
00150    int m_curHelpId;
00151 
00152    /**
00153     * current timer id.
00154     */
00155    UINT m_timerHelpId;
00156 
00157 private:
00158    //{{AFX_DATA(CFilterDlg)
00159    enum { IDD = IDD_FILTERDLG };
00160    //}}AFX_DATA
00161 
00162    enum { HOVER_DELAY = 300, };         // milliseconds before embedded help window changes
00163 };
00164 
00165 //{{AFX_INSERT_LOCATION}}
00166 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
00167 
00168 /// @} cfl_scanfilterdialog
00169 
00170 /*
00171  * set filter and document; NULL for pDoc sets edit modeless flag.
00172  */
00173 inline void CFilterDlg::SetParameters( CScanFilterPtr pFilter, CDocument* pDoc )
00174 {
00175    m_pFilter = pFilter;
00176    m_pDoc    = pDoc;
00177    
00178    if ( NULL == pDoc )
00179    {
00180       SetEditModeless();
00181    }
00182 }
00183 
00184 /*
00185  * dialog is being used for EditModeless.
00186  */
00187 inline void CFilterDlg::SetEditModeless()
00188 {
00189    m_bInEditModeless = true;
00190 }
00191 
00192 /*
00193  * true if in EditModeless().
00194  */
00195 inline bool CFilterDlg::InEditModeless()
00196 {
00197    return m_bInEditModeless;
00198 }
00199 
00200 #endif // #ifndef CFL_FILTERDLG_H
00201 
00202 /*
00203  * end of file
00204  */

Camera Filter Library documentation © 2004-2007 by Leiden Probe Microscopy