accept function with long text option

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
zahid_721
Posts: 1
Joined: April 13th, 2022, 6:42 am

accept function with long text option

Post by zahid_721 »

Hello Experts.
I am using the accept function and I want each option in one line instead of Wrap text.
numeric manual_choice = accept("Open which manual?", "Please confirm, do you want work as Supervisor?", "Please confirm, do you want work as Interviewer");
Thanks.

ZahidMasood
Attachments
acceptfunction_pic.png
acceptfunction_pic.png (6.51 KiB) Viewed 731 times
alex_izm
Posts: 19
Joined: December 9th, 2016, 11:31 am

Re: accept function with long text option

Post by alex_izm »

Here are the steps to make choice dialog options text not wrap:

1. Create folder "MyDialogs" inside your application folder
2. Locate file choice.html in the "{CSpro installation folder}\HTML\Dialogs" (default on Windows is "c:\Program Files (x86)\CSPro 7.7\html\dialogs\choice.html") folder and copy it to "MyDialogs" folder you've just created
3. Open "{your application}MyDialogs\choice.html" file in notepad and modify line 39 from this:

Code: Select all

<span class="col withNewline" style="white-space: nowrap;background:#ddd">{{caption}}</span>
to this:

Code: Select all

<span class="col withNewline" style="white-space: nowrap;background:#ddd;padding-right:64px;">{{caption}}</span>
4. In your PFF file add "HtmlDialogs=.\MyDialogs" under the [Files] section:

Code: Select all

[Files]
Application=.\TestCustomAccept.ent
InputData=|type=None
HtmlDialogs=.\MyDialogs
After this your options in accept dialog should not be wrapping anymore:
Image

Note: The options text will still wrap if the length of text exceeds the screen size.

Don't forget to include MyDialogs\choice.html in your application distribution.

Alex
Post Reply