mIRC Home    About    Download    Register    News    Help

Print Thread
M
MauS
MauS
M
I managed to create a listbox /window, it satisfies my needs, except one: i need the text to be wrapped so that it wouldn't be typed outside the visible part of the window. How to do this?

Hmm... And can i create a /dialog with a textbox, that would be disabled (user can copy text, but not change it) and have word wrap switched on?

Thanks for your attention.

Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
/help $wrap

M
MauS
MauS
M
Please, could you give an example? It gives only a single wrapped line or a paragraph of wrapped lines?

Can i set a paragraph into a variable?

Last edited by MauS; 05/11/03 04:52 PM.
Joined: Jan 2003
Posts: 2,973
K
Hoopy frood
Offline
Hoopy frood
K
Joined: Jan 2003
Posts: 2,973
Break it into a paragraph using the $wrap identifyier. use the N property to get line N of the paragraph. Set how wide you have of a space to work with, then it should break it into wrapped portions for you.

Joined: Feb 2003
Posts: 806
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 806
To set how many pixels $wrap() should work with, you might want to try $window().dw (or .dh); take a further look at the help file.

P.S.: since the .dw and .dh properties are related only to non-listbox text @windows, you could temporarily use a hidden, non-listbox one with the same dimensions as the listbox one, then get its .dw and .dh dimensions.
Doing this, though, you'd wrap lines with some offset to the left, because that hidden window would calculate its display width subtracting the scrollbar width, something that listbox windows don't have.

A solution for that (that I know of) would be using a DLL, one that gets the scrollbar width for you, checking your OS settings etc. I'm sure there is one at www.mircscripts.org, I think it was made by dohcan, but I can't remember its name, and I don't know if it'll load properly on the latest mIRC version (it's a little old). Do some search there if you want it.

Last edited by cold; 05/11/03 11:21 PM.
S
stimpy
stimpy
S
The answer on the question about the editbox in a dialog...

How to make the text in an editbox good for copying but not for changing...

Use the read-only option

edit "Your text", 1, 5 5 30 10, read

Something like this...

Grtzzz


Link Copied to Clipboard