Subversion Repositories LassyPad

Compare Revisions

Ignore whitespace Rev 1 → Rev 5

/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/bin/Debug/icons/Thumbs.db
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/LassyPad/obj/x86/Debug/LassyPad.MainForm.resources
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
42,13 → 42,6
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.treeView = new System.Windows.Forms.TreeView();
this.tabControl = new System.Windows.Forms.TabControl();
this.welcomeTab = new System.Windows.Forms.TabPage();
this.welcomeView = new System.Windows.Forms.WebBrowser();
this.editorTab = new System.Windows.Forms.TabPage();
this.editorView = new System.Windows.Forms.RichTextBox();
this.formatBar = new System.Windows.Forms.ToolStrip();
this.sizeF = new System.Windows.Forms.ToolStripTextBox();
this.boldF = new System.Windows.Forms.ToolStripButton();
57,36 → 50,51
this.toolStripButton5 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton6 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton7 = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.toolStripButton8 = new System.Windows.Forms.ToolStripButton();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.editorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
this.editorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.wordWrapToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.tabControl = new System.Windows.Forms.TabControl();
this.welcomeTab = new System.Windows.Forms.TabPage();
this.welcomeView = new System.Windows.Forms.WebBrowser();
this.editorTab = new System.Windows.Forms.TabPage();
this.editorView = new System.Windows.Forms.RichTextBox();
this.treeView = new System.Windows.Forms.TreeView();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.fileBar.SuspendLayout();
this.formatBar.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.tabControl.SuspendLayout();
this.welcomeTab.SuspendLayout();
this.editorTab.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.tabControl.SuspendLayout();
this.welcomeTab.SuspendLayout();
this.editorTab.SuspendLayout();
this.formatBar.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
this.toolStripContainer1.SuspendLayout();
this.SuspendLayout();
//
// fileBar
//
this.fileBar.Dock = System.Windows.Forms.DockStyle.None;
this.fileBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2,
this.toolStripButton3,
this.toolStripButton4});
this.fileBar.Location = new System.Drawing.Point(0, 49);
this.fileBar.Location = new System.Drawing.Point(3, 0);
this.fileBar.Name = "fileBar";
this.fileBar.Size = new System.Drawing.Size(755, 25);
this.fileBar.Size = new System.Drawing.Size(104, 25);
this.fileBar.TabIndex = 1;
this.fileBar.Text = "toolStrip1";
//
130,90 → 138,9
this.toolStripButton4.Text = "toolStripButton4";
this.toolStripButton4.Click += new System.EventHandler(this.ToolStripButton4Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 74);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeView);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tabControl);
this.splitContainer1.Size = new System.Drawing.Size(755, 330);
this.splitContainer1.SplitterDistance = 251;
this.splitContainer1.TabIndex = 3;
//
// treeView
//
this.treeView.BackColor = System.Drawing.SystemColors.InactiveBorder;
this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView.Location = new System.Drawing.Point(0, 0);
this.treeView.Name = "treeView";
this.treeView.Size = new System.Drawing.Size(251, 330);
this.treeView.TabIndex = 0;
this.treeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeViewNodeMouseClick);
//
// tabControl
//
this.tabControl.Controls.Add(this.welcomeTab);
this.tabControl.Controls.Add(this.editorTab);
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl.Location = new System.Drawing.Point(0, 0);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(500, 330);
this.tabControl.TabIndex = 0;
//
// welcomeTab
//
this.welcomeTab.Controls.Add(this.welcomeView);
this.welcomeTab.Location = new System.Drawing.Point(4, 22);
this.welcomeTab.Name = "welcomeTab";
this.welcomeTab.Padding = new System.Windows.Forms.Padding(3);
this.welcomeTab.Size = new System.Drawing.Size(492, 304);
this.welcomeTab.TabIndex = 0;
this.welcomeTab.Text = "Welcome";
this.welcomeTab.UseVisualStyleBackColor = true;
//
// welcomeView
//
this.welcomeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.welcomeView.Location = new System.Drawing.Point(3, 3);
this.welcomeView.MinimumSize = new System.Drawing.Size(20, 20);
this.welcomeView.Name = "welcomeView";
this.welcomeView.Size = new System.Drawing.Size(486, 298);
this.welcomeView.TabIndex = 0;
//
// editorTab
//
this.editorTab.Controls.Add(this.editorView);
this.editorTab.Location = new System.Drawing.Point(4, 22);
this.editorTab.Name = "editorTab";
this.editorTab.Padding = new System.Windows.Forms.Padding(3);
this.editorTab.Size = new System.Drawing.Size(492, 304);
this.editorTab.TabIndex = 1;
this.editorTab.Text = "Editor";
this.editorTab.UseVisualStyleBackColor = true;
//
// editorView
//
this.editorView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.editorView.DetectUrls = false;
this.editorView.Dock = System.Windows.Forms.DockStyle.Fill;
this.editorView.Location = new System.Drawing.Point(3, 3);
this.editorView.Name = "editorView";
this.editorView.Size = new System.Drawing.Size(486, 298);
this.editorView.TabIndex = 0;
this.editorView.Text = "";
this.editorView.SelectionChanged += new System.EventHandler(this.EditorViewSelectionChanged);
this.editorView.TextChanged += new System.EventHandler(this.EditorViewTextChanged);
//
// formatBar
//
this.formatBar.Dock = System.Windows.Forms.DockStyle.None;
this.formatBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.sizeF,
this.boldF,
221,10 → 148,12
this.underlineF,
this.toolStripButton5,
this.toolStripButton6,
this.toolStripButton7});
this.formatBar.Location = new System.Drawing.Point(0, 24);
this.toolStripButton7,
this.toolStripSeparator1,
this.toolStripButton8});
this.formatBar.Location = new System.Drawing.Point(107, 0);
this.formatBar.Name = "formatBar";
this.formatBar.Size = new System.Drawing.Size(755, 25);
this.formatBar.Size = new System.Drawing.Size(231, 25);
this.formatBar.TabIndex = 2;
this.formatBar.Text = "toolStrip2";
//
294,6 → 223,20
this.toolStripButton7.Text = "toolStripButton7";
this.toolStripButton7.Click += new System.EventHandler(this.ToolStripButton7Click);
//
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(6, 25);
//
// toolStripButton8
//
this.toolStripButton8.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton8.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton8.Image")));
this.toolStripButton8.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton8.Name = "toolStripButton8";
this.toolStripButton8.Size = new System.Drawing.Size(23, 22);
this.toolStripButton8.Text = "toolStripButton8";
//
// menuStrip1
//
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
310,7 → 253,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 → 263,7
//
this.newToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("newToolStripMenuItem.Image")));
this.newToolStripMenuItem.Name = "newToolStripMenuItem";
this.newToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.newToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.newToolStripMenuItem.Text = "New";
this.newToolStripMenuItem.Click += new System.EventHandler(this.NewToolStripMenuItemClick);
//
327,7 → 271,7
//
this.openToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("openToolStripMenuItem.Image")));
this.openToolStripMenuItem.Name = "openToolStripMenuItem";
this.openToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.openToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.openToolStripMenuItem.Text = "Open";
this.openToolStripMenuItem.Click += new System.EventHandler(this.OpenToolStripMenuItemClick);
//
335,13 → 279,16
//
this.saveToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveToolStripMenuItem.Image")));
this.saveToolStripMenuItem.Name = "saveToolStripMenuItem";
this.saveToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.saveToolStripMenuItem.Text = "Save";
this.saveToolStripMenuItem.Click += new System.EventHandler(this.SaveToolStripMenuItemClick);
//
// openFileDialog1
// saveAsToolStripMenuItem
//
this.openFileDialog1.FileName = "openFileDialog1";
this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem";
this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(124, 22);
this.saveAsToolStripMenuItem.Text = "Save As";
this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.SaveAsToolStripMenuItemClick);
//
// editorToolStripMenuItem
//
353,19 → 300,129
//
// wordWrapToolStripMenuItem
//
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);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
this.openFileDialog1.Filter = "Rich Text Format|*.rtf|Plain Text|*.txt|All Files|*.*";
//
// saveFileDialog1
//
this.saveFileDialog1.Filter = "Rich Text Format|*.rtf|Plain Text|*.txt";
//
// tabControl
//
this.tabControl.Controls.Add(this.welcomeTab);
this.tabControl.Controls.Add(this.editorTab);
this.tabControl.Dock = System.Windows.Forms.DockStyle.Fill;
this.tabControl.Location = new System.Drawing.Point(0, 0);
this.tabControl.Name = "tabControl";
this.tabControl.SelectedIndex = 0;
this.tabControl.Size = new System.Drawing.Size(502, 355);
this.tabControl.TabIndex = 0;
//
// welcomeTab
//
this.welcomeTab.Controls.Add(this.welcomeView);
this.welcomeTab.Location = new System.Drawing.Point(4, 22);
this.welcomeTab.Name = "welcomeTab";
this.welcomeTab.Padding = new System.Windows.Forms.Padding(3);
this.welcomeTab.Size = new System.Drawing.Size(494, 329);
this.welcomeTab.TabIndex = 0;
this.welcomeTab.Text = "Welcome";
this.welcomeTab.UseVisualStyleBackColor = true;
//
// welcomeView
//
this.welcomeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.welcomeView.Location = new System.Drawing.Point(3, 3);
this.welcomeView.MinimumSize = new System.Drawing.Size(20, 20);
this.welcomeView.Name = "welcomeView";
this.welcomeView.Size = new System.Drawing.Size(488, 323);
this.welcomeView.TabIndex = 0;
//
// editorTab
//
this.editorTab.Controls.Add(this.editorView);
this.editorTab.Location = new System.Drawing.Point(4, 22);
this.editorTab.Name = "editorTab";
this.editorTab.Padding = new System.Windows.Forms.Padding(3);
this.editorTab.Size = new System.Drawing.Size(315, 124);
this.editorTab.TabIndex = 1;
this.editorTab.Text = "Editor";
this.editorTab.UseVisualStyleBackColor = true;
//
// editorView
//
this.editorView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.editorView.DetectUrls = false;
this.editorView.Dock = System.Windows.Forms.DockStyle.Fill;
this.editorView.Location = new System.Drawing.Point(3, 3);
this.editorView.Name = "editorView";
this.editorView.Size = new System.Drawing.Size(309, 118);
this.editorView.TabIndex = 0;
this.editorView.Text = "";
this.editorView.SelectionChanged += new System.EventHandler(this.EditorViewSelectionChanged);
this.editorView.TextChanged += new System.EventHandler(this.EditorViewTextChanged);
//
// treeView
//
this.treeView.BackColor = System.Drawing.SystemColors.InactiveBorder;
this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView.Location = new System.Drawing.Point(0, 0);
this.treeView.Name = "treeView";
this.treeView.Size = new System.Drawing.Size(249, 355);
this.treeView.TabIndex = 0;
this.treeView.NodeMouseClick += new System.Windows.Forms.TreeNodeMouseClickEventHandler(this.TreeViewNodeMouseClick);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.treeView);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.tabControl);
this.splitContainer1.Size = new System.Drawing.Size(755, 355);
this.splitContainer1.SplitterDistance = 249;
this.splitContainer1.TabIndex = 3;
//
// toolStripContainer1
//
//
// toolStripContainer1.ContentPanel
//
this.toolStripContainer1.ContentPanel.Controls.Add(this.splitContainer1);
this.toolStripContainer1.ContentPanel.Size = new System.Drawing.Size(755, 355);
this.toolStripContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.toolStripContainer1.Location = new System.Drawing.Point(0, 24);
this.toolStripContainer1.Name = "toolStripContainer1";
this.toolStripContainer1.Size = new System.Drawing.Size(755, 380);
this.toolStripContainer1.TabIndex = 5;
this.toolStripContainer1.Text = "toolStripContainer1";
//
// toolStripContainer1.TopToolStripPanel
//
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.fileBar);
this.toolStripContainer1.TopToolStripPanel.Controls.Add(this.formatBar);
//
// MainForm
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(755, 404);
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.fileBar);
this.Controls.Add(this.formatBar);
this.Controls.Add(this.toolStripContainer1);
this.Controls.Add(this.menuStrip1);
this.Name = "MainForm";
this.Text = "LassyPad";
372,19 → 429,28
this.Load += new System.EventHandler(this.MainFormLoad);
this.fileBar.ResumeLayout(false);
this.fileBar.PerformLayout();
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.tabControl.ResumeLayout(false);
this.welcomeTab.ResumeLayout(false);
this.editorTab.ResumeLayout(false);
this.formatBar.ResumeLayout(false);
this.formatBar.PerformLayout();
this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout();
this.tabControl.ResumeLayout(false);
this.welcomeTab.ResumeLayout(false);
this.editorTab.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
this.toolStripContainer1.ContentPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.ResumeLayout(false);
this.toolStripContainer1.TopToolStripPanel.PerformLayout();
this.toolStripContainer1.ResumeLayout(false);
this.toolStripContainer1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private System.Windows.Forms.ToolStripButton toolStripButton8;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenuItem saveAsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem wordWrapToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem editorToolStripMenuItem;
private System.Windows.Forms.ToolStripTextBox sizeF;
414,5 → 480,6
private System.Windows.Forms.TabControl tabControl;
private System.Windows.Forms.ToolStrip fileBar;
private System.Windows.Forms.SplitContainer splitContainer1;
}
}
/LassyPad/MainForm.resx
206,6 → 206,15
wbZRY2wAAAAASUVORK5CYII=
</value>
</data>
<data name="toolStripButton8.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAHZJREFUOE9jYKAG
eMHw/z85GG43OZpBelAMYLgCFIDhBUIQNoxGloOyCRtAwBDcBoA0omOyXPBfkUwvwJwOMgBPOOAPA5BG
mAFYnA8yGMOA7//F/iNjkAHoYsh8ggbg0wySw/RCKNDZJGDqG0BOcqZeXqAkRwMAkgcVdDDC2TAAAAAA
SUVORK5CYII=
</value>
</data>
<metadata name="menuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>217, 17</value>
</metadata>
/LassyPad/MainForm.cs
38,7 → 38,7
saved = true;
}
public void open()
public bool open()
{
try
{
48,7 → 48,9
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Load Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
return false;
}
return true;
}
}
115,6 → 117,7
}
case ("Files"):
{
showFile(e.Node.Name);
break;
}
141,10 → 144,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 → 158,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 → 181,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,16 → 190,29
}
}
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()
{
bool openRes;
DialogResult res = openFileDialog1.ShowDialog();
if (openFileDialog1.FileName != "" && res != DialogResult.Cancel)
{
files.Add(new rtfFile(openFileDialog1.FileName));
files[files.Count - 1].open();
treeView.Nodes["Files"].Nodes.Add(openFileDialog1.FileName, openFileDialog1.FileName);
openRes = files[files.Count - 1].open();
if (openRes)
{
treeView.Nodes["Files"].Nodes.Add(openFileDialog1.FileName, openFileDialog1.FileName);
showFile(files.Count - 1);
}
else
files.RemoveAt(files.Count - 1);
}
showFile(files.Count - 1);
}
public void closeFile()
236,7 → 260,7
{
selectionStart = editorView.SelectionStart;
selectionLength = editorView.SelectionLength;
sizeF.Text = editorView.SelectionFont.Size.ToString();
// sizeF.Text = editorView.SelectionFont.Size.ToString();
}
#region File stuff
276,6 → 300,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