本文整理汇总了C++中GmoBox::get_owner_box方法的典型用法代码示例。如果您正苦于以下问题:C++ GmoBox::get_owner_box方法的具体用法?C++ GmoBox::get_owner_box怎么用?C++ GmoBox::get_owner_box使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GmoBox
的用法示例。
在下文中一共展示了GmoBox::get_owner_box方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}