Jump to content

Awesome in UniImage


Dinkin

Recommended Posts

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniImage1 do
  begin
    //JSInterface.JSConfig('cls', ['x-fa fa-heart']); // or
    JSInterface.JSConfig('cls', [UniNativeImageList1.GetImageIconCls(1)]);

    // color optional
    // the remaining two properties must be specified
    JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle("color", "red"); me.setStyle("line-height", "'+ Height.ToString() +'px"); me.setStyle("font-size", "'+ Height.ToString() +'px")}');
  end;

end;

 

  • Like 2
Link to comment
Share on other sites

   JSInterface.JSConfig('cls', ['x-fa fa-sync fa-spin']); 
   JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle("color", "red"); me.setStyle("line-height", "'+ Height.ToString() +'px"); me.setStyle("font-size", "'+ Height.ToString() +'px")}');

fasync.gif.8313aae265d086ae796a8162de71c055.gif

  • Like 3
Link to comment
Share on other sites

Thank!.
But I can’t translate this line into in Builder c++ =(
 

  JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle("color", "red"); me.setStyle("line-height", "'+ Height.ToString() +'px"); me.setStyle("font-size", "'+ Height.ToString() +'px")}');
Link to comment
Share on other sites

String st = "function(me){me.setStyle(\"color\", \"red\"); me.setStyle(\"line-height\", \"" + IntToStr(32) + "px\"); me.setStyle(\"font-size\", \"" + IntToStr(32) + "px\")}";
UniImage1->JSInterface->JSAddListener(L"afterrender", ARRAYOFCONST(((String)st)));

 

Quote

Could not find a match for 'IUniJSInterface::JSAddListener(const wchar_t *,OpenArray<TVarRec>,unsigned int)'

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...