I need to change a large number of Delphi components defined in one package to similar ones in another package. Much of the grunt work can be done by replacing text (component types and properties) in the DFM files - saved as text of course.
I have searched Stackoverflow and Google and am now adapting the Felix Colibri DFM parser from http://www.felix-colibri.com/papers/colibri_utilities/dfm_parser/dfm_parser.html
I come across a 'feature' in the DFM files that the parser chokes on: [number]s after the type specifications like this:
inherited DialoogEditAgenda: TDialoogEditAgenda
ActiveControl = PlanCalendar
Caption = 'Agenda'
[snip]
inherited PanelButtons: TRzPanel
Top = 537
[snip]
inherited ButtonCancel: TRzBitBtn [0] <== *here*
Left = 852
[snip]
end
object CheckBoxBeschikbaarheid: TRzCheckBox [1] <== *here*
Left = 8
[snip]
end
inherited ButtonOK: TRzBitBtn [2] <== *here*
Left = 900
[snip]
end
end
inherited PageControl: TRzPageControl
Left = 444
[snip]
end
object PanelBeschikbaarheid: TRzSizePanel [2] <== *here*
Left = 967
[snip]
end
object PanelScheduler: TRzPanel [3] <== *here*
Left = 23
Top = 22
[...]
Many of these DFMs are heavily inherited (I had to adapt Colibri's code for that already), but a small test app with inheritance failed to produce the [number]s in the DFM.
My question before having to extend the parser code: does anyone know where these [number]s come from and consequently, can I maybe remove them before parsing the DFM files?
Thanks
Jan