Fórum Editor de Forms, como o do Delphi, como fazer? #294395
03/09/2005
0
Desde já agradeço
[]s
Titanius
Curtir tópico
+ 0Posts
03/09/2005
Iniciante12345
Aí já deixe criado o form que vai receber os componentes (Form).
Ao clicar no botão Novo Button (BtNovo) ele deve colocar um TButton no form que vai receber os componentes. Ao clicar o código será:
procedure TForm1.BtNovoOnClick(Sender : TObject); Var Button : TButton; begin Button := TButton.Create(Form); with Button do begin Parent := Form; height := 32; width := 128; caption := ´Button1!´; left := (Form.ClientWidth - width) div 2; top := (Form.ClientHeight - height) div 2; end; end;
Ao clicar no botão Novo Label (BtLabel) ele deve colocar um TLabel no form que vai receber os componentes. Ao clicar o código será:
procedure TForm1.Button1Click(Sender: TObject); Var NLabel : TLabel; begin NLabel := TLabel.Create(Application); NLabel.Parent := Form; NLabel.Name := ´Label1´; NLabel.Left := 10; NLabel.Top := 10; NLabel.Font.Size := 20; end;
Ao clicar no botão Novo Label (BtLabel) ele deve colocar um TLabel no form que vai receber os componentes. Ao clicar o código será:
procedure TForm1.BtNovoOnClick(Sender : TObject); Var NLabel : TLabel; begin NLabel := TLabel.Create(Form); with Label do begin Parent := Form; height := 32; width := 128; text := ´Label1!´; left := (Form.ClientWidth - width) div 2; top := (Form.ClientHeight - height) div 2; end; end;
Ah; E assim por diante. Só descobrir as características dos componentes e ir trocando.
Bom. Talvez ainda dê alguns buqsinhos por causa que são forms distintos mas é só combinar eles. Mas testa lá.
Flwx.
Gostei + 0
04/09/2005
Titanius
[]s
Gostei + 0
04/09/2005
Iniciante12345
Gostei + 0
05/09/2005
Titanius
Bem, na verdade, o dfm nada mais é que um arquivo texto, como o .pas, porém com os comandos proprios... do tipo
object Shape1: TShape Left = 283 Top = 272 Width = 221 Height = 95 Pen.Style = psClear end object Label2: TLabel Left = 336 Top = 295 Width = 131 Height = 13 Caption = ´Gerador de Dicion´#225´rios´ Color = clWhite Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = ´MS Sans Serif´ Font.Style = [fsBold] ParentColor = False ParentFont = False end
O problema é mesmo na parte visual... como jogar esse codigo visual pro usuário...
[]s
Gostei + 0
05/09/2005
Massuda
Você também pode dar uma olhada no artigo [url=http://www.thedelphimagazine.com/samples/1355/1355.htm]End-User Form Design[/url] da revista inglesa The Delphi Magazine.
Gostei + 0
05/09/2005
Titanius
valeu...
[]s
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)