Jump to content

UniCanvas Border Styling


mos

Recommended Posts

I am trying to apply some styling to the border of a TUniCanvas using the following, but nothing appears:

procedure TMainForm.UniFormShow(Sender: TObject);
begin
  with UniCanvas1.JSInterface do
  begin
    JSConfig('style', ['border-style: solid']);
    JSConfig('style', ['border-width: 1px']);
    JSConfig('style', ['border-color: red']);
  end;
end;

If I comment out the border-width and border-color lines then the border appears.

How can I apply all the border styling to the Canvas.

Link to comment
Share on other sites

15 minutes ago, mos said:

How can I apply all the border styling to the Canvas.

Hello,

Also try:

procedure TMainForm.UniFormShow(Sender: TObject);
begin
  with UniCanvas1.JSInterface do
  begin
    JSCall('setStyle', ['border-style', 'solid']);
    JSCall('setStyle', ['border-width', '1px']);
    JSCall('setStyle', ['border-color', 'red']);
    JSCall('setStyle', ['width', 'auto']);
  end;
end;

 

Link to comment
Share on other sites

Hi Sherzod,

    Thanks for that.

    I tried to add the following line to above code but all I get is a single vertical black line:

JSCode(#1'.el.query("canvas")[0].style.height="0";');

  I need to add this line to get around this other issue I posted awhile ago: http://forums.unigui.com/index.php?/topic/9976-setting-tunicanvascolor-issue/&tab=comments#comment-51953

 Can you tell me how I can fix this.

 

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...