Einzelnen Beitrag anzeigen

messie

Registriert seit: 2. Mär 2005
Ort: Göttingen
1.592 Beiträge
 
Delphi 2009 Professional
 
#24

Re: Nicht nur Form vergrößern, sondern auch Elemente

  Alt 12. Okt 2006, 19:27
Sooo, ich habe mal
Delphi-Quellcode:
if (FComponent = nil)
           or
           (FComponent.Align = alClient)
        then Exit;
durch
Delphi-Quellcode:
if FComponent = nil then exit;
        if FComponent.Align = alClient then
        begin
          if FHasFontProp then
          begin
            NewFontSize := InitFontSize;
            FCompFont.Size := NewFontSize;
            SetCompFont(Component, FCompFont);
          end;
          if (Round(OwnerHeight) = InitOwnerHeight) and
             (Round(OwnerWidth) = InitOwnerWidth) then
          begin
            if FHasFontProp then
            begin
              NewFontSize := InitFontSize;
              FCompFont.Size := NewFontSize;
              SetCompFont(Component, FCompFont);
            end;
          end
          else
          begin
            if FHasFontProp then
            begin
              NewFontSize := Round(InitFontSize * HeightRatio - 0.5);
              if NewFontSize > FSglMaxFontSize then NewFontSize := FSglMaxFontSize;
              if NewFontSize < FSglMinFontSize then NewFontSize := FSglMinFontSize;
              FCompFont.Size := NewFontSize;
              SetCompFont(Component,FCompFont);
            end;
          end;
          FComponent.Align := alClient;
          FComponent.Repaint;
          Application.ProcessMessages;
          Exit;
        end;
ersetzt. Jetzt wird die Schriftgröße so angepaßt wie bei den anderen Controls. Wenn alclient zu sehr großen Änderungen des Controls führt, wird das natürlich nicht optimal. Aber das soll die Kompo ja eigentlich durch die Skalierung verhindern.
Es bleibt noch ein Problem: ich habe zwei Elemente, die albottom sind, ein Panel und einen Statusbar. Nach ResizeAll wird der Statusbar über das Panel gesetzt. Dies passiert nur, wenn das Form ein untergeordnetes ist! In einem Testprojekt lief das glatt solange ich im MainForm war...

Trotzdem meiner Meinung nach ein sehr gutes Projekt was die Weiterentwicklung auch berechtigt

Grüße, Messie
  Mit Zitat antworten Zitat