Autor Beitrag
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Fr 24.03.06 09:40 
Wie kann ich im Menü "Fenster" mir die Fensterliste reingeben(Bei einer MDI anwendung die Childfensterliste)? ich habs mit WindowMenu probiert aber das funkt nicht ganz!Brauch ich da nen zusatz (irgenwas dazuprogrammieren oder so?)?

mfg el

P.S: in der suche hab ich schon nachgesehen aber nix gefunden!!!
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Fr 24.03.06 13:04 
Moin :-)

Eine Idee wäre z.B. folgendes im Oncreate des jeweiligen ChildFensters:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TChildForm.FormCreate(Sender: TObject);
var NewItem: TMenuItem;
begin
  NewItem := TMenuItem.Create(frmMain.Fenster1);
  NewItem.Caption := IntToStr(frmMain.Fenster1.Count+1) + ' - ' + Caption;
  frmMain.Fenster1.Add(NewItem);
end;


Fenster1 -> Menüpunkt im HauptFormular frmMain
Caption -> Fenstertitel des Childs

Im OnClose des Childs muss natürlich der Menüpunkt wieder gelöscht werden:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TChildForm.FormClose(Sender: TObject;
  var Action: TCloseAction);
  var i: Integer;
begin
  Action := caFree;
  for i := 0 to frmMain.Fenster1.Count -1 do
    if Pos(Caption,frmMain.Fenster1.Items[i].Caption)>0 then
      begin
        frmMain.Fenster1.Items[i].Free; //löschen und Speicher freigeben
        break;
  end;
end;
elundril Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 28.03.06 11:15 
ok!! thx!! und wie funktioniert das mir einer Fensterleiste?? (Panel mit Buttons!! für jedes Fenster einen!!!)
mfg mike
raiguen
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 374

WIN 2000prof, WIN XP prof
D7EP, MSSQL, ABSDB
BeitragVerfasst: Di 28.03.06 16:29 
Moin :-)
Im Prinzip so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
....
var NewButton: TSpeedButton;
begin
          NewButton := TSpeedButton.Create(frmMain.Panel1);
          NewButton.Parent := frmMain.Panel1;
          NewButton.Name := 'sbtnChild'+Caption;
          //NewButton.Flat := True;
          NewButton.Width := 80;
          NewButton.Left := 10 + i*80;
          NewButton.Caption := Caption;
end;

Breite und Position entsprechend anpassen ;-)
elundril Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Di 28.03.06 16:48 
thx ich werds versuchen

mfg el