Manually trigger highlight

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #38320
    JM-DG
    Participant

    Hi!

    I would like to know if it's possible to manually trigger the highlight effect you can see when hovering your mouse over a TMemo.

    I'ld like to be able to trigger it when there's a keypress instead.

    b14ed72bafde211218796cc28432e8f9.gif

    Thank you for your time.

    #59771
    K.Ob
    Participant
    'JM-DG' wrote:

    Hi!

    I would like to know if it's possible to manually trigger the highlight effect you can see when hovering your mouse over a TMemo.

    I'ld like to be able to trigger it when there's a keypress instead.

    b14ed72bafde211218796cc28432e8f9.gif

    Thank you for your time.

    +1

    Great idea and i want to add that i would love to see that highlight effect manually triggered for buttons too, ex. with a timer i can point the user to the logical button to press after filling a form (undo,cancel,…) or to point that the content had changed by triggering the effect once for a memo or a listview,

    In other words please add a way to trigger the animations effect manually with a demo how to do it right .

    Best regards

    #59773
    SzakiLaci
    Participant

    This topic should be moved to

    Technical support >> Tricks

    (And delete this reply I've just made here)

    #59783
    Support
    Keymaster

    Hello

    You can use code like this

    Code:
    procedure TForm9.FormMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    ReleaseCapture;
    sEdit1.SkinData.FMouseAbove := True;
    ShowGlowingIfNeeded(sEdit1.SkinData)
    end;

    procedure TForm9.FormMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
    begin
    HideGlow(sEdit1.SkinData.GlowID);
    end;

    But this way has some limitations and glow effect may be not defined in the current skin.

    I will think how to make this feature better, I hope to publish a best solution soon.

    #59786
    K.Ob
    Participant
    'Support' wrote:

    But this way has some limitations and glow effect may be not defined in the current skin.

    I will think how to make this feature better, I hope to publish a best solution soon.

    I tried to create sample to explain what i am looking for , so here is it:

    asControlFlash.gif

    What i did is duplicating ShowGlowingIfNeeded to new function

    Code:
    procedure ShowGlowing(const SkinData: TsCommonData; const Clicked: boolean = False; const CtrlHandle: HWND = 0; Alpha: byte = MaxByte; DoAnimation: boolean = True; ASkinIndex: integer = -1); // DoAnimation: boolean = True; was False

    This procedure code is same as ShowGlowingIfNeeded and called it from timer event like this:

    Code:
    var
    i: Integer;
    begin
    sEdit1.SkinData.FMouseAbove := True;
    ShowGlowing(sEdit1.SkinData);

    i := 0;
    while i < 100 do
    begin
    sleep(1);
    application.ProcessMessages;
    Inc(i);
    end;

    sEdit1.SkinData.FMouseAbove := False;
    ShowGlowing(sEdit1.SkinData);

    This exactly what i need to do flash control (now it is only highlight and only some skins support it ), but may be this can be a future feature as specific flash visual can be added to skins with different color than highlight.

    Anyway, this snippet is wrong and should not be like that, i did this to show the required result which i think many will love to have and use, even may be this can be converted into automatic property to flash controls when changed ( edits, memo's …)

    Thank you in advance and please consider to add usable interface to this visual effect.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.