diff options
| author | nyamatongwe <unknown> | 2012-07-24 15:29:48 +1000 | 
|---|---|---|
| committer | nyamatongwe <unknown> | 2012-07-24 15:29:48 +1000 | 
| commit | b74d888e9d72a7a61295dccfee1f07465f5be867 (patch) | |
| tree | fb958dd1e96d6451555c8fdb0730ed7c2d02ca89 /src | |
| parent | 124855efe9f3d44625552854cf618a64613fe8c8 (diff) | |
| download | scintilla-mirror-b74d888e9d72a7a61295dccfee1f07465f5be867.tar.gz | |
Add ncurses platform. Rest of the implementation is an external project.
From Mitchell Foral.
Diffstat (limited to 'src')
| -rw-r--r-- | src/AutoComplete.cxx | 4 | ||||
| -rw-r--r-- | src/AutoComplete.h | 2 | ||||
| -rw-r--r-- | src/CallTip.cxx | 16 | ||||
| -rw-r--r-- | src/CallTip.h | 5 | ||||
| -rw-r--r-- | src/Editor.cxx | 8 | ||||
| -rw-r--r-- | src/Editor.h | 3 | ||||
| -rw-r--r-- | src/ScintillaBase.cxx | 4 | 
7 files changed, 29 insertions, 13 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx index 82773f4db..bab123a99 100644 --- a/src/AutoComplete.cxx +++ b/src/AutoComplete.cxx @@ -34,7 +34,9 @@ AutoComplete::AutoComplete() :  	cancelAtStartPos(true),  	autoHide(true),  	dropRestOfWord(false), -	ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE) { +	ignoreCaseBehaviour(SC_CASEINSENSITIVEBEHAVIOUR_RESPECTCASE), +	widthLBDefault(100), +	heightLBDefault(100) {  	lb = ListBox::Allocate();  	stopChars[0] = '\0';  	fillUpChars[0] = '\0'; diff --git a/src/AutoComplete.h b/src/AutoComplete.h index 91e084857..4d27e6add 100644 --- a/src/AutoComplete.h +++ b/src/AutoComplete.h @@ -34,6 +34,8 @@ public:  	bool autoHide;  	bool dropRestOfWord;  	unsigned int ignoreCaseBehaviour; +	int widthLBDefault; +	int heightLBDefault;  	AutoComplete();  	~AutoComplete(); diff --git a/src/CallTip.cxx b/src/CallTip.cxx index 9f17e592a..d5ba3bd09 100644 --- a/src/CallTip.cxx +++ b/src/CallTip.cxx @@ -18,9 +18,6 @@  using namespace Scintilla;  #endif -static const int insetX = 5;    // text inset in x from calltip border -static const int widthArrow = 14; -  CallTip::CallTip() {  	wCallTip = 0;  	inCallTipMode = false; @@ -36,6 +33,11 @@ CallTip::CallTip() {  	above = false;  	useStyleCallTip = false;    // for backwards compatibility +	insetX = 5; +	widthArrow = 14; +	borderHeight = 2; // Extra line for border and an empty line at top and bottom. +	verticalOffset = 1; +  #ifdef __APPLE__  	// proper apple colours for the default  	colourBG = ColourDesired(0xff, 0xff, 0xc6); @@ -284,15 +286,15 @@ PRectangle CallTip::CallTipStart(int pos, Point pt, int textHeight, const char *  	}  	lineHeight = surfaceMeasure->Height(font); -	// Extra line for border and an empty line at top and bottom. The returned +	// The returned  	// rectangle is aligned to the right edge of the last arrow encountered in  	// the tip text, else to the tip text left edge. -	int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + 2 + 2; +	int height = lineHeight * numLines - surfaceMeasure->InternalLeading(font) + borderHeight * 2;  	delete surfaceMeasure;  	if (above) { -		return PRectangle(pt.x - offsetMain, pt.y - 1 - height, pt.x + width - offsetMain, pt.y - 1); +		return PRectangle(pt.x - offsetMain, pt.y - verticalOffset - height, pt.x + width - offsetMain, pt.y - verticalOffset);  	} else { -		return PRectangle(pt.x - offsetMain, pt.y + 1 + textHeight, pt.x + width - offsetMain, pt.y + 1 + textHeight + height); +		return PRectangle(pt.x - offsetMain, pt.y + verticalOffset + textHeight, pt.x + width - offsetMain, pt.y + verticalOffset + textHeight + height);  	}  } diff --git a/src/CallTip.h b/src/CallTip.h index 657e0caa1..fdc4db86f 100644 --- a/src/CallTip.h +++ b/src/CallTip.h @@ -50,6 +50,11 @@ public:  	int codePage;  	int clickPlace; +	int insetX; // text inset in x from calltip border +	int widthArrow; +	int borderHeight; +	int verticalOffset; // pixel offset up or down of the calltip with respect to the line +  	CallTip();  	~CallTip(); diff --git a/src/Editor.cxx b/src/Editor.cxx index c3f1b984e..4a52f38ce 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -218,6 +218,9 @@ Editor::Editor() {  	convertPastes = true; +	marginNumberPadding = 3; +	ctrlCharPadding = 3; // +3 For a blank on front and rounded edge each side +  	hsStart = -1;  	hsEnd = -1; @@ -1957,7 +1960,7 @@ void Editor::PaintSelMargin(Surface *surfWindow, PRectangle &rc) {  						PRectangle rcNumber = rcMarker;  						// Right justify  						XYPOSITION width = surface->WidthText(vs.styles[STYLE_LINENUMBER].font, number, istrlen(number)); -						XYPOSITION xpos = rcNumber.right - width - 3; +						XYPOSITION xpos = rcNumber.right - width - marginNumberPadding;  						rcNumber.left = xpos;  						surface->DrawTextNoClip(rcNumber, vs.styles[STYLE_LINENUMBER].font,  								rcNumber.top + vs.maxAscent, number, istrlen(number), @@ -2199,9 +2202,8 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou  						} else if (controlCharSymbol < 32) {  							if (ctrlCharWidth[ll->chars[charInLine]] == 0) {  								const char *ctrlChar = ControlCharacterString(ll->chars[charInLine]); -								// +3 For a blank on front and rounded edge each side:  								ctrlCharWidth[ll->chars[charInLine]] = -								    surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + 3; +								    surface->WidthText(ctrlCharsFont, ctrlChar, istrlen(ctrlChar)) + ctrlCharPadding;  							}  							ll->positions[charInLine + 1] = ctrlCharWidth[ll->chars[charInLine]];  						} else { diff --git a/src/Editor.h b/src/Editor.h index 0ae1f115f..cb1141b61 100644 --- a/src/Editor.h +++ b/src/Editor.h @@ -269,6 +269,9 @@ protected:	// ScintillaBase subclass needs access to much of Editor  	bool convertPastes; +	int marginNumberPadding; // the right-side padding of the number margin +	int ctrlCharPadding; // the padding around control character text blobs +  	Document *pdoc;  	Editor(); diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx index cc3992f8f..b3b0b679f 100644 --- a/src/ScintillaBase.cxx +++ b/src/ScintillaBase.cxx @@ -226,8 +226,8 @@ void ScintillaBase::AutoCompleteStart(int lenEntered, const char *list) {  	if (rcPopupBounds.Height() == 0)  		rcPopupBounds = rcClient; -	int heightLB = 100; -	int widthLB = 100; +	int heightLB = ac.heightLBDefault; +	int widthLB = ac.widthLBDefault;  	if (pt.x >= rcClient.right - widthLB) {  		HorizontalScrollTo(xOffset + pt.x - rcClient.right + widthLB);  		Redraw();  | 
