全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:2178
推到 Plurk!
推到 Facebook!

如何恢復DELPHI 7中原有的TBitmap, TIcon andTPicture屬性

尚未結案
ucdesign2
一般會員


發表:24
回覆:33
積分:11
註冊:2002-10-23

發送簡訊給我
#1 引用回覆 回覆 發表時間:2007-07-13 14:30:39 IP:211.23.xxx.xxx 訂閱
請教各位先進:
今天下載了一個TLsPictureEditor的package
(TLsPictureEditor as a replacement of the default TBitmap, TIcon and
TPicture property editor in Object Inspector.)
有下列檔案:LsPicEditorMainD6.pas,LsPicEditorMainD6.dfm
LsPicEditorViewD6.pas,LsPicEditorViewD6.dfm
LsPicEditorRegD6.pas及LsPictureEditorD6.dpk
我直接用component->install component ->選取LsPicEditorRegD6.pas來安裝(不是用install package方式安裝)
現在我後悔了!如何恢復DELPHI 7中原有的TBitmap, TIcon ,TPicture屬性操作方式?
(因為我無法在Install Packages中用remove方式刪除),先謝謝前輩!

danny
版主


發表:100
回覆:522
積分:595
註冊:2002-03-11

發送簡訊給我
#2 引用回覆 回覆 發表時間:2007-07-14 08:05:34 IP:211.76.xxx.xxx 訂閱
一般選 install component 安裝的 component 內定是包在 Borland User Components 這個 Delphi package 中
你選 install packages 取消 Borland User Components 應該就可以了
------
將問題盡快結案也是一種禮貌!
ucdesign2
一般會員


發表:24
回覆:33
積分:11
註冊:2002-10-23

發送簡訊給我
#3 引用回覆 回覆 發表時間:2007-07-15 12:19:29 IP:218.167.xxx.xxx 訂閱
謝謝版主回覆!我試了還是不行!

不知道是不因為我是用component->install component 點選LsPicEditorRegD6.pas來安裝
(非用install packages方式)我把LsPicEditorRegD6.pas貼上來請前輩幫我看看!謝謝!!

{$INCLUDE LsComp.inc}
unit LsPicEditorRegD6;
interface
uses SysUtils, Controls, Graphics, TypInfo, LsPicEditorMainD6, LsPicEditorViewD6,
Forms,
{$IFDEF D6_OR_HIGHER}
DesignIntf, DesignEditors //2.4
{$ELSE}
DsgnIntf
{$ENDIF};
type
TLsPictureEditor = class(TClassProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
end;
procedure Register;
implementation

function TLsPictureEditor.GetAttributes: TPropertyAttributes;
begin
Result := [paDialog]
end;
procedure TLsPictureEditor.Edit;
begin
Application.CreateForm(TPEMainForm, PEMainForm);
Application.CreateForm(TPEViewForm, PEViewForm);
with PEMainForm do
try
if GetPropType <> nil then //2.5>
begin
if (GetPropType^.Name = 'TIcon') then
Image1.Picture.Icon := TIcon(GetOrdValue)
else
Image1.Picture := TPicture(GetOrdValue);
Image2.Picture := Image1.Picture;
if ShowModal = mrOk then
begin
if (GetPropType^.Name = 'TIcon') then
SetOrdValue(LongInt(Image1.Picture.Icon))
else if (GetPropType^.Name = 'TPicture') then
SetOrdValue(LongInt(Image1.Picture))
else
SetOrdValue(LongInt(Image1.Picture.Bitmap));
end;
end; //2.5<
finally
Close;
end; { finally }
PEViewForm.Close;
end;
procedure Register;
begin
RegisterPropertyEditor(TypeInfo(TPicture), nil, '', TLsPictureEditor);
RegisterPropertyEditor(TypeInfo(TBitmap), nil, '', TLsPictureEditor);
RegisterPropertyEditor(TypeInfo(TIcon), nil, '', TLsPictureEditor); //2.5
end;
end.
編輯記錄
ucdesign2 重新編輯於 2007-07-15 12:26:12, 註解 無‧
wameng
版主


發表:31
回覆:1336
積分:1188
註冊:2004-09-16

發送簡訊給我
#4 引用回覆 回覆 發表時間:2007-07-17 11:59:23 IP:61.222.xxx.xxx 訂閱
我十分確定你安裝到 Borland User Components (dclusr60.dpk) Install Component 預設的包裝檔。
因為我也裝了。......
移除在 [ Install Packages]找到 Borland User Components 按下 Remove 即可。
在移除前,最好關掉目前的Delphi 並重新開啟 後執行上述動作。



ucdesign2
一般會員


發表:24
回覆:33
積分:11
註冊:2002-10-23

發送簡訊給我
#5 引用回覆 回覆 發表時間:2007-07-18 13:46:51 IP:211.23.xxx.xxx 訂閱

===================引 用 wameng 文 章===================
我十分確定你安裝到 Borland User Components (dclusr60.dpk) Install Component 預設的包裝檔。
因為我也裝了。......
移除在 [ Install Packages]找到 Borland User Components 按下 Remove 即可。
在移除前,最好關掉目前的Delphi 並重新開啟 後執行上述動作。
===========================================================
謝謝版主回覆!
我是用delphi 7,所以沒有用元件提供的package安裝!
而是直接把LsPicEditorRegD6.pas用install component到我現有的custom1.dpk中,
雖然過程有錯誤訊息出現!但TPicture,TBitmap等屬性editor還是
被替換了!但奇怪的是在我的custom1.dpk中找不到LsPicEditorRegD6.pas可Remove
後來解決方法是:在Install package中remove我的custom1.dpk然後再重新安裝custom1.dpk就恢復正常了!
謝謝兩位版主回應!謝謝!!雖然一波三折,但也沒白忙!
發現了一個網址介紹property editor很詳盡!各位可參考:)
http://www.drbob42.com/delphi/property.htm
我參照此網頁的說明還寫了自己的TPicture,TBitmap等屬性editor,也算豐收了




編輯記錄
ucdesign2 重新編輯於 2007-07-18 14:10:09, 註解 無‧
系統時間:2024-05-03 6:12:21
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!