diff options
| -rw-r--r-- | qt/ScintillaEdit/ScintillaEdit.cpp.template | 25 | ||||
| -rw-r--r-- | qt/ScintillaEdit/ScintillaEdit.h.template | 11 | 
2 files changed, 36 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 */ diff --git a/qt/ScintillaEdit/ScintillaEdit.h.template b/qt/ScintillaEdit/ScintillaEdit.h.template index 32c8a7726..052d87c74 100644 --- a/qt/ScintillaEdit/ScintillaEdit.h.template +++ b/qt/ScintillaEdit/ScintillaEdit.h.template @@ -51,6 +51,17 @@ public:  		return get_text_range(start, end);  	} +	// Exposing the FORMATRANGE api with both underscore & qt style names +	long format_range(bool draw, QPaintDevice* target, QPaintDevice* measure,  +			   const QRect& print_rect, const QRect& page_rect, +                          long range_start, long range_end); +	long formatRange(bool draw, QPaintDevice* target, QPaintDevice* measure,  +                         const QRect& print_rect, const QRect& page_rect, +                         long range_start, long range_end) { +		return format_range(draw, target, measure, print_rect, page_rect, +		                    range_start, range_end);			  +	} +  /* ++Autogenerated -- start of section automatically generated from Scintilla.iface */  /* --Autogenerated -- end of section automatically generated from Scintilla.iface */ | 
