Einzelnen Beitrag anzeigen

hansklok

Registriert seit: 14. Apr 2004
Ort: Karlsruhe
318 Beiträge
 
Delphi 2010 Architect
 
#15

AW: konzeptionelle Gedanken optische Darstellung Stammbaum

  Alt 5. Aug 2015, 18:06
Wenn ich mir das Bild so anschaue, dann kann man die Daten zu dieser Anzeige hiermit abbilden (die Bilder habe ich jetzt mal weggelassen):
Delphi-Quellcode:
unit Unit2;

interface

uses
  System.Generics.Collections;

type
  TLocationDateTime = record
    Location: string;
    Timestamp: TDateTime;
  end;

  TPersonViewModel = class
  private
    FID: TGUID;
    FLastName: string;
    FFirstName: string;
    FBorn: TLocationDateTime;
    FDied: TLocationDateTime;
  public
    property ID: TGUID read FID write FID;
    property LastName: string read FLastName;
    property FirstName: string read FFirstName;
    property Born: TLocationDateTime read FBorn;
    property Died: TLocationDateTime read FDied;
  end;

  TParentViewModel = class( TPersonViewModel )
  private
    FFather: TPersonViewModel;
    FMother: TPersonViewModel;
  public
    property Father: TPersonViewModel read FFather;
    property Mother: TPersonViewModel read FMother;
  end;

  TChildViewModel = class( TPersonViewModel )
  private
    FEngagedTo: TList<TPersonViewModel>;
  public
    property EngagedTo: TList<TPersonViewModel> read FEngagedTo;
  end;

  TRelationViewModel = class( TPersonViewModel )
  private
    FChildren: TList<TChildViewModel>;
  public
    property Children: TList<TChildViewModel> read FChildren;
  end;

  TSelectedPersonViewModel = class( TPersonViewModel )
  private
    FFather: TParentViewModel;
    FMother: TParentViewModel;
    FRelations: TList<TRelationViewModel>;
    FSiblings: TList<TChildViewModel>;
  public
    property Father: TParentViewModel read FFather;
    property Mother: TParentViewModel read FMother;
    property Siblings: TList<TChildViewModel> read FSiblings;
    property Relations: TList<TRelationViewModel> read FRelations;
  end;

implementation

end.
Genau Rufo, dein Entwurf ist sehr gut nachvollziehbar und Bilder genau das ab, worum es mir ging. Dankeschön.
Bleibt nach wie vor zu klären, wie man den Baum "günstig" grafisch in einer Paintbox ausgibt, sodass er sich auch scrollen lässt (Zoom wäre natürlich super). und, wie lässt es sich umsetzen, bei so einem verschachtelten Modell, dass jeder Eintrag sich auf der Zeichenfläche anklicken lässt?

P.S. Was macht EngagedTo?
  Mit Zitat antworten Zitat