線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:5065
推到 Plurk!
推到 Facebook!

Change your property value from DFM (Delphi Form F

 
axsoft
版主


發表:681
回覆:1056
積分:969
註冊:2002-03-13

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-02-11 14:19:51 IP:61.218.xxx.xxx 未訂閱
Change your property value from DFM (Delphi Form File)    資料來源: www.delphi3000.com    Standard Operation Procedure for changing property value from a project with a lot of forms.    Sometimes we change our mind about a property value of VCLs. The most common workaround for this is, open our forms one by one and change the property value. What if we have a lot of forms in our project. OK we can use OnCreate event for setting the property value at common ancestor forms. This works only when you have several common ancestor forms (base forms). What if you don't have a common ancestor forms (my deepest sympathy for you ^_^) or the property value already takes effect while loading. Don't worry you don't have to set them one by one from Object Inspector. Delphi Form File is your Delphi form that is serialized into a text file. It's very easy to understand the text file. You can edit the DFM files and save it. When you change your mode into View As Form you can see from Object Inspector that your changes already takes effect. OK here's my Standard Operation Procedure (SOP) for hacking DFM:  1. Backup your project first. I hate being cursed by you when you messed up your project ^_^.  2. Find a keyword for searching your property value. Inspect one form DFM first for the correct keyword (right click a form and choose View as Text).  4. Close all form in your project but leave your project open.  5. From Windows Explorer right click your project folder and choose find (F3). Select Advanced tab from Find Dialog. Choose Delphi Form as the file type and enter your keyword and click Find Now (Enter). Sort the file as you wish.  6. Highlight the first file and hit Enter. Explorer will open this file on your already opened project. Maximize the source code editor window. Hit CTRL+F and enter your keyword. Change the property value as you wish and hit F3 for changing next property value until no more keyword found. Hit CTRL+S for saving your changes. Don't close this file since you will need to maximize source code editor for the next DFM.  7. Hit ALT+TAB for switching back to Find Dialog and hit DOWN ARROW for next DFM and hit ENTER.  8. Hit F3 for changing property value until no more keyword found. Hit CTRL+F4 for closing your DFM. And choose Save (ENTER) for Close Dialog. Repeat to step 7 until all DFM processed.  9. Try to build your project, when something goes wrong, use your backup for recovering your damaged DFM.  10. OK you have done a good job and you deserve a 10 minutes coffee break ^_^.     OK good luck and let me know if you have build an automated parser for doing this.     聯盟----Visita網站http://www.vista.org.tw ---[ 發問前請先找找舊文章 ]---
系統時間:2024-04-24 7:06:33
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!