本文整理汇总了C++中PageItem_Table::adjustFrameToTable方法的典型用法代码示例。如果您正苦于以下问题:C++ PageItem_Table::adjustFrameToTable方法的具体用法?C++ PageItem_Table::adjustFrameToTable怎么用?C++ PageItem_Table::adjustFrameToTable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PageItem_Table
的用法示例。
在下文中一共展示了PageItem_Table::adjustFrameToTable方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PyString_FromString
PyObject *scribus_newtable(PyObject* /* self */, PyObject* args)
{
double x, y, w, h;
int numRows, numColumns;
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "ddddii|es", &x, &y, &w, &h, &numRows, &numColumns, "utf-8", &Name))
return NULL;
if (!checkHaveDocument())
return NULL;
if (numRows < 1 || numColumns < 1)
{
PyErr_SetString(PyExc_ValueError, QObject::tr("Both numRows and numColumns must be greater than 0.","python error").toLocal8Bit().constData());
return NULL;
}
int i = ScCore->primaryMainWindow()->doc->itemAdd(PageItem::Table, PageItem::Unspecified,
pageUnitXToDocX(x),
pageUnitYToDocY(y),
ValueToPoint(w),
ValueToPoint(h),
0, // Unused.
CommonStrings::None, // Unused.
CommonStrings::None); // Unused.
PageItem_Table *table = ScCore->primaryMainWindow()->doc->Items->at(i)->asTable();
table->insertRows(0, numRows - 1);
table->insertColumns(0, numColumns - 1);
table->adjustTableToFrame();
table->adjustFrameToTable();
if (strlen(Name) > 0)
{
QString objName = QString::fromUtf8(Name);
if (!ItemExists(objName))
ScCore->primaryMainWindow()->doc->Items->at(i)->setItemName(objName);
}
return PyString_FromString(table->itemName().toUtf8());
}
示例2: doCreateNewObject
//.........这里部分代码省略.........
currItem->annotation().setType(Annotation::Textfield);
currItem->setItemName( CommonStrings::itemName_TextField + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFCheckbox:
currItem->annotation().setType(Annotation::Checkbox);
currItem->setItemName( CommonStrings::itemName_CheckBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFCombobox:
currItem->annotation().setType(Annotation::Combobox);
currItem->annotation().setFlag(Annotation::Flag_Combo);
currItem->setItemName( CommonStrings::itemName_ComboBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFListbox:
currItem->annotation().setType(Annotation::Listbox);
currItem->setItemName( CommonStrings::itemName_ListBox + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFTextAnnotation:
currItem->annotation().setType(Annotation::Text);
currItem->setItemName( CommonStrings::itemName_TextAnnotation + QString("%1").arg(m_doc->TotalItems));
break;
case modeInsertPDFLinkAnnotation:
currItem->annotation().setType(Annotation::Link);
currItem->annotation().setZiel(m_doc->currentPage()->pageNr());
currItem->annotation().setAction("0 0");
currItem->setItemName( CommonStrings::itemName_LinkAnnotation + QString("%1").arg(m_doc->TotalItems));
currItem->setTextFlowMode(PageItem::TextFlowDisabled);
break;
}
break;
case modeDrawTable2:
// TODO: Figure out what these conditions actually do.
if ((m_doc->m_Selection->count() == 0) && (m_view->HaveSelRect) && (!m_view->MidButt))
{
m_view->HaveSelRect = false;
// Calculate table rectangle.
FRect tableRect = adjustedRect(canvasPressCoord, canvasCurrCoord);
if (tableRect.width() < 6 || tableRect.height() < 6)
{
// Ignore tiny tables.
m_view->requestMode(submodePaintingDone);
break;
}
// Show table insert dialog.
// qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
InsertTable *dia = new InsertTable(m_view, static_cast<int>(tableRect.height()/6), static_cast<int>(tableRect.width()/6));
if (!dia->exec())
{
m_view->requestMode(submodePaintingDone);
delete dia;
dia = 0;
break;
}
int numRows = dia->Rows->value();
int numColumns = dia->Cols->value();
delete dia;
dia = 0;
// Add the table item.
// TODO: This should be done in an undo transaction.
m_doc->dontResize = true;
z = m_doc->itemAdd(PageItem::Table, PageItem::Unspecified,
tableRect.x(),
tableRect.y(),
tableRect.width(),
tableRect.height(),
0, // Unused.
CommonStrings::None, // Unused.
CommonStrings::None); // Unused.
PageItem_Table *table = m_doc->Items->at(z)->asTable();
table->insertRows(0, numRows - 1);
table->insertColumns(0, numColumns - 1);
table->adjustTableToFrame();
table->adjustFrameToTable();
m_doc->dontResize = false;
m_doc->setRedrawBounding(table);
}
break;
case modeInsertPDF3DAnnotation:
if (modifiers == Qt::ShiftModifier)
{
z = m_doc->itemAddArea(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, 1, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor);
}
else
{
z = m_doc->itemAdd(PageItem::OSGFrame, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().imageFillColor, m_doc->itemToolPrefs().imageStrokeColor);
}
currItem = m_doc->Items->at(z);
currItem->setIsAnnotation(true);
currItem->AutoName = false;
currItem->annotation().setType(Annotation::Annot3D);
currItem->setItemName( tr("3DAnnot") + QString("%1").arg(m_doc->TotalItems));
break;
}
if (z >= 0)
{
SetupDrawNoResize(z);
newObject = m_doc->Items->at(z);
newObject->ContourLine = newObject->PoLine.copy();
}
return newObject;
}