BOOL CPnSPresetsDlg::OnInitDialog()
{
	__super::OnInitDialog();

	for (int i = 0, j = m_pnspresets.GetCount(); i < j; i++) {
		CString label;
		double PosX, PosY, ZoomX, ZoomY;
		StringToParams(m_pnspresets[i], label, PosX, PosY, ZoomX, ZoomY);

		m_list.AddString(label);

		if (i == 0) {
			m_list.SetCurSel(0);
			OnLbnSelchangeList1();
		}
	}

	return TRUE;
}
void CPnSPresetsDlg::OnLbnSelchangeList1()
{
	int i = m_list.GetCurSel();

	if (i >= 0 && i < m_pnspresets.GetCount()) {
		double PosX, PosY, ZoomX, ZoomY;
		StringToParams(m_pnspresets[i], m_label, PosX, PosY, ZoomX, ZoomY);
		m_PosX = PosX;
		m_PosY = PosY;
		m_ZoomX = ZoomX;
		m_ZoomY = ZoomY;
	} else {
		m_label.Empty();
		m_PosX.SetWindowText(_T(""));
		m_PosY.SetWindowText(_T(""));
		m_ZoomX.SetWindowText(_T(""));
		m_ZoomY.SetWindowText(_T(""));
	}

	UpdateData(FALSE);
}
示例#3
0
BOOL CPnSPresetsDlg::OnInitDialog()
{
	__super::OnInitDialog();

	for(int i = 0, j = m_pnspresets.GetCount(); i < j; i++)
	{
		CString label;
		double PosX, PosY, ZoomX, ZoomY;
		StringToParams(m_pnspresets[i], label, PosX, PosY, ZoomX, ZoomY);

		m_list.AddString(label);

		if(i == 0)
		{
			m_list.SetCurSel(0);
			OnLbnSelchangeList1();
		}
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}