delphi課程設(shè)計文本編輯器_第1頁
delphi課程設(shè)計文本編輯器_第2頁
delphi課程設(shè)計文本編輯器_第3頁
delphi課程設(shè)計文本編輯器_第4頁
delphi課程設(shè)計文本編輯器_第5頁
已閱讀5頁,還剩15頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認(rèn)領(lǐng)

文檔簡介

1、 前 言delphi課程設(shè)計是計算機科學(xué)與技術(shù)專業(yè)學(xué)生的專業(yè)實踐必修課程,是學(xué)習(xí)delphi應(yīng)用程序課程非常重要的綜合性實踐教學(xué)環(huán)節(jié)。課程設(shè)計是檢驗學(xué)生是否掌握相關(guān)專業(yè)課程知識的重要手段,同時課程設(shè)計應(yīng)充分體現(xiàn)“教師指導(dǎo)下的以學(xué)生為中心”的教學(xué)模式,以學(xué)生為認(rèn)知主體,充分調(diào)動學(xué)生的積極性和能動性,重視學(xué)生實踐應(yīng)用能力和自學(xué)能力的培養(yǎng)。1 、設(shè)計的目的與要求(1)設(shè)計的目的: 課程設(shè)計是計算機科學(xué)與技術(shù)專業(yè)學(xué)生的專業(yè)實踐必修課程,是學(xué)習(xí)delphi應(yīng)用程序設(shè)計課程非常重要的綜合性實踐教學(xué)環(huán)節(jié)。課程設(shè)計是檢驗學(xué)生是否掌握相關(guān)專業(yè)課程知識的重要手段,同時課程設(shè)計應(yīng)充分體現(xiàn)“教師指導(dǎo)下的以學(xué)生為中心”

2、的教學(xué)模式,以學(xué)生為認(rèn)知主體,充分調(diào)動學(xué)生的積極性和能動性,重視學(xué)生實踐應(yīng)用能力和自學(xué)能力的培養(yǎng)。通過設(shè)計文本編輯器并實現(xiàn)其功能來熟練掌握delphi語言基礎(chǔ),初步掌握軟件開發(fā)中系統(tǒng)分析、系統(tǒng)設(shè)計、系統(tǒng)實現(xiàn)和系統(tǒng)測試等階段的基本方法與技術(shù),培養(yǎng)學(xué)生的創(chuàng)新意識,提高實踐應(yīng)用能力,為培養(yǎng)應(yīng)用型人才服務(wù)。(2)做文本編輯器的要求:菜單要求: 要求有新建 、保存、另存為、退出 、拷貝、剪切、粘貼、幫助等功能。要求其操作簡單、界面清晰、靈活、實用、方便。要求程序須經(jīng)調(diào)試,并添加異常處理和代碼注釋,同時在功能實現(xiàn)后,要將代碼進行優(yōu)化。最好能響應(yīng)鍵盤和鼠標(biāo)事件,同時可添加快捷鍵。 2 、設(shè)計進度及完成情況日

3、 期內(nèi) 容2011年5月22日準(zhǔn)備和審題、接受任務(wù),開發(fā)環(huán)境配置等2011年2月2324日查找相關(guān)資料,系統(tǒng)調(diào)查,需求分析2011年5月25日系統(tǒng)建模2011年5月26日概要設(shè)計2011年5月2728日詳細(xì)設(shè)計2011年5月2931日編碼測試2011年6月01日部署、配置、運行2011年6月0203日撰寫課程設(shè)計報告2011年6月04日課程設(shè)計總結(jié)2011年6月05日正式提交課程設(shè)計報告和系統(tǒng)源程序目 錄前 言i1 、設(shè)計的目的與要求ii2 、設(shè)計進度及完成情況iii目 錄i1引言12設(shè)計任務(wù)與目的13. 需求分析24 系統(tǒng)設(shè)計34.1 總體設(shè)計34.1.1 系統(tǒng)功能34.2詳細(xì)設(shè)計35 系統(tǒng)

4、實現(xiàn)65.1 系統(tǒng)主要用例的實現(xiàn)65.1.1運行用例運行效果65.1.2 打開文檔用例運行效果75.1.3 關(guān)于用例運行效果86 結(jié)束語9致謝10參考文獻11附錄a:系統(tǒng)源程序121 引言計算機的普及發(fā)展,軟件行業(yè)在社會占著舉足輕重的作用?,F(xiàn)今市場中存在的文本編輯器已不是少數(shù)幾種,而且功能已相對齊全,但我們作為未來從事軟件行業(yè)的專業(yè)人士,借著軟件發(fā)展的周期,研究這個課題,在學(xué)習(xí)過程掌握文本編輯器以及java的相關(guān)知識很有必要,既隨科技發(fā)展的前沿,又方便了我們的生活。事實上,因為暫時知識的限制性,我們只能做一個比較簡單的文本編輯器,通過一學(xué)期對delphi的了解和課程設(shè)計培訓(xùn),以及對文本編輯器主

5、要功能的詳細(xì)研究,我們將其功能轉(zhuǎn)化為了程序代碼。主要分為編輯區(qū)、輸入?yún)^(qū)等,此文本編輯器含有保存、 退出、查找、拷貝、剪切、粘貼等簡要功能,其操作簡單、界面清晰、靈活、實用、方便等優(yōu)點,適用于簡便的存檔及撰寫文稿。2 設(shè)計任務(wù)與目的1)設(shè)計一個簡單的文本編輯器,可以實現(xiàn)以下功能: 1:文件的新建,打開,保存和另存; 2:對文件的編輯,如全選,復(fù)制,剪切,粘貼; 3:執(zhí)行完操作后,能夠順利關(guān)閉記事本。4;能對文本進行格式修改5:可以改變文本的對齊方式6:有簡單的搜索定位功能 2)通過這次設(shè)計,可以幫助學(xué)生:1:提高對delphi語言設(shè)計的掌握能力; 2:理論聯(lián)系實際,進一步提高學(xué)生的軟件開發(fā)技術(shù);

6、 3:培養(yǎng)學(xué)生分析、解決問題的能力。3. 需求分析 在科學(xué)技術(shù)飛速發(fā)展的今天,計算機科學(xué)日漸成熟,其強大的功能已為人們深刻認(rèn)識,它已進入人類社會的各個領(lǐng)域并發(fā)揮著越來越重要的作用。應(yīng)用delphi技術(shù)實現(xiàn)學(xué)生學(xué)習(xí)實踐是可行而必要的工作 。在社會生活中我們經(jīng)常需要用電腦編寫一些文檔來保存文件,本課程設(shè)計是運用了delphi軟件開發(fā)工具開發(fā)的應(yīng)用軟件。適合編寫記錄文件。 訓(xùn)練學(xué)生靈活應(yīng)用所學(xué)delphi語言的基本知識,熟練的完成問題分析、算法設(shè)計、編寫程序,求解出指定的問題;訓(xùn)練用系統(tǒng)的觀點和軟件開發(fā)一般規(guī)范進行軟件開發(fā),鞏固、深化學(xué)生的理論知識,提高編程水平,并在此過程中培養(yǎng)嚴(yán)謹(jǐn)?shù)目茖W(xué)態(tài)度和良好

7、的工作作風(fēng); 提高綜合運用所學(xué)的理論知識和方法獨立分析和解決問題的能力運行要求: 由于本程序是運用delphi語言編成的,所以首先必須在電腦上安裝delphi開發(fā)軟件,并在delphi7.0中進行編程。 4 系統(tǒng)設(shè)計4.1 總體設(shè)計4.1.1 系統(tǒng)功能1:文件的新建,打開,保存和另存;2:對文件的編輯,如全選,復(fù)制,剪切,粘貼;3:執(zhí)行完操作后,能夠順利關(guān)閉記事本。4;能對文本進行格式修改5:可以改變文本的對齊方式6:有簡單的搜索定位功能4.2 詳細(xì)設(shè)計 文本編輯器各功能的實現(xiàn)代碼如下1.新建procedure tform1.filenewexecute(sender: tobject);/新

8、建部分beginrichedit1.clear;filename:=未命名文件.txt;statusbar1.panels0.text:=filename;end;2.打開procedure tform1.fileopen1accept(sender: tobject);/打開部分beginrichedit1.lines.loadfromfile(fileopen1.dialog.filename);filename:=fileopen1.dialog.filename;form1.caption:=filename;statusbar1.panels0.text:=filename;end;

9、3.保存procedure tform1.filesaveexecute(sender: tobject);/保存beginif filename=未命名文件.txtthen filesaveas1.execute else richedit1.lines.savetofile(filename);end;4.幫助 contents菜單procedure tform1.helpcontents1execute(sender: tobject);/幫助const help_tab=15; contents_active=-3;begin application.helpcommand(help_

10、tab,contents_active);end;5.幫助indes菜單procedure tform1.helpindexexecute(sender: tobject);const help_tab=15; index_active=-2;begin application.helpcommand(help_tab,index_active);end;6.關(guān)于部分procedure tform1.helpaboutexecute(sender: tobject);beginwith taboutbox.create(self) do try showmodal; finally free;

11、 end;end;7.顯示字體procedure tform1.showhint(sender: tobject);begin if length(application.hint) 0 then begin statusbar1.simplepanel := true; statusbar1.simpletext := application.hint; end else statusbar1.simpletext := 歡迎使用本軟件!; end;8.窗體建立procedure tform1.formcreate(sender: tobject);begin application.hel

12、pfile:=extractfilepath(application.exename)+texteditor.hlp;end;另存為procedure tform1.filesaveas2execute(sender: tobject);/另存為begin richedit1.lines.savetofile(filename);end;9.字體名稱procedure tform1.fontnamechange(sender: tobject);/字體名稱begin if fontname.text=ansi_charset then richedit1.font.charset:=ansi_

13、charset; if fontname.text=arabic_charset then richedit1.font.charset:=arabic_charset; if fontname.text=baltic_charset then richedit1.font.charset:=baltic_charset;end;10.更改字體大小procedure tform1.fontsizechange(sender: tobject); /字體大小改變begin richedit1.font.size:= strtoint(fontsize.text);end;end.5 系統(tǒng)實現(xiàn)5.

14、1 系統(tǒng)主要用例的實現(xiàn)5.1.1運行用例運行效果 圖5-1 運行用例運行效果圖5.1.2 打開文檔用例運行效果圖5-2 打開文件用例運行效果圖5.1.3 關(guān)于用例運行效果居中對齊如下加粗、傾斜、下劃線效果 圖5-3 用例演示運行效果6 結(jié)束語作為計算機科學(xué)與技術(shù)的學(xué)生,我覺得能做類似的課程設(shè)計是十分有意義,而且是十分必要的。在已度過的時間里我們大多數(shù)接觸的是專業(yè)基礎(chǔ)課。我們在課堂上掌握的僅僅是專業(yè)基礎(chǔ)課的理論面,如何去鍛煉我們的實踐面?如何把我們所學(xué)到的專業(yè)基礎(chǔ)理論知識用到實踐中去呢?我想做類似的大作業(yè)就為我們提供了良好的實踐平臺。在做本次課程設(shè)計的過程中,我感觸最深的當(dāng)數(shù)查閱大量的書籍了。為

15、了讓自己的設(shè)計更加完善,更加符合軟件工程標(biāo)準(zhǔn),一次次翻閱各種參考資料是十分必要的,同時也是必不可少的。我們是在作設(shè)計,但我們不是藝術(shù)家。他們可以拋開實際,盡情在幻想的世界里翱翔,我們是軟件設(shè)計師,一切都要有據(jù)可依.有理可尋,不切實際的構(gòu)想永遠(yuǎn)只能是構(gòu)想,永遠(yuǎn)無法升級為設(shè)計。作為一名專業(yè)學(xué)生掌握一門或幾門程序設(shè)計語言是必不可少的,由于本次課程設(shè)計要求用delphi進行開發(fā),在這過程中我對各種的開發(fā)環(huán)境進行了探索,這使我對delphi的集成開發(fā)環(huán)境有了更深刻的理解雖然去從未獨立應(yīng)用過它們,但是由于水平有限,難免會有錯誤,還望老師批評指正。致謝非常感謝老師對我們的指導(dǎo),讓我們能學(xué)會這門課程并且成功地

16、完成了本次課程設(shè)計,還有設(shè)計過程中給予我們幫助的同學(xué)、朋友,有了大家的共同努力才有今天的成果。參考文獻附錄a:系統(tǒng)源程序unit unit1;interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, actnctrls, toolwin, actnman, actnmenus, stdactns, extactns, actnlist, imglist, stdctrls, comctrls,about;type tform1 = class(tform)

17、actionmanager1: tactionmanager; imagelist1: timagelist; filenew: taction; filesave: taction; helpindex: taction; helpabout: taction; editcut1: teditcut; editcopy1: teditcopy; editpaste1: teditpaste; editselectall1: teditselectall; editundo1: teditundo; editdelete1: teditdelete; richeditbold1: triche

18、ditbold; richedititalic1: trichedititalic; richeditunderline1: tricheditunderline; richeditstrikeout1: tricheditstrikeout; richeditbullets1: tricheditbullets; richeditalignleft1: tricheditalignleft; richeditalignright1: tricheditalignright; richeditaligncenter1: tricheditaligncenter; helpcontents1:

19、thelpcontents; fileopen1: tfileopen; filesaveas1: tfilesaveas; fileexit1: tfileexit; searchfind1: tsearchfind; searchfindnext1: tsearchfindnext; searchreplace1: tsearchreplace; searchfindfirst1: tsearchfindfirst; actionmainmenubar1: tactionmainmenubar; actiontoolbar1: tactiontoolbar; statusbar1: tst

20、atusbar; toolbar1: ttoolbar; fontsize: tedit; updown1: tupdown; toolbutton1: ttoolbutton; boldbutton: ttoolbutton; toolbutton4: ttoolbutton; toolbutton5: ttoolbutton; toolbutton3: ttoolbutton; toolbutton6: ttoolbutton; toolbutton7: ttoolbutton; toolbutton8: ttoolbutton; toolbutton9: ttoolbutton; too

21、lbutton10: ttoolbutton; richedit1: trichedit; fontname: tcomboboxex; procedure filenewexecute(sender: tobject); procedure fileopen1accept(sender: tobject); procedure filesaveexecute(sender: tobject); procedure helpcontents1execute(sender: tobject); procedure helpindexexecute(sender: tobject); proced

22、ure helpaboutexecute(sender: tobject); procedure formcreate(sender: tobject); procedure showhint(sender: tobject); procedure filesaveas2execute(sender: tobject); procedure fontnamechange(sender: tobject); procedure fontsizechange(sender: tobject); private private declarations public public declarati

23、ons filename:string; end;var form1: tform1;implementation$r *.dfmprocedure tform1.filenewexecute(sender: tobject);beginrichedit1.clear;filename:=未命名文件.txt;statusbar1.panels0.text:=filename;end;procedure tform1.fileopen1accept(sender: tobject);beginrichedit1.lines.loadfromfile(fileopen1.dialog.filena

24、me);filename:=fileopen1.dialog.filename;form1.caption:=filename;statusbar1.panels0.text:=filename;end;procedure tform1.filesaveexecute(sender: tobject);beginif filename=未命名文件.txtthen filesaveas1.execute else richedit1.lines.savetofile(filename);end;procedure tform1.helpcontents1execute(sender: tobje

25、ct);const help_tab=15; contents_active=-3;begin application.helpcommand(help_tab,contents_active);end;procedure tform1.helpindexexecute(sender: tobject);const help_tab=15; index_active=-2;begin application.helpcommand(help_tab,index_active);end;procedure tform1.helpaboutexecute(sender: tobject);beginwith taboutbox.create(self) do try showmodal; finally free; end;

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論