Einzelnen Beitrag anzeigen

Glados
(Gast)

n/a Beiträge
 
#17

AW: Panel geschmeidig ein- und ausblenden?

  Alt 16. Sep 2017, 23:41
Was denkst du denn über meine Änderung oben? Ich poste es hier unten noch einmal sauber neu:

Delphi-Quellcode:
Button
var
 C, D: Cardinal;
const
 Duration = 3000;
 POS_START = 200; // Größe eingeklappt
 POS_END = 500; // Größe ausgeklappt
begin
 C := GetTickCount;
 D := 0;
 if Height >= POS_END then
  begin
   // > ÄNDERUNG
   POS_END := POS_END - POS_START - (POS_END - Height);
   POS_START := Height;
   // < ÄNDERUNG

   while (D < Duration) do
    begin
     Height := POS_START - Round(POS_END * QuintEasing(D, Duration));
     Application.ProcessMessages;
     D := GetTickCount - C;
    end;

   Caption := '1. ' + Height.ToString;
  end
 else
  begin
   // > ÄNDERUNG
   POS_START := Height;
   POS_END := POS_END - POS_START;
   // < ÄNDERUNG

   while (D < Duration) do
    begin
     Height := POS_START + Round(POS_END * QuintEasing(D, Duration));
     Application.ProcessMessages;
     D := GetTickCount - C;
    end;

   Caption := '2. ' + Height.ToString;
  end;
  Mit Zitat antworten Zitat