Subversion Repositories LassyPad

Compare Revisions

Ignore whitespace Rev 2 → Rev 3

/LassyPad/bin/Debug/LassyPad.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/bin/Debug/LassyPad.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/obj/x86/Debug/LassyPad.exe
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/obj/x86/Debug/LassyPad.csproj.GenerateResource.Cache
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/obj/x86/Debug/LassyPad.pdb
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/MainForm.Designer.cs
66,6 → 66,7
this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.fileBar.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
310,7 → 311,8
this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.newToolStripMenuItem,
this.openToolStripMenuItem,
this.saveToolStripMenuItem});
this.saveToolStripMenuItem,
this.saveAsToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "File";
319,7 → 321,7
//
this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewToolStripMenuItemClick);
//
327,7 → 329,7
//
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenToolStripMenuItemClick);
//
335,7 → 337,7
//
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(111, 22);
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick);
//
352,7 → 354,7
this.wordWrapToolStripMenuItem.Checked = true;
this.wordWrapToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.wordWrapToolStripMenuItem.Name = "wordWrapToolStripMenuItem";
this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.wordWrapToolStripMenuItem.Size = new System.Drawing.Size(140, 22);
this.wordWrapToolStripMenuItem.Text = "Word Wrap";
this.wordWrapToolStripMenuItem.Click += new System.EventHandler(this.WordWrapToolStripMenuItemClick);
//
360,6 → 362,13
//
this.openFileDialog1.FileName = "openFileDialog1";
//
// saveAsToolStripMenuItem
//
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveAsToolStripMenuItem.Text = "Save As";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItemClick);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
387,6 → 396,7
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem wordWrapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editorToolStripMenuItem;
private System.Windows.Forms.ToolStripTextBox sizeF;
416,5 → 426,6
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.ToolStrip fileBar;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}
/LassyPad/MainForm.cs
115,6 → 115,7
}
case ("Files"):
{
showFile(e.Node.Name);
break;
}
141,10 → 142,12
tabControl.SelectedIndex = 1;
for (int i = 0; i < files.Count; i++)
{
// editorView.Text = files[i].rtfBox.Text;
//editorView = files[i].rtfBox;
curFileID = i;
return;
if (files[i].loc == filename)
{
editorView.Rtf = files[i].rtfBox.Rtf;
curFileID = i;
return;
}
}
}
153,18 → 156,22
public void newFile()
{
int i = 0;
bool exists;
while (true)
{
exists = false;
for (int j = 0; j < files.Count; j++)
{
if (!(files[j].loc == "NewFile" + i.ToString() + ".rtf"))
{
files.Add(new rtfFile("NewFile" + i.ToString() + ".rtf"));
treeView.Nodes["Files"].Nodes.Add("NewFile" + i.ToString() + ".rtf", "NewFile" + i.ToString() + ".rtf");
showFile(files.Count - 1);
return;
}
if ((files[j].loc == "NewFile" + i.ToString() + ".rtf"))
exists = true;
}
if (!exists)
{
files.Add(new rtfFile("NewFile" + i.ToString() + ".rtf"));
treeView.Nodes["Files"].Nodes.Add("NewFile" + i.ToString() + ".rtf", "NewFile" + i.ToString() + ".rtf");
showFile(files.Count - 1);
return;
}
i++;
}
172,6 → 179,8
public void renameFile(string filename, string newFilename)
{
treeView.Nodes["Files"].Nodes[filename].Text = newFilename;
treeView.Nodes["Files"].Nodes[filename].Name = newFilename;
for (int i = 0; i < files.Count; i++)
{
if (files[i].loc == filename)
179,6 → 188,13
}
}
public void renameFile(int fileID, string newFilename)
{
treeView.Nodes["Files"].Nodes[files[fileID].loc].Text = newFilename;
treeView.Nodes["Files"].Nodes[files[fileID].loc].Name = newFilename;
files[fileID].loc = newFilename;
}
public void openFile()
{
DialogResult res = openFileDialog1.ShowDialog();
276,6 → 292,17
closeFile();
}
void SaveAsToolStripMenuItemClick(object sender, EventArgs e)
{
DialogResult res = saveFileDialog1.ShowDialog();
if (saveFileDialog1.FileName != "" && res != DialogResult.Cancel)
{
renameFile(curFileID, saveFileDialog1.FileName);
files[curFileID].loc = saveFileDialog1.FileName;
files[curFileID].save();
}
}
#endregion
#region Format stuff