Autor Beitrag
huhn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 272
Erhaltene Danke: 1

WIN XP
D7Pers
BeitragVerfasst: Mo 19.06.06 21:35 
Hi leute!
ich bin gerade dabei ein bischen die Jedi Plugin-Komponente zu testen. Ich habe selbst schon mal ein Pluginsystem geschrieben das ziemlich aufwendig geworden ist und so wollt ich eben das mal von Jedi testen. Mein problem ist: "Wie kann ich in meiner Form den Frame der in dem Plugin ist anzeigen?". Die Beispiele hab ich mir schon angeschaut, leider war keines mit einem Frame dabei, sondern nur mit MDIChild (was ich nicht nehmen möchte). Bei meinen Plugin system musste ich das Parent meiner Form übergeben damit der Frame angezeigt werden konnte. Doch wo oder wie mach ich das bei der Kompo von Jedi?
Mein bisherigen Versuche waren nicht sehr erfolgreich...
Ich hoffe ein paar haben damit auch schon gearbeitet und können mir eine schnelle antwort geben.
Ich dank euch schonmal wenn ihr das durchgelesen habt ;)

mfg huhn

ps:wenn einer ein quellcodeschnipsel dazu hat kann er ihn ruhig posten, des kann man immer gebrauchen.

_________________
Quod Erat Demonstrandum-Was zu beweisen war! *THX to Chrissivo!*
huhn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 272
Erhaltene Danke: 1

WIN XP
D7Pers
BeitragVerfasst: Mi 21.06.06 15:53 
Nochmal hochschieb^^

_________________
Quod Erat Demonstrandum-Was zu beweisen war! *THX to Chrissivo!*
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mi 21.06.06 17:22 
also ohne die PlugIn Kompo zu kennen hätte ich mal folgende Idee:
Wenn du MDI Childs anzeigen lassen kannst, dann kannst du auch ein normales Formular zurückgeben lassen, oder ?

Und man kann auch andere Kontrollelemente als Parent für Formulare fungieren lassen. Also z.b.
ausblenden Delphi-Quelltext
1:
PluginForm.parent := panel1;					

Mithilfe dieses Codes wird das PlugInForm im Panel1 angezeigt.

Wie gesagt, ich kenne die Kompo nicht, du hast keinerlei Code gepostet, da kann man nur ratem und allgemeine Tipps geben.
huhn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 272
Erhaltene Danke: 1

WIN XP
D7Pers
BeitragVerfasst: Mi 21.06.06 21:26 
das hab ich auch probiert^^
seltsamerweise hat dies nicht geklappt...bei meinen selbstgeschriebenen system funktionierte es
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:
unit PluginJWPlugin;

interface

uses
  Windows, Messages, SysUtils, Classes, Dialogs, Forms, Controls,
  JvPlugin, FramePlugIn, Graphics, stdctrls;

type
  TPluginJWPlugin = class(TJvPlugin)
    procedure JvPlugInInitialize(Sender: TObject; var AllowLoad: Boolean);
    procedure JvPlugInDestroy(Sender: TObject);
  private
    { Private declarations }
    fr:TFrame1; //ein gemachter Frame, den ich integrieren wollte
    fr2:TFrame; //erstmal klein anfangen^^
  public
    { Public declarations }
  end;

function RegisterPlugin: TJvPlugin; stdcall;

implementation

{$R *.dfm}

// IMPORTANT NOTE: If you change the name of the Plugin container,
// you must set the type below to the same type. (Delphi changes
// the declaration, but not the procedure itself. Both the return
// type and the type created must be the same as the declared type above.
function RegisterPlugin: TJvPlugin;
begin
  Result := TPluginJWPlugin.Create(nil);
end;

procedure TPluginJWPlugin.JvPlugInInitialize(Sender: TObject;
  var AllowLoad: Boolean);
var
  wnd: HWND;
begin
  wnd :=  FindWindow('TForm1', 'Form1'); //um an das handel der Main Form zu kommen
  wnd :=  FindWindowEx(wnd, 0, 'TPanel', nil); //für das Panel
  if wnd <> 0 then
  begin
    try
    fr2:=TFrame.Create(nil);
    fr2.Parent:=FindControl(wnd); //TWinControl
    Fr2.ParentFont:=false;
    fr2.Align:=alClient;
    fr2.Color:=Clred;
    ShowWindow(Fr.Handle,SW_SHOW); 
    //fr2.Show; //keine fehlermeldung, auch keine wirkung
    except
      showmessage('errör intern^^');
    end;
  end
  else showmessage('errör, handel existiert nicht!');
                             
    showmessage('asd initialize');
end;

procedure TPluginJWPlugin.JvPlugInDestroy(Sender: TObject);
begin
  fr.Free;
end;

end.



mfg huhn

_________________
Quod Erat Demonstrandum-Was zu beweisen war! *THX to Chrissivo!*
huhn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 272
Erhaltene Danke: 1

WIN XP
D7Pers
BeitragVerfasst: Fr 23.06.06 12:50 
Keiner ne Ideee

_________________
Quod Erat Demonstrandum-Was zu beweisen war! *THX to Chrissivo!*