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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...