This topic covers the implementation details of TMiscGridOptions.
Scope: cpMiscGridOptions.pas; class derived from TBtnEditProperty. Prepared from the curated implementation supplied for this review on 2 October 2026.
The property contains FirstHours, StartOfWeek, Miscellaneous, TemplateColors, OutsideDays, MonthHeaders and GenTokens. FirstHour slots use days 1–7; there are 12 MonthHeader slots and 18 GenToken slots.
ShowOutsideDays=true selects before/after font settings; false selects HideOutsideDaysMethod. Enabling the former requires the corresponding wrappers.
The local constructor helpers define MonthHeader and GenTokens defaults; their complete assignments appear in the initialization detail. ReadFromXML reads MonthHeaders[]/GenTokens[] and then assigns a DataValue snapshot. The v3 accessor source establishes the GenTokens slot mapping described below.
Notation and shared helper rules: Reading this reference.
Practical editing guide: Modifying GenTokens in an XML script.
GenTokens slot identity in the supplied editor
The expanded v3 unit implements GetGenTokens: indices 1–18 return pointers to GenTokOptions1–GenTokOptions18. The editor’s tab index is zero-based and maps to slot 1+TabIndex. The XML uses GenTokens/GenToken with the corresponding id attribute. Locate a slot by id within the intended grid script line, not by its position among XML siblings.
Literal rec_type values emitted within these routines: TFirstHours, TGenTokens, TMonthHeaders, TMonthlyOutsideDaysOptions, TMonthlyOutsideDaysVisibilityFormatting, TStartOfWeekOptions, TTemplateColors. Nested values may belong to child wrappers rather than this owner itself; the attribute entries below give their exact locations.
Inherited implementation: TBtnEditProperty. Follow it when the ordered behavior invokes inherited methods; inherited fields are not repeated as locally owned fields.
Structures used directly by this XML implementation:
Exact XML fields and attributes
The paths below start at this record or property node. A slash identifies a child element; @ identifies an attribute. Curly braces mark a variable index or expression, not literal XML text. Initial values describe initialization; they do not establish what an omitted individual element does. The Implementation toggle below contains the supplied routines for exact branch order and conversions.
FirstHours/FirstHour[@id={i.toString}]
XML representation: The text of the FirstHour[@id={i.toString}] element.
Reading: Reads the element into aPropValue.mgOptions.FirstHour[i] when the record node exists; for each i from low (FirstHour) through high (FirstHour).
Writing: Stores the text representation of FirstHour[i] when for each i from low (FirstHour) through high (FirstHour).
StartOfWeek/swTriggerWeekday
XML representation: The text of the swTriggerWeekday element.
Reading: Reads the element into aPropValue.mgOptions.swTriggerWeekday when the record node exists.
Writing: Stores the numeric value of swTriggerWeekday whenever the writer reaches this field.
StartOfWeek/swUsesNextMonday
XML representation: The text of the swUsesNextMonday element.
Reading: Reads the element into aPropValue.mgOptions.swUsesNextMonday when the record node exists.
Writing: Stores true or false according to swUsesNextMonday whenever the writer reaches this field.
Miscellaneous/WeekStartsOn
XML representation: The text of the WeekStartsOn element.
Reading: Reads the element into aPropValue.mgOptions.WeekStartsOn when the record node exists.
Writing: Stores the numeric value of WeekStartsOn whenever the writer reaches this field.
Miscellaneous/CurMinicalDefinition
XML representation: The text of the CurMinicalDefinition element.
Reading: Reads the element into aPropValue.mgOptions.CurMinicalDefinition when the record node exists.
Writing: Stores the numeric value of CurMinicalDefinition whenever the writer reaches this field.
Miscellaneous/FillerTokenDelimiters
XML representation: The text of the FillerTokenDelimiters element.
Reading: Reads the element into aPropValue.mgOptions.FillerTokenDelimiters when the record node exists.
Writing: Stores the numeric value of FillerTokenDelimiters whenever the writer reaches this field.
Miscellaneous/Length_ddd
XML representation: The text of the Length_ddd element.
Reading: Reads the element into aPropValue.mgOptions.Length_ddd when the record node exists.
Writing: Stores the numeric value of Length_ddd whenever the writer reaches this field.
Miscellaneous/Length_Tx
XML representation: The text of the Length_Tx element.
Reading: Reads the element into aPropValue.mgOptions.Length_Tx when the record node exists.
Writing: Stores the numeric value of Length_Tx whenever the writer reaches this field.
Miscellaneous/SideFirstGeneratedPage
XML representation: The text of the SideFirstGeneratedPage element.
Reading: Reads the element into aPropValue.mgOptions.SideFirstGeneratedPage when the record node exists.
Writing: Stores the numeric value of SideFirstGeneratedPage whenever the writer reaches this field.
Miscellaneous/PageNumberOffset
XML representation: The text of the PageNumberOffset element.
Reading: Reads the element into aPropValue.mgOptions.PageNumberOffset when the record node exists.
Writing: Stores the numeric value of PageNumberOffset whenever the writer reaches this field.
Miscellaneous/HideWatermarks
XML representation: The text of the HideWatermarks element.
Reading: Reads the element into aPropValue.mgOptions.HideWatermarks when the record node exists.
Writing: Stores true or false according to HideWatermarks whenever the writer reaches this field.
Miscellaneous/HideHolidaysSymbols
XML representation: The text of the HideHolidaysSymbols element.
Reading: Reads the element into aPropValue.mgOptions.HideHolidaysSymbols when the record node exists.
Writing: Stores true or false according to HideHolidaysSymbols whenever the writer reaches this field.
Miscellaneous/DeleteDominanteBox
XML representation: The text of the DeleteDominanteBox element.
Reading: Reads the element into aPropValue.mgOptions.DeleteDominanteBox when the record node exists.
Writing: Stores true or false according to DeleteDominanteBox whenever the writer reaches this field.
Miscellaneous/LowerCaseDtoken
XML representation: The text of the LowerCaseDtoken element.
Reading: Reads the element into aPropValue.mgOptions.LowerCaseDtoken when the record node exists.
Writing: Stores true or false according to LowerCaseDtoken whenever the writer reaches this field.
Miscellaneous/PayeEveryDay
XML representation: The text of the PayeEveryDay element.
Reading: Reads the element into aPropValue.mgOptions.PayeEveryDay when the record node exists.
Writing: Stores true or false according to PayeEveryDay whenever the writer reaches this field.
Miscellaneous/ShowPayeLabel
XML representation: The text of the ShowPayeLabel element.
Reading: Reads the element into aPropValue.mgOptions.ShowPayeLabel when the record node exists.
Writing: Stores true or false according to ShowPayeLabel whenever the writer reaches this field.
Miscellaneous/RomanFourAsIIII
XML representation: The text of the RomanFourAsIIII element.
Reading: Reads the element into aPropValue.mgOptions.RomanFourAsIIII when the record node exists.
Writing: Stores true or false according to RomanFourAsIIII whenever the writer reaches this field.
Miscellaneous/AllowedDuplicatedTokens
XML representation: The text of the AllowedDuplicatedTokens element.
Reading: Reads the element into aPropValue.mgOptions.AllowedDuplicatedTokens when the record node exists.
Writing: Stores AllowedDuplicatedTokens whenever the writer reaches this field.
OutsideDays/ShowOutsideDays
XML representation: The text of the ShowOutsideDays element.
Reading: Reads the element into aPropValue.mgOptions.ShowOutsideDays when the record node exists.
Writing: Stores true or false according to ShowOutsideDays whenever the writer reaches this field.
OutsideDays/HideOutsideDaysMethod
XML representation: The text of the HideOutsideDaysMethod element.
Reading: Reads the element into aPropValue.mgOptions.HideOutsideDaysMethod when the record node exists; ShowOutsideDays is false.
Writing: Stores the numeric value of HideOutsideDaysMethod when ShowOutsideDays is false.
FirstHours/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TFirstHours” whenever the writer reaches this field.
FirstHours/FirstHour/@id
XML representation: The id attribute.
Writing: Stores the text representation of i when for each i from low (FirstHour) through high (FirstHour).
StartOfWeek/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TStartOfWeekOptions” whenever the writer reaches this field.
TemplateColors/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TTemplateColors” whenever the writer reaches this field.
TemplateColors/TemplateColor[@id={i.toString}]/@id
XML representation: The id attribute.
Writing: Stores the text representation of i when for each i from 1 through 3.
OutsideDays/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMonthlyOutsideDaysOptions” whenever the writer reaches this field.
OutsideDays/before/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMonthlyOutsideDaysVisibilityFormatting” when ShowOutsideDays is true.
OutsideDays/after/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMonthlyOutsideDaysVisibilityFormatting” when ShowOutsideDays is true.
MonthHeaders/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TMonthHeaders” whenever the writer reaches this field.
MonthHeaders/MonthHeader[@id={i.toString}]/@id
XML representation: The id attribute.
Writing: Stores the text representation of i when for each i from 1 through NUM_MONTHHEADERS_IN_GRIDOPTIONS.
GenTokens/@rec_type
XML representation: The rec_type attribute.
Writing: Stores the literal text “TGenTokens” whenever the writer reaches this field.
GenTokens/GenToken[@id={i.toString}]/@id
XML representation: The id attribute.
Writing: Stores the text representation of i when for each i from 1 through NUM_GENTOKS_IN_GRIDOPTIONS.
Nested records and repeated elements
Operation |
XML location |
When it is processed |
Read TemplateColors[i] |
TemplateColors/TemplateColor[@id={i.toString}] |
the record node exists; for each i from 1 through 3; node2 exists |
Read OutsideDaysBeforeFontSettings |
OutsideDays/before/OutsideDaysFontSettings |
the record node exists; ShowOutsideDays is true |
Read OutsideDaysAfterFontSettings |
OutsideDays/after/OutsideDaysFontSettings |
the record node exists; ShowOutsideDays is true |
Read MonthHeaders[i]^ |
MonthHeaders/MonthHeader[@id={i.toString}] |
the record node exists; for each i from 1 through NUM_MONTHHEADERS_IN_GRIDOPTIONS |
Read GenTokens[i]^ |
GenTokens/GenToken[@id={i.toString}] |
the record node exists; for each i from 1 through NUM_GENTOKS_IN_GRIDOPTIONS |
Write TemplateColors[i] |
TemplateColors/TemplateColor[@id={i.toString}] |
for each i from 1 through 3 |
Write OutsideDaysBeforeFontSettings |
OutsideDays/before/OutsideDaysFontSettings |
ShowOutsideDays is true |
Write OutsideDaysAfterFontSettings |
OutsideDays/after/OutsideDaysFontSettings |
ShowOutsideDays is true |
Write MonthHeaders[i]^ |
MonthHeaders/MonthHeader[@id={i.toString}] |
for each i from 1 through NUM_MONTHHEADERS_IN_GRIDOPTIONS |
Write GenTokens[i]^ |
GenTokens/GenToken[@id={i.toString}] |
for each i from 1 through NUM_GENTOKS_IN_GRIDOPTIONS |
Initialization and reset values
TMiscGridOptions.Create
Setting or temporary variable |
Initial value |
When it is assigned |
PropName |
“Grid Options” |
Always |
Required |
1 |
Always |
IncludedMacros |
an empty set |
Always |
lstTokensOfMacroIndex |
TStringList.Create |
Always |
ListMacroTokens |
TStringList.Create |
Always |
ListMacroTokens.Duplicates |
dupIgnore |
Always |
PropValue |
Default (TSL_PropValue) |
Always |
PropValue.mgOptions.FirstHour[iDay] |
8 |
for each iDay from 1 through 7 |
PropValue.mgOptions.StartMultiWeekDailiesOnRhs_JUNK |
False |
Always |
PropValue.mgOptions.SideFirstGeneratedPage |
1 |
Always |
PropValue.mgOptions.ShowOutsideDays |
False |
Always |
PropValue.mgOptions.HideOutsideDaysMethod |
hodmGroupDelete |
Always |
PropValue.mgOptions.CurMinicalDefinition |
cmdTokenDate |
Always |
PropValue.mgOptions.FillerTokenDelimiters |
0 |
Always |
PropValue.mgOptions.WeekStartsOn |
1 |
Always |
PropValue.mgOptions._sw_TriggeredByWeekday |
false |
Always |
PropValue.mgOptions._sw_UsesMonday |
true |
Always |
PropValue.mgOptions.HideWatermarks |
False |
Always |
PropValue.mgOptions.HideHolidaysSymbols |
False |
Always |
PropValue.mgOptions.DeleteDominanteBox |
False |
Always |
PropValue.mgOptions.LowerCaseDtoken |
False |
Always |
PropValue.mgOptions.PayeEveryDay |
False |
Always |
PropValue.mgOptions.ShowPayeLabel |
True |
Always |
PropValue.mgOptions.PageNumberOffset |
0 |
Always |
PropValue.mgOptions.Length_ddd |
0 |
Always |
PropValue.mgOptions.Length_Tx |
3 |
Always |
PropValue.mgOptions.SaintsSeparators[iQhl] |
an empty string |
for each iQhl from qhlA through qhlU |
PropValue.mgOptions.Version |
0 |
Always |
PropValue.mgOptions.MH1_DateSystem |
0 |
Always |
PropValue.mgOptions.MH1_DayValue1 |
1 |
Always |
PropValue.mgOptions.MH1_DayValue2 |
7 |
Always |
PropValue.mgOptions.MH1_StrNoChange |
an empty string |
Always |
PropValue.mgOptions.MH1_StrMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH1_StrYearChange |
an empty string |
Always |
PropValue.mgOptions.MH1_FmtNoChange |
an empty string |
Always |
PropValue.mgOptions.MH1_FmtMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH1_FmtYearChange |
an empty string |
Always |
PropValue.mgOptions.MH3_DateSystem |
0 |
Always |
PropValue.mgOptions.MH3_DayValue1 |
1 |
Always |
PropValue.mgOptions.MH3_DayValue2 |
7 |
Always |
PropValue.mgOptions.MH3_StrNoChange |
an empty string |
Always |
PropValue.mgOptions.MH3_StrMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH3_StrYearChange |
an empty string |
Always |
PropValue.mgOptions.MH3_FmtNoChange |
an empty string |
Always |
PropValue.mgOptions.MH3_FmtMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH3_FmtYearChange |
an empty string |
Always |
PropValue.mgOptions.MH2_DateSystem |
0 |
Always |
PropValue.mgOptions.MH2_DayValue1 |
1 |
Always |
PropValue.mgOptions.MH2_DayValue2 |
7 |
Always |
PropValue.mgOptions.MH2_StrNoChange |
an empty string |
Always |
PropValue.mgOptions.MH2_StrMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH2_StrYearChange |
an empty string |
Always |
PropValue.mgOptions.MH2_FmtNoChange |
an empty string |
Always |
PropValue.mgOptions.MH2_FmtMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH2_FmtYearChange |
an empty string |
Always |
PropValue.mgOptions.MH4_DateSystem |
0 |
Always |
PropValue.mgOptions.MH4_DayValue1 |
1 |
Always |
PropValue.mgOptions.MH4_DayValue2 |
7 |
Always |
PropValue.mgOptions.MH4_StrNoChange |
an empty string |
Always |
PropValue.mgOptions.MH4_StrMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH4_StrYearChange |
an empty string |
Always |
PropValue.mgOptions.MH4_FmtNoChange |
an empty string |
Always |
PropValue.mgOptions.MH4_FmtMonthChange |
an empty string |
Always |
PropValue.mgOptions.MH4_FmtYearChange |
an empty string |
Always |
PropValue.mgOptions.RomanFourAsIIII |
false |
Always |
PropValue.mgOptions.AllowedDuplicatedTokens |
an empty string |
Always |
PropValue.mgOptions.TemplateColors[iCb].Cyan |
99 |
for each iCB from 1 through 3 |
PropValue.mgOptions.TemplateColors[iCb].Magenta |
99 |
for each iCB from 1 through 3 |
PropValue.mgOptions.TemplateColors[iCb].Yellow |
99 |
for each iCB from 1 through 3 |
PropValue.mgOptions.TemplateColors[iCb].Black |
99 |
for each iCB from 1 through 3 |
PropValue.mgOptions.OutsideDaysBeforeStyle |
an empty set |
Always |
PropValue.mgOptions.OutsideDaysBeforeStyle_Remove |
an empty set |
Always |
PropValue.mgOptions.OutsideDaysAfterStyle |
an empty set |
Always |
PropValue.mgOptions.OutsideDaysAfterStyle_Remove |
an empty set |
Always |
PropValue.mgOptions |
IniSettings.MiscGridOptions.DataValue.mgOptions |
UseIniSettingsInPropertyConstructor is true |
DataValue |
PropValue |
Always |
This routine also calls inherited Create; lstTokensOfMacroIndex.Add(''); InitMonthHeaderRec(MonthHeaderOptions1); InitMonthHeaderRec(MonthHeaderOptions2); InitMonthHeaderRec(MonthHeaderOptions3); InitMonthHeaderRec(MonthHeaderOptions4); InitMonthHeaderRec(MonthHeaderOptions5); InitMonthHeaderRec(MonthHeaderOptions6); InitMonthHeaderRec(MonthHeaderOptions7); InitMonthHeaderRec(MonthHeaderOptions8); InitMonthHeaderRec(MonthHeaderOptions9); InitMonthHeaderRec(MonthHeaderOptions10); InitMonthHeaderRec(MonthHeaderOptions11); InitMonthHeaderRec(MonthHeaderOptions12); InitDefaultLineEndingOptions; InitGenTokOptions(GenTokOptions1); InitGenTokOptions(GenTokOptions2); InitGenTokOptions(GenTokOptions3); InitGenTokOptions(GenTokOptions4); InitGenTokOptions(GenTokOptions5); InitGenTokOptions(GenTokOptions6); InitGenTokOptions(GenTokOptions7); InitGenTokOptions(GenTokOptions8); InitGenTokOptions(GenTokOptions9); InitGenTokOptions(GenTokOptions10); InitGenTokOptions(GenTokOptions11); InitGenTokOptions(GenTokOptions12); InitGenTokOptions(GenTokOptions13); InitGenTokOptions(GenTokOptions14); InitGenTokOptions(GenTokOptions15); InitGenTokOptions(GenTokOptions16); InitGenTokOptions(GenTokOptions17); InitGenTokOptions(GenTokOptions18); OutsideDaysBeforeFontSettings.Initialize; OutsideDaysAfterFontSettings.Initialize; self.FillDisplayValue. See Implementation for their order and any conditional calls.
Local helper procedures are included inside their enclosing routine in Implementation. These contain additional initialization details.
Value namespaces used by this implementation
These are declared Pascal ordinal values. Use the ordinal only where the field serializer actually writes ord(...), an integer cast or an equivalent value. Set-marker strings and local option lists have their own representation; sentinel members in an enum are not automatically legal XML choices.
TqHolList
Ordinal |
Declared member |
0 |
qhlA |
1 |
qhlE |
2 |
qhlI |
3 |
qhlO |
4 |
qhlU |
5 |
qhlNone |
6 |
qhlInsert |
7 |
qhlXtra |
TRulesLength
Ordinal |
Declared member |
0 |
qrlIndents |
1 |
qrlText |
2 |
qrlColumn |
TConditionBoolType
Ordinal |
Declared member |
0 |
cbtAny |
1 |
cbtAll |
TLineEndingType
Ordinal |
Declared member |
0 |
letSoft |
1 |
letHard |
2 |
letTab |
3 |
letMacro |
4 |
letFormatting |
5 |
letXtags |
6 |
letNothing |
7 |
letNextBox |
8 |
letNextColumn |
9 |
letSkipLine |
TGenTokMaxType
Ordinal |
Declared member |
0 |
gtmEndOfMonth |
1 |
gtmDayvalue |
2 |
gtmDayOfMonth |
3 |
gtmFixedNumLines |
4 |
gtmMinOfFixedNumLinesOrEOM |
5 |
gtmNumLinesOrEOM |
Storage declarations relevant to interpretation
These are in-memory member and property types, not a list of mandatory XML children. They retain array bounds, fixed buffers and selector types. The field reference above defines what is actually serialized.
Name |
Declared type / bounds |
Kind |
lstTokensOfMacroIndex |
TStringList |
member |
ListMacroTokens |
TStringList |
member |
SaintsSeparators |
array [qhlA..qhlU] of string |
member |
MH1_StrNoChange |
string |
member |
MH1_StrMonthChange |
string |
member |
MH1_StrYearChange |
string |
member |
MH3_StrNoChange |
string |
member |
MH3_StrMonthChange |
string |
member |
MH3_StrYearChange |
string |
member |
MH2_StrNoChange |
string |
member |
MH2_StrMonthChange |
string |
member |
MH2_StrYearChange |
string |
member |
MH4_StrNoChange |
string |
member |
MH4_StrMonthChange |
string |
member |
MH4_StrYearChange |
string |
member |
MH1_FmtNoChange |
string |
member |
MH1_FmtMonthChange |
string |
member |
MH1_FmtYearChange |
string |
member |
MH3_FmtNoChange |
string |
member |
MH3_FmtMonthChange |
string |
member |
MH3_FmtYearChange |
string |
member |
MH2_FmtNoChange |
string |
member |
MH2_FmtMonthChange |
string |
member |
MH2_FmtYearChange |
string |
member |
MH4_FmtNoChange |
string |
member |
MH4_FmtMonthChange |
string |
member |
MH4_FmtYearChange |
string |
member |
IncludedMacros |
TSetOfMacros |
member |
MonthHeaderOptions1 |
TMonthHeaderOptions |
member |
MonthHeaderOptions2 |
TMonthHeaderOptions |
member |
MonthHeaderOptions3 |
TMonthHeaderOptions |
member |
MonthHeaderOptions4 |
TMonthHeaderOptions |
member |
MonthHeaderOptions5 |
TMonthHeaderOptions |
member |
MonthHeaderOptions6 |
TMonthHeaderOptions |
member |
MonthHeaderOptions7 |
TMonthHeaderOptions |
member |
MonthHeaderOptions8 |
TMonthHeaderOptions |
member |
MonthHeaderOptions9 |
TMonthHeaderOptions |
member |
MonthHeaderOptions10 |
TMonthHeaderOptions |
member |
MonthHeaderOptions11 |
TMonthHeaderOptions |
member |
MonthHeaderOptions12 |
TMonthHeaderOptions |
member |
GenTokOptions1 |
TGenTokensRec |
member |
GenTokOptions2 |
TGenTokensRec |
member |
GenTokOptions3 |
TGenTokensRec |
member |
GenTokOptions4 |
TGenTokensRec |
member |
GenTokOptions5 |
TGenTokensRec |
member |
GenTokOptions6 |
TGenTokensRec |
member |
GenTokOptions7 |
TGenTokensRec |
member |
GenTokOptions8 |
TGenTokensRec |
member |
GenTokOptions9 |
TGenTokensRec |
member |
GenTokOptions10 |
TGenTokensRec |
member |
GenTokOptions11 |
TGenTokensRec |
member |
GenTokOptions12 |
TGenTokensRec |
member |
GenTokOptions13 |
TGenTokensRec |
member |
GenTokOptions14 |
TGenTokensRec |
member |
GenTokOptions15 |
TGenTokensRec |
member |
GenTokOptions16 |
TGenTokensRec |
member |
GenTokOptions17 |
TGenTokensRec |
member |
GenTokOptions18 |
TGenTokensRec |
member |
RomanFourAsIIII |
Boolean |
member |
AllowedDuplicatedTokens |
string |
member |
The Implementation toggle contains only TMiscGridOptions methods. Initializers and helpers belonging to other types are identified separately below. Shared XML-helper limitations are explained in Reading this reference.