void PropPageFormats::OnEdit () { try { int idx = GetSelectedItem(); CString formatKey = listControl.GetItemText(idx, 0); FormatDefinitionDialog dlg (this, TU_(formatKey)); if (dlg.DoModal() != IDOK) { return; } FormatInfo formatInfo = dlg.GetFormatInfo(); if (PathName::Compare(formatInfo.key.c_str(), TU_(formatKey)) != 0) { // rename key: delete old, create new SessionWrapper(true)->DeleteFormatInfo (TU_(formatKey)); formatKey = formatInfo.key.c_str(); } SessionWrapper(true)->SetFormatInfo (formatInfo); Refresh (); MakeAlias (formatInfo); } catch (const MiKTeXException & e) { ErrorDialog::DoModal (this, e); } catch (const exception & e) { ErrorDialog::DoModal (this, e); } }
/*e*/ void CWindow::LinkWindowToList(CLinkedListT<CWindow> *list) { CListElementT<CWindow> *ele=MakeAlias(); ThrowIfMemFull_(ele); list->LinkElement(ele); }
void PropPageFormats::OnNew () { try { FormatDefinitionDialog dlg (this, 0); if (dlg.DoModal() != IDOK) { return; } FormatInfo formatInfo = dlg.GetFormatInfo(); SessionWrapper(true)->SetFormatInfo (formatInfo); Refresh (); MakeAlias (formatInfo); } catch (const MiKTeXException & e) { ErrorDialog::DoModal (this, e); } catch (const exception & e) { ErrorDialog::DoModal (this, e); } }