From 3f95d417d9e623ac0c74df8ef11d7a01846392dd Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Sep 2003 19:07:23 +0000 Subject: Initial Import --- NSCmpts/SourceProp.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 NSCmpts/SourceProp.h (limited to 'NSCmpts/SourceProp.h') diff --git a/NSCmpts/SourceProp.h b/NSCmpts/SourceProp.h new file mode 100644 index 0000000..9e3aa46 --- /dev/null +++ b/NSCmpts/SourceProp.h @@ -0,0 +1,80 @@ +// SourceProp.h : Declaration of the CSourceProp + +#ifndef __SOURCEPROP_H_ +#define __SOURCEPROP_H_ + +#include "resource.h" // main symbols + +#include "../common/cmptdata.h" + +#include +#include +#include +#include +#include + + +///////////////////////////////////////////////////////////////////////////// +// CSourceProp: Base functionality for Night Sec File List Property Pages +// With dragdrop, browse etc... + +class ATL_NO_VTABLE CSourceProp : +// public CDialogImpl, + public CDialogImplEx, + public IDropTarget +{ +public: + CSourceProp() : CDialogImplEx(IDD_SOURCE) {} + + enum { IDD = IDD_SOURCE }; + +BEGIN_MSG_MAP(CSourceProp) + MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog) + MESSAGE_HANDLER(WM_DESTROY, OnDestroy) + MESSAGE_HANDLER(WM_SHOWWINDOW, OnShowWindow) + NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_ENDLABELEDIT, OnEndLabelEdit) + NOTIFY_HANDLER(IDC_SOURCE_LIST, NM_SETFOCUS, OnListSetFocus) + NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_KEYDOWN, OnKeyDown) + NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_ITEMCHANGED, OnChange) + NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_INSERTITEM, OnChange) + NOTIFY_HANDLER(IDC_SOURCE_LIST, LVN_DELETEITEM, OnChange) + COMMAND_ID_HANDLER(IDC_ADD, OnAdd) + COMMAND_ID_HANDLER(IDC_REMOVE, OnRemove) +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); + + LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnShowWindow(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled); + LRESULT OnEndLabelEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnListSetFocus(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnKeyDown(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnChange(int idCtrl, LPNMHDR pnmh, BOOL& bHandled); + LRESULT OnRemove(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + LRESULT OnAdd(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled); + + + bool AddFile(string sFileName); + +protected: + CSysImageList m_imgList; + CListViewCtrl m_ctlList; + string_array m_aPaths; + + void UpdateData(bool bSave = true); + +// IDropTarget +public: + STDMETHOD(DragEnter)(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); + STDMETHOD(DragOver)(DWORD grfKeyState, POINTL pt, DWORD* pdwEffect) + { return S_OK; } + STDMETHOD(DragLeave)(void) + { return S_OK; } + STDMETHOD(Drop)(IDataObject* pDataObject, DWORD grfKeyState, POINTL pt, DWORD* pdwEffect); +}; + +#endif //__SOURCEPROP_H_ -- cgit v1.2.3