請問貴討論區的版主,元件安裝問題 |
尚未結案
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
前次貼錯討論區,非常報歉,所以再貼一次。 目前手邊有四個元件,但這只適合DELPHI 3,不過有SOURCE,但是裝在DELPHI 5時將元件放在FORM上時有ERROR,不知如何解決,可否請版主幫個忙。 其中STATCTRL,OMENU 皆繼承自MWCUCOCO這個元件並使用COLORBUTTON元件。 不知道方不方便E-MAIL這些元件給版主您,如果可以的話請告訴我。 kcdavid346@msn.com
|
Justmade
版主 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
引言: 你可否先 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 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
引言: 你在 TStatCtrl = Class(...) ... private ... public ... published ...但是在程式裡沒有這一句?? 以下是兩個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 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
|
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
|
Justmade
版主 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
引言: 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 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
引言:確定只有一份vcl後照這方法做結果一樣。我在上載區有一份vcl,不知道您有沒有看到。 如果我要產生一樣的vcl要如何做呢?因為New Component的方式產生出來的vcl都沒有Form。引言: 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 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
引言: 甚麼叫 "確定只有一份vcl" ? 你現在的情況明顯是系統仍在使用未更改前的 STATCTRLS.DCU 因為更改後的元件根本原全沒OldCreateOrder這個字眼了你認為Delphi可以從無變有嗎? 你也可以開啟 C:\Program Files\Borland\Delphi5\Lib\dclusr.dpk 看看到底你在用的 STATCTRLS 在那裡 及重新 Compile 元件終於可了。謝謝版主的指導。 順便請教如果要產生一個有form的component要如何做呢? |
danny
版主 發表:100 回覆:522 積分:595 註冊:2002-03-11 發送簡訊給我 |
|
kcdavid346
一般會員 發表:4 回覆:9 積分:2 註冊:2002-09-06 發送簡訊給我 |
|
Justmade
版主 發表:94 回覆:1934 積分:2030 註冊:2003-03-12 發送簡訊給我 |
引言: 請教之前討論的元件目前已可以使用,但是用New Application時元件面板會消失。我在安裝元件時有將所有的程式都close,但還是會消失,why??我從沒在 D5 見過這種情形,在 D6/D7 元件有分 VCL / CLX 在不同的 Application 有些不能用的元件會消失 引言: 順便請教如果要產生一個有form的component要如何做呢?用TFrame 罷,有大部份 Form 的功能,可像 Form 獨立顯示,也可加入其他元件合成新元件放在元件頁上。 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |