本文整理汇总了C++中QsciScintillaBase::SendScintilla方法的典型用法代码示例。如果您正苦于以下问题:C++ QsciScintillaBase::SendScintilla方法的具体用法?C++ QsciScintillaBase::SendScintilla怎么用?C++ QsciScintillaBase::SendScintilla使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QsciScintillaBase
的用法示例。
在下文中一共展示了QsciScintillaBase::SendScintilla方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: characterCount
// Return the number of characters in the text.
int QsciAccessibleScintillaBase::characterCount() const
{
QsciScintillaBase *sb = sciWidget();
return sb->SendScintilla(QsciScintillaBase::SCI_COUNTCHARACTERS, 0,
sb->SendScintilla(QsciScintillaBase::SCI_GETTEXTLENGTH));
}
示例2: setSelection
// Set the selection.
void QsciAccessibleScintillaBase::setSelection(int selectionIndex,
int startOffset, int endOffset)
{
if (selectionIndex == 0)
{
QsciScintillaBase *sb = sciWidget();
sb->SendScintilla(QsciScintillaBase::SCI_SETSELECTIONSTART,
offsetAsPosition(sb, startOffset));
sb->SendScintilla(QsciScintillaBase::SCI_SETSELECTIONEND,
offsetAsPosition(sb, endOffset));
}
}
示例3: fontForStyle
// Convert a integer colour to an RGB string.
QFont QsciAccessibleScintillaBase::fontForStyle(int style) const
{
QsciScintillaBase *sb = sciWidget();
char fontName[64];
int len = sb->SendScintilla(QsciScintillaBase::SCI_STYLEGETFONT, style,
fontName);
int size = sb->SendScintilla(QsciScintillaBase::SCI_STYLEGETSIZE, style);
bool italic = sb->SendScintilla(QsciScintillaBase::SCI_STYLEGETITALIC,
style);
int weight = sb->SendScintilla(QsciScintillaBase::SCI_STYLEGETWEIGHT,
style);
return QFont(QString::fromUtf8(fontName, len), size, weight, italic);
}
示例4: setCursorPosition
// Set the cursor offset.
void QsciAccessibleScintillaBase::setCursorPosition(int position)
{
QsciScintillaBase *sb = sciWidget();
sb->SendScintilla(QsciScintillaBase::SCI_GOTOPOS,
offsetAsPosition(sb, position));
}
示例5: insertText
// Insert some text.
void QsciAccessibleScintillaBase::insertText(int offset, const QString &text)
{
QsciScintillaBase *sb = sciWidget();
sb->SendScintilla(QsciScintillaBase::SCI_INSERTTEXT,
offsetAsPosition(sb, offset), textAsBytes(sb, text).constData());
}
示例6: textAfterOffset
// Return the fragment of text after an offset.
QString QsciAccessibleScintillaBase::textAfterOffset(int offset,
QAccessible::TextBoundaryType boundaryType, int *startOffset,
int *endOffset) const
{
QsciScintillaBase *sb = sciWidget();
// Initialise in case of errors.
*startOffset = *endOffset = -1;
int position = validPosition(offset);
if (position < 0)
return QString();
int start_position, end_position;
if (!boundaries(sb, position, boundaryType, &start_position, &end_position))
return QString();
if (end_position >= sb->SendScintilla(QsciScintillaBase::SCI_GETTEXTLENGTH))
return QString();
if (!boundaries(sb, end_position, boundaryType, &start_position, &end_position))
return QString();
positionRangeAsOffsetRange(sb, start_position, end_position, startOffset,
endOffset);
return textRange(sb, start_position, end_position);
}
示例7: scrollToSubstring
// Scroll to make sure an area of text is visible.
void QsciAccessibleScintillaBase::scrollToSubstring(int startIndex,
int endIndex)
{
QsciScintillaBase *sb = sciWidget();
int start = offsetAsPosition(sb, startIndex);
int end = offsetAsPosition(sb, endIndex);
sb->SendScintilla(QsciScintillaBase::SCI_SCROLLRANGE, end, start);
}
示例8: offsetAtPoint
// Return the offset of the character at the given screen coordinates.
int QsciAccessibleScintillaBase::offsetAtPoint(const QPoint &point) const
{
QsciScintillaBase *sb = sciWidget();
QPoint p = sb->viewport()->mapFromGlobal(point);
int position = sb->SendScintilla(QsciScintillaBase::SCI_POSITIONFROMPOINT,
p.x(), p.y());
return (position >= 0) ? positionAsOffset(sb, position) : -1;
}
示例9: replaceText
// Replace some text.
void QsciAccessibleScintillaBase::replaceText(int startOffset, int endOffset,
const QString &text)
{
QsciScintillaBase *sb = sciWidget();
addSelection(startOffset, endOffset);
sb->SendScintilla(QsciScintillaBase::SCI_REPLACESEL,
textAsBytes(sb, text).constData());
}
示例10: characterRect
QRect QsciAccessibleScintillaBase::characterRect(int offset) const
{
QsciScintillaBase *sb = sciWidget();
int position = offsetAsPosition(sb, offset);
int x_vport = sb->SendScintilla(QsciScintillaBase::SCI_POINTXFROMPOSITION,
position);
int y_vport = sb->SendScintilla(QsciScintillaBase::SCI_POINTYFROMPOSITION,
position);
const QString ch = text(offset, offset + 1);
// Get the character's font metrics.
int style = sb->SendScintilla(QsciScintillaBase::SCI_GETSTYLEAT, position);
QFontMetrics metrics(fontForStyle(style));
QRect rect(x_vport, y_vport, metrics.width(ch), metrics.height());
rect.moveTo(sb->viewport()->mapToGlobal(rect.topLeft()));
return rect;
}
示例11: setColor
// Set the color attribute.
void QsciStyle::setColor(const QColor &color)
{
style_color = color;
if (style_nr >= 0)
{
QsciScintillaBase *sci = QsciScintillaBase::pool();
if (sci)
sci->SendScintilla(QsciScintillaBase::SCI_STYLESETFORE, style_nr,
style_color);
}
}
示例12: setHotspot
// Set the hotspot attribute.
void QsciStyle::setHotspot(bool hotspot)
{
style_hotspot = hotspot;
if (style_nr >= 0)
{
QsciScintillaBase *sci = QsciScintillaBase::pool();
if (sci)
sci->SendScintilla(QsciScintillaBase::SCI_STYLESETHOTSPOT,
style_nr, style_hotspot);
}
}
示例13: setChangeable
// Set the changeable attribute.
void QsciStyle::setChangeable(bool changeable)
{
style_changeable = changeable;
if (style_nr >= 0)
{
QsciScintillaBase *sci = QsciScintillaBase::pool();
if (sci)
sci->SendScintilla(QsciScintillaBase::SCI_STYLESETCHANGEABLE,
style_nr, style_changeable);
}
}
示例14: setVisible
// Set the visible attribute.
void QsciStyle::setVisible(bool visible)
{
style_visible = visible;
if (style_nr >= 0)
{
QsciScintillaBase *sci = QsciScintillaBase::pool();
if (sci)
sci->SendScintilla(QsciScintillaBase::SCI_STYLESETVISIBLE,
style_nr, style_visible);
}
}
示例15: setTextCase
// Set the text case attribute.
void QsciStyle::setTextCase(QsciStyle::TextCase text_case)
{
style_case = text_case;
if (style_nr >= 0)
{
QsciScintillaBase *sci = QsciScintillaBase::pool();
if (sci)
sci->SendScintilla(QsciScintillaBase::SCI_STYLESETCASE, style_nr,
(long)style_case);
}
}