Home » U++ Library support » LineEdit, EditFields, DocEdit » Dotted spaces (Show spaces, like show tabs)
Dotted spaces (Show spaces, like show tabs) [message #32010] |
Sat, 16 April 2011 21:27 |
galious
Messages: 28 Registered: March 2008
|
Promising Member |
|
|
Hi,
for a project of mine I've update the following files to allow the user to show the spaces with a small dot. Much like the blue line which indicates tabs, if Show tabs is on.
Maybe it's of interest to others or a candidate for inclusion in the default code base.
Best regards,
Martin
Changes:
In TextEdit.h
added at line 252:
added at line 337:
LineEdit& ShowSpaces(bool ss = true) { showspaces = ss; Refresh(); return *this; }
bool IsShowSpacess() const { return showspaces; }
In LineEdit.cpp:
added at line 10:
added at line 145:
else if(txt[q] == ' ') {
LLOG("Highlight -> space[" << q << "] paper = " << h.paper);
if(pass == 0) {
w.DrawRect(gp * fsz.cx - scx, y, fsz.cx * l, fsz.cy, h.paper);
if(showspaces && h.paper != SColorHighlight && q < tx.GetLength()) {
Color c = Blend(SColorLight, SColorHighlight);
w.DrawRect(gp * fsz.cx - scx + fsz.cx / 2, y + fsz.cy / 2,
1, 1, c);
}
if(bordercolumn > 0 && bordercolumn >= gp && bordercolumn < gp + 1)
w.DrawRect((bordercolumn - sc.x) * fsz.cx, y, 1, fsz.cy, bordercolor);
}
q++;
gp++;
}
changed line 164 into:
while(p < len && h == hl[p] && txt[p] != '\t' && txt[p] != ' ' && IsCJKIdeograph(txt[p]) == cjk && p - q < 128)
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Fri Sep 20 10:31:36 CEST 2024
Total time taken to generate the page: 0.03371 seconds
|