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 next 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)
Re: Dotted spaces (Show spaces, like show tabs) [message #32027 is a reply to message #32010] Sun, 17 April 2011 22:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
OK, why not, patch applied, welcome to contributors list... Smile

Mirek
Re: Dotted spaces (Show spaces, like show tabs) [message #32048 is a reply to message #32027] Tue, 19 April 2011 09:42 Go to previous messageGo to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

mirek wrote on Sun, 17 April 2011 23:26

OK, why not, patch applied, welcome to contributors list... Smile

Mirek


After this patch TheIDE starts behave very strange.
index.php?t=getfile&id=3184&private=0

OS: Ubuntu 10.10 32 bits
Re: Dotted spaces (Show spaces, like show tabs) [message #32208 is a reply to message #32048] Sun, 01 May 2011 09:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Yes, there was a bug to fix, should be ok now.
Re: Dotted spaces (Show spaces, like show tabs) [message #43809 is a reply to message #32010] Wed, 22 October 2014 18:40 Go to previous messageGo to next message
wimpie is currently offline  wimpie
Messages: 46
Registered: March 2013
Location: holland
Member
Hello maybe it's already fixed but there's a typo I think:
bool      IsShowSpacess() const           { return showspaces; }
                     ~~


note the double s
Re: Dotted spaces (Show spaces, like show tabs) [message #43828 is a reply to message #43809] Wed, 29 October 2014 16:17 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thanks, fixed as well.

Mirek
Previous Topic: New method with EditorSyntax
Next Topic: How to add a currency symbol to an EditDoubleSpin?
Goto Forum:
  


Current Time: Tue Apr 16 20:17:25 CEST 2024

Total time taken to generate the page: 0.02989 seconds