Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous message
galious is currently offline  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:
bool             showspaces;


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:
showspaces = false;


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)
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New method with EditorSyntax
Next Topic: How to add a currency symbol to an EditDoubleSpin?
Goto Forum:
  


Current Time: Fri Apr 19 07:01:31 CEST 2024

Total time taken to generate the page: 0.02536 seconds