简易文本编辑器说明书

合集下载

文本编辑器使用使用说明

文本编辑器使用使用说明

文本编辑器使用说明书目录1文本编辑器结构 (1)1.1功能操作按钮栏 (1)1.2内容栏 (1)2功能分解 (1)2.1功能操作按钮栏第一排 (1)2.1.1全屏编辑 (2)2.1.2预览 (2)2.1.3粘贴 (2)2.1.4粘贴为无格式文本 (2)2.1.5从MS Word 粘贴 (2)2.1.6撤销 (3)2.1.7重做 (3)2.1.8插入/编辑图像 (3)2.1.9插入/编辑表格 (4)2.1.10插入水平线 (4)2.1.11插入/编辑超链接 (4)2.1.12取消超链接 (5)2.1.13查找 (5)2.1.14替换 (5)2.1.15全选 (5)2.1.16清除格式 (5)2.2功能操作按钮栏第二排 (5)2.2.1格式 (6)2.2.2字体 (6)2.2.3大小 (6)2.3功能操作按钮栏第三排 (6)2.3.1空格 (6)2.3.2加粗 (6)2.3.3倾斜 (7)2.3.4下划线 (7)2.3.5删除线 (7)2.3.6左对齐 (7)2.3.7居中对齐 (7)2.3.8右对齐 (7)2.3.9两端对齐 (7)2.3.10插入/删除编号列表 (8)2.3.11插入/删除项目列表 (8)2.3.12文本颜色 (8)2.3.13背景颜色 (8)2.3.14下标 (8)2.3.15上标 (8)2.3.16源代码 (9)1文本编辑器结构文本编辑器大体结构可以分为两部分,分别为:功能操作按钮栏和内容栏。

1.1功能操作按钮栏功能操作按钮栏:用于对内容进行编辑。

1.2内容栏内容栏:用于显示输入的内容。

2功能分解在功能操作按钮栏中功能按钮分为三排,下面将分别按照每排的顺序进行逐一介绍。

2.1功能操作按钮栏第一排功能操作按钮栏第一排中共包含16个功能按钮,如下图所示。

图2-1-1 功能操作按钮栏第一排2.1.1全屏编辑全屏编辑按钮为图2-1-1中字母A上方的按钮。

全屏编辑:点击全屏编辑按钮将扩充满屏幕,更为方便进行大量内容的编辑;再点击按钮取消全屏编辑。

sakura文本编辑器用法

sakura文本编辑器用法

sakura文本编辑器用法Sakura文本编辑器是一款轻量级的文本编辑器,主要用于编辑纯文本文件。

下面是Sakura文本编辑器的一些常用用法:1. 打开文件:在Sakura文本编辑器中,点击菜单栏中的"文件",然后选择"打开"选项,或者使用快捷键Ctrl+O进行文件打开。

选择要编辑的文本文件并点击"打开"按钮即可打开文件。

2. 编辑文本:在Sakura文本编辑器中,您可以直接在打开的文本文件中进行编辑。

使用键盘输入或者复制粘贴文本进行编辑。

还可以使用快捷键Ctrl+S保存文件。

3. 查找和替换:点击菜单栏中的"编辑",然后选择"查找"或"替换"选项。

在查找对话框中输入要查找的文本,并选择查找的方向(上或下)。

在替换对话框中输入要查找和替换的文本,并选择替换的方式(一次替换或全部替换)。

4. 调整字体和颜色:点击菜单栏中的"编辑",然后选择"首选项"选项。

在首选项对话框中,您可以选择您喜欢的字体、字号和颜色。

5. 设置文本格式:Sakura文本编辑器支持设置文本的格式,如加粗、斜体、下划线等。

您可以选择要设置格式的文本,然后点击菜单栏中的"格式",选择相应的格式选项。

6. 行号显示:点击菜单栏中的"视图",然后选择"显示行号"选项。

将会在编辑器的左侧显示行号。

7. 多窗口编辑:在Sakura文本编辑器中,您可以同时打开多个文本文件进行编辑。

点击菜单栏中的"文件",然后选择"新建窗口"选项,即可打开一个新的编辑窗口。

这些是Sakura文本编辑器的一些常用用法,希望对您有所帮助!。

Akai MPK Mini Play编辑器用户指南说明书

Akai MPK Mini Play编辑器用户指南说明书

Table of ContentsUser Guide (4)Introduction (4)Support (4)Installation (4)Windows (4)macOS (4)Setup (5)Features (6)Graphical Interface (6)Operation (8)Managing Your Favorites (8)Saving Favorites (8)Loading Favorites (8)Sending Favorites (9)Editing a Pad’s MIDI Note (10)Editing a Knob (10)Editing the X-Y Controller (Joystick) (11)2Editing the Keyboard and Arpeggiator (12)Keyboard (12)Arpeggiator (13)Editing the Sound (14)Appendix (15)Trademarks and Licenses (15)3The MPK Mini Play Editor software gives you intuitive ways to edit the many functions that your MPK Mini Play can perform.SupportFor the latest information about this product (system requirements, compatibility information, etc.) and product registration, visit .For additional product support, visit /support.Windows1.Double-click the .exe installer file you downloaded.2.Follow the on-screen instructions.macOS1.Double-click the .dmg installer file you downloaded.2.Follow the on-screen instructions.45To use the MPK Mini Play Editor: 1.Optional: Connect M PK M ini Play to your computer using a standard USB cable. (If you are connecting MPK Mini Play to a USB hub, make sure it is a powered hub). You can still use the Editor and create favorites without connecting an MPK M ini Play, but you will not be able to send/load favorites to/from it.2.Open the M PK M ini Play Editor on your computer. The window will show a visual representation of all your M PK M ini Play’s editable controls. See Features > Graphical Interfacefor an overview of each section.6Graphical InterfaceThe MPK Mini Play Editor has a straightforward user interface that can be broken down into seven sections for editing:1.Joystick: These settings control the parameters affected when moving the X-Y Controller alongits X axis (left/right) or Y axis (up/down). See Operation > Editing the X-Y Controller (Joystick) to learn more.2.Sound: These two fields determine the overall sound of the keyboard as well as the pads. SeeOperation > Editing the Sound to learn more.3.Pads: This section enables you to edit note assignments for the pads. 16 pads are pictured inthe Editor: 8 of them correspond to the pads on the MPK Mini Play when Bank A is active, and the other 8 correspond to the pads on the M PK M ini Play when Bank B is active. See Operation > Editing a Pad’s MIDI Note to learn more.4.Knobs: This section enables you to edit the function of the knobs. 8 knobs are pictured in theEditor: 4 of them correspond to the knobs on the MPK Mini Play when Bank A is active, and the other 4 correspond to the knobs on the MPK Mini Play when Bank B is active. See Operation > Editing a Knob to learn more.5.Favorites: These controls let you import a favorite from your computer or from your connectedMPK Mini Play. They also allow you to save the current settings as a favorite and export them to your computer or to your connected M PK M ini Play. See Operation > Managing Your Favorites to learn more.6.Channels: These two fields determine the channels through which the pads, knobs, X-YController, and keyboard send MIDI data. Specific instructions are provided in the chapters for each control: Operation > Editing a Pad’s MIDI Note, Editing a Knob, Editing the X-Y Controller (Joystick), Editing the Keyboard and Apeggiator > Keyboard.7.Keyboard and Arpeggiator: This is a visual representation of the 25-key keyboard as well asthe settings that control the timing, range, and general behavior of the arpeggiator. See Operation > Editing the Keyboard and Arpeggiator to learn more.78Managing Your FavoritesWith the Favorites feature, you can save all your current settings in the Editor to a single .mpkplay file that can be loaded onto your MPK Mini Play. MPK Mini Play holds a maximum of eight favorites, but you can store more favorites on your computer to load onto MPK Mini Play later with the Editor. This way, you can have countless different control configurations for different situations. For instance, you may use different favorites with different software. Or you may use some favorites for production and others for performance.Saving FavoritesAfter saving a favorite on your computer, you can send it to MPK Mini Play or edit it again later. All settings that you see in the Editor software will be saved in the favorite.To save a favorite: Go to File > Save Favorite . Alternatively, you can type Ctrl + S (Windows) or + S (Mac). Then select the destination folder on your computer, enter a file name, and click Save . The favorite will be saved as an .mpkplay file.Loading FavoritesTo load a favorite from a connected MPK Mini Play: Click the R (receive) icon corresponding to the number of the desired favorite on your MPK Mini Play (1-8). Note : Using the software to edit a favorite loaded from your MPK Mini Play will not automatically affect this favorite on your keyboard; you will have to send the edited favorite to the keyboard after modifying it. See Sending Favorites below to learn more.To load a favorite from your computer, go to File > Open Favorite.Alternatively, you can type Ctrl + O (Windows) or + O (Mac). Then locate the desired .mpkplay file and click Open .Sending FavoritesWhen you send from the Editor to a connected MPK Mini Play, all settings that you see in the Editor will be stored as a favorite on the MPK Mini Play’s internal memory. When playing your keyboard, the favorite will be available for you to activate whenever you like.corresponding to the number of the favorite you want to replace on your M PKMini Play (1-8). Doing so will overwrite the favorite currently stored in this numberslot on the MPK Mini Play.You can also send a favorite to M PK M ini Play's RAM, where it will be kepttemporarily and will not overrite any favorite stored on the device. This applies thesettings to the MPK Mini Play and lets you try them out without fully committingto them. If you then decide that you like the settings, you can save the favorite toyour computer (see Saving Favorites above) or overwrite one of the currentlystored favorites on your MPK Mini Play.To send a Program to the RAM of a connected MPK Mini Play, click the SEND TO RAM icon or go to File > Send Favorite > Ram.Note: To avoid losing the settings kept in the RAM, you will need to save them before modifyingthem with the Editor or exiting the Editor.910Editing a Pad’s MIDI NoteYou can set the MIDI note for any of the pads in Bank A or Bank B. You can also set the channel through which all the pads send their MIDI notes.To select a pad’s MIDI note: Click the Note field within the pad and then type the desired M IDI note number (0 – 127). The M IDI note value will change accordingly. The current MIDI note value (C-1 – G9) will be displayed on the pad.To select the MIDI channel for all the pads: Click the Pad MIDI Channel field at the bottom of the window. In the pop-up menu that appears, select the desired MIDI channel number (1 – 16).Editing a KnobYou can edit settings for each of the eight knobs, including CC message, minimum value, maximum value, and FX level. You can also set the channel through which all the knobs send MIDI data.To select the CC message a knob sends: Click the CC field under a knob and then type the desired CC number (0 – 127).To select a knob's minimum and maximum values: Click the Lo field (minimum) or Hi field (maximum) under a knob and then type the desired value (0 – 127).To assign the FX level : Click the effect name field and then type the desired value (0 – 127). Each knob in each bank has its own designated effect.To select the MIDI channel for all the knobs, open the Keybed / Controls MIDI Channel pop-up menu at the bottom of the window. Then select the desired MIDI channel number (1 – 16). This will affect the X-Y Controller and keyboard as well as the knobs.11Editing the X-Y Controller (Joystick)You can designate the function for each axis of the X-Y Controller (joystick), allowing you to use it to manipulate up to two different parameters simultaneously.To designate the function of the axis, click the X Axis or Y Axis field under the X-Y Controller and then select the desired function from the pop-up menu: • Pitchbend: M oving the X-Y controller along the axis will bend thekeyboard pitch.• Single CC: M oving the X-Y controller along this axis will send a CCmessage.• Dual CC: M oving the X-Y controller along this axis will send one CCmessage in the positive direction (up or right) and another CC message in the negative direction (down or left).To select the CC message the X-Y Controller sends (when set to Single CC or Dual CC), click the CC field(s) and then type the desired value (0 – 127).To select the MIDI channel for the X-Y Controller, open the K eybed / Controls MIDI Channel pop-up menu at the bottom of the window. Then select the desired MIDI channel number (1 – 16). This will affectthe knobs and keyboard as well as the X-Y Controller.Editing the Keyboard and ArpeggiatorKeyboardThe Editor allows you to set the keyboard's octave and transposition.To transpose the keyboard, click the Transpose field under the keyboard. When the pop-up menu appears, select the desired value (-12 to 12 semitones). A transposition of 0 means the keyboard is not transposed. For reference, the leftmost key will display its note value to indicate the current transposition.To change the keyboard's octave, click the Octave field under the keyboard. When the pop-up menu appears, select the desired value (-4 to 4 octaves). An octave of 0 means the keyboard is at its center/default octave.To select the MIDI channel for the Keyboard: open Array the Keybed / Controls MIDI Channel pop-up menuat the bottom of the window. Then select the desiredM IDI channel number (1 – 16). This will affect theknobs and X-Y Controller as well as the keyboard.12ArpeggiatorYou can edit various parameters for the arpeggiator.To activate or deactivate the arpeggiator: Click the On/Off icon. The icon’s outline will be red if the arpeggiator is on and gray if the arpeggiator is off.To set the arpeggiator's time division: Click the Time Div field. When the pop-up menu appears, select the desired setting (1/4 – 1/32T).To set the arpeggiator's mode: Click the Mode field. When the pop-up menu appears, select the desired setting from the pop-up menu.The mode determines how the arpeggiated notes are played back:•Up: Notes will sound from lowest to highest.•Down: Notes will sound from highest to lowest.•Exclusive: Notes will sound from lowest to highest and then back down. The lowest and highest notes will sound only once at the directional change.•Inclusive: Notes will sound from lowest to highest and then back down. The lowest and highest notes will sound twice at the directional change.•Order: Notes will sound in the order they were pressed.•Random: Notes will sound in random order.1314To activate or deactivate the Latch: Click the Latch field and then select Off or On from the pop-up menu. • Off: When the Latch is Off and you press keys, the Arpeggiator will cease after you release your fingers from the keyboard.•On: When the Latch is On and you press keys, the Arpeggiator will continue even after you release your fingers from the keyboard. While holding down the keys, you can add more notes to the arpeggio by pressing down additional keys. If you press the keys, release them, and then press a new combination of keys, the Arpeggiator will arpeggiate the new notes.To set the arpeggiator's octave range: Click the Octave field and select the desired value from the pop-up menu: 0, 1, 2, or 3 octaves.To set the arpeggiator's swing, click the Swing field and select the desired setting from the pop-up menu: 50% (no swing), 55%, 57%, 59%, 61%, or 64%.To set the minimum number of taps required for MPK Mini Play’s Tap Tempo button to detect a new arpeggiator tempo: Click the Tempo Taps field and select the desired number from the pop-up menu: 2, 3, or 4 taps.Note: M PK M ini Play's Tap Tempo button is disabled if the Arpeggiator is synced to an external clock.Editing the SoundThe Editor allows you to select the default keyboard sound and pad sound for a favorite.To select the keyboard sound : Click the Keyboard Sound field at the top of the window. When the pop-up menu appears, select one of the 130 available sounds.To select the pad sound : Click the Pad Sound field at the top of the window. When the pop-up menu appears, select one of the 10 available sounds.Akai Professional is a trademark of inMusic Brands, Inc., registered in the U.S. and other countries. macOS is a trademark of Apple Inc., registered in the U.S. and other countries.Windows is a registered trademark of M icrosoft Corporation in the United States and other countries.All other product or company names are trademarks or registered trademarks of their respective owners.15。

ultraedit的使用说明

ultraedit的使用说明

程序语法着色:*********************************************为了让你看到着色的效果,你先用UltraEdit建立一个新文件,并另存为.java文件,然后输入一段简单的代码,如:import java.util.*;import ng.*;/**java test class*/public class RenderEdit {String field = "UltraEdit Test";public RenderEdit(){}public void static main(String[] args){//just testSystem.out.println(this.field);}}(你把这段代码拷过去用用吧。

)打开菜单Advanced --- configuaration -- Syntax Highlighting在Language下拉框里,你能看到现在默认的着色方案。

UltraEdit的用途用做普通文本文件编辑器(.txt .bat .conf .ini等)用做.doc文件编辑器(不过,不是msword的文档,其实也是文本文件,我不知道为什么叫doc)用做c, c++, java, jsp, html, xml等的源代码编辑器(以上文件可以是本地的,也可以是通过FTP方式操作远程的文件)对文本文件进行按行排序,排序的方式是可以定义的。

对16进制的文件直接修改字节指定直接的内容对文件全体内容或选定内容进行整体的操作,比如转换格式、内容等对文件的字符、词数量进行统计对一个文本文件或源代码文件组成的项目进行操作介绍----------------------------------------------通过上面的列表,你基本上能知道UltraEdit是干什么用的:小巧且功能全面、灵活好用的文本编辑器,尤其适合于源代码的编写。

KindEditor使用说明书

KindEditor使用说明书

编辑器使用方法1. 下载编辑器下载 KindEditor 最新版本,下载之后打开 examples/index.html 就可以看到演示。

下载页面: /down.php2. 部署编辑器解压 kindeditor-x.x.x.zip 文件,将所有文件上传到您的网站程序目录里,例如:http://您的域名/editor/Note您可以根据需求删除以下目录后上传到服务器。

∙asp - ASP程序∙ - 程序∙php - PHP程序∙jsp - JSP程序∙examples - 演示文件3. 修改HTML页面1.在需要显示编辑器的位置添加textarea输入框。

<textarea id="editor_id" name="content"style="width:700px;height:300px;">&lt;strong&gt;HTML内容&lt;/strong&gt;</textarea>Note∙id在当前页面必须是唯一的值。

∙在textarea里设置HTML内容即可实现编辑,在这里需要注意的是,如果从服务器端程序(ASP、PHP、等)直接显示内容,则必须转换HTML 特殊字符(>,<,&,”)。

具体请参考各语言目录下面的demo.xxx程序,目前支持ASP、 、PHP、JSP。

∙在有些浏览器上不设宽度和高度可能显示有问题,所以最好设一下宽度和高度。

宽度和高度可用inline样式设置,也可用编辑器初始化参数设置。

2.在该HTML页面添加以下脚本。

<script charset="utf-8" src="/editor/kindeditor.js"></script><script charset="utf-8" src="/editor/lang/zh_CN.js"></script><script>var editor;KindEditor.ready(function(K) {editor = K.create('#editor_id');});</script>Note∙第一个参数可用其它CSS选择器,匹配多个textarea时只在第一个元素上加载编辑器。

文本编辑器使用

文本编辑器使用

文本编辑器使用Visual C++6.0开发环境中包含了一个功能强大的文本编辑器,使用它可以管理、编辑及打印源代码文件。

虽然该文本编辑器和其他基于Windows文本编辑器软件(如Windows 98的记事本)的大多数功能是相同的,但它是集成在Visual C++6.0开发环境中,一旦文档窗口中的源代码文件被打开,就可以使用了,且增加许多帮助快速键入代码、提高可读性的功能,例如在文本编辑器中用不同的颜色表示不同的语法结构(蓝色表示关键字,浅绿色表示注释)。

使用文本编辑器,用户可以实现以下功能:·通过在线弹出的列表框选择所需要的类成员、参数或值来完成相应的语句。

·使用文本编辑器的宏操作。

·可以为不同的编程语言产生相应的代码源文件,包括C/C++、SQL及HTML。

·为源文件中相应的字、词或语法定制不同的颜色以及文本编辑器的外规定制等。

·在单个或多个源文件中进行多种条件的漫游、查找和替换。

·用书签标记源文件中要处理的代码行。

·管理源文件窗口,在多个窗口之间进行拖放操作。

·支持SQL脚本的处理、切换等操作。

1 选定文本在文本编辑过程中常常需要选定所需要的文本,并进行剪切、复制、删除、增加或减少缩进等操作。

在选择时,可以选定文本中的一行、多行或文本块,其相应的操作过程如下:(1)选定一行将鼠标移至要选定的行的最左边,当鼠标箭头变成反向时,单击鼠标左键。

(2)选定多行将鼠标移至要选定内容的开始处,按下左键并拖动,在选定内容的结尾处释放鼠标。

(3)选定文本块将鼠标移至要选定内容的开始处,按下鼠标左键之前按住ALT键不放并拖动,在选定内容的结尾处释放鼠标和ALT键。

另外,若双击鼠标左键,则鼠标所在位置的整个单词被选定。

2 语句的自动完成Visual C++6.0的文本编辑器开始使用“词语敏感器”来提高键入代码的速度并有效地减少错误的产生。

010 editor使用手册

010 editor使用手册

010 editor使用手册
010 Editor是一款功能强大的文本/二进制文件编辑器,它提
供了许多高级功能,包括数据分析、文件比较、模板编辑等。

虽然
它的使用手册非常详细,但我会尽量从多个角度对其进行介绍。

首先,010 Editor的界面分为多个部分,包括菜单栏、工具栏、编辑区域和数据解析器。

用户可以通过菜单栏和工具栏访问各种功能,编辑区域是用户进行文本或二进制文件编辑的地方,而数据解
析器则可以帮助用户解析和分析数据。

其次,010 Editor支持多种文件类型的编辑,包括文本文件、
二进制文件、图像文件等。

用户可以通过打开文件或者新建文件来
开始编辑,而且010 Editor还支持在同一个窗口中同时打开多个文件,方便用户进行比较和编辑。

此外,010 Editor还提供了许多高级功能,比如模板编辑器和
脚本编写。

模板编辑器可以帮助用户定义文件的结构,以便进行数
据分析和编辑,而脚本编写则可以让用户自定义各种功能,甚至可
以进行自动化操作。

最后,010 Editor的使用手册包含了对各种功能的详细介绍和操作方法,用户可以通过阅读手册来了解如何使用各种功能,以及如何解决常见问题。

此外,010 Editor的官方网站也提供了丰富的教程和视频,帮助用户快速掌握软件的各种功能和技巧。

总的来说,010 Editor是一款功能强大的文本/二进制文件编辑器,它提供了丰富的功能和灵活的操作方式,用户可以通过阅读使用手册和教程来快速掌握软件的各种功能,从而提高工作效率。

希望这些信息能够帮助你更好地了解010 Editor的使用方法。

NotePad需求说明书

NotePad需求说明书

关于开发NotePad的需求说明书目录1引言 (3)1.1编写目的 (3)1.2背景 (3)1.3相关术语 (4)2任务概述 (4)2.1目标 (4)2.2用户的特点 (4)2.3假定和约束 (4)3需求规定 (5)3.1对功能的规定 (5)3.2对性能的规定 (5)3.2.1时间特性要求 (6)3.2.2灵活性 (6)3.3输人输出要求 (7)3.4故障处理要求 (7)3.5其他专门要求 (7)4运行环境规定 (7)4.1测试运行环境 (8)1引言1.1编写目的为了更好的让客户和开发人员了解所开发软件的功能及性能,也为了让开发人员和客户就最后软件做成什么样子达成一致的意见和见解,使开发人员能够很好的按照客户的需求设计出一个用户满意的软件产品,并交付客户。

此说明书详细说明了所开发软件具有的功能和相关信息。

目前网络上有各种各样的文本编辑软件虽然功能齐全,但是用户都不是很多。

经过各方面的了解得知,Windows系统自带的文本编辑器(记事本)是用户使用最多的文本编器,记事本给我们提供了在文本编辑中经常使用到的各种功能。

但是由于设计的原因,他也有很多不足的地方,如:不能实现自动保存、操作不方便、不能保证数据的安全等问题。

综合上诉原因,所以决定在Windows系统的记事本功能的基础上,加入一些新的功能和特性,重新设计并开发一个全新的、操作方便的、安全的文本编辑软件。

1.2背景软件相关说明:待开发的软件系统的名称;经小组讨论决定,新文本编辑器命名为:NotePad 开发人员:杨长燕、马鹏宇、王珊、胡荠仁、袁佳旭、涂剑琴、蒋立立1.3相关术语Java(面向对象的程序设计语言)JVM(Java virtual machine,Java虚拟机)JRE(Java Runtime Environment,Java运行时环境)JDK(Java Development Kit,Java开发包)2任务概述2.1目标由于windows系统自带的记事本不能满足用户的需求,如在不能实现自动保存功能、操作不方便等原因。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

中北大学课程设计说明书学院、系:专业:班级:学生姓名:学号:设计题目:简易文本编辑器起迄日期: 2016年12月16日~2016年12月29日指导教师:日期: 2016年12月29日1 设计目的通过用户调查分析及实际需求,开发出一个文本编辑器,可以方便用户对文本进行编辑。

系统需要实现如下基本功能:(1)具有图形菜单界面;(2)查找,替换(等长,不等长),插入(插串,文本块的插入)、块移动(行块,列块移动),删除;(3)可正确存盘、取盘;(4)正确显示总行数。

2 任务概述要设计一简易的文本编辑器,要求有图形菜单界面,也就是菜单选择的界面,要实现的功能有对文本进行存盘,取盘,在某一个盘中新建一个TXT的文件,在里面输入内容,对这个文件进行取盘,显示出文本内容,并在显示的时候显示行数,具有对文本进行查找、替换、插入、移动、删除等功能。

为实现数据的有序存储,该编辑器应该用顺序表来存储输入的信息。

顺序表是数据结构中线性表的一种,它是用一块地址连续的存储空间依次存储线性表的元素。

其特点为:在顺序表上逻辑关系相邻的两个元素在物理位置上也相邻;在顺序表上可以随即存取表中的元素。

在编辑器的主界面中应有如下提示信息:⑴显示当前文本信息:从文件中读出文本,在某一个盘中创建一个文本文件,所以要读出来,显示到显示器上,并统计出行数。

⑵查找文本信息:因为在下面做插入,删除,移动之类的都需用到查找,在查找的时候,也要调用一个字符匹配模式的程序,来判断查找的内容是否符合所要查找的内容。

⑶删除文本信息:首先在数组中查找要删除的信息,查找的时候调用匹配模式的子函数,如果找到该信息,提示是否确认删除该信息,通过确认来删除信息,如果未找到要删除的信息,提示未找到该信息;⑷插入文本信息:首先调用字符匹配模式的子函数找到插入点,如果找到该插入点,提示输入插入信息,确认插入信息后,选择是否在这个位置插入,如果是的话执行插入,不是的话再往下查找下一个插入点。

⑸替换文本信息:首先在数组中查找要被替换的信息,如果找到该信息,提示输入要替换的信息内容,否则提示未找到要被替换的信息;⑹保存文本信息:在这里使用文件写入读出的功能,把你修改完的内容保存到你所建立的文本中。

⑺显示文本内容:读出文件中的所有字符,显示到显示器上。

⑻退出3 模块划分(1)系统主要包含主程序模块和其他操作模块。

其调用关系如图(一)所示。

图(一)(2)文本编辑器的运行流程图如图(二)所示。

图(二)(3)系统子模块及其功能设计:1.文件的打开:void open(char text[]);2.文件的保存:void save(char text[]);3.查找文本:void search(char text[],int l);4.字符的匹配:int strindex(char text[],char t[],int i2,int l);5.文本的输出:void output(char text[]);6.删除文本:void Delete(char p[],int l);7.插入文本:void insert(char text[],int l);8.替换文本:void Replace(int status);4 主要函数说明及其N-S图(1)对于文本内容的处理,查找部分仍是使用循环对已存储的文章进行匹配,判断需要查找的字符或者字符串是否与文章中某部分内容相同,在程序的执行中,先是进入的主函数,在主函数中调用了菜单函数,进行功能的选择,各个模块分为多个函数来实现。

在程序中,设置了几个全局变量,来记录文本的内容等信息:char text[MAX]=""; //文本编辑域char name[20]=""; //文件保存的位置int status=0; //显示是否保存过的状态int ntext; //文本编辑的位置(2)字符匹配在这个程序中要特别注意的是字符的匹配,因为查找、插入、替换都需要用到这一步设计。

在这里我设计了一个子模块来实现匹配:int strindex(char text[],char t[],int i2,int l) //查找要操作的数据的位置(模式匹配) {int i1=l,j=0;while (i1<ntext&&j<i2){if (text[i1]==t[j]) //继续匹配下一个字符{j++;i1++;} //主串和子串依次匹配下一个字符else //主串、子串指针回溯重新开始下一次匹配{i1=i1-j+1; //主串从下一个位置开始匹配j=0;} //子串从头开始匹配}if (j>=i2){return(i1-i2);} //返回匹配的第一个字符的下标elsereturn(-1); //模式匹配不成功}(3而且程序中用的顺序表存储的形式,在执行的时候考虑到在查找时,要显示是在第几行第几列的位置,但是程序并不是用二维数组来实现的,并不记录文本中每一个字符的行列号,所以如果直接一下子统计出来的话,就会出现行列号上的错误,所以在程序中使用了一下LOOP语句,来让程序一行一行的统计与显示。

当调用strindex(text,str1,t,l)函数时,得到返回值,如果a!=-1时,得到返回的是查找的字符串的第一字符的下标,l=a+t;t是字符的长度,hs,ls,分别记录行号与列号。

loop:a=strindex(text,str1,t,l);if (a!=-1){l=a+t;}int hs=1,ls=0;for (i=0;i<=a;i++){ls++;if (text[i]=='\n'){hs++;ls=0;}} if (a==-1){printf("查找到结尾没有找到\n输入【R】将重头查找;");l=0;fflush(stdin);pd=getchar();}else{printf("已经找到在第%d行第%d列,输入【R】继续查找下一处;",hs,ls);kk+=1;fflush(stdin);bd=getchar();if (bd=='R'||bd=='r')goto loop;}5(1)界面(2)打开已有文件(3)查找具体内容(4)删除内容(5)插入内容(6)替换内容(7)保存文件(8)退出6 课程设计心得通过这次的实训,对之前所学的C语言与数据结构都在加深一下印象,也把之前学得不是很熟悉的数据结构都做了一次回顾。

在程序中,我用到的数据结构是顺序表,顺序表是用一组地址连续的存储单元依次存储线性表的数据元素,这种表也称为顺序存储结构或顺序映像。

在程序调试的时候,也遇到了许多问题,最严重的问题,就是程序并不是用二维数组来实现的,在文件中的字符定位问题时,我用的是先找到第一行,再使用LOOP语句来使用循环,再做下一行的定位,这样在查找的时候就是一行一行的显示的,不会出现行数与列数统计上出错的问题。

有的时候做一个程序时,如果不会很好地使用一些特别深的方法的时候,那么可以换一种思考角度,就像上面的问题,用二维数组来实现虽然会很方便地进行行号列号地定位,但是在对后面的问题处理上就会又要涉及到别的处理方法,所以在这里可以换一种思维方式,用简单的方式来思考同一个问题,就会有不同的发现了。

附录:#include"stdio.h"#include"stdlib.h"#include"string.h"void open(char text[]);void save(char text[]);void search(char text[],int l);int strindex(char text[],char t[],int i2,int l); void output(char text[]);void Delete(char p[],int l);void insert(char text[],int l);void Replace(int status);void menu();#define MAX 10000char text[MAX]=""; //文本编辑域char name[20]=""; //文件保存的位置int status=0; //显示是否保存过的状态int ntext; //文本编辑的位置void open(char text[]) // 文件的打开{system("cls");FILE *fp;char pd,ch;char name[30];int i=0,ss=1;printf("输入A:确定打开文件 M:返回主菜单");fflush(stdin);pd=getchar();if (pd=='A'||pd=='a'){p rintf("请输入要打开文件名字(例如c:\\a.txt)");s canf("%s",name);w hile ((fp=fopen(name,"r"))==NULL){printf("\n打开文件失败,请重新输入要打开的文件名:");scanf("%s",name);}s ystem("cls");w hile(!feof(fp)){ch=fgetc(fp);if(ch=='\n') ss++;text[i++]=ch;}t ext[i]='\0';n text=i;f close(fp);p rintf("\n文件读取成功\n文件内容为\n");o utput(text);p rintf("有%d行",ss);}if (pd=='M'||pd=='m')menu();}void save(char text[]) //文件的保存{system("cls");FILE *fp;char pd;char tmp;int i;printf("\n输入【A】保存;\n");fflush(stdin);pd=getchar();if (!(pd=='A'||pd=='a')){m enu();}else{i f(name[20]==NULL){printf("\n请输入保存文件名(例如: c:\\a.txt):");scanf("%s",name);}w hile ((fp=fopen(name,"w+"))==NULL){printf("文件不存在,请重新输入文件名:");scanf("%s",name);}p rintf("\nA:确定;B:取消:");while(scanf("%c",&tmp)!=EOF){if (tmp=='A' || tmp=='a'){for(i=0;i<ntext;i++)fprintf(fp,"%c",text[i]);fclose(fp);status=1;printf("\n文件保存成功\n");break;}if (tmp=='B' || tmp=='b'){break;}}}}int strindex(char text[],char t[],int i2,int l) //查找要操作的数据的位置(模式匹配) {int i1=l,j=0;while (i1<ntext&&j<i2){i f (text[i1]==t[j]) //继续匹配下一个字符{j++;i1++;}//主串和子串依次匹配下一个字符e lse //主串、子串指针回溯重新开始下一次匹配i1=i1-j+1; //主串从下一个位置开始匹配j=0;}//子串从头开始匹配}if (j>=i2){r eturn(i1-i2);} //返回匹配的第一个字符的下标elser eturn(-1); //模式匹配不成功}void search(char text[],int l) //查找文本{system("cls");int i,t,a=-1,kk=0;char str1[20],bd,pd;printf("原文为:\n");output(text);printf("请输入您要查找的内容");scanf("%s",str1);printf("您查找的内容是:%s\n",str1);t=strlen(str1);loop:a=strindex(text,str1,t,l);if (a!=-1){l=a+t;}int hs=1,ls=0;for (i=0;i<=a;i++){l s++;i f (text[i]=='\n'){hs++;ls=0;}}if (a==-1){p rintf("查找到结尾没有找到\n输入【R】将重头查找;");l=0;f flush(stdin);p d=getchar();}else{p rintf("已经找到在第%d行第%d列,输入【R】继续查找下一处;",hs,ls);kk+=1;f flush(stdin);b d=getchar();if (bd=='R'||bd=='r')goto loop;}printf("一共找到了%d次",kk);if (pd=='R'||pd=='r'){l=0;search(text,l);}}void output(char text[]) //文本的输出{system("cls");printf("现在文本的内容为:\n");printf("%s\n",text);int hs=1,i;f or (i=0;i<ntext;i++){if (text[i]=='\n'){hs++;}}printf("\n文本共有%d行\n",hs);}void Delete(char p[],int l) //删除文本{int i,a=-1,t2=0;char x[20],px,pd,pdx,c;system("cls");printf("%s",p);printf("\n输入A执行查找删除内容");fflush(stdin);px=getchar();if (px=='a'||px=='A'){p rintf("\n输入您要删除的内容,以@结束:");f flush(stdin);w hile ((c=getchar())!='@'){if (c=='@'){break;}else{x[t2++]=c;continue;}}loop:a=strindex(p,x,t2,l);i nt hs=1,ls=0;f or (i=0;i<=a;i++){ls++;if (p[i]=='\n'){hs++; ls=0;}}i f (a==-1){printf("已查找结束,您要删除的内容不存在\n输入【R】重新输入要删除的内容; ");l=0;fflush(stdin);pdx=getchar();}e lse{printf("你要删除的内容在第%d行第%d列\n 输入【A】确定删除;输入【B】寻找下个词;",hs,ls);fflush(stdin);pd=getchar();l=t2+a;if (pd=='a'||pd=='A'){for(i=a;i<ntext;i++){p[i]=p[i+t2];}ntext=ntext-t2;printf("删除成功,删除后的内容为:\n%s\n",text);}else if (pd=='b'||pd=='B')goto loop;}i f(pdx=='r'||pdx=='R')Delete(text,l);}}void insert(char text[],int l) //向文本中插入内容{system("cls");int i=0,t=0,t2=0,a=-1,b;char cr[20]="",pd,x[500],c,d;printf("\n当前文本信息为:\n");printf("%s",text);printf("\n输入您要在哪个内容前插入,以@结束:");fflush(stdin);while ((c=getchar())!='@') //用一个数组接收要插入在哪个内容之前{i f (c=='@'){break;}e lse{cr[t++]=c;continue;}}loop:a=strindex(text,cr,t,l); //查找并返回要插入的位置点int hs=1,ls=0;for (b=0;b<a;b++){l s++;i f (text[b]=='\n'){hs++;ls=0;}}if (a==-1){p rintf("\n查找到结尾没有找到插入点,输入【R】查找其他;\n");l=0;f flush(stdin);d=getchar();f flush(stdin);}else{p rintf("\n您要插入的位置是第%d行,第%d列之前\n",hs,ls+1);p rintf("\n【A】.不是此位置向后继续找插入点\n【B】.在此位置插入\n按其他键返回菜单\n请选择:");f flush(stdin);p d=getchar();if (pd=='a'||pd=='A'){l=a+t;goto loop;}e lse if (pd=='b'||pd=='B'){printf("\n\n输入您要插入的内容,以@结束:");fflush(stdin);while ((c=getchar())!='@'){if (c=='@'){break;}else{x[t2++]=c;continue;}}for (i=ntext;i>=a;i--){text[i+t2]=text[i];}for (i=0;i<t2;i++){text[i+a]=x[i];}ntext=ntext+t2;printf("\n当前文本信息为:\n");for (i=0;i<=ntext-1;i++)printf("%c",text[i]);printf("\n文本插入成功\n");fflush(stdin);getchar();}}if (d=='r'||d=='R'){l=0;i nsert(text,l); }status=0;}void Replace(char p[],int l) //内容替换{int t=0,t1=0,i,a,b;char c,th[20],d,d1,bth[20];int i2;system("cls");printf("\n当前文本信息为:\n");for (i2=0;i2<=ntext-1;i2++)printf("%c",p[i2]);printf("\n输入要被替换的内容,以@结束:");fflush(stdin);while ((c=getchar())!='@') //t指替换前内容的长度{i f (c=='@'){break;}e lse{bth[t++]=c;continue;}}loop:a=strindex(p,bth,t,l); //查找要被替换的内容的位置int hs=1,ls=0;for (b=0;b<a;b++){l s++;i f (p[b]=='\n'){hs++;ls=0;}}if (a==-1){p rintf("\n查找到结尾没有找到要被替换的内容\n输入【R】查找其他内容\n");l=0;d=getchar();f flush(stdin); //用来清空输入缓存,以便不影响后面输入的东西}else{p rintf("\n\n已经找到要查找的数据在第%d行第%d列\n输入",hs,ls+1);p rintf("\n【A】继续向后查找相同内容\n输入其他键将进行替换操作\n请选择:");f flush(stdin);l=t+a;c har pd;p d=getchar();if (pd!='a'&&pd!='A'){p rintf("\n是否要替换该内容?\nA:替换给内容;其他键返回主菜单\n请选择:");f flush(stdin);d1=getchar();i f (d1=='a'||d1=='A'){printf("\n输入要替换的内容,以@结束:");fflush(stdin);while ((c=getchar())!='@') //t1指替换后的内容长度{if (c=='@'){break;}else{th[t1++]=c;continue;}}if (t==t1) //将要被替换的内容和替换后的内容进行长度比较{for (i=0;i<t1;i++)p[i+a]=th[i];}elseif (t>t1){for (i=0;i<t1;i++){p[i+a]=th[i];}for (i=a+t1;i<ntext;i++){p[i]=p[i+t-t1];}ntext=ntext+t1-t;}else{for (i=ntext;i>=a;i--){p[i+t1-t]=p[i];}for (i=0;i<t1;i++){p[i+a]=th[i];}ntext=ntext+t1-t;}}printf("替换成功");printf("\n当前文本信息为:\n");for (i2=0;i2<=ntext-1;i2++)printf("%c",p[i2]);getchar();status=0;}}elseg oto loop;}if(d=='r'||d=='R')Replace(text,l);}void menu(){system("cls");loop:system("cls");printf("\n");printf("*****************************************************\n"); printf("**** 欢迎使用简易文本编辑器 ****\n");printf("*****************************************************\n"); printf("********************\n");printf("1、打开文件\n");printf("2、查找\n");printf("3、删除\n");printf("4、插入\n");printf("5、替换\n");printf("6、保存\n");printf("7、显示内容\n");printf("8、退出 ****\n");printf("********************\n");printf("请选择(1~8):");char c;f flush(stdin);i f(c>='0'&&c<='9'){switch (c){case '1':open(text);break;case '2':search(text,0);break;case '3':Delete(text,0);break;case '4':insert(text,1);break;case '5':Replace(text,0);break;case '6':save(text);break;case '7':output(text);break;case '8':exit(0);default : break;}}e lse{printf("\n输入有误,请重新输入:");fflush(stdin);c=getchar();}system("pause");g oto loop;}int main(){menu();}。

相关文档
最新文档