diff options
Diffstat (limited to 'qt/ScintillaEdit/ScintillaEdit.cpp.template')
-rw-r--r-- | qt/ScintillaEdit/ScintillaEdit.cpp.template | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/qt/ScintillaEdit/ScintillaEdit.cpp.template b/qt/ScintillaEdit/ScintillaEdit.cpp.template index e9bd2cbeb..d13527db8 100644 --- a/qt/ScintillaEdit/ScintillaEdit.cpp.template +++ b/qt/ScintillaEdit/ScintillaEdit.cpp.template @@ -55,5 +55,30 @@ void ScintillaEdit::set_doc(ScintillaDocument *pdoc_) { send(SCI_SETDOCPOINTER, 0, (sptr_t)(pdoc_->pointer())); } +long ScintillaEdit::format_range(bool draw, QPaintDevice* target, QPaintDevice* measure, + const QRect& print_rect, const QRect& page_rect, + long range_start, long range_end) +{ + Sci_RangeToFormat to_format; + + to_format.hdc = target; + to_format.hdcTarget = measure; + + to_format.rc.left = print_rect.left(); + to_format.rc.top = print_rect.top(); + to_format.rc.right = print_rect.right(); + to_format.rc.bottom = print_rect.bottom(); + + to_format.rcPage.left = page_rect.left(); + to_format.rcPage.top = page_rect.top(); + to_format.rcPage.right = page_rect.right(); + to_format.rcPage.bottom = page_rect.bottom(); + + to_format.chrg.cpMin = range_start; + to_format.chrg.cpMax = range_end; + + return send(SCI_FORMATRANGE, draw, reinterpret_cast<sptr_t>(&to_format)); +} + /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */ /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ |