void Bitmap::Layout() { if (m_tree->GetType() != MC_TYPE_GROUP) { RecalculateWidths(); BreakUpCells(); BreakLines(); RecalculateSize(); } else { int fontsize = 12; wxConfig::Get()->Read(wxT("fontSize"), &fontsize); int mfontsize = fontsize; wxConfig::Get()->Read(wxT("mathfontsize"), &mfontsize); GroupCell* tmp = (GroupCell *)m_tree; wxMemoryDC dc; dc.SelectObject(m_bmp); CellParser parser(dc); parser.SetClientWidth(BM_FULL_WIDTH); while (tmp != NULL) { tmp->Recalculate(parser, fontsize, mfontsize); tmp = (GroupCell *)tmp->m_next; } } int width, height; GetMaxPoint(&width, &height); m_bmp.Create(width, height); Draw(); }
DcGp::DcGpBoundBox DcGp::DcGpPointCloud::GetMyOwnBoundBox() { DcGpBoundBox emptyBox(GetMinPoint(), GetMaxPoint()); return emptyBox; }
bool Emfout::Layout() { if(m_recalculationDc == NULL) return false; (*m_configuration)->SetContext(*m_recalculationDc); if (m_tree->GetType() != MC_TYPE_GROUP) { RecalculateWidths(); BreakUpCells(); BreakLines(); RecalculateHeight(); } else { GroupCell *tmp = dynamic_cast<GroupCell *>(m_tree); while (tmp != NULL) { tmp->Recalculate(); tmp = dynamic_cast<GroupCell *>(tmp->m_next); } } if(!m_recalculationDc->IsOk()) { return false; } GetMaxPoint(&m_width, &m_height); if(m_dc != NULL) { m_dc->Close(); wxDELETE(m_dc); } // Let's switch to a DC of the right size for our object. m_dc = new wxEnhMetaFileDC(m_filename, m_width, m_height); if(m_dc != NULL) { (*m_configuration)->SetContext(*m_dc); Draw(); // Closing the DC seems to trigger the actual output of the file. m_dc->Close(); wxDELETE(m_dc); m_dc = NULL; } return true; }
bool GmGridMapView::OnMap(Point<int>& point) { Point<int> maxPoint = GetMaxPoint(); return ((point.X >= 0) &&(point.Y >= 0)&&(point.X < maxPoint.X)&&(point.Y < maxPoint.Y)); }