// ValueEditor.h: interface for the CValueEditor class.
//
// Author : David Shepherd
// Copyright (c) 2002, DaeDoe-Software
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_VALUEEDITOR_H__8E49A3A3_7163_11D6_BCED_444553540000__INCLUDED_)
#define AFX_VALUEEDITOR_H__8E49A3A3_7163_11D6_BCED_444553540000__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// edit box id
#define VE_IDC_EDIT 0x1000
// edit box message map id
#define VE_MSG_MAP_EDIT VE_IDC_EDIT
/////////////////////////////////////////////////////////////////////////////
// CValueEditor
class CValueEditor : public CWindowImpl<CValueEditor>
{
private:
// edit box
CContainedWindowT<CEdit> m_Edit;
// while TRUE this keeps the internal message loop running
BOOL m_RunMessageLoop;
public:
// value
std::wstring m_Value;
CValueEditor();
virtual ~CValueEditor();
// edits the value
BOOL EditValue(const CWindow &Parent,const CRect &Rect);
BEGIN_MSG_MAP(CValueEditor)
MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_SIZE, OnSize)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
COMMAND_HANDLER(VE_IDC_EDIT, EN_CHANGE, OnChangeEdit)
// edit box message map
ALT_MSG_MAP(VE_MSG_MAP_EDIT)
MESSAGE_HANDLER(WM_ACTIVATE, OnActivate)
MESSAGE_HANDLER(WM_KILLFOCUS, OnKillFocus)
END_MSG_MAP()
// Handler prototypes:
// LRESULT MessageHandler(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
// message handlers
LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnActivate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnKillFocus(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnChangeEdit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// message handlers (edit box)
};
#endif // !defined(AFX_VALUEEDITOR_H__8E49A3A3_7163_11D6_BCED_444553540000__INCLUDED_)