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

請問貴討論區的版主,元件安裝問題

尚未結案
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-04-04 14:51:50 IP:211.21.xxx.xxx 未訂閱
前次貼錯討論區,非常報歉,所以再貼一次。    目前手邊有四個元件,但這只適合DELPHI 3,不過有SOURCE,但是裝在DELPHI 5時將元件放在FORM上時有ERROR,不知如何解決,可否請版主幫個忙。    其中STATCTRL,OMENU 皆繼承自MWCUCOCO這個元件並使用COLORBUTTON元件。    不知道方不方便E-MAIL這些元件給版主您,如果可以的話請告訴我。    kcdavid346@msn.com
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-04-04 15:03:53 IP:218.16.xxx.xxx 未訂閱
你可否先 post 出你的 error message 呢? 要上傳問題檔案可到 http://delphi.ktop.com.tw/forum.asp?FORUM_ID=97 不過我若非必要還是不願裝我不用的元件的。
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#3 引用回覆 回覆 發表時間:2003-04-04 17:03:58 IP:211.21.xxx.xxx 未訂閱
引言: 你可否先 post 出你的 error message 呢? 要上傳問題檔案可到 http://delphi.ktop.com.tw/forum.asp?FORUM_ID=97 不過我若非必要還是不願裝我不用的元件的。
版主我的 error message 如下: 當我將元件放至form上時出現如下的error: Error Reading: TStatCtrl.OldCreateOrder:Property does not exist. 這四個元件的source code 都不長,只是我不會寫元件,所以無論如何請您幫幫忙。
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#4 引用回覆 回覆 發表時間:2003-04-04 17:20:03 IP:218.16.xxx.xxx 未訂閱
你在 TStatCtrl = Class(...) ... private ... public ... published ... OldCreateOrder; //刪了這個 ... end;
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#5 引用回覆 回覆 發表時間:2003-04-04 17:34:21 IP:211.21.xxx.xxx 未訂閱
引言: 你在 TStatCtrl = Class(...) ... private ... public ... published ... OldCreateOrder; //刪了這個 ... end;
但是在程式裡沒有這一句?? 以下是兩個vcl的source code: unit mwCuCoCo; interface uses SysUtils, WinTypes, Classes, Graphics, Controls, ExtCtrls, Buttons, Forms, Messages, Menus; type TmwCustomCompoundComponent = class(TPanel) private { Private declarations } fTextHeight: Integer; fMoveAble:Boolean; fBorderStyle:TBorderStyle; procedure GetTextHeight(Reader: TReader); procedure SetTextHeight(Writer: TWriter); procedure GetPixelsPerInch(Reader: TReader); procedure SetPixelsPerInch(Writer: TWriter); procedure DefineProperties(Filer: TFiler); override; function RunTime: Boolean; procedure WMNCHitTest(var NCTest: TWMNCHitTest);message WM_NCHitTest; protected { Protected declarations } public { Public declarations } constructor Create(Owner: TComponent); override; property MoveAble:Boolean read fMoveAble write fMoveAble; published { Published declarations } property BorderStyle:TBorderStyle read fBorderStyle; end; var mwCustomCompoundComponent: TmwCustomCompoundComponent; implementation {$R *.DFM} { This component has two fake properties, TextHeight and PixelsPerInch. The form editor stores these properties in the .DFM file, TextHeight always and PixelsPerInch in some cases. This will only be a problem if you use the form editor as a component editor. However what is stored in the .DFM file must be handled. You may use the the TextHeight Property to store any integer value. } procedure TmwCustomCompoundComponent.DefineProperties(Filer: TFiler); begin inherited DefineProperties(Filer); Filer.DefineProperty('TextHeight', GetTextHeight, SetTextHeight, True); Filer.DefineProperty('PixelsPerInch', GetPixelsPerInch, SetPixelsPerInch, False); end; { Create a CustomCompoundComponent and set some default properties. } constructor TmwCustomCompoundComponent.Create(Owner: TComponent); var FormBorder, FormCaption, FormFrame: Integer; begin inherited Create(Owner); ReadComponentRes(Self.ClassName, Self); fBorderStyle:= bsNone; FormBorder:= GetSystemMetrics(SM_CXBORDER); FormCaption:= GetSystemMetrics(SM_CYCAPTION); FormFrame:= GetSystemMetrics(SM_CXFIXEDFRAME); { use SM_CXFRAME for Windows 3.1 } Align := alnone; BevelOuter := bvRaised; Caption := ''; { Consider this is a panel. To prevent your user from dropping any other controls on it, you must set the ControlStyle accordingly. } ControlStyle := ControlStyle - [csAcceptsControls, csSetCaption]; Height:= Height - FormCaption - FormFrame *2 - FormBorder *2; Width:= Width - FormFrame *2 - FormBorder *2; end; procedure TmwCustomCompoundComponent.GetTextHeight(Reader: TReader); begin FTextHeight:= Reader.ReadInteger; end; { GetTextHeight } procedure TmwCustomCompoundComponent.SetTextHeight(Writer: TWriter); begin Writer.WriteInteger(fTextHeight); end; { SetTextHeight } procedure TmwCustomCompoundComponent.GetPixelsPerInch(Reader: TReader); begin { Ignore it } Reader.ReadInteger; end; { GetPixelsPerInch } procedure TmwCustomCompoundComponent.SetPixelsPerInch(Writer: TWriter); begin Writer.WriteInteger(0); end; { SetPixelsPerInch } function TmwCustomCompoundComponent.RunTime: Boolean; begin RunTime := not (csDesigning in ComponentState); end; { RunTime } procedure TmwCustomCompoundComponent.WMNCHitTest(var NCTest: TWMNCHitTest); begin inherited; if Runtime and MoveAble then NCTest.Result:= htCaption; end; { WMNCHitTest } end. //////////////////////////////////////////////////////////////////// unit statctrls; interface uses SysUtils, Windows, Messages, Classes, Graphics, Controls, StdCtrls, ExtCtrls, Forms, ToolWin, ComCtrls,mwcucoco, Buttons,Dialogs, ColorButton; type TStatctrl = class(TmwCustomCompoundComponent) tableno: TPanel; BlueBtn: TColorButton; RedBtn: TColorButton; Memo: TMemo; private function RunTime: Boolean; protected procedure SetBounds(Left, Top, Width, Height: Integer); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override; published Property ControlStyle; end; procedure Register; var Statctrl: TStatctrl; implementation {$R *.DFM} procedure Register; begin RegisterComponents('MyVcl', [TStatctrl]); end; constructor TStatctrl.Create(AOwner: TComponent); begin inherited Create(AOwner); ControlStyle := ControlStyle - [csAcceptsControls, csSetCaption]; Caption:=''; if not RunTime then begin //Height:= 31; //Width:= 132; end else begin end; end; { Create } destructor TStatctrl.Destroy; begin if not RunTime then begin ControlStyle := ControlStyle - [csFramed]; (Owner as TForm).Repaint; end; Parent:= nil; inherited Destroy; end; { Destroy } function TStatctrl.RunTime: Boolean; begin RunTime := not (csDesigning in ComponentState); end; { RunTime } procedure TStatctrl.SetBounds(Left, Top, Width, Height: Integer); begin inherited SetBounds(Left, Top, Width, Height); if not RunTime then begin (Owner as TForm).Repaint; end else begin end; end; { SetBounds } end. //////////////////////////////////////////////////////
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#6 引用回覆 回覆 發表時間:2003-04-04 17:46:54 IP:211.21.xxx.xxx 未訂閱
補充說明一下:這兩個元件在設計時都是有畫面的。我用view as Text去看,有一行 OldCreateOrder = True 我把它刪掉後,切換到畫面再用view as Text去看又會現 OldCreateOrder = True, Why ?? [版主刪除了過長的 quote] 發表人 - Justmade 於 2003/04/04 19:35:26
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#7 引用回覆 回覆 發表時間:2003-04-04 17:55:50 IP:211.21.xxx.xxx 未訂閱
我將元件放至問題上傳區中,如果需要可至問題上傳區下載。 [版主刪除了過長的 quote] 發表人 - Justmade 於 2003/04/04 19:34:28
william
版主


發表:66
回覆:2535
積分:3048
註冊:2002-07-11

發送簡訊給我
#8 引用回覆 回覆 發表時間:2003-04-04 19:27:16 IP:210.3.xxx.xxx 未訂閱
It should be the problem of STATCTRLS.dfm. View this for as text and remove the line OldCreateOrder = True. Perhaps this form has been opened with newer version of Delphi before?
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#9 引用回覆 回覆 發表時間:2003-04-04 19:32:11 IP:218.16.xxx.xxx 未訂閱
1. in your MyDBGrid folder, double click STATCTRLS.dfm 2. delete the OldCreateOrder = True line 3. save the file 4. delete the STATCTRLS.dcu
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#10 引用回覆 回覆 發表時間:2003-04-04 23:09:28 IP:61.16.xxx.xxx 未訂閱
引言: 1. in your MyDBGrid folder, double click STATCTRLS.dfm 2. delete the OldCreateOrder = True line 3. save the file 4. delete the STATCTRLS.dcu
我按照您的方式操作,然後再用install component的方式安裝依然會出現同樣的Error。因為一開啟TstatCtrl.pas畫面就會出現,然後這一行 OldCreateOrder = True 就自動出現了。 是不是我的操作程序有誤呢??真是頭痛的問題。
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#11 引用回覆 回覆 發表時間:2003-04-04 23:54:57 IP:218.16.xxx.xxx 未訂閱
我想你是修改了錯誤的檔案罷,你找找你硬盤有沒有別的 STATCTRLS.dfm 及 statctrls.dcu 刪掉多餘的只剩一個 修改後的 statctrls.dfm 及 statctrls.pas 就好,應不用重新 install 的
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#12 引用回覆 回覆 發表時間:2003-04-05 00:23:58 IP:61.16.xxx.xxx 未訂閱
引言:
引言: 1. in your MyDBGrid folder, double click STATCTRLS.dfm 2. delete the OldCreateOrder = True line 3. save the file 4. delete the STATCTRLS.dcu
我按照您的方式操作,然後再用install component的方式安裝依然會出現同樣的Error。因為一開啟TstatCtrl.pas畫面就會出現,然後這一行 OldCreateOrder = True 就自動出現了。 是不是我的操作程序有誤呢??真是頭痛的問題。
確定只有一份vcl後照這方法做結果一樣。我在上載區有一份vcl,不知道您有沒有看到。 如果我要產生一樣的vcl要如何做呢?因為New Component的方式產生出來的vcl都沒有Form。
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#13 引用回覆 回覆 發表時間:2003-04-05 09:00:59 IP:218.16.xxx.xxx 未訂閱
甚麼叫 "確定只有一份vcl" ? 你現在的情況明顯是系統仍在使用未更改前的 STATCTRLS.DCU 因為更改後的元件根本原全沒OldCreateOrder這個字眼了你認為Delphi可以從無變有嗎? 你也可以開啟 C:\Program Files\Borland\Delphi5\Lib\dclusr.dpk 看看到底你在用的 STATCTRLS 在那裡 及重新 Compile 元件
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#14 引用回覆 回覆 發表時間:2003-04-07 08:55:31 IP:211.21.xxx.xxx 未訂閱
引言: 甚麼叫 "確定只有一份vcl" ? 你現在的情況明顯是系統仍在使用未更改前的 STATCTRLS.DCU 因為更改後的元件根本原全沒OldCreateOrder這個字眼了你認為Delphi可以從無變有嗎? 你也可以開啟 C:\Program Files\Borland\Delphi5\Lib\dclusr.dpk 看看到底你在用的 STATCTRLS 在那裡 及重新 Compile 元件
終於可了。謝謝版主的指導。 順便請教如果要產生一個有form的component要如何做呢?
danny
版主


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

發送簡訊給我
#15 引用回覆 回覆 發表時間:2003-04-07 10:14:59 IP:211.76.xxx.xxx 未訂閱
引言:順便請教如果要產生一個有form的component要如何做呢?
Form 無法直接放到 Component palette 中 ... 您必須從 TComponent 繼承下來, 另外寫一個元件包裝起來, 至於實際的作法您可以參考 Dialogs 頁面中的元件 Source code.
------
將問題盡快結案也是一種禮貌!
kcdavid346
一般會員


發表:4
回覆:9
積分:2
註冊:2002-09-06

發送簡訊給我
#16 引用回覆 回覆 發表時間:2003-04-07 10:20:31 IP:211.21.xxx.xxx 未訂閱
引言:
引言:順便請教如果要產生一個有form的component要如何做呢?
Form 無法直接放到 Component palette 中 ... 您必須從 TComponent 繼承下來, 另外寫一個元件包裝起來, 至於實際的作法您可以參考 Dialogs 頁面中的元件 Source code.
請教之前討論的元件目前已可以使用,但是用New Application時元件面板會消失。我在安裝元件時有將所有的程式都close,但還是會消失,why??
Justmade
版主


發表:94
回覆:1934
積分:2030
註冊:2003-03-12

發送簡訊給我
#17 引用回覆 回覆 發表時間:2003-04-07 11:31:38 IP:218.16.xxx.xxx 未訂閱
引言: 請教之前討論的元件目前已可以使用,但是用New Application時元件面板會消失。我在安裝元件時有將所有的程式都close,但還是會消失,why??
我從沒在 D5 見過這種情形,在 D6/D7 元件有分 VCL / CLX 在不同的 Application 有些不能用的元件會消失
引言: 順便請教如果要產生一個有form的component要如何做呢?
用TFrame 罷,有大部份 Form 的功能,可像 Form 獨立顯示,也可加入其他元件合成新元件放在元件頁上。
系統時間:2024-05-16 18:07:36
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!