summaryrefslogtreecommitdiff
path: root/NSCmpts/SourceProp.h
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
committerStef Walter <stef@thewalter.net>2003-09-17 19:07:23 +0000
commit3f95d417d9e623ac0c74df8ef11d7a01846392dd (patch)
tree45ec73f2dc07eafd7f41a6f62a8cdfbaa279469f /NSCmpts/SourceProp.h
Initial ImportHEADmaster
Diffstat (limited to 'NSCmpts/SourceProp.h')
-rw-r--r--NSCmpts/SourceProp.h80
1 files changed, 80 insertions, 0 deletions
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 <atlctrls.h>
+#include <mystring.h>
+#include <sysimglist.h>
+#include <shlobj.h>
+#include <atlextra.h>
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CSourceProp: Base functionality for Night Sec File List Property Pages
+// With dragdrop, browse etc...
+
+class ATL_NO_VTABLE CSourceProp :
+// public CDialogImpl<CSourceProp>,
+ 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_