On 28/03/2008, Jonas Maebe <[EMAIL PROTECTED]> wrote: > > It compiles again. Unrelated (because I think such declarations are > broken for fpu types/values): what code do you have to write so that > this default value is actually used?
fpGUI's UI Designer generates GUI code directly in the .pas unit, not via BinaryObjectToText() etc.. It checks the default value of a property before it decides to generate code or not. Here is an example of a Boolean property. function TPropertyBoolean.GetPropertySource(wg: TfpgWidget; const ident: string): string; var i: integer; s: string; PropInfo: PPropInfo; begin PropInfo := GetPropInfo(wg.ClassType, Name); i := GetOrdProp(wg, Name); if PropInfo^.Default <> i then begin if i = 1 then s := 'True' else s := 'False'; Result := ident + Name + ' := ' + s + ';' + LineEnding; end else Result := ''; end; Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel