AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

TGrid in FM mit Daten füllen

Ein Thema von Peter-Pascal · begonnen am 18. Jan 2014 · letzter Beitrag vom 27. Jan 2014
Antwort Antwort
Peter-Pascal

Registriert seit: 18. Feb 2007
Ort: 32139 Spenge
200 Beiträge
 
Delphi 11 Alexandria
 
#1

AW: TGrid in FM mit Daten füllen

  Alt 23. Jan 2014, 20:34
Heureka,

das funktioniert soweit bei FMX mit HD. Und dann sieht es auch ganz gut aus.

Vielen Dank.

Ich bin jetzt auch angefangen, mir die Sourcen anzuschauen. Ich glaube dadurch bekomme ich dann doch vielleicht mehr Verständnis von FMX. Ob es die richtige Entscheidung ist Metropolis UI zu verwenden, weiß ich nicht. Bislang hat mich allein nur herauszufinden, welche Komponente für die Darstellung einer Zeitleiste in Betracht kommt, ein paar Wochenenden gekostet.

Leider ist das bei Metropolis offenbar alles anders. Die Standardgesten funktionieren in Metropolis nicht. In FMX bekomme ich das alles sauber hin.

Gruß Peter
Peter Niemeier

Geändert von Peter-Pascal (23. Jan 2014 um 22:04 Uhr)
  Mit Zitat antworten Zitat
Volker Z.

Registriert seit: 3. Dez 2012
Ort: Augsburg, Bayern, Süddeutschland
419 Beiträge
 
Delphi XE4 Ultimate
 
#2

AW: TGrid in FM mit Daten füllen

  Alt 23. Jan 2014, 23:31
Hallo,

Zitat:
Leider ist das bei Metropolis offenbar alles anders. Die Standardgesten funktionieren in Metropolis nicht. In FMX bekomme ich das alles sauber hin.
Was hakt denn da genau? Ich habe das Beispiel aus Post #15 als FireMokey-Anwendung für Metropolis-UI Delphi (Leere Metropolis-UI-Anwendung) erstellt. Machst Du noch was im FormGesture?

Gruß
Volker Zeller
  Mit Zitat antworten Zitat
Peter-Pascal

Registriert seit: 18. Feb 2007
Ort: 32139 Spenge
200 Beiträge
 
Delphi 11 Alexandria
 
#3

AW: TGrid in FM mit Daten füllen

  Alt 24. Jan 2014, 09:29
Es ist mir peinlich, aber bei mir funktioniert es in Metropolis FMX nicht. Unter "Normal-" FMX schon.

Delphi-Quellcode:
unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs, FMX.Ani, FMX.Layouts, FMX.Gestures,
  FMX.StdCtrls;

type

 TScrollBox = class (FMX.Layouts.TScrollBox)

   end;

  TForm1 = class(TForm)
    StyleBook1: TStyleBook;
    ToolbarHolder: TLayout;
    ToolbarPopup: TPopup;
    ToolbarPopupAnimation: TFloatAnimation;
    ToolBar1: TToolBar;
    ToolbarApplyButton: TButton;
    ToolbarCloseButton: TButton;
    ToolbarAddButton: TButton;
    ScrollBox1: TScrollBox;
    Panel1: TPanel;
    GestureManager1: TGestureManager;
    procedure ToolbarCloseButtonClick(Sender: TObject);
    procedure FormGesture(Sender: TObject;
      const EventInfo: TGestureEventInfo; var Handled: Boolean);
    procedure FormKeyDown(Sender: TObject; var Key: Word; var KeyChar: Char;
      Shift: TShiftState);
    procedure ScrollBox1Gesture(Sender: TObject;
      const EventInfo: TGestureEventInfo; var Handled: Boolean);
  private
    FGestureOrigin: TPointF;
    FGestureInProgress: Boolean;
    { Private-Deklarationen }
    procedure ShowToolbar(AShow: Boolean);
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  var KeyChar: Char; Shift: TShiftState);
begin
  if Key = vkEscape then
    ShowToolbar(not ToolbarPopup.IsOpen);
end;

procedure TForm1.ToolbarCloseButtonClick(Sender: TObject);
begin
  Application.Terminate;
end;

procedure TForm1.FormGesture(Sender: TObject;
  const EventInfo: TGestureEventInfo; var Handled: Boolean);
var
  DX, DY : Single;
begin
showmessage('Hello World');
  if EventInfo.GestureID = igiPan then
  begin
    if (TInteractiveGestureFlag.gfBegin in EventInfo.Flags)
      and ((Sender = ToolbarPopup)
        or (EventInfo.Location.Y > (ClientHeight - 70))) then
    begin
      FGestureOrigin := EventInfo.Location;
      FGestureInProgress := True;
    end;

    if FGestureInProgress and (TInteractiveGestureFlag.gfEnd in EventInfo.Flags) then
    begin
      FGestureInProgress := False;
      DX := EventInfo.Location.X - FGestureOrigin.X;
      DY := EventInfo.Location.Y - FGestureOrigin.Y;
      if (Abs(DY) > Abs(DX)) then
        ShowToolbar(DY < 0);
    end;
  end
end;

procedure TForm1.ScrollBox1Gesture(Sender: TObject;
  const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
showmessage('Hello World');
case EventInfo.GestureID of
     sgiDown : ScrollBox1.ScrollTo (0, -40);
     sgiLeft : ScrollBox1.ScrollTo (-40, 0);
     sgiRight : ScrollBox1.ScrollTo (40, 0);
     sgiUp : ScrollBox1.ScrollTo (0, 40);
   end;
end;

procedure TForm1.ShowToolbar(AShow: Boolean);
begin
  ToolbarPopup.Width := ClientWidth;
  ToolbarPopup.PlacementRectangle.Rect := TRectF.Create(0, ClientHeight-ToolbarPopup.Height, ClientWidth-1, ClientHeight-1);
  ToolbarPopupAnimation.StartValue := ToolbarPopup.Height;
  ToolbarPopupAnimation.StopValue := 0;

  ToolbarPopup.IsOpen := AShow;
end;

end.
Ich habe eine neue Anwendung erstellt: Firemonkey-Anwendung für Metropolis UI Delphi - anschließend Leere Metropolis-UI Anwendung.
Den Gesturemanager habe ich bei der Scrollbox eingehakt.

Gruß
Peter Niemeier
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:19 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz