Join 300,497 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,847 people online right now. Registration is fast and FREE... Join Now!
This was an idea I had a while ago, but never got around to doing. [in other words, like most of my ideas]
But, I've finally delved into .NET and it's going pretty well.
Basically, it's a very simple program, with a tree view on the left, and a rich text box on the right. You can select the snippets, sorted by language, from the tree view, and it will load it into the rich text box. There are a few buttons as well, but they don't all have functionality yet.
Once I've got a working version, I'll post it here.
TO THOSE OF YOU WHO WANT TO DOWNLOAD THE LATEST VERSION: Remember to go to the most recent post. I've left all previous versions here, and I've struck them out The newest is in bold
Version 1.0b is available here if you don't want to read through all of the development process.
And the latest *reasonably* stable version is here: Version 1.3.6b ~ it even has tabs!
I've got a very early sample, there's not too much to it yet, and there are some bugs, but please try it!
I've added a sample snippet, just so you can load one. Just open the program, and click it in the tree menu on the left.
Note that you have to create a new language directory before you can create a new snippet in that directory. In other words, if the directory doesn't already exist, the program will freeze when you click OK on the new dialog.
<edit> There's a newer version, available here but I'll leave this available for those of you who want to see the progress. </edit> Snippet_Manager_0.5a.zip ( 5.7k )
Number of downloads: 18
I'm looking for constructive criticism, not just "you suck" and if possible, some suggestions would be nice.
Future development ideas:
Make it possible to compile the code. (Turn it in to a mini-IDE) -You would have to configure your compiler yourself, as a one time thing.
Anyway, I've just edited it some more. Try resizing that version, the anchors are screwy. I just fixed that.
And, because I was coming up with more and more options, there wasn't enough room for all those big nasty buttons. So right now, everything you see there is actually under "File"
Yup, syntax highlighting would be the only thing I need...I'm pretty good about finding errors when/right after I make them.
Making a mini-IDE would be pretty cool to say the least.
I think you've done a good job on this, even though it's only an early sample!
Might I offer a few minor, minor, changes?
The Font:
Well the font is a little small and weird looking (mostly because it's small). Might I recommend the Courier New font? That's what most IDEs I come across use, either Courier or Courier New. And make it size...about...12 - 14?
Pretty much other than that, it's good! Great job!
Cool! Though would you permenently out an IDE in it or eventually will you fork it and keep the sinppet manager? Because I'd use the snippet manager but the IDE would be unnessesary and it would shorten the size of it.
Yeah, the source code will be available once it's done. It's just a mess at the moment.
As for the tutorial, it's a possibility. I might write one on how I populate the tree view, we'll just wait and see how things go.
And I think I'd probably make the IDE seperately, this would just be a quick compile-and-test sorta thing. Though I could package them together, I suppose.
Yep. I've been working with .NET since... Saturday! So this is all new to me, but I'm getting there.
Here it is: Again, kept to see development, but the newest is further down in this post. Snippet_Manager_0.7.6a.zip ( 7.5k )
Number of downloads: 8
There are a lot of changes, all for the better. It looks much neater now, there's an about option, all the previous options are under "File" and there's syntax highlighting on the word "test." (I know it's not the right word, but it's a start)
I need to fix some of the syntax highlighting, make it start from the beginning of the current line as opposed to the beginning of the text every time, which will hopefully reduce the flashing.
Again, feedback is welcomed
EDIT: Here's the latest version. There's some basic C++ syntax highlighting going on, it doesn't highlight it when you load a file yet, but it does it as you type. It scans the text for the current line, so flashing is reduced. Note that the cursor moves to the end if you type somewhere in the middle of the box at the moment. That's one of the next things that I'll fix Snippet_Manager_0.8.3a.zip ( 7.38k )
Number of downloads: 20 <edit> Newer version available here </edit>
Here's a screen shot of the syntax highlighting in action:
I think the next addition will be preprocessor stuff, which makes the whole line a certain colour if there's a '#' at the beginning of the line. Also, I'll make that stuff bold too, to make it stand out more.
Here's the newest version: Snippet_Manager_0.8.854a.zip ( 7.97k )
Number of downloads: 9 <edit>VERSION 1 NOW AVAILABLE HERE! </edit>
And here's a gift abgorn. Syntax highlighting, basic code:
csharp
void colour (System.Drawing.Color a, string [] search, bool bold, int loop) { int z; // current caret position, use to reposition after font changes z = code.SelectionStart; int i; try {for (int x = 0; x < loop; x++) { i = code.GetFirstCharIndexFromLine(code.GetLineFromCharIndex(code.SelectionStart + 1));
i = code.Text.IndexOf (search[x], i); if (i != -1) { code.SelectionStart = i; code.SelectionLength = search[x].Length; if (code.SelectionColor == System.Drawing.Color.Black) // if it isn't to be overridden code.SelectionColor = a; if (bold == true) code.SelectionFont = new System.Drawing.Font(code.Font, System.Drawing.FontStyle.Bold); code.DeselectAll(); i += search[x].Length;
} }
code.SelectionStart = z; code.SelectionColor = System.Drawing.Color.Black; code.SelectionFont = new System.Drawing.Font(code.Font, System.Drawing.FontStyle.Regular); } catch (System.Exception t) {} // do nothing }
void HandleGreen () { try {// get the first character of the line int pos = code.GetFirstCharIndexFromLine(code.GetLineFromCharIndex(code.SelectionStart + 1)); if (code.Text[pos] == '#') code.SelectionColor = System.Drawing.Color.Green; char current = code.Text[code.SelectionStart-1]; if (current == '\n') code.SelectionColor = System.Drawing.Color.Black; }catch (System.Exception t) {} }
I have a nasty habit of not commenting my code. Sorry about that. It isn't the best, it's very flawed. But it's there, all the same.