예제 #1
0
void EntryManageDialog::OnBnClickedButtonDel()
{
	//选择的行
	HTREEITEM selectedItem = m_LinesTree.GetSelectedItem();

	if( selectedItem == NULL)
		 return;

	UINT selectedID = (UINT)m_LinesTree.GetItemData(selectedItem);

	//得到选择的数据
	LineEntry* pEntry = m_EntryFile->FindLine(selectedID);

	if( pEntry )
	{
		// Initializes the variables to pass to the MessageBox::Show method.
		CString message;
		message.Format(L"确实要删除[%s]吗?",pEntry->m_LineName.c_str());

		LPCTSTR caption = L"删除实体";

		// Displays the MessageBox.
		int result = MessageBoxW(message, caption, MB_OKCANCEL);
		if ( result == IDOK )
		{
			//从数据库删除管线本身
			ArxWrapper::PostToNameObjectsDict(pEntry,pEntry->LINE_ENTRY_LAYER,true);

			//从数据库删除管线所有的线段
			ArxWrapper::eraseLMALine(*pEntry);

			//删除所有的内存节点
			pEntry->ClearPoints();

			//Delete from the list
			m_EntryFile->DeleteLine(selectedID);

			// delete the selected item. 
			m_LinesTree.DeleteItem(selectedItem);

			//保存到导出文件
			m_EntryFile->Persistent();
		}
	}
}
예제 #2
0
bool
LineTable::GetLineEntryAtIndex(uint32_t idx, LineEntry& line_entry)
{
    if (idx < m_entries.size())
    {
        ConvertEntryAtIndexToLineEntry (idx, line_entry);
        return true;
    }
    line_entry.Clear();
    return false;
}
예제 #3
0
void EntryManageDialog::OnBnClickedButtonOK()
{
	PointList* newPoints = new PointList();

	CString temp;
	for( int i = 0; i < m_LineDetailList.GetItemCount(); i++ )
	{
		PointEntry* point = new PointEntry();

		//得到当前编号(及其在列表中的序列号)
		point->m_PointNO = (UINT)i;

		temp = m_LineDetailList.GetItemText(i,1);
		acdbDisToF(temp.GetBuffer(), -1, &((point->m_Point)[X]));

		temp = m_LineDetailList.GetItemText(i,2);
		acdbDisToF(temp.GetBuffer(), -1, &((point->m_Point)[Y]));

		temp = m_LineDetailList.GetItemText(i,3);
		acdbDisToF(temp.GetBuffer(), -1, &((point->m_Point)[Z]));

		//加入到队列中
		newPoints->push_back(point);
	}

	//得到当前编辑的直线
	LineEntry* selectLine = GetSelectLine();

	//设置新的数据
	if( selectLine )
	{
		selectLine->SetPoints(newPoints);
	}

	//默认进入XY视图
	acedCommand(RTSTR, _T("._-VIEW"), RTSTR, L"TOP", 0);

	//保存到临时文件
	m_EntryFile->Persistent();
}
예제 #4
0
bool Address::CalculateSymbolContextLineEntry(LineEntry &line_entry) const {
  SectionSP section_sp(GetSection());
  if (section_sp) {
    SymbolContext sc;
    sc.module_sp = section_sp->GetModule();
    if (sc.module_sp) {
      sc.module_sp->ResolveSymbolContextForAddress(*this,
                                                   eSymbolContextLineEntry, sc);
      if (sc.line_entry.IsValid()) {
        line_entry = sc.line_entry;
        return true;
      }
    }
  }
  line_entry.Clear();
  return false;
}
예제 #5
0
 bool
 IsValid () const
 {
     return (bool)function && line_entry.IsValid();
 }