Different background color for procedures?

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Different background color for procedures?

Post by PB »

Freak, how hard would it be to add an OPTION to make the background color
of each procedure be different to the default background color, by alternating
with two different user-specified colours?

Because it would make it easier to spot where procedures start and end when
coding, especially when you have lots of little procedures on-screen at once. :)

See my comparison screenshots further down.
Last edited by PB on Sat Feb 03, 2007 1:35 am, edited 2 times in total.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

I do not think it can be easily done, but i can have a look at it.
quidquid Latine dictum sit altum videtur
User avatar
Joakim Christiansen
Addict
Addict
Posts: 2452
Joined: Wed Dec 22, 2004 4:12 pm
Location: Norway
Contact:

Post by Joakim Christiansen »

I agree that an option like this would make the code more readable and that would actually be cool! :)
I like logic, hence I dislike humans but love computers.
r_hyde
Enthusiast
Enthusiast
Posts: 155
Joined: Wed Jul 05, 2006 12:40 am

Post by r_hyde »

I hope it's not extremely difficult, because I think it looks like a very useful feature!
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

Here's why I asked... the first shot is actual code from an old app of mine,
and the second shot is how it would look with this feature added. As you can
see, it makes it so much easier to differentiate between the procedures! 8)

All the editor would have to do, is support the normal background color, but
let the user specify another alt background color, and then just toggle between
the two every time a new procedure is listed. That's my theory, anyway. :)

And for those who might say to just fold my procedures: I need to view them!

Image Image

(BTW, apologies to those who hate ImageShack, but ImgSpot doesn't respond very much, so I've ditched it).
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Kaeru Gaman
Addict
Addict
Posts: 4826
Joined: Sun Mar 19, 2006 1:57 pm
Location: Germany

Post by Kaeru Gaman »

PB wrote:(BTW, apologies to those who hate ImageShack, but ImgSpot doesn't respond very much, so I've ditched it).
it would be even more convenient, if you'll change the link a bit:
take the complete forums-tag including the thumbnail,
but change the URL from the php-link to the direct-link.
this will provide a commercial-free big picture connected with the conveniance of using the thumbnail...

demo:
Image
(click to see the difference... ;) )
oh... and have a nice day.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Cheap solution : use specials tags like this :

Image
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> Cheap solution : use specials tags

No thanks -- that would require you to convert ALL your source codes.

Besides, I like the way I envision it, as it highlights the procedures.
Highlighting just a line is no good if that line is just off-screen. See:

If only the line above the procedure is highlighted:
Image

If it's done the way I like (no need to modify sources):
Image

Or, alternatively, maybe make the line number column have alternating colors
for the start of every procedure? I figure that since the line number column
is already drawing a line the length of the procedure, then it might be easy
to give it a different color background too? Take a look:

Image

Basically, just any way to make procedures stand out more, would be good,
to visually separate the blocks of code.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
kenmo
Addict
Addict
Posts: 2033
Joined: Tue Dec 23, 2003 3:54 am

Post by kenmo »

I don't like this idea... just make the fold-lines in the line number column stand out more and it's pretty easy to discriminate procedures.
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

> I don't like this idea

That's why I said OPTION in capital letters... so you don't have to use it. :P

But, as you said, perhaps a thicker fold line would be just as good. As they
stand, they're pretty thin and don't do much to differentiate the procedures.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Flype
Addict
Addict
Posts: 1542
Joined: Tue Jul 22, 2003 5:02 pm
Location: In a long distant galaxy

Post by Flype »

i voted yes because i like this idea.
No programming language is perfect. There is not even a single best language.
There are only languages well suited or perhaps poorly suited for particular purposes. Herbert Mayer
Derek
Addict
Addict
Posts: 2354
Joined: Wed Apr 07, 2004 12:51 am
Location: England

Post by Derek »

Voted yes, if it's not too hard to implement and also optional then I think it would be a good thing to have, anything to make coding easier and quicker.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Easy to implement : using the folding flags to draw an horizontal line above each folding marker

Image
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post by PB »

I deleted the poll because it was pointless. :)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

PB wrote:@gnozal: you're still missing the point -- drawing a line like that still doesn't differentiate procedures if the top of one is not visible in the editor ...
I know it's not exactly want you want, but it's easy to implement. On the other side, I am not sure that what you've asked for is easy to do or even possible with scintilla. I don't see any obvious way to do it with the existing function set (but sometimes you don't see the obvious ...).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply