What does the Text DFM context menu option mean?
Asked Answered
G

1

10

When you right click on a Delphi form you get the popup context menu. The bottom option is Text DFM. This option can either be checked or not checked. What does it mean when this option is checked or unchecked?

enter image description here

Granjon answered 8/6, 2012 at 22:43 Comment(0)
L
16

This option is used to select the format used to save your form (in binary or text format).

If you use the text DFM option, the form (dfm file) will be stored in a text format like so

object Form1: TForm1
  Left = 451
  Top = 290
  Caption = 'Form38'
  ClientHeight = 300
  ClientWidth = 635
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
end
Ladylove answered 8/6, 2012 at 22:48 Comment(4)
Remember, though, this has absolutely zero (0) bearing on how the forms is stored when it is linked into the resulting binary. It is always linked in in binary format.Kisser
@AllenBauer, but it does have a big bearing on what happens when a third-party component does something to the DFM and you have to edit it as text with Notepad to recover. :-) It also makes it easier on your version control system to store as text rather than binary.Homotaxis
Always use text dfms so that you can make sense of changes in your revision control systemJoanejoanie
I merely pointed this out because there are many who think that when you have text-based DFM files that is how they are linked into their binary. I've seen comments where folks have erroneously complained that leaving their forms as text "makes their application bigger" because it is linked in using that format.Kisser

© 2022 - 2024 — McMap. All rights reserved.