mIRC Homepage
Posted By: TECO Custom dialog multiline checkbox - 24/06/17 12:31 PM
I would like to put the text of a check in two lines.

Someone can help me?

Line:
check "&Adjust windows to Toolbar and Statusbar", 17, 19 120 150 14

And he wanted it to look like this:

Adjust windows to Toolbar
and Statusbar
Posted By: ruprecht Re: Custom dialog multiline checkbox - 24/06/17 04:34 PM
The text label for a checkbox control can't be split like that, but it's possible to fake it. One way is to use the first part of the text in the check, and make a text control under it with the rest of the line.
Code:
check "&Adjust windows to Toolbar", 17, 19 120 150 14
text "and Statusbar", 917, 35 136 150 14


You may need to adjust the location of the text control. For my setup 16px to the right and down fits nicely.
Posted By: TECO Re: Custom dialog multiline checkbox - 24/06/17 07:29 PM
That way I also know how to do it, but mIRC does allow this, because the Windows Group dialog has it, and somehow Khaled did it!
Posted By: maroon Re: Custom dialog multiline checkbox - 24/06/17 09:16 PM
does the style 'multi' not give you what you're seeking?
Posted By: ruprecht Re: Custom dialog multiline checkbox - 25/06/17 03:52 AM
Well there you go... another undocumented feature. Never thought about that. I was trying to insert line breaks...
Posted By: TECO Re: Custom dialog multiline checkbox - 25/06/17 06:09 PM
Originally Posted By: maroon
does the style 'multi' not give you what you're seeking?


Thank you maroon.

Your suggestion has resulted. I just want to ask you one more thing. Is it possible to put the check on the first line as mIRC has in the Window Group dialog?

Example:
Posted By: maroon Re: Custom dialog multiline checkbox - 25/06/17 08:42 PM
Unfortunately, it seems style 'top' doesn't work for the check control. You can fake it by beginning the check label like:

//did -ra dialogname check# $crlf $+ &Visible label

This is only practical if the visible text is split between 2 lines, and prevents the checkbox from being very close to another control above it.

It's also possible that mIRC gives itself access to things it doesn't give us, but I do see the wrapping you're talking about, and it's in quite a few places, such as mirc-options/display has several. Similar to what the other guy suggested above, a slightly better choice is to have the text for the checkbox be $null and have the entire wrap text be in a text control. You'll have to make the text control be very thin to keep the text from getting wiped when the checkbox is toggled. This example works for me without 'option dbu' enabled:

Quote:
check "", 17, 19 120 10 14
text "&Adjust windows to Toolbar and Statusbar", 917, 35 120 140 26


There are additional styles that could easily be enabled but aren't. For example, BUTTON always displays the text centered, when there are cases where I wish it would make it easy to have the text left/right justified.
Posted By: TECO Re: Custom dialog multiline checkbox - 25/06/17 09:40 PM
Too bad you do not know a solution, but your suggestion is not interesting. I do not try to pretend a solution, but to have it.

I hope Khaled will answer me and tell me the solution to this mystery.
© mIRC Discussion Forums