Autor Beitrag
NeoInDerMATRIX
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: So 01.05.05 00:22 
Hi,

ich habe eine Abgeleitete Klasse von tForm die natürlich auch Ereignise Implementiert. Das möchte ich nun natürlich auch aus der Delphi IDE heraus benutzen könne. Der source geht soweit, allerdings werden meine neuen Ereignisse nicht im ObjectInspekter mit angezeigt. Nun die Frage an auch ob ihr wisst wie ich das nun erledigen kann.
Wenn ihr dazu den aktuellen source benötigt den ich zur zeit habe, dann sagt bescheid.

Cu
Neo
hansa
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3079
Erhaltene Danke: 9



BeitragVerfasst: So 01.05.05 00:34 
Ja, präsentiere mal den Source. TForm ist nämlich nur bedingt mit "Komponenten" zu vergleichen.

_________________
Gruß
Hansa
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: So 01.05.05 00:47 
Moin!

1. Hast du den neuen Form Typ im Repository bekannt gemacht?
2. Hast du die Form des neuen Typs dann danach über Datei->Neu->andere im Repository den Typ ausgewählt und unten auch auf "Kopie" und "Ableitung" geachtet?

MfG
Muetze1
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: So 01.05.05 12:06 
Dazu musst du einen eigenen Experten schreiben. Ich hab das auch mal gemacht - ich hab dir mal meine Version davon angehängt. Statt meinem Klassennamen (TStyleForm) musst du natürlich den deiner Form einsetzen...
Diesen Experten musst du dann in ein DesignTime-Package einbinden, das du dann installieren kannst...
Einloggen, um Attachments anzusehen!
_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
Muetze1
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 346



BeitragVerfasst: So 01.05.05 14:18 
Moin!

Also ich habe mit den o.g. beiden schritten noch nie ein Experten gebraucht - klappt alles so einwandfrei.

1. Auf der Form rechtsklick->Anzeigen als Text. Dort dann oben bei "object XXXForm: TXXXForm" das "object" durch "inherited" ersetzen. Danach wieder als Formular anzeigen.
2. Danach einen Rechtsklick auf die Form und "ins Repository einfügen". Dann den aufgehenden Dialog ausfüllen und angeben wo er eingefügt werden soll im Repository.
3. Um deine Form dann zu nutzen, musst du einfach nur Datei->Neu->Andere und die ebend hinzugefügt Form raussuchen und unten "inherited" auswählen und anlegen lassen. Fertig ist das ganze.

(Funktioniert beim Borland C++Builder entsprechend)

MfG
Muetze1

_________________
49 63 68 68 61 62 65 6B 65 69 6E 65 41 68 6E 75 6E 67 21


Zuletzt bearbeitet von Muetze1 am Di 03.05.05 17:46, insgesamt 2-mal bearbeitet
NeoInDerMATRIX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: So 01.05.05 20:46 
Hi,

ich habe nun den Source für den Experten probiert mal hinzuzufügen. Alerdings mosert er nun an der er die *intf.dcu nicht finden kann.
Wo bekomme ich die files für das OTA her?

Thx & Cu
Neo
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 02.05.05 10:21 
user profile iconMuetze1 hat folgendes geschrieben:
Also ich habe mit den o.g. beiden schritten noch nie ein Experten gebraucht - klappt alles so einwandfrei.

1. Auf der Form rechtsklick->Anzeigen als Text. Dort dann oben bei "object XXXForm: TXXXForm" das "object" durch "inherited" ersetzen. Danach wieder als Formular anzeigen.
2. Danach einen Rechtsklick auf die Form und "ins Repository einfügen". Dann den aufgehenden Dialog ausfüllen und angeben wo er eingefügt werden soll im Repository.
3. Um deine Form dann zu nutzen, musst du einfach nur Datei->Neu->Andere und die ebend hinzugefügt Form raussuchen und unten "inherited" auswählen und anlegen lassen. Fertig ist das ganze.

Wenn du zu einer Form aber zusätzliche Properties oder Events hinzufügst, dann scheinen die nachher trotzdem nicht im Objekt-Inspektor auf. Hab das zumindest gerade bei meinem D6 Prof. ausprobiert...

user profile iconNeo_in_der_MATRIX hat folgendes geschrieben:
ich habe nun den Source für den Experten probiert mal hinzuzufügen. Alerdings mosert er nun an der er die *intf.dcu nicht finden kann.
Wo bekomme ich die files für das OTA her?

Deinem Profil entnehm ich, dass du mit D6 Pers. arbeitest - is das richtig? Ich hab das mit D6 Prof gemacht, und es hat problemlos funktioniert, sollte also nicht zu viel Unterschied sein. Wie bist du denn vorgegangen?

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
NeoInDerMATRIX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Mo 02.05.05 20:25 
Hi,

also ich diese dcu's sind auf meine system nicht auffindbar! Ansonsten konnte ich das nicht weiter testen.

Auch die suche im INET ergab nicht wirklich viel informatieveres! Sprich ein Download.

Cu
Neo
NeoInDerMATRIX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Mo 02.05.05 22:37 
Hi,

so ich habe jetzt die nötigen DCU's da, und ich kann nun auch den source ohne fehler übersetzten. Aber leider Kommen keine neuen Properties.
Was mache ich noch falsch, ich kapiere das glaube gerade garnicht

ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
Unit OSDKForms;
{$Include 'Omorphia.config.inc' }
Interface

Uses
  Classes,
  Forms;

Type
  tOSDKFormOnChangeFormFocus = Procedure(Sender: tObject) of Object;
  TOSDKForm = Class;
  TOSDKForm = Class(TCustomForm)
   Constructor Create(AOwner: TComponent); ReIntroduce;
   Destructor Destroy; Override;
  Protected
  Private
   fWert: Integer;
   fOnChangeFormFocus: tOSDKFormOnChangeFormFocus;
  Public
   ...
  Published
   Property Wert: Integer read fWert write fWert;
   Property onChangeFormFocus: tOSDKFormOnChangeFormFocus read fOnChangeFormFocus write fOnChangeFormFocus;
  End;

Procedure Register;

Implementation

Uses
 {$IFDEF DELPHI6_UP}
  DesignIntf,
  DesignEditors,
 {$Else}
  DsgnIntf,
 {$EndIf}
  ExptIntf,
  ToolIntf,
  VirtIntf,
  FileIntF,
  IStreams,
  ToolsAPI,
  Windows,
  SysUtils,
  Controls;

...

// *****************************************************************************
// Delphi IDE Expert Interface
// *****************************************************************************

type
  tOSDKFormExpert = Class(TIExpert)
    Function GetName: String; Override;
    Function GetComment: String; Override;
    Function GetGlyph: hICON; Override;
    Function GetStyle: tExpertStyle; Override;
    Function GetState: tExpertState; Override;
    Function GetIDString: String; Override;
    Function GetAuthor: String; Override;
    Function GetPage: String; Override;
    Function GetMenuText: String; Override;
    Procedure Execute; Override;
  End;

{ TStyleFormExpert }

Function tOSDKFormExpert.GetName: String;
Begin
  Result := 'OSDKForm';
End;

Function tOSDKFormExpert.GetComment: String;
Begin
  Result := 'Omorphia SDK Formular';
End;

Function tOSDKFormExpert.GetGlyph: hICON;
Begin
  Result := LoadIcon(hInstance, '');
End;

Function tOSDKFormExpert.GetStyle: tExpertStyle;
Begin
  Result := esForm;
End;

Function tOSDKFormExpert.GetState: tExpertState;
Begin
  Result := [esEnabled];
End;

Function tOSDKFormExpert.GetIDString: String;
Begin
  Result := 'OSDKForm.Expert';
End;

Function tOSDKFormExpert.GetAuthor: String;
Begin
  Result := 'Neo';
End;

Function tOSDKFormExpert.GetPage: String;
Begin
  Result := 'Omorphia';
End;

Function tOSDKFormExpert.GetMenuText: String;
Begin
  Result := '';
End;

Const
  FormUnitSource =
    'Unit %0:s;'#13#10 +
    #13#10 +
    'Interface'#13#10 +
    #13#10 +
    'Uses Windows, SysUtils, Messages, Classes, Graphics,Controls, OSDKForm;'#13#10 +
    #13#10 +
    'Type'#13#10 +
    '  t%1:s = class(tOSDKForm)'#13#10 +
    '  Private'#13#10 +
    '  Public'#13#10 +
    '  End;'#13#10 +
    #13#10 +
    'Var'#13#10 +
    '  %1:s: t%1:s;'#13#10 +
    #13#10 +
    'Implementation'#13#10 +
    #13#10 +
    '{$R *.DFM}'#13#10 +
    #13#10 +
    'END.'#13#10;

  FormDfmSource = 'object %s: T%0:s end';

Procedure tOSDKFormExpert.Execute;
Var
  UnitIdent, Filename: String;
  FormName: String;
  CodeStream: TStreamAdapter;
  DFMStream: TStreamAdapter;
  DFMString: TStringStream;
  DFMVCLStream: TMemoryStream;
Begin
  If not ToolServices.GetNewModuleName(UnitIdent, FileName) Then
    Exit;

  FormName := 'StyleForm' + Copy(UnitIdent, 5, 255);
  CodeStream := TStreamAdapter.Create(TStringStream.Create(Format(FormUnitSource, [UnitIdent, FormName])));
  DFMString := TStringStream.Create(Format(FormDfmSource,[FormName]));
  Try
    DFMVCLStream := TMemoryStream.Create;
    Try
      ObjectTextToResource(DFMString, DFMVCLStream);
      DFMVCLStream.Position := 0;
      DFMStream := TStreamAdapter.Create(DFMVCLStream);
    Except
      DFMVCLStream.Free;
    End;
    ToolServices.CreateModuleEx(FileName, FormName, 'TStyleForm', '', CodeStream, DFMStream,
      [cmAddToProject, cmShowSource, cmShowForm, cmUnNamed, cmMarkModified]);
  Finally
    DFMString.Free;
  End;
End;

Procedure Register;
Begin
  RegisterCustomModule(tOSDKForm, TCustomModule);
  RegisterLibraryExpert(tOSDKFormExpert.Create);
End;


Initialization

Finalization

End.


Was mache ich den nun falsch, gebt mir mal nen trit damit ich sehe wo der fehler ist.

Thx & Cu
Neo
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mo 02.05.05 22:42 
Hast du das ganze denn in ein DesignTime-Package gepackt??

BTW: in der Execute-Methode gehören die StyleForm-Strings auch noch durch deinen Klassennamen ersetzt..!

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
NeoInDerMATRIX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Di 03.05.05 08:06 
Hi,

also das mit dem DesigneTime hatte ich vergessen. Nun Werden aber nicht mehr alle Propertys der Ordinal Klasse angezeigt? Und wie kann ich zur DesignTime auf bestimmte sachen reagieren?

Cu
Neo
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 03.05.05 10:56 
user profile iconNeo_in_der_MATRIX hat folgendes geschrieben:
Und wie kann ich zur DesignTime auf bestimmte sachen reagieren?

Wie meinst du das..? :gruebel:

Ich mach dir einen Vorschlag - schick mir die Unit mit deiner Form, ich mach dir deinen Experten, erstell dir deine Packages und häng sie dir da an.

Gruß, Motzi

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
NeoInDerMATRIX Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 245

Win95, Win98(+se), WinNT, Win2000, WinME, WinXP(+pro), VISTA, Linux(SuSe), DOS [MultiMon(3)], Vista
D6 PeE + (FP 2.0l) + D3 Pe + D2005+ D2006 Arch
BeitragVerfasst: Di 03.05.05 11:03 
Hi,

@Motzi: Bitte sei mir nicht bösse aber ich will es mir nicht coden lassen. Dabe lehrne ich ja nichts!

Ich habe es jetzt hin bekommen das ich meine eigene Form im ObjectInspector angezeigt bekomme. Auch Ereignisse und os!
Nur eine sache stört mich noch! Und zwar wenn ich nun eine Neue Form von meiner erstelle dann wird mir zwar eine angezeigt, aber die wird mir oben links am bildrand geklatscht und hat keine vorbelegten werte wie man es gewohnt ist. Und das ist nun das was mich noch interessiert. Wie kann ich bestimmte werte vor belegen?

Thx & Cu
Neo
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Di 03.05.05 11:14 
Ich bin dir nicht bös, im Gegenteil - so erspar ich mir Arbeit! ;)
Kannst du mal alles was du jetzt gemacht hast (Form, Experte, Packages) in ein zip-File packen und da anhängen? Dann schau ich mir das mal an.. is schon länger her, dass ich damals meine Form gemacht hab, weiß also nicht mehr so genau auf was aufpassen muss, muss mir das erst selber wieder anschaun...

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Di 03.05.05 17:41 
@Neo: Mach mal ein Override auf AfterConstruction. Danach auf csDesigning in ComponentState prüfen un deine Standards vorgeben. Sollte IMHO so funzen.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.