本文整理汇总了C++中Geometry::SetFilename方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::SetFilename方法的具体用法?C++ Geometry::SetFilename怎么用?C++ Geometry::SetFilename使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry::SetFilename方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnEditGeometry
void GeometryListView::OnEditGeometry()
// Called when user clicks "Edit" in the geometry list.
{
// Figure out which geometry item to edit.
int index = GetSelectedItemIndex();
if (index < 0) {
// No item selected, so we don't know what to delete...
return;
}
if (index == 0) {
// Can't edit null geometry.
return;
}
// Get the geometry object to edit.
Geometry* g = GetDocument()->GetGeometry(index);
if (g == NULL) return;
// Call edit dialog box.
GeometryPropertiesDialog d;
d.SetName(g->GetName());
d.SetFilename(g->GetFilename());
d.SetComment(g->GetComment());
if (d.DoModal() != IDCANCEL) {
// Apply the changes.
g->SetName(d.GetName());
g->SetFilename(d.GetFilename());
g->SetComment(d.GetComment());
GetDocument()->SetModifiedFlag();
GetDocument()->UpdateAllViews(NULL);
}
}
示例2: OnAddNewGeometry
void GeometryListView::OnAddNewGeometry()
// Called when user clicks "New Geometry" button.
{
// Call the properties dialog box with some default initial values.
GeometryPropertiesDialog d;
d.SetName("Untitled");
d.SetFilename("Unknown");
d.SetComment("");
if (d.DoModal() != IDCANCEL) {
// Create a new geometry item with the new values, and add it to our list.
Geometry* g = new Geometry;
g->SetName(d.GetName());
g->SetFilename(d.GetFilename());
g->SetComment(d.GetComment());
GetDocument()->AddGeometry(g);
GetDocument()->SetModifiedFlag();
GetDocument()->UpdateAllViews(NULL);
}
}