Recent

Author Topic: [SOLVED] Question about lfm-file format: numbers in square brackets []  (Read 2380 times)

Hartmut

  • Hero Member
  • *****
  • Posts: 742
In some of my *.lfm files I see numbers in square brackets, which I have only in a few projects, most projects don't have them.
Does anybody know what these numbers mean?
I use Lazarus 1.8.4 on Windows 7, 32 bit. Thanks in advance.
Here is an example, which contains 23 such numbers:

Code: Pascal  [Select][+][-]
  1. inherited Form1: TForm1
  2.   Left = 355
  3.   Height = 420
  4.   Top = 316
  5.   Width = 648
  6.   Caption = 'Form1'
  7.   ClientHeight = 420
  8.   ClientWidth = 648
  9.   OnActivate = FormActivate
  10.   OnClose = FormClose
  11.   OnCreate = FormCreate
  12.   OnKeyDown = FormKeyDown
  13.   inherited DBGrid1: TDBGrid
  14.     Height = 72
  15.     Top = 46
  16.     Width = 520
  17.   end
  18.   object Label_fspec: TLabel[1]
  19.     Left = 8
  20.     Height = 13
  21.     Top = 12
  22.     Width = 17
  23.     Caption = 'DB:'
  24.     ParentColor = False
  25.   end
  26.   object LB1: TListBox[2]
  27.     Left = 16
  28.     Height = 227
  29.     Top = 184
  30.     Width = 130
  31.     ItemHeight = 0
  32.     OnClick = LB1Click
  33.     TabOrder = 1
  34.   end
  35.   object Splitter0: TSplitter[3]
  36.     Left = 160
  37.     Height = 200
  38.     Top = 200
  39.     Width = 30
  40.     Align = alNone
  41.   end
  42.   object PageControl1: TPageControl[4]
  43.     Left = 200
  44.     Height = 227
  45.     Top = 184
  46.     Width = 350
  47.     ActivePage = Tab_Browse
  48.     TabIndex = 0
  49.     TabOrder = 3
  50.     OnChange = PageControl1Change
  51.     object Tab_Browse: TTabSheet
  52.       Caption = '&Browse'
  53.       ClientHeight = 201
  54.       ClientWidth = 342
  55.       object SG0: TStringGrid
  56.         Left = 16
  57.         Height = 172
  58.         Top = 12
  59.         Width = 315
  60.         ColCount = 4
  61.         TabOrder = 0
  62.         OnHeaderClick = SG0HeaderClick
  63.         OnPrepareCanvas = SG0PrepareCanvas
  64.       end
  65.     end
  66.     object Tab_SQL1: TTabSheet
  67.       Caption = 'SQL&1'
  68.       ClientHeight = 201
  69.       ClientWidth = 342
  70.       object Button_exec1: TButton
  71.         Left = 47
  72.         Height = 25
  73.         Top = 5
  74.         Width = 75
  75.         Caption = '&Ausführen'
  76.         OnClick = Button_exec_Click
  77.         TabOrder = 0
  78.       end
  79.       object Memo1: TMemo
  80.         Left = 12
  81.         Height = 40
  82.         Top = 36
  83.         Width = 316
  84.         Lines.Strings = (
  85.           'Memo1'
  86.         )
  87.         TabOrder = 1
  88.       end
  89.       object Splitter1: TSplitter
  90.         Left = 24
  91.         Height = 14
  92.         Top = 88
  93.         Width = 274
  94.         Align = alNone
  95.       end
  96.       object SG1: TStringGrid
  97.         Left = 15
  98.         Height = 86
  99.         Top = 111
  100.         Width = 313
  101.         ColCount = 4
  102.         RowCount = 4
  103.         TabOrder = 3
  104.       end
  105.     end
  106.     object Tab_SQL2: TTabSheet
  107.       Caption = 'SQL&2'
  108.       ClientHeight = 201
  109.       ClientWidth = 342
  110.       object Button_exec2: TButton
  111.         Left = 47
  112.         Height = 25
  113.         Top = 5
  114.         Width = 75
  115.         Caption = '&Ausführen'
  116.         OnClick = Button_exec_Click
  117.         TabOrder = 0
  118.       end
  119.       object Memo2: TMemo
  120.         Left = 12
  121.         Height = 40
  122.         Top = 36
  123.         Width = 316
  124.         Lines.Strings = (
  125.           'Memo1'
  126.         )
  127.         TabOrder = 1
  128.       end
  129.       object Splitter2: TSplitter
  130.         Left = 24
  131.         Height = 14
  132.         Top = 88
  133.         Width = 274
  134.         Align = alNone
  135.       end
  136.       object SG2: TStringGrid
  137.         Left = 15
  138.         Height = 86
  139.         Top = 111
  140.         Width = 313
  141.         ColCount = 4
  142.         RowCount = 4
  143.         TabOrder = 3
  144.       end
  145.     end
  146.     object Tab_SQL3: TTabSheet
  147.       Caption = 'SQL&3'
  148.       ClientHeight = 201
  149.       ClientWidth = 342
  150.       object Button_exec3: TButton
  151.         Left = 47
  152.         Height = 25
  153.         Top = 5
  154.         Width = 75
  155.         Caption = '&Ausführen'
  156.         OnClick = Button_exec_Click
  157.         TabOrder = 0
  158.       end
  159.       object Memo3: TMemo
  160.         Left = 12
  161.         Height = 40
  162.         Top = 36
  163.         Width = 316
  164.         Lines.Strings = (
  165.           'Memo1'
  166.         )
  167.         TabOrder = 1
  168.       end
  169.       object Splitter3: TSplitter
  170.         Left = 24
  171.         Height = 14
  172.         Top = 88
  173.         Width = 274
  174.         Align = alNone
  175.       end
  176.       object SG3: TStringGrid
  177.         Left = 15
  178.         Height = 86
  179.         Top = 111
  180.         Width = 313
  181.         ColCount = 4
  182.         RowCount = 4
  183.         TabOrder = 3
  184.       end
  185.     end
  186.     object Tab_SQL4: TTabSheet
  187.       Caption = 'SQL&4'
  188.       ClientHeight = 201
  189.       ClientWidth = 342
  190.       object Button_exec4: TButton
  191.         Left = 47
  192.         Height = 25
  193.         Top = 5
  194.         Width = 75
  195.         Caption = '&Ausführen'
  196.         OnClick = Button_exec_Click
  197.         TabOrder = 0
  198.       end
  199.       object Memo4: TMemo
  200.         Left = 12
  201.         Height = 40
  202.         Top = 36
  203.         Width = 316
  204.         Lines.Strings = (
  205.           'Memo1'
  206.         )
  207.         TabOrder = 1
  208.       end
  209.       object Splitter4: TSplitter
  210.         Left = 24
  211.         Height = 14
  212.         Top = 88
  213.         Width = 274
  214.         Align = alNone
  215.       end
  216.       object SG4: TStringGrid
  217.         Left = 15
  218.         Height = 86
  219.         Top = 111
  220.         Width = 313
  221.         ColCount = 4
  222.         RowCount = 4
  223.         TabOrder = 3
  224.       end
  225.     end
  226.   end
  227.   object ComboBox_fspec: TComboBox[5]
  228.     Left = 32
  229.     Height = 21
  230.     Top = 8
  231.     Width = 100
  232.     ItemHeight = 13
  233.     OnEditingDone = ComboBox_fspecEditingDone
  234.     OnKeyDown = ComboBox_fspecKeyDown
  235.     TabOrder = 4
  236.     Text = 'ComboBox_fspec'
  237.   end
  238.   object Button_fspec: TButton[6]
  239.     Left = 140
  240.     Height = 25
  241.     Top = 8
  242.     Width = 32
  243.     Caption = '...'
  244.     OnClick = Button_fspecClick
  245.     TabOrder = 5
  246.   end
  247.   object Button_Close: TButton[7]
  248.     Left = 560
  249.     Height = 25
  250.     Top = 128
  251.     Width = 75
  252.     Caption = '&Close'
  253.     OnClick = Button_CloseClick
  254.     TabOrder = 6
  255.   end
  256.   object Button_Refresh: TButton[8]
  257.     Left = 184
  258.     Height = 25
  259.     Top = 8
  260.     Width = 75
  261.     Caption = '&Refresh'
  262.     OnClick = Button_RefreshClick
  263.     TabOrder = 7
  264.   end
  265.   object CheckBox_max: TCheckBox[9]
  266.     Left = 267
  267.     Height = 17
  268.     Top = 12
  269.     Width = 90
  270.     Caption = 'Max. Records:'
  271.     OnChange = CheckBox_maxChange
  272.     TabOrder = 8
  273.   end
  274.   object SpinEdit_max: TSpinEditEx[10]
  275.     Left = 360
  276.     Height = 21
  277.     Top = 12
  278.     Width = 70
  279.     MaxLength = 0
  280.     TabOrder = 9
  281.     OnEditingDone = SpinEdit_maxEditingDone
  282.     NullValue = 0
  283.   end
  284.   object Label_von: TLabel[11]
  285.     Left = 439
  286.     Height = 13
  287.     Top = 15
  288.     Width = 22
  289.     Caption = 'von:'
  290.     ParentColor = False
  291.   end
  292.   object StatusBar_anz: TStatusBar[12]
  293.     Left = 469
  294.     Height = 20
  295.     Top = 12
  296.     Width = 72
  297.     Align = alNone
  298.     Panels = <>
  299.   end
  300.   object Button_Tables: TButton[13]
  301.     Left = 560
  302.     Height = 25
  303.     Top = 48
  304.     Width = 75
  305.     Caption = '&Tables'
  306.     OnClick = Button_TablesClick
  307.     TabOrder = 11
  308.   end
  309.   object Button_Help: TButton[14]
  310.     Left = 560
  311.     Height = 25
  312.     Top = 87
  313.     Width = 75
  314.     Caption = '&Help'
  315.     OnClick = Button_HelpClick
  316.     TabOrder = 12
  317.   end
  318.   object CheckBox_auto: TCheckBox[15]
  319.     Left = 554
  320.     Height = 17
  321.     Top = 14
  322.     Width = 93
  323.     Caption = 'Spalten autom.'
  324.     OnChange = CheckBox_autoChange
  325.     TabOrder = 13
  326.   end
  327.   inherited DBConnection: TSQLite3Connection[16]
  328.   end
  329.   inherited SQLTransaction1: TSQLTransaction[17]
  330.   end
  331.   inherited SQLQuery1: TSQLQuery[18]
  332.   end
  333.   inherited DataSource1: TDataSource[19]
  334.   end
  335.   object OpenDialog1: TOpenDialog[20]
  336.     left = 336
  337.     top = 129
  338.   end
  339.   object IniPropStorage1: TIniPropStorage[21]
  340.     StoredValues = <>
  341.     left = 416
  342.     top = 129
  343.   end
  344.   object PopupMenu_LB: TPopupMenu[22]
  345.     left = 64
  346.     top = 288
  347.     object popTabname: TMenuItem
  348.       Caption = 'markierten Tabellennamen in Zwischenablage'
  349.       OnClick = popTabnameClick
  350.     end
  351.   end
  352.   object pop_SG: TPopupMenu[23]
  353.     left = 368
  354.     top = 311
  355.     object popFeldname: TMenuItem
  356.       Caption = 'Spaltenname der roten Zelle in Zwischenablage'
  357.       OnClick = Kontextmenu_SG
  358.     end
  359.     object MenuItem1: TMenuItem
  360.       Caption = '-'
  361.     end
  362.     object popZelle: TMenuItem
  363.       Caption = 'rote Zelle in Zwischenablage'
  364.       OnClick = Kontextmenu_SG
  365.     end
  366.     object popZeile: TMenuItem
  367.       Caption = 'rote Zeile in Zwischenablage'
  368.       OnClick = Kontextmenu_SG
  369.     end
  370.     object popSpalte: TMenuItem
  371.       Caption = 'rote Spalte in Zwischenablage'
  372.       OnClick = Kontextmenu_SG
  373.     end
  374.     object MenuItem3: TMenuItem
  375.       Caption = '-'
  376.     end
  377.     object popTabelle: TMenuItem
  378.       Caption = 'ganze Tabelle in Zwischenablage'
  379.       OnClick = Kontextmenu_SG
  380.     end
  381.     object popSelection: TMenuItem
  382.       Caption = 'blau markierten Bereich in Zwischenablage'
  383.       OnClick = Kontextmenu_SG
  384.     end
  385.     object MenuItem2: TMenuItem
  386.       Caption = '-'
  387.     end
  388.     object popMemo: TMenuItem
  389.       Caption = 'rote Zelle in Memofeld anzeigen'
  390.       OnClick = Kontextmenu_SG
  391.     end
  392.   end
  393. end
  394.  
« Last Edit: July 09, 2018, 06:47:42 pm by Hartmut »

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • POKE 54296,15
    • Eye-Candy Controls
Lazarus 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Hartmut

  • Hero Member
  • *****
  • Posts: 742
Re: Question about lfm-file format: numbers in square brackets []
« Reply #2 on: July 08, 2018, 06:42:01 pm »
Thanks a lot to Blaazen for your reply.
The video refers to a stackoverflow question, which handles this numbers very detailed:
https://stackoverflow.com/questions/10916294/strange-numbers-in-delphi-dfm-files-origin-and-necessity

The best answers (I think) are the 2 answers from "hvd", although (for me) very hard to understand. As far as I understood (not sure):
a) For TWinControls and their descendants this numbers are the Z-order.
b) For Non-windowed controls (say, TLabel) this number is a component index (lower than any windowed control in the same parent) which is mostly unused. But e.g. menus can use the component index to specify the order of their menu items (top to bottom). Toolbar controls can use the component index to specify the order of the toolbar buttons, even when those toolbar buttons aren't themselves controls.
As far as I understood the video covers only a)

 

TinyPortal © 2005-2018