mos Posted September 17, 2020 Share Posted September 17, 2020 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 More sharing options...
Sherzod Posted September 17, 2020 Share Posted September 17, 2020 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 More sharing options...
mos Posted September 22, 2020 Author Share Posted September 22, 2020 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 More sharing options...
Sherzod Posted September 22, 2020 Share Posted September 22, 2020 1 hour ago, mos said: JSCode(#1'.el.query("canvas")[0].style.height="0";'); Please remind me, what did we use this for? Link to comment Share on other sites More sharing options...
mos Posted September 22, 2020 Author Share Posted September 22, 2020 Hi Sherzod, That line was originally used to fix an issue where if you tried to set the Canvas.Color property the Canvas did not show the color. Link to comment Share on other sites More sharing options...
Sherzod Posted September 22, 2020 Share Posted September 22, 2020 2 minutes ago, mos said: That line was originally used to fix an issue where if you tried to set the Canvas.Color property the Canvas did not show the color. Hi, OK, I will check. Link to comment Share on other sites More sharing options...
Sherzod Posted September 22, 2020 Share Posted September 22, 2020 24 minutes ago, mos said: property the Canvas did not show the color One question, canvas in "readonly" mode? Link to comment Share on other sites More sharing options...
mos Posted September 22, 2020 Author Share Posted September 22, 2020 Are you referring to the enabled property of the canvas? Link to comment Share on other sites More sharing options...
Sherzod Posted September 23, 2020 Share Posted September 23, 2020 5 hours ago, mos said: Are you referring to the enabled property of the canvas? Yes, editable property. And how do you want to use the canvas? Link to comment Share on other sites More sharing options...
mos Posted September 23, 2020 Author Share Posted September 23, 2020 Yes Enabled is set to true. I have a small UniCanvas next to a UniColorButton. When the user selects a UniColorButton I want the UniCanvas to show the selected color. Link to comment Share on other sites More sharing options...
Sherzod Posted September 23, 2020 Share Posted September 23, 2020 10 minutes ago, mos said: to show the selected color Just wanted the paint to change color? Link to comment Share on other sites More sharing options...
mos Posted September 23, 2020 Author Share Posted September 23, 2020 Yes Link to comment Share on other sites More sharing options...
Sherzod Posted September 23, 2020 Share Posted September 23, 2020 And what if you will use UniPanel instead? \FMSoft\Framework\uniGUI\Demos\Desktop\ColorPalette Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now