|
#if !defined(AFX_FLOATINGEDIT_H__7DC36E2E_AE1D_11D4_A002_006067718D04__INCLUDED_)
#define AFX_FLOATINGEDIT_H__7DC36E2E_AE1D_11D4_A002_006067718D04__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FloatingEdit.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CFloatingEdit window
class CFloatingEdit : public CEdit
{
// Construction
public:
CFloatingEdit();
// Attributes
public:
BOOL IsValid() {return SyntaxValid && ValueValid; };
BOOL IsSyntaxValid() { return SyntaxValid; }
BOOL IsValueValid() { return ValueValid; }
/****************************************************************************
* UWM_CHECK_VALUE
* Inputs:
* WPARAM: MAKELONG(GetDlgCtrlID(), EN_CHANGE)
* LPARAM: (LPARAM)(HWND): Window handle
* Result: BOOL
* TRUE if value is acceptable
* FALSE if value has an error
* Effect:
* If the value is FALSE, the window is marked as an invalid value
* If the value is TRUE, the window is marked as a valid value
* Notes:
* This message is sent to the parent of the control as a consequence
* of the EN_CHANGE notification, but only if the value is syntactically
* correct. It may be sent at other times as well
****************************************************************************/
static UINT UWM_CHECK_VALUE;
/****************************************************************************
* UWM_VALID_CHANGE
* Inputs:
* WPARAM: (WPARAM)MAKELONG(GetDlgCtrlID(), BOOL) Flag indicating new valid state
* LPARAM: Window handle of child window
* Result: LRESULT
* Logically void, 0, always
* Effect:
* Notifies the parent that the validity of the input value has changed
****************************************************************************/
static UINT UWM_VALID_CHANGE;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CFloatingEdit)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CFloatingEdit();
// Generated message map functions
protected:
CBrush errorBrush;
CBrush partialBrush;
CBrush emptyBrush;
CBrush OKBrush;
CBrush * Check();
BOOL SyntaxValid;
BOOL ValueValid;
//{{AFX_MSG(CFloatingEdit)
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
afx_msg HBRUSH CtlColor(CDC * dc, UINT id);
afx_msg BOOL OnChange();
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FLOATINGEDIT_H__7DC36E2E_AE1D_11D4_A002_006067718D04__INCLUDED_)
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.