Subversion Repositories LassyPad

Compare Revisions

Ignore whitespace Rev 6 → Rev 7

/LassyPad/MainForm.resx
259,4 → 259,54
<metadata name="saveFileDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>459, 17</value>
</metadata>
<metadata name="editorMenuStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>591, 17</value>
</metadata>
<data name="saveFileToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAHNJREFUOE/Fk2EK
wCAIhb33brQj7k/L2BsP03IgLJDMfF8qJFKx2iFNOdhXTDdXg574U9xLzsbe0m0VESDb7gBn5hLO7B8A
Xo32uNyr9wt7ep8glDOBhvgksxC+67l7gAoAYbH6aYAV4hwCeA4bv+IP1jBu0cn9sabO8QwAAAAASUVO
RK5CYII=
</value>
</data>
<data name="closeFileToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJNJREFUOE+tk90O
gCAIhVnvf9dr9T5dErhoRzyYW7nYlJ8PMBT5a6mIfWtr8HXFI2p7JsfWEqBvl66DnLtqFgOUwY3sWbGS
DAAbbbQBPIhBUOeV3O30LQQgQxjQfIcqhovDQN+ni+UA7DsD0FZWEE45OM5hnwLeLtEhJWDxN3LALJi0
Vk9hNcqhrwbq02Nae4Pc6wJDlo2KjrbsMAAAAABJRU5ErkJggg==
</value>
</data>
<data name="inToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAHpJREFUOE9jYKA1
mN7y/z8Mk2QXskZ0NkGDkDUce/s/FIaJdg1MIUwjA8P//+iG4HQFumaQRmQDQHy8YYJsAEgjOibJAGxe
IGgAyG8UhQGyASCDSI4F2Yb//0GYrHQA0wyiYdFEdNxj00wwxcEUUKQZZAjMAKJtpKZCAHarKbXxglmH
AAAAAElFTkSuQmCC
</value>
</data>
<data name="outToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAHJJREFUOE9jYKA1
mN7y/z8Mk2QXskZ0NkGDkDUce/s/FIaJdg1MIbJmdENwugKfZqIMQTaAgeH/f3QMMgRvoFLsApDfKAoD
ZANABpEcC7IN//+DMFnpAKYZRMOiiei4x6aZYIqDKaBIM8gQmAFE20hNhQBluS3Z0JHRrAAAAABJRU5E
rkJggg==
</value>
</data>
<data name="zoomToolStripMenuItem.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAGZJREFUOE9jYKA1
mN7y/z8Mk2QXskZ0NkGDkDUce/s/FIaJdg1MIbJmdENwugKfZqIMGXgDQH6jKAyQDQAZRHIsyDb8/w/C
ZKUDmGYQDYsmouMem2aCKQ6mgCLNIENgBhBtIzUVAgDQgzMGLrQeBQAAAABJRU5ErkJggg==
</value>
</data>
<metadata name="colorDialog1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>722, 17</value>
</metadata>
</root>
/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
36,6 → 36,7
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm));
this.fileBar = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
44,6 → 45,9
this.toolStripButton4 = new System.Windows.Forms.ToolStripButton();
this.formatBar = new System.Windows.Forms.ToolStrip();
this.sizeF = new System.Windows.Forms.ToolStripTextBox();
this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator();
this.textColourF = new System.Windows.Forms.ToolStripButton();
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.boldF = new System.Windows.Forms.ToolStripButton();
this.italicF = new System.Windows.Forms.ToolStripButton();
this.underlineF = new System.Windows.Forms.ToolStripButton();
68,9 → 72,16
this.welcomeView = new System.Windows.Forms.WebBrowser();
this.editorTab = new System.Windows.Forms.TabPage();
this.editorView = new System.Windows.Forms.RichTextBox();
this.editorMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components);
this.saveFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.closeFileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.zoomToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.inToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.outToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.treeView = new System.Windows.Forms.TreeView();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.toolStripContainer1 = new System.Windows.Forms.ToolStripContainer();
this.colorDialog1 = new System.Windows.Forms.ColorDialog();
this.fileBar.SuspendLayout();
this.formatBar.SuspendLayout();
this.menuStrip1.SuspendLayout();
77,6 → 88,7
this.tabControl.SuspendLayout();
this.welcomeTab.SuspendLayout();
this.editorTab.SuspendLayout();
this.editorMenuStrip.SuspendLayout();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
148,6 → 160,9
this.formatBar.Dock = System.Windows.Forms.DockStyle.None;
this.formatBar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.sizeF,
this.toolStripSeparator3,
this.textColourF,
this.toolStripSeparator4,
this.boldF,
this.italicF,
this.underlineF,
159,7 → 174,7
this.toolStripButton8});
this.formatBar.Location = new System.Drawing.Point(107, 0);
this.formatBar.Name = "formatBar";
this.formatBar.Size = new System.Drawing.Size(268, 25);
this.formatBar.Size = new System.Drawing.Size(272, 25);
this.formatBar.TabIndex = 2;
this.formatBar.Text = "toolStrip2";
//
170,6 → 185,27
this.sizeF.ToolTipText = "Font Size";
this.sizeF.TextChanged += new System.EventHandler(this.SizeFTextChanged);
//
// toolStripSeparator3
//
this.toolStripSeparator3.Name = "toolStripSeparator3";
this.toolStripSeparator3.Size = new System.Drawing.Size(6, 25);
//
// textColourF
//
this.textColourF.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text;
this.textColourF.Font = new System.Drawing.Font("Tahoma", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.textColourF.ImageTransparentColor = System.Drawing.Color.Red;
this.textColourF.Name = "textColourF";
this.textColourF.Size = new System.Drawing.Size(23, 22);
this.textColourF.Text = "A";
this.textColourF.ToolTipText = "Set Text Colour";
this.textColourF.Click += new System.EventHandler(this.ToolStripButton9Click);
//
// toolStripSeparator4
//
this.toolStripSeparator4.Name = "toolStripSeparator4";
this.toolStripSeparator4.Size = new System.Drawing.Size(6, 25);
//
// boldF
//
this.boldF.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
375,8 → 411,11
// editorView
//
this.editorView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.editorView.ContextMenuStrip = this.editorMenuStrip;
this.editorView.DetectUrls = false;
this.editorView.Dock = System.Windows.Forms.DockStyle.Fill;
this.editorView.EnableAutoDragDrop = true;
this.editorView.HideSelection = false;
this.editorView.Location = new System.Drawing.Point(3, 3);
this.editorView.Name = "editorView";
this.editorView.Size = new System.Drawing.Size(488, 323);
385,9 → 424,61
this.editorView.SelectionChanged += new System.EventHandler(this.EditorViewSelectionChanged);
this.editorView.TextChanged += new System.EventHandler(this.EditorViewTextChanged);
//
// editorMenuStrip
//
this.editorMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.saveFileToolStripMenuItem,
this.closeFileToolStripMenuItem,
this.zoomToolStripMenuItem});
this.editorMenuStrip.Name = "editorMenuStrip";
this.editorMenuStrip.Size = new System.Drawing.Size(131, 70);
//
// saveFileToolStripMenuItem
//
this.saveFileToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("saveFileToolStripMenuItem.Image")));
this.saveFileToolStripMenuItem.Name = "saveFileToolStripMenuItem";
this.saveFileToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
this.saveFileToolStripMenuItem.Text = "Save File";
this.saveFileToolStripMenuItem.Click += new System.EventHandler(this.SaveFileToolStripMenuItemClick);
//
// closeFileToolStripMenuItem
//
this.closeFileToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("closeFileToolStripMenuItem.Image")));
this.closeFileToolStripMenuItem.Name = "closeFileToolStripMenuItem";
this.closeFileToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
this.closeFileToolStripMenuItem.Text = "Close File";
this.closeFileToolStripMenuItem.Click += new System.EventHandler(this.CloseFileToolStripMenuItemClick);
//
// zoomToolStripMenuItem
//
this.zoomToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.inToolStripMenuItem,
this.outToolStripMenuItem});
this.zoomToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("zoomToolStripMenuItem.Image")));
this.zoomToolStripMenuItem.Name = "zoomToolStripMenuItem";
this.zoomToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
this.zoomToolStripMenuItem.Text = "Zoom";
//
// inToolStripMenuItem
//
this.inToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("inToolStripMenuItem.Image")));
this.inToolStripMenuItem.Name = "inToolStripMenuItem";
this.inToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.inToolStripMenuItem.Text = "Zoom In";
this.inToolStripMenuItem.Click += new System.EventHandler(this.InToolStripMenuItemClick);
//
// outToolStripMenuItem
//
this.outToolStripMenuItem.Image = ((System.Drawing.Image)(resources.GetObject("outToolStripMenuItem.Image")));
this.outToolStripMenuItem.Name = "outToolStripMenuItem";
this.outToolStripMenuItem.Size = new System.Drawing.Size(132, 22);
this.outToolStripMenuItem.Text = "Zoom Out";
this.outToolStripMenuItem.Click += new System.EventHandler(this.OutToolStripMenuItemClick);
//
// treeView
//
this.treeView.BackColor = System.Drawing.SystemColors.InactiveBorder;
this.treeView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.treeView.Dock = System.Windows.Forms.DockStyle.Fill;
this.treeView.Location = new System.Drawing.Point(0, 0);
this.treeView.Name = "treeView";
450,6 → 541,7
this.tabControl.ResumeLayout(false);
this.welcomeTab.ResumeLayout(false);
this.editorTab.ResumeLayout(false);
this.editorMenuStrip.ResumeLayout(false);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel2.ResumeLayout(false);
this.splitContainer1.ResumeLayout(false);
461,6 → 553,16
this.ResumeLayout(false);
this.PerformLayout();
}
private System.Windows.Forms.ToolStripButton textColourF;
private System.Windows.Forms.ColorDialog colorDialog1;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator4;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenuItem outToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem inToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem zoomToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem closeFileToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem saveFileToolStripMenuItem;
private System.Windows.Forms.ContextMenuStrip editorMenuStrip;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripContainer toolStripContainer1;
private System.Windows.Forms.ToolStripButton toolStripButton8;
/LassyPad/MainForm.cs
71,6 → 71,24
{
welcomeView.Url = new Uri("http://tim32.org/~freddie/LassyPad/Welcome.htm");
initAll();
 
bool openRes;
string[] envArgs = System.Environment.GetCommandLineArgs();
for (int i = 0; i < envArgs.Length; i++)
{
if (envArgs[i].EndsWith(".rtf") || envArgs[i].EndsWith(".txt"))
{
files.Add(new rtfFile(envArgs[i]));
openRes = files[files.Count - 1].open();
if (openRes)
{
treeView.Nodes["Files"].Nodes.Add(envArgs[i], envArgs[i]);
showFile(files.Count - 1);
}
else
files.RemoveAt(files.Count - 1);
}
}
}
public void initAll()
117,7 → 135,6
}
case ("Files"):
{
showFile(e.Node.Name);
break;
}
127,6 → 144,25
// other functions
public void insertImageFromFile()
{
DialogResult res = openFileDialog1.ShowDialog();
if (openFileDialog1.FileName != "" && res != DialogResult.Cancel)
{
// HELL - Get help from somewhere....
}
}
public void zoomIn()
{
editorView.ZoomFactor *= 1.2f;
}
public void zoomOut()
{
editorView.ZoomFactor /= 1.2f;
}
public void setSelection()
{
editorView.Select(selectionStart, selectionLength);
260,6 → 296,7
{
selectionStart = editorView.SelectionStart;
selectionLength = editorView.SelectionLength;
textColourF.ForeColor = editorView.SelectionColor;
// sizeF.Text = editorView.SelectionFont.Size.ToString();
}
376,7 → 413,41
void ToolStripButton8Click(object sender, EventArgs e)
{
insertImageFromFile();
}
#region editorMenuStrip
void CloseFileToolStripMenuItemClick(object sender, EventArgs e)
{
closeFile();
}
void SaveFileToolStripMenuItemClick(object sender, EventArgs e)
{
files[curFileID].save();
}
void InToolStripMenuItemClick(object sender, EventArgs e)
{
zoomIn();
}
void OutToolStripMenuItemClick(object sender, EventArgs e)
{
zoomOut();
}
#endregion
void ToolStripButton9Click(object sender, EventArgs e)
{
DialogResult res = colorDialog1.ShowDialog();
if (res != DialogResult.Cancel)
{
textColourF.ForeColor = colorDialog1.Color;
editorView.SelectionColor = colorDialog1.Color;
}
}
}
}