Re: EditField format is copied between fields

  • Hi Julian (or anyone who migth help me :-))
    How I can avoid the format of one EditField to be copied to next when moved
    using cursor Up or Down keys? For example, I have two fields, one bold the
    second normal. When I move from One to Second using cursor down, the second
    field gets bold when I start to type its content, but if I use TAB works
    correctly.

    I can't found this in Edit options. Another acceptable way could be disable
    cursors keys between fields, but I need them into multiline fields, so
    KeyDown event for the editor don't work.

    Thanks a lot

    Diego

  • You can trap the OnEditFieldFocus and set the property CurrAttr
    according to the edit field you are in (function CurrentEditField :
    string).

    Other procedures helpful in this context are:

    function InputField(c: Char; const text, fieldname: string):
    Integer;
    function InputFieldEx(c: Char; const DisplayName, FieldName,
    Command: string; Format: Integer): Integer;
    function InputEditField(const fieldname, fieldtext: string;
    placecaret: Boolean): Integer;
    function ReadFieldText(const fieldname: string): string;
    procedure GetFields(list: TStrings);
    function GetFieldName(tag: Integer): string;
    function GetPreviousFieldName(par: PTParagraph; lin: PTLine; pos:
    Integer): string;
    function CurrentEditField: string;
    // EditField Support
    function MoveToField(const fieldname: string; from_start:
    Boolean): Boolean;
    function MoveToNextField(from_start: Boolean): string;
    function MoveToPreviousField(from_end: Boolean): string;
    function DeleteFieldAtCP: Boolean;
    function SelectFieldAtCP: Boolean;

  • Hi Julian:
    Thanks for your reply.
    Sorry, but I still don't understand how to get the field on focus
    attributes, to replace the current attr. CurrentEditField only gives me the
    name, how do I get the field attr?

    Regards

    Diego