Notepad +
Notepad +
Notepad +
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
c
1.? ÷ TRODUCT÷O .2
2.? SOFTWARE REQU÷REME TS..3
3.? SDLC..3
3.1 REQU÷REME T A ALYS÷S...3
3.2 SOFTWARE DES÷
3.3 DEVELOPME T PHASE.6
3. TEST÷ PHASE...6
3.5 MA÷ TE A CE PHASE.6
.? DATA FLOW D÷ARAM...7
5.? COD÷ ...10
.1 PARE T FORM.10
.2 F÷ D FORM...37
.3 CH÷LD FORM....39
5. S APSHOTS.
6. CO CLUS÷O ...5
B÷BL÷ORAPHY
1
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
?
c
A text editor, in general , is a type of program used to edit plane text files.
Text editors are often provided with operating systems or software
development packages, and can be used to change configuratio n files and
programming language source codes. Various text editors are available in
the market for example, vi editor and Emacs editor in Unix, SimpleText
and TextEdit in Macintosh, notepad in Microsoft windows, and so on. A
text can be graphical user interface based or character user interface based.
A U÷ based application is always preferred over a CU÷ based one since
we have to click with the help of mouse on the icon of readymade
commands instead of typing them.
otepad is the most common text editor used by almost all computer
literate person. ÷t is used to create simple documents. ÷t saves files in plain
text format and support only a few formatting options. ÷t is used to view or
edit text files . users find otepad an ideal tool for creating web pages.
Though notepad is one of the few tools that have been a part of the
windows operating system since the beginning, it has not evolved much
since its initial release.
2
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
offer additional features and enhancements that were left out of the original
otepad.
?
Visual Studio 2008
? c
!"#
Software development life cycle (SDLC) is a methodology used to
develop, maintaining, and replace information systems for improving the quality
and process of software design. The typical phases of SDLC are.
? Requirement analysis
? Software design
? Development
? Testing
$ % &
3
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
O? |
!c'!
|
"
"
m
m
m
$
m Ô
Ô
%
#m
#|
O? |
å
&
' # # #
# $
O? | å
"
O? | å
O? |
å
O? |
å
(
O? |
å
O? | å
(()*#(*
This module provides and interface, called Find Box, to help user search a string,
replace a string by another string, or go to a specific line . the interface designed
5
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
in this module is related to many options under the edit menu, which was
designed in the Main Window module
!c+*)!
The development phase involves writing the source code based on the require
functionality adhering the code standards, code optimization etc. ÷t takes its
primary input from the design elements described in the software design phase.
The development of this application involves creating windows forms, class
form.
!'!
After the designing and developing phases, the application is tested for any logical
flows and functionality of all operations. The project is also tested to ensure that all
methods and all modules designed and developed are functioning properly, along with
the navigation links provided in all the user interfaces. Finally, the project is tested to
ensure that all the requirements analysis phase are being fulfilled.
!
)*(#!
6
c
R i l C ll ti R l i
j t i
,* * c c
c
R i l C ll ti R l i
j t i
*c c
c
R i l C ll ti R l i
j t i
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
+*c c
-
c
?????????????????
-
using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.÷O;
using System.Drawing.Printing;
namespace otepadPlus
{
public partial class ParentForm : Form
{
ChildForm child = new ChildForm();
StringReader myReader;
Font DocFont;
Color BackgroundColor = new Color();
Color ForegroundColor = new Color();
int m_nFilePointerPosition = 0;
10
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
public ParentForm()
{
÷nitializeComponent();
foreach (System.Drawing.FontFamily ff in
System.Drawing.FontFamily.Families)
{
if (ff. ame.Equals("Verdana"))
fontTypeToolStripComboBox.Selected÷ndex =
fontTypeToolStripComboBox.÷tems.Add(ff. ame);
else
fontTypeToolStripComboBox.÷tems.Add(ff. ame);
}
fontSizeToolStripComboBox.Selected÷ndex = 3;
foregroundColorToolStripComboBox.÷tems.AddRange(m_colornames);
backgroundColorToolStripComboBox.÷tems.AddRange(m_colornames);
foregroundColorToolStripComboBox.Selected÷ndex = 1;
backgroundColorToolStripComboBox.Selected÷ndex = 0;
}
public void Find ext(string str)
{
try
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, m_nFilePointerPosition);
11
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
activeTextBox.Select(nStart, nLength);
activeTextBox.Focus();
m_nFilePointerPosition = nStart + nLength;
}
}
}
catch (Exception e)
{
e.ToString();
MessageBox.Show("Reached End of Document.");
m_nFilePointerPosition = 0;
}
}
public void Replace ext(string str, string strReplace)
{
try
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, 0);
int nLength = str.Length;
}
}
}
catch (Exception e)
{
e.ToString();
12
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
int nStart = activeTextBox.Text.÷ndexOf(str, m_nFilePointerPosition);
int nLength = str.Length;
activeTextBox.Select(nStart, nLength);
activeTextBox.Text = activeTextBox.Text.Replace(str, strReplace);
activeTextBox.Focus();
m_nFilePointerPosition = nStart + nLength;
}
}
}
catch (Exception e)
{
e.ToString();
MessageBox.Show("Reached End of Document.");
m_nFilePointerPosition = 0;
}
}
newToolStripMenu÷tem.Enabled = true;
openToolStripMenu÷tem.Enabled = true;
saveAsToolStripMenu÷tem.Enabled = true;
saveToolStripMenu÷tem.Enabled = true;
SaveAllToolStripMenu÷tem.Enabled = true;
pageSetupToolStripMenu÷tem.Enabled = true;
printPreviewToolStripMenu÷tem.Enabled = true;
printToolStripMenu÷tem.Enabled = true;
exitToolStripMenu÷tem.Enabled = true;
editMenu.Enabled = true;
viewMenu.Enabled = true;
formatMenu.Enabled = true;
windowsMenu.Enabled = true;
standardToolStrip.Enabled = true;
formatToolStrip.Enabled = true;
1
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
ofd.÷nitialDirectory =
Environment.etFolderPath(Environment.SpecialFolder.Personal);
ofd.Title = "Open a Text File";
ofd.Filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";
DialogResult dr = ofd.ShowDialog();
fn = ofd.File ame.Trim();
if ((dr == DialogResult.Cancel))
{
return;
}
if (ofd.CheckFileExists)
{
sr = File.OpenText(fn);
doc.RichTextBox1.Text = sr.ReadToEnd();
sr.Close();
doc.MdiParent = this;
doc.Text = ofd.File ame;
doc.RichTextBox1.Multiline = true;
doc.RichTextBox1.Dock = DockStyle.Fill;
doc.Show();
openDoc++;
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);
i = 1;
fileMenu.Enabled = true;
newToolStripMenu÷tem.Enabled = true;
openToolStripMenu÷tem.Enabled = true;
saveAsToolStripMenu÷tem.Enabled = true;
saveToolStripMenu÷tem.Enabled = true;
SaveAllToolStripMenu÷tem.Enabled = true;
pageSetupToolStripMenu÷tem.Enabled = true;
printPreviewToolStripMenu÷tem.Enabled = true;
printToolStripMenu÷tem.Enabled = true;
exitToolStripMenu÷tem.Enabled = true;
editMenu.Enabled = true;
viewMenu.Enabled = true;
formatMenu.Enabled = true;
windowsMenu.Enabled = true;
standardToolStrip.Enabled = true;
15
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
formatToolStrip.Enabled = true;
}
else
{
MessageBox.Show("File not found!");
}
}
private void SaveAsToolStripMenu÷tem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.÷nitialDirectory =
Environment.etFolderPath(Environment.SpecialFolder.Personal);
sfd.Title = "Save a Text File";
sfd.Filter = "Text File (*.txt)|*.txt|All Files (*.*)|*.*";
if (!(ActiveMdiChild == null))
{
ChildForm doc = (ChildForm)this.ActiveMdiChild;
sfd.File ame = doc.Text;
DialogResult dr = sfd.ShowDialog();
string fn = sfd.File ame.Trim();
if ((dr == DialogResult.Cancel))
{
return;
}
doc.Tag = fn;
doc.Text = fn;
StreamWriter sw = new StreamWriter(fn);
sw.Write(doc.RichTextBox1.Text);
i = 1;
sw.Close();
}
}
{
// TODO: Use System.Windows.Forms.Clipboard to insert the selected text or
images into the clipboard
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Cut();
}
}
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Copy();
}
}
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
activeTextBox.Paste();
17
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
}
}
}
openDoc = 0;
}
18
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
}
19
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
}
}
public void writer(String str, StreamWriter sw)
{
sw.WriteLine(str);
sw.Flush();
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
printDialog1.Document = printDocument1;
string strText = activeTextBox.Text;
myReader = new StringReader(strText);
if (printDialog1.ShowDialog() == DialogResult.OK)
{
this.printDocument1.Print();
}
}
}
}
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (activeTextBox != null)
{
float linesPerPage = 0;
float yPosition = 0;
int count = 0;
float leftMargin = e.MarginBounds.Left;
float topMargin = e.MarginBounds.Top;
string line = null;
Font printFont = activeTextBox.Font;
SolidBrush myBrush = new SolidBrush(Color.Black);
// Work out the number of lines per page, using the MarginBounds.
linesPerPage = e.MarginBounds.Height /
printFont.etHeight(e.raphics);
// ÷terate over the string using the StringReader, printing each line.
while (count < linesPerPage && ((line = myReader.ReadLi ne()) != null))
{
// calculate the next line position based on
// the height of the font according to the printing device
yPosition = topMargin + (count * printFont.etHeight(e.raphics));
// draw the next line in the rich edit control
e.raphics.DrawString(line, printFont, myBrush, leftMargin, yPosition,
new StringFormat());
count++;
}
// ÷f there are more lines, print another page.
if (line != null)
e.HasMorePages = true;
else
e.HasMorePages = false;
myBrush.Dispose();
}
}
}
21
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
}
}
this.ActiveMdiChild.Close();
openDoc = openDoc - 1;
if (this.ActiveMdiChild == null)
{
openDoc = 0;
}
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);
}
if (!(ActiveMdiChild == null))
{
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.BackColor = BackgroundColor;
}
}
return;
ForegroundColor = cd.Color;
ChildForm Doc = (ChildForm)this.ActiveMdiChild;
Doc.RichTextBox1.SelectionColor = ForegroundColor;
}
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Left;
}
}
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Center;
}
}
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionAlignment = HorizontalAlignment.Right;
}
}
{
FindBox tab = new FindBox(this);
tab.FindTabControl.SelectedTab = tab.gotoTabPage;
tab.Show();
}
if (activeTextBox.SelectionFont.Bold)
{
style &= ~FontStyle.Bold;
}
else
{
style |= FontStyle.Bold;
}
activeTextBox.SelectionFont = new Font(activeTextBox.SelectionFont,
style);
}
}
}
FontStyle style = activeTextBox.SelectionFont.Style;
if (activeTextBox.SelectionFont.÷talic)
{
style &= ~FontStyle.÷talic;
}
else
{
style |= FontStyle.÷talic;
}
activeTextBox.SelectionFont = new Font(activeTextBox.SelectionFont,
style);
}
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
31
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
if (fontSizeToolStripComboBox.Selected÷ndex == -1 ||
fontTypeToolStripComboBox.Selected÷ndex == -1)
return;
activeTextBox.SelectionFont = new
Font(name,float.Parse(fontSizeToolStripComboBox.÷tems[fontSi zeToolStripComboB
ox.Selected÷ndex].ToString()),style);
activeTextBox.Focus();
}
}
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.SelectionColor =
m_colors[foregroundColorToolStripComboBox.Selected÷ndex];
activeTextBox.Focus();
}
}
private void
backgroundColorToolStripComboBox_Selected÷ndexChanged(object sender,
EventArgs e)
{
Form activeChildForm = this.ActiveMdiChild;
if (activeChildForm != null)
{
RichTextBox activeTextBox =
(RichTextBox)activeChildForm.ActiveControl;
activeTextBox.BackColor =
m_colors[backgroundColorToolStripComboBox.Selected÷ndex];
activeTextBox.Focus();
}
}
}
windowsCountStatusLabel.Text = ("Windows Count: " +
this.MdiChildren.Length);
}
}
c'#
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.ToolStripMenu÷tem fileMenu;
internal System.Windows.Forms.ToolStripMenu÷tem newToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem openToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
internal System.Windows.Forms.ToolStripMenu÷tem saveToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem saveAsToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem SaveAllToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator;
internal System.Windows.Forms.ToolStripMenu÷tem printToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem printPreviewToolStrip
Menu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem pageSetupToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator5;
internal System.Windows.Forms.ToolStripMenu÷tem exitToolStripMenu÷tem;
internal System.Windows.Forms.ToolStripMenu÷tem editMenu;
private System.Windows.Forms.ToolStripMenu÷tem undoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem redoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator6;
private System.Windows.Forms.ToolStripMenu÷tem cutToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem copyToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem pasteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem deleteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator9;
3
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
.? (/0
using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace otepadPlus
{
public partial class FindBox : Form
{
private System.Windows.Forms.Form formPad;
public FindBox()
{
÷nitializeComponent();
}
public FindBox(ParentForm pad)
{
formPad = pad;
÷nitializeComponent();
}
private void cancelButton_Click(object sender, EventArgs e)
{
Close();
}
37
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
f2.Activate();
}
catch (Exception er)
{
er.ToString();
}
}
}
}
(/0c'#
39
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
using System;
using System.Collections.eneric;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.÷O;
namespace otepadPlus
{
public partial class ChildForm : Form
{
public ChildForm()
{
÷nitializeComponent();
}
private void undoToolStripMenu÷tem_Click(object sender, EventArgs e)
{
RichTextBox1.Undo();
}
RichTextBox1.SelectedText = "";
}
if (RichTextBox1.Text != "")
1
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
}
}
}
!*( c'#
private System.Windows.Forms.ContextMenuStrip contextMenuStrip1;
private System.Windows.Forms.ToolStripMenu÷tem undoToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator1;
private System.Windows.Forms.ToolStripMenu÷tem cutToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem copyToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem pasteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem deleteToolStripMenu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator2;
private System.Windows.Forms.ToolStripMenu÷tem selectAllToolStrip
Menu÷tem;
private System.Windows.Forms.ToolStripSeparator toolStripSeparator3;
private System.Windows.Forms.ToolStripMenu÷tem fontToolStripMenu÷tem;
private System.Windows.Forms.ToolStripMenu÷tem bulletsToolStripMenu÷ tem;
internal System.Windows.Forms.RichTextBox RichTextBox1;
3
c
R i l C ll ti R l i
j t i
?r r r
44
c
R i l C ll ti R l i
j t i
4
c
R i l C ll ti R l i
j t i
4
c
R i l C ll ti R l i
j t i
4
c
R i l C ll ti R l i
j t i
4
c
R i l C ll ti R l i
j t i
4
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
50
c
R i l C ll ti R l i
j t i
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
52
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
53
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
1?
OTEAD PLUS it is a Software which makes our task easy to use so that we can
easily handle it and understand it. Software provided by windows are bounded for
many applications, so we need a software which has no boundations for using and easy
to handle it.
otepad plus provides many additional fe atures such as online print, changing
background color, changing text color, changing fonts and etc
÷n this software we can select and replace many character for this we are provided a
find and replace box. This software can be updated by adding many features and its
source code is available freely on the internet.
This software is very light and has just two dependency child and find. The tool bar
provided is easy to understand and easy to handle. And the tool bar is user friendly.
5
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
"#2+3)
2+ 4
&"#**2(5(#)#2+6(67c
2+#2#)*6c#6c
55
c
Regional College For Education Research and Technology - Jaipur
Project Session- 2010 - 2011
/
/
7%
° ? j
j
?
?
j
?
?
?
? ?
?
j
j
?
? å
& )*+)*+ ?
º ?
jjj
j?
?
56