You are here

CHertzEdit.h

First of all the header file:
class CHertzEdit : public CEdit
{
// Konstruktion

public:
        CHertzEdit();
        CHertzEdit(BOOL);
        CHertzEdit(const CHertzEdit&);

// Attributes
public:

// Operators
public:
        CHertzEdit& operator =(double);
// Überschreibungen
        // Vom Klassen-Assistenten generierte virtuelle Funktionsüberschreibungen
        //{{AFX_VIRTUAL(CHertzEdit)
        //}}AFX_VIRTUAL

// Implementation
public:
        BOOL SetValue(HWND);
        BOOL GetValue(HWND);
        double GetValue();
        void SetValue(double);

        virtual ~CHertzEdit();

protected:
        BOOL GetValueFromWindow(HWND);
        void SetValueToWindow(HWND);

        //{{AFX_MSG(CHertzEdit)
        afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
        afx_msg void OnKillFocus(CWnd* pNewWnd);
        //}}AFX_MSG

        DECLARE_MESSAGE_MAP()
private:
        double m_dValue;
        BOOL m_bNegativAllowed;
        CString m_strValue;

        BOOL GetValueFromWindow();
        void SetValueToWindow();

        std::string DoubleToString(double);
        double CStringToDouble(CString&);

        void StripEndingZero(std::ostringstream&);
};

void AFXAPI DDX_HertzEdit(CDataExchange*, int, CHertzEdit&);