Frederick Posted April 30, 2020 Share Posted April 30, 2020 When I set the caption of a TUniPanel to 'Debit <> Credit', UniGUI shows the caption as 'Debit \x3C\x3E Credit'. How do I get the caption to show the angled brackets? Note: I don't see a property of TextConversion in the TUniPanel. Why should it assume that the text I enter is HTML? -- Frederick (UniGUI Complete - Professional Edition 1.90.0.1530) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2020 Share Posted April 30, 2020 4 hours ago, Frederick said: When I set the caption of a TUniPanel to 'Debit <> Credit', UniGUI shows the caption as 'Debit \x3C\x3E Credit'. Hello, This approach may help you: Quote Link to comment Share on other sites More sharing options...
Frederick Posted April 30, 2020 Author Share Posted April 30, 2020 I used the following code in a procedure and not in the OnFormReady event since the caption changes according to some validation process. TUniPanel1.Caption:='Debit <> Credit'; TUniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+TUniPanel1.Caption+'");'); Unfortunately, the result is still the same. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2020 Share Posted April 30, 2020 23 minutes ago, Frederick said: not in the OnFormReady event Where? Quote Link to comment Share on other sites More sharing options...
Frederick Posted April 30, 2020 Author Share Posted April 30, 2020 In Procedure TForm.MyProc; begin TUniPanel1.Caption:='Debit <> Credit'; TUniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+TUniPanel1.Caption+'");'); end; Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 30, 2020 Share Posted April 30, 2020 51 minutes ago, Frederick said: Procedure TForm.MyProc; OK, but where do you call this proc? Quote Link to comment Share on other sites More sharing options...
Frederick Posted April 30, 2020 Author Share Posted April 30, 2020 7 hours ago, Sherzod said: OK, but where do you call this proc? I have found out where the problem lies. In my actual app, I set the TUniPanel's Caption's Font.Color and Color properties in addition to changing the caption. If I set these two properties after your JS code, the angled brackets are not shown correctly. It works if the properties are set before the JS code. So, UniPanel1.Caption:='Debit <> Credit'; UniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+UniPanel1.Caption+'");'); UniPanel1.Font.Color:=clWhite; UniPanel1.Color:=clRed; Wrong! Angled brackets not shown correctly. UniPanel1.Caption:='Debit <> Credit'; UniPanel1.Font.Color:=clWhite; UniPanel1.Color:=clRed; UniPanel1.JSInterface.JSCode('Ext.get('#1'.id+"_td").setHtml("'+UniPanel1.Caption+'");'); Correct! Angled brackets shown correctly. Thanks for your assistance. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.