Anything or just text?
157 Replies - 29826 Views - Last Post: 02 March 2009 - 11:13 AM
#25
Re: Snippet Manager
Posted 25 August 2008 - 12:15 PM
Mmmm, it sounds good and do you mean a visual clipboard or the system clipboard?
#26
Re: Snippet Manager
Posted 25 August 2008 - 12:15 PM
Probably just text.
And I think I'm gonna put the syntax highlighting and auto indentation on hold for a while. Put those into a new class of its own, called RichTextBoxSH which inherits RichTextBox stuff, and highlights stuff too.
And I think I'm gonna put the syntax highlighting and auto indentation on hold for a while. Put those into a new class of its own, called RichTextBoxSH which inherits RichTextBox stuff, and highlights stuff too.
#27
Re: Snippet Manager
Posted 25 August 2008 - 12:16 PM
@gabehabe: You gave me a great idea, so Im working on one as well, with syntax highlighting of course. Once we're done maybe we can compare notes? I'm also thinking of adding syntax formatting as well, we'll see how that goes lol
#28
Re: Snippet Manager
Posted 25 August 2008 - 12:19 PM
awwwww, no chance of me competing with PsychoCoder 
I'd be interested in seeing your code, if that's OK though?
I know I'd learn a lot
I'll probably get to work on the class tonight. And if you check the C# forum, baavgai came up with some pretty cool code for syntax highlighting.
And I guess yours will be done in about 20 minutes, Psycho?
I'd be interested in seeing your code, if that's OK though?
I know I'd learn a lot
I'll probably get to work on the class tonight. And if you check the C# forum, baavgai came up with some pretty cool code for syntax highlighting.
And I guess yours will be done in about 20 minutes, Psycho?
#29
Re: Snippet Manager
Posted 25 August 2008 - 12:24 PM
I can't wait until my project finishes its first (of hopefully many) updates.
#30
Re: Snippet Manager
Posted 25 August 2008 - 12:42 PM
Well, I've got my first use for it.
The code isn't 100% for the syntax highlighting/auto indenting, and it won't be until I've made a proper class and thought about it properly.
So, guess how/where it's going to be stored?
Through my program, of course! xD
The code isn't 100% for the syntax highlighting/auto indenting, and it won't be until I've made a proper class and thought about it properly.
So, guess how/where it's going to be stored?
Through my program, of course! xD
#31
Re: Snippet Manager
Posted 25 August 2008 - 12:44 PM
What language is highlighted in the current version?
#32
Re: Snippet Manager
Posted 25 August 2008 - 12:59 PM
C++
But in my version right now, there's no highlighting. It was just too buggy, so like I said, I'm going to make my own class.
@Psycho~
If I create my own class in C# like I intend to, is it possible to use it in design view? If so, how?
Right now, I'm just getting rid of all those nasty errors. Like when you try to create a snippet in a language that doesn't already have it's own directory, instead of throwing an unhandled exception, it now creates the directory and inserts a snippet into it
Next: CTRL+S, ALT+F4, CTRL+N shortcuts.
Then clipboard management! w00t!
Then I think it will be time to release version 1 into the world.
After that, I'll start on my class, and work towards a version 2 with syntax highlighting, auto indentation, and *possibly* a compile option.
But in my version right now, there's no highlighting. It was just too buggy, so like I said, I'm going to make my own class.
@Psycho~
If I create my own class in C# like I intend to, is it possible to use it in design view? If so, how?
Right now, I'm just getting rid of all those nasty errors. Like when you try to create a snippet in a language that doesn't already have it's own directory, instead of throwing an unhandled exception, it now creates the directory and inserts a snippet into it
Next: CTRL+S, ALT+F4, CTRL+N shortcuts.
Then clipboard management! w00t!
Then I think it will be time to release version 1 into the world.
After that, I'll start on my class, and work towards a version 2 with syntax highlighting, auto indentation, and *possibly* a compile option.
#33
Re: Snippet Manager
Posted 25 August 2008 - 02:26 PM
OK, I lied. I did the clipboard stuff first.
Added options:
Dump clipboard contents to snippet: pastes everything from the clipboard to the code window.
Dump clipboard contents to file: auto creates files (clipdump1, clipdump2, etc) and saves the clipboard contents to that file.
Dump clipboard contents to file as: opens a save file dialog, for the user to choose the path of the file.
Options #2 and #3 will create a directory called "Clipboard" if it doesn't already exist.
If #3 was picked, and the folder is still empty (ie, user chose not to use it) it is deleted again.
(This is just an option if the user can't decide where to save it to, basically.)
EDIT:
Added the ability to load files that are just in the directory of the program into the tree view for selection~ this helps to avoid the error of not displaying the snippets if the user did not create/was not aware that it was necessary to put the snippets into a folder of their own.
The code itself some 310 lines~ not bad for a C# newbie
Oh, and I also added the syntax highlighting back in. It doesn't do it automatically at the moment, but it's available as a button from the menu.
ANOTHER EDIT:
I finally reached version 1.0b, which is stable! (Or at least I think it is
)
I'll upload it tomorrow, with a readme (gotta write one first)
Ooooooo, and a .chm, too
Added options:
Dump clipboard contents to snippet: pastes everything from the clipboard to the code window.
Dump clipboard contents to file: auto creates files (clipdump1, clipdump2, etc) and saves the clipboard contents to that file.
Dump clipboard contents to file as: opens a save file dialog, for the user to choose the path of the file.
Options #2 and #3 will create a directory called "Clipboard" if it doesn't already exist.
If #3 was picked, and the folder is still empty (ie, user chose not to use it) it is deleted again.
(This is just an option if the user can't decide where to save it to, basically.)
EDIT:
Added the ability to load files that are just in the directory of the program into the tree view for selection~ this helps to avoid the error of not displaying the snippets if the user did not create/was not aware that it was necessary to put the snippets into a folder of their own.
The code itself some 310 lines~ not bad for a C# newbie
Oh, and I also added the syntax highlighting back in. It doesn't do it automatically at the moment, but it's available as a button from the menu.
ANOTHER EDIT:
I finally reached version 1.0b, which is stable! (Or at least I think it is
I'll upload it tomorrow, with a readme (gotta write one first)
Ooooooo, and a .chm, too
#34
Re: Snippet Manager
Posted 26 August 2008 - 04:22 AM
Version 1 is Now Available! 
http://www.dreamincode.net/forums/index.php?act=Attach&type=post&id=8124
I've fixed (what I think to be) all of the bugs that already existed, and make it more graphically pleasing.
All the key features have already been described, but I'll put them all here in one place.
Future Development Concepts:
If anyone else has some suggestions, or bug reports, please let me know!
And without further ado... Here it is!
Snippet_Manager_1.0b.zip (17.86K)
Number of downloads: 61
v1.3.6b available here
Enjoy!
http://www.dreamincode.net/forums/index.php?act=Attach&type=post&id=8124
I've fixed (what I think to be) all of the bugs that already existed, and make it more graphically pleasing.
All the key features have already been described, but I'll put them all here in one place.
- Tree view to list directories and sub directories
---Makes it easy to manage your snippets by language - Automatic recreation of the readme
---In case it didn't come with one, it will create it at run time - Menu strip containing the basics, plus more!
---Clipboard management, syntax highlighting(currently contains bugs), and more! - About
---Display a new form, with the basic information about the program! - All new tool strip! (Because the menu strip just didn't cut it)
---Contains buttons to quickly create new snippets, cut, copy, paste, etc~
Future Development Concepts:
- Better syntax highlighting -> this is a must
---It will be customisable - Syntax formatting
---You know, with the little box that appears to scroll through and find what you want? That little widget. (Most likely to come in v3) - Automatic code indentation
---The original worked, but it contained bugs - Ability to print
---This is a possibility. While it wouldn't really need printing as such, it could take advantage of a pre-installed pdf writer - Automatic clipboard pasting
---This feature could go under the tree view. It could have scroll bars, and store the last *custom inputted* amount of clipboard additions. All stored in a single XML file
If anyone else has some suggestions, or bug reports, please let me know!
And without further ado... Here it is!
Snippet_Manager_1.0b.zip (17.86K)
Number of downloads: 61
v1.3.6b available here
Enjoy!
Attached image(s)
#35
Re: Snippet Manager
Posted 26 August 2008 - 06:10 AM
Nice.
Requested feature, ability to change directory and store it in preferences. Also, if you get your syntax highlighting in config files, the ability to have them in their own directory.
Look at how Visual Studio projects stores application preferences by default to give you some ideas. http://msdn.microsof...869(VS.80).aspx
Source?
Requested feature, ability to change directory and store it in preferences. Also, if you get your syntax highlighting in config files, the ability to have them in their own directory.
Look at how Visual Studio projects stores application preferences by default to give you some ideas. http://msdn.microsof...869(VS.80).aspx
Source?
#36
Re: Snippet Manager
Posted 26 August 2008 - 12:09 PM
@gabehabe: Nope mine isn't completed yet. I didn't get a chance to work on it last night any because I ran over one of my dogs yesterday when coming in the driveway, and that has my head a little messed up (well I'm a little better today). Ill be working on it throughout the day and will let you see some of the code when I get some things completed.
I sad, I love my dogs so much, and it's not because they cost a lot of money (the one I ran over cost us $450), it's because they become a part of your life, like kids, and I know I'm gonna have a hard time living with myself for a while.
Well enough of the sad shit, Ill keep you posted on my progress
I sad, I love my dogs so much, and it's not because they cost a lot of money (the one I ran over cost us $450), it's because they become a part of your life, like kids, and I know I'm gonna have a hard time living with myself for a while.
Well enough of the sad shit, Ill keep you posted on my progress
#37
Re: Snippet Manager
Posted 26 August 2008 - 01:18 PM
Nice suggestions baavgai, I'll definitely take them into consideration 
It might be a little different, since I'm using SharpDevelop, but I'll take a look now
@Psycho:
I'm sorry to hear that. I know how much they become a part of a family, I bawled my eyes out for days after she had to be put down
Back to the topic of this thread though, I'm gonna start working towards v2 tomorrow~ I've only just got home from hospital (it's 9pm) and I left at 2:30pm.
Woops, side tracked again!
Any more suggestions/feedback?
It might be a little different, since I'm using SharpDevelop, but I'll take a look now
@Psycho:
I'm sorry to hear that. I know how much they become a part of a family, I bawled my eyes out for days after she had to be put down
Back to the topic of this thread though, I'm gonna start working towards v2 tomorrow~ I've only just got home from hospital (it's 9pm) and I left at 2:30pm.
Woops, side tracked again!
Any more suggestions/feedback?
#38
Re: Snippet Manager
Posted 26 August 2008 - 02:02 PM
One idea I just had is to add a button to add semi-colons to the end of each line, provided there isn't one there already. It would have a few exceptions, like if there's a "for" or "if" etc on that line, then it wouldn't append one to it.
It's a pretty common error, and I think I can make something to automatically fix it.
Thoughts?
I'll just kick out the source code here for now, on the next release I'll add it under "C#" so that you can access it through my program
Obviously there's the other forms, but the code for those is just so basic it's not worth rushing to post. There's only about 40 lines to each, and most of it is just spacing and
{
}
It's a pretty common error, and I think I can make something to automatically fix it.
Thoughts?
I'll just kick out the source code here for now, on the next release I'll add it under "C#" so that you can access it through my program
/*
* Title: The Snippet Manager
* Author: Danny Battison
* Date: 23/08/2008
*/
using System;
using System.Windows.Forms;
using System.IO;
using System.Collections.Generic;
namespace Snippet_Manager
{
/// <summary>
/// A snippet management program, used to create and load snippets
/// in a manageable solution.
/// Loads directories as languages, and files within the directories
/// as the snippets.
/// </summary>
public partial class MainForm : Form
{
string readme;
void initialiseReadme()
{
readme = "===========================\n";
readme += "|The Snippet Manager v1.0b|\n";
readme += "===========================\n\n";
readme += "I've finally reached a stable version of development for this program, so I decided it's time to release it as a beta! w00t!\n\n";
readme += "So, with a beta program, what do you expect to get with it? A readme, of course. Which is what this is. It's even been written using the Snippet Manager! YAY!\n\n";
readme += "=======================\n";
readme += "|What is this program?|\n";
readme += "=======================\n";
readme += "This program's main intention is to serve as a snippet management program. Basically, you have the text editing region, and a tree view. The text editing region is for, well, it's for editing text!\n";
readme += "The tree view on the left will list all directories in the program root as parent nodes, and all files within it as child nodes.\n\n";
readme += "The main use is for the folders in the program root to be programming languages. Then, the snippets themselves are stored in the folders. Organised, huh?\n\n";
readme += "===============================\n";
readme += "|Who is this program aimed at?|\n";
readme += "===============================\n";
readme += "This program's #1 target is the programmer. It's main purpose, as originally stated, is to manage snippets. However, it also serves as a pretty good note taking application. Of course, the folders don't HAVE to be named after programming languages. They can be anything. Contact details of friends, for example. See? It's an all-round program!\n\n";
readme += "==========================================\n";
readme += "|Who the heck wrote this program, anyway?|\n";
readme += "==========================================\n";
readme += "Me of course! And who am I? I'm Danny. This is actually my first ever C#.NET project, but I figured it may as well be a pretty big project. I already have experience in C/C++ so the concept of programming is nothing new to me. All I had to do was learn a bit of new syntax, and there's nothing better than improving skills!\n\n";
readme += "Anyway, to sum up the \"who is\" part of this readme:\n";
readme += "I'm Danny. I live in England, and I'm 18 years old. From now on, I'm going to be working on quite a few projects of a similar (and hopefully larger) scale than the snippet manager. I really enjoy programming, and since I started, I literally just haven't stopped!\n\n";
readme += "=================================\n";
readme += "|So where can this guy be found?|\n";
readme += "=================================\n";
readme += "Well, you could always click \"About\" on the Snippet Manager!\n";
readme += "But, my email address is: [email protected]\n";
readme += "Please feel free to contact me if you have any questions about the program, or any errors to report!\n\n";
readme += "Also, I'm a moderator over at a programming forum called </dream.in.code> :: [url="http://www.dreamincode.net\n";"]http://www.dreamincode.net\n";[/url]
readme += "My user name is gabehabe. If you're interested in programming, why not sign up?\n\n";
readme += "=======================\n";
readme += "|And now for the outro|\n";
readme += "=======================\n";
readme += "And that's it from me! I've finished babbling on about stuff that you really didn't need to know anyway! Please enjoy the program!\n\n";
readme += "=)";
}
string currentlyOpen; // the snippet that is open in the rich text box (used for delete)
void updateTreeView ()
{
treeView1.Nodes.Clear();
// get all folders within the current directory, to add to the tree menu
System.IO.DirectoryInfo dir = new DirectoryInfo(System.Environment.CurrentDirectory);
foreach (DirectoryInfo g in dir.GetDirectories())
{ // load the parent nodes, aka "languages"
TreeNode objNode = treeView1.Nodes.Add(g.Name);
foreach (FileInfo h in g.GetFiles())
// load the child nodes, aka "snippets"
objNode.Nodes.Add (h.Name);
}
int count = 0;
bool readmeExists = false;
TreeNode unsortedNode = treeView1.Nodes.Add ("Unsorted"); // the parent node
foreach (FileInfo g in dir.GetFiles())
{
if (g.Name != "readme.snippet")
{
unsortedNode.Nodes.Add (g.Name);
count++;
} else readmeExists = true;
}
if (count == 0)
treeView1.Nodes.Remove(unsortedNode);
if (readmeExists == true)
treeView1.Nodes.Add("readme.snippet");
if (readmeExists == false)
{ // the sneaky bit. recreate the readme if it doesn't already exist!
initialiseReadme();
StreamWriter SW;
SW = File.CreateText (@System.Environment.CurrentDirectory + @"\\readme.snippet");
SW.Write (@readme);
SW.Close();
treeView1.Nodes.Add ("readme.snippet");
}
}
public MainForm()
{
// The InitializeComponent() call is required for Windows Forms designer support.
InitializeComponent();
updateTreeView();
}
void TreeView1AfterSelect(object sender, TreeViewEventArgs e)
{
try
{ // Look for a file extension.
if (e.Node.Text.Contains("."))
{
code.Clear();
string toOpen = System.Environment.CurrentDirectory;
toOpen += '\\';
if (treeView1.SelectedNode.Level == 1
&& treeView1.SelectedNode.Parent.Text != "Unsorted"
&& treeView1.SelectedNode.Text != "readme.snippet")
toOpen += treeView1.SelectedNode.Parent.Text + '\\';
toOpen += treeView1.SelectedNode.Text;
code.AppendText (File.ReadAllText(toOpen));
currentlyOpen = toOpen;
}
}
catch (System.ComponentModel.Win32Exception){} // do nothing
}
void RichTextBox1TextChanged(object sender, EventArgs e)
{
}
void Button1Click(object sender, EventArgs e)
{
Form1 input = new Form1();
input.ShowDialog(this);
if (input.dir != null) // if something has been inputted, and the user pressed OK
Directory.CreateDirectory (input.dir);
updateTreeView();
}
void LanguageToolStripMenuItem1Click(object sender, EventArgs e)
{
Form1 input = new Form1();
if (DialogResult.OK == MessageBox.Show(@"Deleting the language container will delete all snippets of that language.", @"Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
{
input.ShowDialog(this);
if (input.dir != null) // if something was inputted, and the user pressed OK
Directory.Delete (@input.dir, true);
updateTreeView();
}
}
void SnippetToolStripMenuItemClick(object sender, EventArgs e)
{
Form2 input = new Form2();
input.ShowDialog(this);
if (input.snip != null && input.lang != null) // if something has been inputted
{
string toMake = System.Environment.CurrentDirectory;
toMake += '\\' + input.lang;
if (!Directory.Exists(toMake))
Directory.CreateDirectory (toMake);
toMake += '\\' + input.snip + ".snippet";
FileStream FS;
FS = File.Create (@toMake);
FS.Close();
updateTreeView();
}
}
void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
{
SaveFileDialog sfn = new SaveFileDialog();
sfn.Title = "Save Snippet...";
sfn.Filter = "Snippet|*.snippet";
sfn.InitialDirectory = System.Environment.CurrentDirectory;
if (sfn.ShowDialog() == DialogResult.OK)
{
StreamWriter SW;
SW = File.CreateText (@sfn.FileName);
SW.Write (@code.Text);
SW.Close();
currentlyOpen = @sfn.FileName;
}
updateTreeView();
}
void SnippetToolStripMenuItem2Click(object sender, EventArgs e)
{
if (currentlyOpen != null)
System.IO.File.Delete (currentlyOpen);
updateTreeView();
}
void SaveToolStripMenuItemClick(object sender, EventArgs e)
{
if (currentlyOpen == null)
SaveAsToolStripMenuItemClick(this, e);
else
{
StreamWriter SW;
SW = File.CreateText (@currentlyOpen);
SW.Write (@code.Text);
SW.Close();
}
updateTreeView();
}
void ExitToolStripMenuItemClick(object sender, EventArgs e)
{
this.Close ();
}
void LanguageToolStripMenuItemClick(object sender, EventArgs e)
{
Form1 input = new Form1();
input.ShowDialog(this);
if (input.dir != null)
Directory.CreateDirectory (input.dir);
updateTreeView();
}
void AboutToolStripMenuItemClick(object sender, EventArgs e)
{
Form3 about = new Form3();
about.ShowDialog(this);
}
void DumpClipboardToSnippetToolStripMenuItemClick(object sender, EventArgs e)
{
code.Clear();
code.AppendText (Clipboard.GetText());
}
void SaveClipboardToFileToolStripMenuItemClick(object sender, EventArgs e)
{
char counter = '1';
DirectoryInfo info = new DirectoryInfo (System.Environment.CurrentDirectory + "\\Clipboard");
foreach (FileInfo g in info.GetFiles())
if (g.Name.Contains("clipdump"))
counter++;
string dir = System.Environment.CurrentDirectory + "\\Clipboard\\clipdump" + counter + ".snippet";
StreamWriter SW;
SW = File.CreateText (@dir);
SW.Write (@Clipboard.GetText());
SW.Close();
updateTreeView();
}
void DumpClipboardToFileAsToolStripMenuItemClick(object sender, EventArgs e)
{
if (!Directory.Exists (System.Environment.CurrentDirectory + "\\Clipboard"))
Directory.CreateDirectory (System.Environment.CurrentDirectory + "\\Clipboard");
SaveFileDialog sfn = new SaveFileDialog();
sfn.Title = "Save Clipboard Contents...";
sfn.Filter = "Snippet|*.snippet";
sfn.InitialDirectory = System.Environment.CurrentDirectory;
if (sfn.ShowDialog() == DialogResult.OK)
{
StreamWriter SW;
SW = File.CreateText (@sfn.FileName);
SW.Write (@Clipboard.GetText());
SW.Close();
}
int count = 0; // use to check if there is anything in the clipboard folder already
// if there isn't, the folder is deleted again
DirectoryInfo info = new DirectoryInfo (System.Environment.CurrentDirectory + "\\Clipboard");
foreach (FileInfo x in info.GetFiles())
count++;
// after the loop, if count is still equal to 0, the folder is still empty and was not used
if (count == 0)
Directory.Delete(System.Environment.CurrentDirectory + "\\Clipboard");
updateTreeView();
}
void ClearAllToolStripMenuItemClick(object sender, EventArgs e)
{
if (DialogResult.OK == MessageBox.Show(@"You are about to clear all contents of the code box. Proceed?",
@"Confirm", MessageBoxButtons.OKCancel, MessageBoxIcon.Question))
code.Clear();
}
void UndoToolStripMenuItemClick(object sender, EventArgs e)
{
code.Undo();
}
void RedoToolStripMenuItemClick(object sender, EventArgs e)
{
code.Redo();
}
void CutToolStripMenuItemClick(object sender, EventArgs e)
{
code.Cut();
}
void CopyToolStripMenuItemClick(object sender, EventArgs e)
{
code.Copy();
}
void PasteToolStripMenuItemClick(object sender, EventArgs e)
{
code.Paste();
}
void NewToolStripButtonclick(object sender, EventArgs e)
{
SnippetToolStripMenuItemClick(this, e);
}
void OpenToolStripButtonclick(object sender, EventArgs e)
{
OpenFileDialog ofn = new OpenFileDialog();
ofn.Title = "Load snippet...";
ofn.Filter = "Snippet |*.snippet";
ofn.InitialDirectory = System.Environment.CurrentDirectory;
if (DialogResult.OK == ofn.ShowDialog())
{
code.Clear();
code.AppendText(File.ReadAllText(@ofn.FileName));
currentlyOpen = @ofn.FileName;
}
}
void SaveToolStripButtonclick(object sender, EventArgs e)
{
SaveToolStripMenuItemClick(this, e);
}
void CutToolStripButtonclick(object sender, EventArgs e)
{
code.Cut();
}
void CopyToolStripButtonclick(object sender, EventArgs e)
{
code.Copy();
}
void PasteToolStripButtonclick(object sender, EventArgs e)
{
code.Paste();
}
void HelpToolStripButtonclick(object sender, EventArgs e)
{
AboutToolStripMenuItemClick(this, e);
}
void ToolStripStatusLabel1Click(object sender, EventArgs e)
{
// possible easter egg! KYA IS GAY!
}
// from here on in, it's all about syntax highlighting. There's a lot of code to
// something so basic, but it does the job for now!
void colour (System.Drawing.Color a, string [] search, bool bold, int loop)
{
int z = 0;
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 HandleRed ()
{
string [] search = {"=", "/", "*", "(", ")", "[", "]"};
colour (System.Drawing.Color.Red, search, false, 7);
}
void HandleBlue ()
{
string [] search = {"using", "namespace", "void", "int", "bool", "char", "for", "while",
"do", "try", "catch", "throw", "static", "const", "class", "true",
"false", "return", "this", "if", "else", "public", "private"};
colour (System.Drawing.Color.Blue, search, true, 23);
}
void HandleGreen ()
{
try
{// get the first character of the line
int pos = code.GetFirstCharIndexFromLine(code.GetLineFromCharIndex(code.Selectionstart + 1));
int start;
int end;
char current = code.Text[pos];
start = code.Selectionstart;
end = start;
while (current != '\n')
{
end++;
code.Selectionstart += 1;
current = code.Text[code.Selectionstart];
}
code.Select (start, end - start);
code.SelectionColor = System.Drawing.Color.Green;
code.DeselectAll();
code.SelectionColor = System.Drawing.Color.Black;
}catch (System.Exception t) {}
}
void CToolStripMenuItemClick(object sender, EventArgs e)
{
HandleRed();
HandleGreen();
HandleBlue();
}
void MainFormLoad(object sender, EventArgs e)
{
}
}
}
Obviously there's the other forms, but the code for those is just so basic it's not worth rushing to post. There's only about 40 lines to each, and most of it is just spacing and
{
}

New Topic/Question
Reply



MultiQuote







|