Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > FireMonkey
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 06-07-2018
el-mono el-mono is offline
Miembro
 
Registrado: abr 2008
Ubicación: Lules
Posts: 176
Poder: 16
el-mono Va por buen camino
Material Design TextFields con Firemonkey

Hola Gente les comparto un poco de código que descubrí en https://www.youtube.com/watch?v=6J9qKvPfbiI



Lo que hace este codigo es que en nuestras aplicaciones Firemonkey nuestros TEdit se comporten como dicta Material Design.


Dejo adjunto mi codigo para que jueguen un poco.

Código Delphi [-]
unit Unit7;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  FMX.Controls.Presentation, FMX.Edit, FMX.StdCtrls;

type  THelperObject = Class Helper for TFMXObject
  Public
   procedure Caption(Desc: String);
End;



type
  TForm7 = class(TForm)
    Edit1: TEdit;
    StyleBook1: TStyleBook;
    Edit2: TEdit;
    Edit3: TEdit;
    Edit4: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure Edit1Enter(Sender: TObject);
    procedure Edit1Exit(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form7: TForm7;

implementation

{$R *.fmx}

{ THelperObject }

procedure THelperObject.Caption(Desc: String);
 var
   lbl :Tlabel;
begin
    lbl := TLabel.create(Self);
    lbl.Text := desc;
    lbl.Name := 'Label'+ self.Name;
    lbl.StyledSettings := [TstyledSetting.Family];
    lbl.Position.X := 3;
    lbl.Position.Y := 0;
    lbl.TextSettings.Font.Size := 18;
    lbl.TextSettings.FontColor := Talphacolors.Darkgrey;
    lbl.Parent := self;

end;

procedure TForm7.Edit1Enter(Sender: TObject);
var
  runlbl: Tlabel;
begin
  if (Sender as TEdit).text = '' then
    begin
      runlbl := Tlabel((Sender as TEdit).FindComponent('Label' + (Sender as TEdit).Name ));
      runlbl.AnimateFloat('Font.Size',9,0.1, TAnimationtype.InOut,tinterpolationType.Linear);
      runlbl.AnimateFloat('Position.y',-16,0.1, TanimationType.InOut, TInterpolationType.Linear );
      runlbl.FontColor := TAlphacolors.Blue;
    end;

end;

procedure TForm7.Edit1Exit(Sender: TObject);
var
  runlbl: Tlabel;
begin
  if (Sender as TEdit).text = '' then
    begin
      runlbl := Tlabel((Sender as TEdit).FindComponent('Label' + (Sender as TEdit).Name ));
      runlbl.AnimateFloat('Font.Size',14,0.1, TAnimationtype.InOut,tinterpolationType.Linear);
      runlbl.AnimateFloat('Position.y',3,0.1, TanimationType.InOut, TInterpolationType.Linear );
      runlbl.FontColor := TAlphacolors.Black;
    end;


end;

procedure TForm7.FormCreate(Sender: TObject);
begin
  Edit1.Caption('Nombre');
  Edit2.Caption('Domicilio');
  Edit3.Caption('Telefono');
  Edit4.Caption('Email');

end;

end.


Lo que buscamos conseguir:

https://material.io/design/components/text-fields.html#
Responder Con Cita
  #2  
Antiguo 06-07-2018
Avatar de ElKurgan
[ElKurgan] ElKurgan is offline
Miembro Premium
 
Registrado: nov 2005
Posts: 1.232
Poder: 20
ElKurgan Va camino a la fama
Thumbs up

Gracias por el aporte

Saludos
Responder Con Cita
Respuesta


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
¿Dónde conseguir componentes para Firemonkey? ¿Cómo véis a Firemonkey? dec FireMonkey 27 08-10-2016 18:49:19
Problemas con el responsive web design elsamurai HTML, Javascript y otros 2 18-12-2013 20:01:17
In Design: Control no has parent window Negegoca Varios 1 26-01-2007 18:26:36
Design Tab desaparece en ASP.NET edalmasso .NET 0 05-12-2006 21:22:02
dxWinXPBar de (Design eXperience II) olbeup Varios 0 17-08-2005 19:42:07


La franja horaria es GMT +2. Ahora son las 22:06:58.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi