Ver Mensaje Individual
  #12  
Antiguo 14-04-2016
Avatar de Neftali [Germán.Estévez]
Neftali [Germán.Estévez] Neftali [Germán.Estévez] is offline
[becario]
 
Registrado: jul 2004
Ubicación: Barcelona - España
Posts: 18.275
Reputación: 10
Neftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en brutoNeftali [Germán.Estévez] Es un diamante en bruto
Cita:
Empezado por roman Ver Mensaje
Hola Neftalí, en cuanto a esto, ¿te refieres a una utilidad que lea un DFM como cualquier archivo de texto implementando un "parseo" específico?
Exactamente a eso Román.

Un objeto TDBGrid en un DFM tiene una cabecera similar a esta (cambiando el nombre del componente):

Código Delphi [-]
  object DBGridClientes: TDBGrid
    ...

La parte del componente es bastante parecida a esta y siempre similar. Lo único "complejo" es si tiene o no columnas definidas.
Si tiene columnas será así:

Código Delphi [-]
object DBGrid1: TDBGrid
    Left = 48
    Top = 40
    Width = 481
    Height = 289
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
    Columns = <
      item
        Expanded = False
        Visible = True
      end
      item
        Expanded = False
        Visible = True
      end
      item
        Expanded = False
        Visible = True
      end>
  end

Si no tiene columnas así:

Código Delphi [-]
object DBGrid1: TDBGrid
    Left = 48
    Top = 40
    Width = 481
    Height = 289
    TabOrder = 0
    TitleFont.Charset = DEFAULT_CHARSET
    TitleFont.Color = clWindowText
    TitleFont.Height = -11
    TitleFont.Name = 'MS Sans Serif'
    TitleFont.Style = []
  end

En ambos casos estará o no la propiedad ReadOnly así:

Código Delphi [-]
    ReadOnly = True

Si no está se considera a False.

No me parece complicado hacer un "parseo" de esos ficheros y modificarlos...
¿Qué os parece?
__________________
Germán Estévez => Web/Blog
Guía de estilo, Guía alternativa
Utiliza TAG's en tus mensajes.
Contactar con el Clubdelphi

P.D: Más tiempo dedicado a la pregunta=Mejores respuestas.
Responder Con Cita