summaryrefslogtreecommitdiff
path: root/NSCmpts/BackupAdvancedProp.cpp
blob: d1c03d9ae38ab6d3e93def2693654633122d294e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// BackupAdvancedProp.cpp : Implementation of CBackupAdvancedProp
#include "stdafx.h"
#include "NSCmpts.h"
#include "BackupAdvancedProp.h"

/////////////////////////////////////////////////////////////////////////////
// CBackupAdvancedProp Property Sheet Stuff

LRESULT CBackupAdvancedProp::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	// Let it choose an object to get data from
	m_Data.Initialize(m_nObjects, m_ppUnk);

	// Set this for CIgnoreProp
	m_hwndIgnore = m_hWnd;

	// Let the Ignore stuff initialize
	CIgnoreProp::OnInitDialog(uMsg, wParam, lParam, bHandled);

	// Setup the Combo box
	m_sEngineType = m_Data.GetString(NS_BACKUP_REG_ENGINE, _T("Archive"));

	m_ctlEngine = GetDlgItem(IDC_ENGINE_TYPE);
	m_ctlEngine.AddString(_T("Archive"));
	m_ctlEngine.AddString(_T("Date"));

	UpdateData(false);

	bHandled = true;
	return TRUE;
}

LRESULT CBackupAdvancedProp::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	// Just in case, before going out
	UpdateData(true);
	return 0; 
}

void CBackupAdvancedProp::UpdateData(bool bSave) 
{
	// Let it save/load first
	CIgnoreProp::UpdateData(bSave);

	if(bSave)
	{
		// Get Selected Text
		int nSel = m_ctlEngine.GetCurSel();
		m_ctlEngine.GetLBText(nSel, m_sEngineType.get_buffer(m_ctlEngine.GetLBTextLen(nSel)));
	}
	else
	{
		// Just Select the Appropriate One
		m_ctlEngine.SelectString(-1, m_sEngineType);
	}
}