Login Page - Create Account

Support Board


Date/Time: Fri, 29 Nov 2024 10:36:42 +0000



[ACSIL] newline character in control bar button text?

View Count: 511

[2023-02-17 22:26:43]
User275839 - Posts: 61
I have some custom ACSIL studies that I can invoke using custom control bar buttons. I get the string for the button text using sc.Input[].GetString(). I set the button label text using sc.SetCustomStudyControlBarButtonText().

I have found that if I add a '\n' newline character to the string in the settings dialog, fetch it using sc.Input[].GetString() and set it using sc.SetCustomStudyControlBarButtonText(), the '\n' appears in the string and doesn't cause a line break.

However, setting a control bar button label using the standard "Control Bar Button Properties" dialog and entering the label text with a '\n' newline character in the "Caption:" field yields the desired result.

Is there a way to accomplish this using ACSIL calls?

Thank you!
[2023-02-18 21:50:02]
ForgivingComputers.com - Posts: 960
sc.SetCustomStudyControlBarButtonText(ButtonBuyStop.GetInt(), "Buy\nHigh");

[2023-02-18 22:26:12]
User275839 - Posts: 61
Hi bradh -

Thank you for your response. I'm effectively doing what you suggested, except that I'm pulling the user-provided string from the Input_ item in the study settings dialog.


sc.SetCustomStudyControlBarButtonText(ACS_Button_ID, Input_ACSButtonLabel.GetString());

I tried putting a \n newline in the settings dialog but it just shows up as backslash-n in the button label.

Then I tried some voodoo, but same results:


SCString inputString;
inputString.Format("%s", Input_ACSButtonLabel.GetString());

sc.SetCustomStudyControlBarButtonText(ACS_Button_ID, inputString);

I wonder if Sierra is doing something clever with the string to make it work in the button label when it is entered via the Control Bar Button Properties dialog in the UI?
[2023-02-20 15:07:26]
Sierra_Chart Engineering - Posts: 17226
We will look this over.
Sierra Chart Support - Engineering Level

Your definitive source for support. Other responses are from users. Try to keep your questions brief and to the point. Be aware of support policy:
https://www.sierrachart.com/index.php?l=PostingInformation.php#GeneralInformation

For the most reliable, advanced, and zero cost futures order routing, use the Teton service:
Sierra Chart Teton Futures Order Routing

To post a message in this thread, you need to log in with your Sierra Chart account:

Login

Login Page - Create Account