SECPopupColorWell Class

class SECPopupColorWell: public SECColorWell

The SECPopupColorWell class implements a popup color well window (See SECColorWell). This class is defined primarily for use with the SECWellButton class. It is popped up when the well button is clicked to allow the user to select a color. When a color is selected a CWN_COLOR_CHANGE message is sent to the SECWellButton, and the popup window is destroyed (not the SECPopupColorWell object). Similarly, if the popup window loses focus, it is also destroyed.

If the 'Other' button (displayed on the face of the popup color well window) is clicked, the popup window is destroyed and a CWN_CUSTOM_COLOR message is sent to the button.

DDX_Color can be used for DDX support with the color well classes.

See the COLOR sample in the \\OT\\SAMPLES\\STANDARD\\CONTROLS\\COLRWELL directory for a demonstration of this class.

Defined in: SECWELL.h

Class Members

Creation/Initialization

FOUNDATION_API SECPopupColorWell()

Constructs a popup color well object.

FOUNDATION_API virtual BOOL Create(DWORD dwStyle, CRect& buttonRect, CWnd* pParentWnd, BOOL bHasOther = TRUE, CCreateContext* pContext = NULL)

Creates a popup color well window.

Attributes

FOUNDATION_API BOOL IsCreated() const

Returns whether the popup color well window is currently created.

FOUNDATION_API void SetNotifyWindow(CWnd* pWnd)

Sets the window to notify of color changes.

FOUNDATION_API virtual void Reset()

Resets the popup color well object.

Overrides

FOUNDATION_API virtual void HandleSelection( int x, int y, SelTypes selType )

Called when the user selects a new color.

FOUNDATION_API virtual void NotifyChange()

Notifies the parent window of a change in color.

FOUNDATION_API virtual void PostNcDestroy()

Called by the default OnNcDestroy member function after the

FOUNDATION_API virtual UINT GetClassStyle() const

Returns the class style used to register the color well window class.

FOUNDATION_API virtual BOOL HasFocusRectangle() const

Returns whether the color well has a focus rectangle.

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

Called when a nonsystem key is pressed.

FOUNDATION_API afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags)

Called when a nonsystem key is released.

FOUNDATION_API virtual void ClickedOther()

Called from OnLButtonDown() when the "other" button is clicked (to create CColorDialog).

FOUNDATION_API afx_msg void OnLButtonDown(UINT nFlags, CPoint point)

Called when the user presses the left mouse button.

FOUNDATION_API afx_msg UINT OnGetDlgCode()

Override to control the particular types of input to process.

FOUNDATION_API afx_msg void OnKillFocus(CWnd* pNewWnd)

Called immediately before losing the input focus.

HWND m_notifyHwnd

Window to notify of color changes.

CWnd* m_pNotifyWnd

Window to return focus to on destroying popup.

BOOL m_bCreated

True when the popup has been created