本文整理汇总了C++中GmoBox::is_box_system方法的典型用法代码示例。如果您正苦于以下问题:C++ GmoBox::is_box_system方法的具体用法?C++ GmoBox::is_box_system怎么用?C++ GmoBox::is_box_system使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmoBox
的用法示例。
在下文中一共展示了GmoBox::is_box_system方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_caret_y_pos_and_height
//---------------------------------------------------------------------------------------
void ScoreCaretPositioner::set_caret_y_pos_and_height(URect* pBounds, ImoId id,
int iStaff)
{
URect staffBounds;
if (id >= 0)
{
GmoShape* pShape = get_shape_for_imo(id, iStaff);
GmoBox* pBox = pShape->get_owner_box();
while (pBox && !pBox->is_box_system())
pBox = pBox->get_owner_box();
if (!pBox)
{
LOMSE_LOG_ERROR("[ScoreCaretPositioner::set_caret_y_pos_and_height] Invalid boxes structure");
throw runtime_error("[ScoreCaretPositioner::set_caret_y_pos_and_height] Invalid boxes structure");
}
m_pBoxSystem = static_cast<GmoBoxSystem*>(pBox);
int staff = m_spState->staff();
int instr = m_spState->instrument();
GmoShapeStaff* pStaff = m_pBoxSystem->get_staff_shape(instr, staff);
staffBounds = pStaff->get_bounds();
}
else
{
//score is empty
staffBounds = *pBounds;
}
//set position and size
pBounds->y = staffBounds.y - tenths_to_logical(10);
pBounds->height = staffBounds.height + tenths_to_logical(20);
}
示例2: doc
TEST_FIXTURE(DocLayouterTestFixture, DocLayouter_BoxScoreHasBoxSystem)
{
Document doc(m_libraryScope);
doc.from_string("(lenmusdoc (vers 0.0) "
"(pageLayout (pageSize 24000 35700)(pageMargins 1000 1500 3000 2500 4000) landscape) "
"(content (score (vers 1.6) "
"(instrument (musicData (clef G)(key e)(n c4 q)(r q)(barline simple))))))" );
DocLayouter dl( doc.get_im_model(), m_libraryScope);
dl.layout_document();
GraphicModel* pGModel = dl.get_graphic_model();
// pGModel->dump_page(0, cout);
GmoBoxDocPage* pPage = pGModel->get_page(0);
GmoBox* pBDPC = pPage->get_child_box(0); //DocPageContent
GmoBox* pBSP = pBDPC->get_child_box(0); //ScorePage
GmoBox* pBox = pBSP->get_child_box(0); //System
CHECK( pBox != NULL );
CHECK( pBox->is_box_system() == true );
//CHECK( pBox->get_width() == 16000.0f );
//CHECK( pBox->get_height() == 735.0f );
//CHECK( pBox->get_left() == 1000.0f );
//CHECK( pBox->get_top() == 1500.0f );
delete pGModel;
}