Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Mo 29.01.07 21:23 
Bekomme seit neustem am Ende dieser Procedure einen Stack-Überlauf. Warum? Keine Ahnung!
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
procedure TClassDiagram.DrawClassName;
begin
   with FDiagram.Canvas do
    begin
      Pen.Color := clblack;
      Brush.Color := clwhite;
      //Draw only the rectangle for the classname
      Rectangle(0,0,10+GetHighestWidth+10,5+FDiagram.Canvas.TextHeight(FObjectClass.FClassName)+5);
      //Draw the classname in the center of the rectangle
      Font.Style := [fsBold];
      TextOut((FDiagram.Width - FDiagram.Canvas.TextWidth(FObjectClass.FClassname)) div 2,5,FObjectClass.FClassName);
      FHeight_Classname_Rectangle := 5+FDiagram.Canvas.TextHeight(FObjectClass.FClassName)+5;
    end;
end;

Klar, ihr kennt die Klassen nicht. Nur: Soll ich die ernsthaft hier alle posten? Deswegen kann ich mir schon denken, dass ihr aus diesem Codeschnipsel nicht sonderlich schlau werdet. ;)
Aber mal sehen. :P

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: Mo 29.01.07 21:26 
Das sieht nach einer Rekursion ohne Abbruchbedingung aus, kann das sein?
Die Methode, die die gepostete aufruft, wäre interessant zu sehen ;)

Gruß
alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Di 30.01.07 15:49 
Hier:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
function TClassDiagram.GetData: TBitmap;
begin
  //just temporary!
  FDiagram.Width := 10+GetHighestWidth+10;
  FDiagram.Height := 5+FDiagram.Canvas.TextHeight(FObjectClass.FClassName)+5;
  DrawClassName;
  if (FObjectClass.Attributes.Count > 0) then
    DrawAttributes;
  result := FDiagram;
end;

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot