SECDropEdit Class

class SECDropEdit: public CEdit

The SECDropEdit class adds a combo-like drop-down button to an edit control.

Defined in: DropEdit.h

Comments

This class is used with SECCurrencyEdit and Format to implement an edit control for entering and displaying custom-formatted currency data.

See the CURRENCY sample in the \SAMPLES\TOOLKIT\STANDARD\CONTROLS\CURRENCY directory for a demonstration of this class.

Class Members

Creation/Initialization

SECDropEdit()

Constructs a SECDropEdit object.

virtual BOOL Create(DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)

Creates a window and attaches it to the drop edit object.

virtual BOOL CreateEx(DWORD dwExStyle,DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID)

Creates a child window with extended attributes and

BOOL AttachEdit(int nCtlID, CWnd* pParentWnd)

Attaches an existing edit control to the drop edit object.

Attributes

void SetRightAlign(BOOL bRightAlign = TRUE)

Manipulates the alignment mode (within the edit control).

BOOL IsRightAligned() const

Indicates whether drop-down button is right-aligned within the edit control.

void SetBorder(WORD wLeftBorder, WORD wRightBorder)

Manipulates the border settings.

DWORD GetBorders() const

Retrieves the border settings.

Operations

BOOL SetBitmap(UINT nBmpID)

Sets bitmap on the button.

BOOL SetBitmap(LPCTSTR lpszBmpName)

Sets bitmap on the button.

HBITMAP GetBitmap() const

Removes the button.

HBITMAP GetBitmap() const

Sets bitmap on the button.

void InvalidateBtn()

Forces a redraw of the button.

Overridable

virtual void OnClicked()

Called when the button has been clicked.

virtual void DrawBtn(CDC& dc, CRect r)

Draws the button.

Overrides

afx_msg void OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)

Called when the size and position of the client area needs

afx_msg void OnNcLButtonDown(UINT nHitTest, CPoint point)

Called when the user presses the left mouse button while the

afx_msg void OnLButtonUp(UINT nFlags, CPoint point)

Called when the user releases teh left mouse button.

afx_msg void OnMove(int x, int y)

Called after the CWnd object has been moved.

afx_msg void OnMouseMove(UINT nFlags, CPoint point)

Called when the mouse cursor moves.

afx_msg UINT OnNcHitTest(CPoint point)

Called every time the mouse is moved.

afx_msg void OnNcPaint()

Called when the nonclient area needs to be painted.

afx_msg void OnCancelMode()

Called to inform CWnd to cancel any internal mode.

afx_msg void OnSysColorChange()

Called when a change is made in the system color setting.

afx_msg void OnEnable(BOOL bEnable)

Called when an application changes the enabled state of

afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)

Called when a nonsystem key is pressed.

afx_msg void OnSysKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)

Called when a system key is depressed.

virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult)

Called to process messages.

afx_msg void OnNcMouseMove( UINT nHitTest, CPoint point )

virtual BOOL HitTestBtn(CPoint point, BOOL bClient = FALSE) const

Determines whether the given point (in screen or client

CRect m_btnRect

The window rect of the button (in our

CBitmap m_bmp

Bitmap drawn on face of button

LPCTSTR m_lpszBmpName

Resource ID of above bitmap

WORD m_wState

Current state

WORD m_wLeftBorder

Left hand Gap between bitmap and border

WORD m_wRightBorder

Right hand Gap between bitmap and border