ciderpress/app/SubVolumeDialog.cpp

56 lines
1.4 KiB
C++
Raw Normal View History

2007-03-27 17:47:10 +00:00
/*
* CiderPress
* Copyright (C) 2007 by faddenSoft, LLC. All Rights Reserved.
* See the file LICENSE for distribution terms.
*/
/*
* Support for the sub-volume selection dialog.
*
* This just picks a sub-volume. Image format overrides and blocks vs.
* sectors should be chosen elsewhere.
*/
#include "stdafx.h"
#include "SubVolumeDialog.h"
#include "resource.h"
#include "../reformat/Charset.h"
2007-03-27 17:47:10 +00:00
BEGIN_MESSAGE_MAP(SubVolumeDialog, CDialog)
ON_LBN_DBLCLK(IDC_SUBV_LIST, OnItemDoubleClicked)
2007-03-27 17:47:10 +00:00
END_MESSAGE_MAP()
BOOL SubVolumeDialog::OnInitDialog(void)
2007-03-27 17:47:10 +00:00
{
2014-11-18 05:13:13 +00:00
ASSERT(fpDiskFS != NULL);
2007-03-27 17:47:10 +00:00
CListBox* pListBox = (CListBox*) GetDlgItem(IDC_SUBV_LIST);
2014-11-18 05:13:13 +00:00
ASSERT(pListBox != NULL);
2007-03-27 17:47:10 +00:00
// if (pListBox->SetTabStops(12) != TRUE) {
// ASSERT(false);
// }
2007-03-27 17:47:10 +00:00
2014-11-18 05:13:13 +00:00
DiskFS::SubVolume* pSubVol = fpDiskFS->GetNextSubVolume(NULL);
ASSERT(pSubVol != NULL); // shouldn't be here otherwise
while (pSubVol != NULL) {
2015-01-15 22:21:01 +00:00
CString volumeId(Charset::ConvertMORToUNI(pSubVol->GetDiskFS()->GetVolumeID()));
pListBox->AddString(volumeId); // makes a copy of the string
2007-03-27 17:47:10 +00:00
pSubVol = fpDiskFS->GetNextSubVolume(pSubVol);
}
2007-03-27 17:47:10 +00:00
return CDialog::OnInitDialog();
2007-03-27 17:47:10 +00:00
}
void SubVolumeDialog::DoDataExchange(CDataExchange* pDX)
2007-03-27 17:47:10 +00:00
{
DDX_LBIndex(pDX, IDC_SUBV_LIST, fListBoxIndex);
2007-03-27 17:47:10 +00:00
}
void SubVolumeDialog::OnItemDoubleClicked(void)
2007-03-27 17:47:10 +00:00
{
// Accept a double-click as an "OK".
OnOK();
2007-03-27 17:47:10 +00:00
}