Ver Mensaje Individual
  #1  
Antiguo 22-11-2012
cdac901 cdac901 is offline
Miembro
 
Registrado: feb 2008
Posts: 12
Reputación: 0
cdac901 Va por buen camino
Como acceder a un dfm paralelo en tiempo de diseño

Buenas Noches, espero ser los mas descriptivo posible en el titulo.

Delphi XE3, Windows 7

Tengo 2 dfm

El primero se llama Unit1.dfm:

Código Delphi [-]
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 237
  ClientWidth = 425
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 128
    Top = 40
    Width = 59
    Height = 13
    Caption = 'Hola Mundo '
  end
end

y este otro se llama Unit1_Paralelo.dfm:

Código Delphi [-]
object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'Form1'
  ClientHeight = 237
  ClientWidth = 425
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 128
    Top = 40
    Width = 59
    Height = 13
    Caption = 'Hola Mundo Paralelo'
  end
end

El .pas esta de la siguiente forma

Código Delphi [-]
unit Unit1;

{$define DFM_PARALELO} //Con esta directiva se compila en tiempo de ejecucion Unit1.dfm o Unit1_Paralelo.dfm

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm1 = class(TForm)
    Label1: TLabel;
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$ifdef DFM_PARALELO}
   {$R Unit1_Paralelo.dfm}
{$else DFM_PARALELO}
   {$R *.dfm}
{$endif DFM_PARALELO}

end.

Hasta ahora las pruebas que hecho han funcionado sin novedad, pero el detalle que tengo ahorita habra una forma en la que pueda acceder a Unit1_Paralelo.dfm en tiempo de diseño para hacerle cambios?.

De antemano gracias por las sugerencias que me puedan dar, y si hay otra forma de poder trabajar 2 .dfm con 1 .pas teniendo hacer cambios en los .dfm en tiempo de diseño se los agradeceria doblemente.

Última edición por cdac901 fecha: 22-11-2012 a las 00:32:30. Razón: Por alguna razon se coloco en una sola linea el fuente de delphi
Responder Con Cita