Autor Beitrag
Patriol
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52


D3, D5, D7
BeitragVerfasst: Di 02.11.04 22:42 
Hey jo,

ich habe zur zeit n prob was mich an der entwicklung meines programms an dem ich gerade schreibe ziehmlich behindert.
da mein program aus mehreren "modulen" bestehen soll habe ich mir überlegt für jedes modul ein hauptform anzulegen (zwecks übersichtlichkeit). da ich aber die forms nicht einfach einzeln aufrufen möchte (z.b. mit showmodal) und diese auch in einer gewissen weise im "absoluten hauptform" angezeigt werden sollen habe ich im "absoluten hauptform" panels angeordnet in denen die entsprechenden forms geladen werden sollen.
hat jemand irgend eine idee wie ich es realisieren kann, dass ein form im bereich eines panels angezeigt wird? ich habe dies schon mal irgendwo gesehen, hab leider nur keinen blassen schimmer wie man das macht.

ich wäre für jede idee sehr dankbar!

Patriol
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Di 02.11.04 22:55 
Servus,

Probier's mal so ungefähr:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
begin
 panelform.borderstyle := bsnone;  // Wenn du deine Form mit Rahmen anzeigen willst dann lösche die zeile...
 panelform.visible := true;
 panelform.left := hauptform.left + panel.left + 5;  //...und das +5
 panelform.top := hauptform.top + panel.top + 20;    //... und das +20
 panelform.formstyle := fsstayontop;
 panelform.width := panel.width;
 panelform.height := panel.height;
end;


Das sollte alles soweit sein, wird dann aber wohl ziemlich unsauber je mehr Code kommt ;)
Deswegen würde ich das alles noch in ne Function packen.
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Di 02.11.04 23:29 
Also das was du willst geht schon, ist allerdings etwas kompliziert. Die Variante mit einem Formular das in ein Panel eingefügt werden soll ist möglich, allerdings würde ich es nur dann so machen, wenn ich mein Formular in irgend anderes Programm einfügen muß.

Wie ich sehe hast du Delphi 7. Da gibt es die Frame-Fenster. Die kannst du wie normale Fenster beachten. Allerdings kannst die diese Frame-Fenster in einem anderen Fenster anzeigen lassen.

_________________
Gruß
Martin
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mi 03.11.04 00:22 
Zitat:
Also das was du willst geht schon, ist allerdings etwas kompliziert.
find ich eigentlich nich:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
 
with [DeineForm] do 
begin
 ParentWindow := [DeinPanel].handle;
 BorderStyle := bsNone;
 Top := 0;
 Left := 0;
 Width := [DeinPanel].Width;
 Height := [DeinPanel].height;
 Show;
end;

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
MartinPb
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 698



BeitragVerfasst: Mi 03.11.04 00:39 
Na und? Soll ich jetzt begeistert sein? Das Frame-Fenster kriege ich mit einem Mausklick rein.

_________________
Gruß
Martin
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mi 03.11.04 15:29 
Zitat:
Na und? Soll ich jetzt begeistert sein? Das Frame-Fenster kriege ich mit einem Mausklick rein.
Hallo? Hab ich dir irgendwas getan, oder was? :shock:

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
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 03.11.04 15:46 
hey, jetzt bleib mal ganz cool !!

ich denke mal, das hauptsächliche problem ist, ein form, das in einer DLL gespeichert ist da einzubinden, richtig ?

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 03.11.04 16:13 
also leute ich finds ein bisschen unverschämt dass ihr meinen Post einfach ignoriert , zumal GSE fast das gleiche gepostet hat wie ich.
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Mi 03.11.04 18:00 
Zitat:
zumal GSE fast das gleiche gepostet hat wie ich
aber eben nur fast :wink:
du "legst" das Fenster ja über das Panel und ich "legs" rein (-> bewegt sich von allein mit Panel mit)

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Mi 03.11.04 18:34 
Jo ein Buchstabe kann viel entscheiden. :twisted: Habs grad nochmal getestet, hast Recht.
Patriol Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52


D3, D5, D7
BeitragVerfasst: Mi 03.11.04 21:52 
ok danke leutz, ich glaube damit kann ich erstmal was anfangen. werd wahrscheinlich die variante mit den frames nehmen. hab da heute auch noch mal jemand gefragt und der hat mir das mal grob gezeigt, wie ich frames in nen panel lade.
SchelmVomElm
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 154

W2K Pro
D5 Pro
BeitragVerfasst: Fr 05.11.04 14:35 
Hi, ich fand die Idee von GSE gut und wollte sie einsetzen - mich persönlich nerven Frames!

Ich hab also GSE's Code ein wenig verfeinert :

ausblenden volle Höhe 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:
procedure ClipForm(Form: TForm; TargetControl: TWinControl);
begin
  with Form do
  begin
     Parent := TargetControl;
     BorderStyle := bsNone;
     Top := 0;
     Left := 0;
     Width := TargetControl.ClientWidth;
     Height := TargetControl.ClientHeight;
     Align := alClient;
     Show;
  end;
end;

procedure UnclipForm(Form: TForm; BorderStyle: TBorderStyle; Width,Height,Left,Top: integer);  overload;
begin
  Form.BorderStyle := BorderStyle;
  Form.Align := alNone;
  Form.Height := Height;
  Form.Width := Width;
  Form.Left := Left;
  Form.Top := Top;
  Form.Parent := nil;
  Form.Show;
end;

procedure UnclipForm(Form: TForm); overload;
var Width, Height, Left, Top: integer;
begin
  Width := Form.Width;
  Height := Form.Height;
  Left := (Screen.DesktopWidth - Width) div 2;  //Desktop Center
  Top := (Screen.DesktopHeight - Height) div 2;
  UnclipForm(Form,bsSingle,Width,Height,Left,Top); //Hier bsSizeable
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
  //UnclipForm(Form2,bsSingle,300,300,300,300);
  UnclipForm(Form2);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
  ClipForm(Form2,Panel1);
end;


Seltsam ist, dass wenn ich die Funktion UnclipForm mit bsSizeable aufrufe,
bekomme ich den Fehler : "Konstantenausdruck verletzt untere Grenzen" :?:

_________________
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);
GSE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 740

Win 2k, Win XP Pro
D5 Prof, D6 Ent, D2k5 PE
BeitragVerfasst: Fr 05.11.04 15:46 
versuch mal als erstes das parent auf nil zu setzen, bevor du den Style setzt

mfg
GSE

_________________
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs
and the universe trying to produce bigger and better idiots. So far, the universe is winning. (Richard Cook)
SchelmVomElm
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 154

W2K Pro
D5 Pro
BeitragVerfasst: Sa 06.11.04 20:39 
Nö, das hilft nicht - im Gegenteil, wenn ich Parent auf nil setze, bevor ich Align auf alNone setze, gibts Flimmern. Aber der Constructor des Forms ist ja auch schon längst aufgerufen, also sollte ich auch alle Eigenschaften setzen können...

:? Hm - ich hab gerade echt ein Brett vorm Kopf glaub ich...

_________________
for(;P("\n"),R--;P("|"))for(e=C;e--;P("_"+(*u++/8)%2))P("|"+(*u/4)%2);