User forums > Using Code::Blocks
Selection Length
(1/1)
White-Tiger:
Hello,
I'm using Code::Blocks a while ago and there is something that really pissed me of.
I miss a "Selection Length" within the status bar to see how many bytes/chars i have selected. Currently i have to count them by myself or i have to open Notepad (Notepad2/Notepad++ etc.)
Is there a way to integrate it into Code::Blocks? Sry when it is "easy" to activate/enable but i didn't find anything about that.
And why isn't it there already? I mean it is very helpful and even little editors like Notepad2 have it.
Kind regards
White-Tiger
Jenna:
--- Quote from: White-Tiger on July 11, 2010, 05:28:35 pm ---Is there a way to integrate it into Code::Blocks?
--- End quote ---
I think so.
--- Quote from: White-Tiger on July 11, 2010, 05:28:35 pm ---And why isn't it there already?
--- End quote ---
As far as I know, nobody ever asked for it.
White-Tiger:
So... now finally I did it by myself :P
Before:
After:
For comparison
Notepad2:
Notepad++:
I've chosen the Notepad++ layout, just because I think many already know it, and it's also more handy as Code::Blocks current default. You have less to read, so you spend less time to take a look ;)
Also I've removed some spacings, i don't like it when it isn't equal on both ends :P (I know, it isn't yet either, but it's better ;))
Diff
--- Code: ---Index: src/src/main.cpp
===================================================================
--- src/src/main.cpp (revision 6843)
+++ src/src/main.cpp (working copy)
@@ -1699,12 +1699,12 @@
width[num++] = -1; // main field
// width[num++] = 128; // progress bar
- dc.GetTextExtent(_(" WINDOWS-1252 "), &width[num++], &h);
- dc.GetTextExtent(_(" Line 12345, Column 123 "), &width[num++], &h);
- dc.GetTextExtent(_(" Overwrite "), &width[num++], &h);
- dc.GetTextExtent(_(" Modified "), &width[num++], &h);
- dc.GetTextExtent(_(" Read/Write....."), &width[num++], &h);
- dc.GetTextExtent(_(" name_of_profile "), &width[num++], &h);
+ dc.GetTextExtent(_("WINDOWS-1252"), &width[num++], &h);
+ dc.GetTextExtent(_("Ln : 12345 Col : 1234 Sel : 12345"), &width[num++], &h);
+ dc.GetTextExtent(_("Overwrite"), &width[num++], &h);
+ dc.GetTextExtent(_("Modified"), &width[num++], &h);
+ dc.GetTextExtent(_("Read/Write....."), &width[num++], &h);
+ dc.GetTextExtent(_("name_of_profile"), &width[num++], &h);
wxStatusBar* sb = CreateStatusBar(num);
if (sb)
@@ -1736,8 +1736,9 @@
{
int panel = 0;
int pos = ed->GetControl()->GetCurrentPos();
+ long a, b;ed->GetControl()->GetSelection(&a, &b);
wxString msg;
- msg.Printf(_("Line %d, Column %d"), ed->GetControl()->GetCurrentLine() + 1, ed->GetControl()->GetColumn(pos) + 1);
+ msg.Printf(_("Ln : %d Col : %d Sel : %ld"), ed->GetControl()->GetCurrentLine() + 1, ed->GetControl()->GetColumn(pos) + 1, b-a);
SetStatusText(ed->GetFilename(), panel++);
SetStatusText(ed->GetEncodingName(), panel++);
SetStatusText(msg, panel++);
--- End code ---
Navigation
[0] Message Index
Go to full version