本文整理汇总了C++中LayoutBreak::subtype方法的典型用法代码示例。如果您正苦于以下问题:C++ LayoutBreak::subtype方法的具体用法?C++ LayoutBreak::subtype怎么用?C++ LayoutBreak::subtype使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LayoutBreak
的用法示例。
在下文中一共展示了LayoutBreak::subtype方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drop
Element* Box::drop(const DropData& data)
{
Element* e = data.element;
switch(e->type()) {
case LAYOUT_BREAK:
{
LayoutBreak* lb = static_cast<LayoutBreak*>(e);
if (_pageBreak || _lineBreak) {
if (
(lb->subtype() == LAYOUT_BREAK_PAGE && _pageBreak)
|| (lb->subtype() == LAYOUT_BREAK_LINE && _lineBreak)
|| (lb->subtype() == LAYOUT_BREAK_SECTION && _sectionBreak)
) {
//
// if break already set
//
delete lb;
break;
}
foreach(Element* elem, _el) {
if (elem->type() == LAYOUT_BREAK) {
score()->undoChangeElement(elem, e);
break;
}
}
break;
}
lb->setTrack(-1); // this are system elements
lb->setParent(this);
score()->undoAddElement(lb);
return lb;
}
case STAFF_TEXT:
{
Text* text = new Text(score());
text->setTextStyle(score()->textStyle(TEXT_STYLE_FRAME));
text->setParent(this);
text->setHtml(static_cast<StaffText*>(e)->getHtml());
score()->undoAddElement(text);
delete e;
return text;
}
case ICON:
switch(static_cast<Icon*>(e)->subtype()) {
case ICON_VFRAME:
score()->insertMeasure(VBOX, this);
break;
case ICON_TFRAME:
score()->insertMeasure(TBOX, this);
break;
case ICON_FFRAME:
score()->insertMeasure(FBOX, this);
break;
case ICON_MEASURE:
score()->insertMeasure(MEASURE, this);
break;
}
break;
default:
e->setParent(this);
score()->undoAddElement(e);
return e;
}
return 0;
}