diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-10-22 09:30:36 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-10-22 09:30:36 +0000 |
commit | 88ee46de57e74eeb01ad6b1e8cf3da9ff60259c0 (patch) | |
tree | 34ab69f343337cc9486511f68af2f109c02a3ffc /examples/apps | |
parent | 0830146bd2221d1ac5177c20b4b5e22ba48ad53c (diff) | |
download | fpGUI-88ee46de57e74eeb01ad6b1e8cf3da9ff60259c0.tar.xz |
* Minor update to the tiOPF generic edit mediators unit.
* Correctly set the default values for Form and PageControl components.
* Improved the UI Designer so only non-default values for Boolean and Enum types are written to file.
Diffstat (limited to 'examples/apps')
-rw-r--r-- | examples/apps/uidesigner/vfdprops.pas | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/examples/apps/uidesigner/vfdprops.pas b/examples/apps/uidesigner/vfdprops.pas index e4bf9912..fd6c37dc 100644 --- a/examples/apps/uidesigner/vfdprops.pas +++ b/examples/apps/uidesigner/vfdprops.pas @@ -422,13 +422,20 @@ function TPropertyBoolean.GetPropertySource(wg: TfpgWidget; const ident: string) var i: integer; s: string; + PropInfo: PPropInfo; begin + PropInfo := GetPropInfo(wg.ClassType, Name); i := GetOrdProp(wg, Name); - if i = 1 then - s := 'True' + if PropInfo^.Default <> i then + begin + if i = 1 then + s := 'True' + else + s := 'False'; + Result := ident + Name + ' := ' + s + ';' + LineEnding; + end else - s := 'False'; - Result := ident + Name + ' := ' + s + ';' + LineEnding; + Result := ''; end; function TPropertyBoolean.GetValueText(wg: TfpgWidget): string; @@ -516,8 +523,14 @@ begin end; function TPropertyEnum.GetPropertySource(wg: TfpgWidget; const ident: string): string; +var + PropInfo: PPropInfo; begin - Result := ident + Name + ' := ' + GetEnumProp(wg, Name) + ';' + LineEnding; + PropInfo := GetPropInfo(wg.ClassType, Name); + if PropInfo^.Default <> GetOrdProp(wg, Name) then + Result := ident + Name + ' := ' + GetEnumProp(wg, Name) + ';' + LineEnding + else + Result := ''; end; function TPropertyEnum.ParseSourceLine(wg: TfpgWidget; const line: string): boolean; |