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/EncryptAdvancedProp.cpp | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 NSCmpts/EncryptAdvancedProp.cpp (limited to 'NSCmpts/EncryptAdvancedProp.cpp') diff --git a/NSCmpts/EncryptAdvancedProp.cpp b/NSCmpts/EncryptAdvancedProp.cpp new file mode 100644 index 0000000..2149139 --- /dev/null +++ b/NSCmpts/EncryptAdvancedProp.cpp @@ -0,0 +1,51 @@ +// EncryptAdvancedProp.cpp : Implementation of CEncryptAdvancedProp +#include "stdafx.h" +#include "NSCmpts.h" +#include "EncryptAdvancedProp.h" + +///////////////////////////////////////////////////////////////////////////// +// CEncryptAdvancedProp + +LRESULT CEncryptAdvancedProp::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + // Let it choose an object for data + m_Data.Initialize(m_nObjects, m_ppUnk); + + // Set this for CIgnoreProp + m_hwndIgnore = m_hWnd; + + CIgnoreProp::OnInitDialog(uMsg, wParam, lParam, bHandled); + + // Other Data Init + m_bDisablePassword = m_Data.GetInt(NS_ENCRYPT_REG_DISABLE, true) ? true : false; + m_bEncryptReadOnly = m_Data.GetInt(NS_ENCRYPT_REG_READONLY, false) ? true : false; + + UpdateData(false); + + bHandled = true; + return TRUE; +} + +LRESULT CEncryptAdvancedProp::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) +{ + // Just in case, save before destroy + UpdateData(true); + return 0; +} + +void CEncryptAdvancedProp::UpdateData(bool bSave) +{ + // Do Ignore Extensions first + CIgnoreProp::UpdateData(bSave); + + if(bSave) + { + m_bDisablePassword = IsDlgButtonChecked(IDC_DISABLEPASSWORD) ? true : false; + m_bEncryptReadOnly = IsDlgButtonChecked(IDC_ENCRYPTREADONLY) ? true : false; + } + else + { + CheckDlgButton(IDC_DISABLEPASSWORD, m_bDisablePassword ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(IDC_ENCRYPTREADONLY, m_bEncryptReadOnly ? BST_CHECKED : BST_UNCHECKED); + } +} -- cgit v1.2.3