Jump to content

How To Show Angled Brackets In TUniPanel's Caption?


Frederick

Recommended Posts

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)
 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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