本文整理汇总了C++中Geometry::GetComment方法的典型用法代码示例。如果您正苦于以下问题:C++ Geometry::GetComment方法的具体用法?C++ Geometry::GetComment怎么用?C++ Geometry::GetComment使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geometry
的用法示例。
在下文中一共展示了Geometry::GetComment方法的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: Update
void GeometryListView::Update()
// Rebuild the list of geometry resources.
{
// CPropertyPage::OnUpdate(pSender, lHint, pHint);
// TODO: Add extra initialization here
CTerrainDoc* doc = GetDocument();
Geometry* g = doc->GetGeometryList();
int GeometryCount = doc->GetGeometryCount();
CListCtrl* list = &m_ListControl /* (CListCtrl*) GetDlgItem(IDC_GEOMETRYLIST) */;
if (list->m_hWnd == NULL) return;
// Setup the column headings.
while (list->DeleteColumn(0)) ;
LV_COLUMN col;
col.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
col.fmt = LVCFMT_LEFT;
// Name.
col.pszText = "Name";
col.iSubItem = 0;
col.cx = 75;
list->InsertColumn(0, &col);
// Filename.
col.iSubItem = 1;
col.pszText = "Filename";
col.cx = 100;
list->InsertColumn(1, &col);
// Comment.
col.iSubItem = 2;
col.pszText = "Comment";
col.cx = 170;
list->InsertColumn(2, &col);
// Set the list items.
list->DeleteAllItems();
list->SetItemCount(GeometryCount);
for (int i = 0; i < GeometryCount; i++, g = g->Next) {
if (g == NULL) break;
int index = list->InsertItem(i, g->GetName());
list->SetItemText(index, 1, g->GetFilename());
list->SetItemText(index, 2, g->GetComment());
list->SetItemData(index, i);
}
}