mIRC Homepage

inserting spaces

Posted By: foshizzle

inserting spaces - 10/02/08 04:26 PM

im trying to create my own custom edit box.. how would i include spaces in it

and how would i simulate word wrapping
Posted By: qwerty

Re: inserting spaces - 10/02/08 04:56 PM

You really have to try harder to make your posts clearer, almost all your posts are way too short and convey a feeling that you just can't be bothered to explain properly and give details.

Assuming you're talking about picture windows:

For the spaces issue, use any of the workarounds suggested here.

As for word wrapping, /help $wrap
Posted By: foshizzle

Re: inserting spaces - 10/02/08 05:03 PM

sorry.. i ment wrapping in picwins too and i wanted to create my own version of a rich edit text box
Posted By: foshizzle

Re: inserting spaces - 11/02/08 12:12 AM

well i didnt understand that article very much.. but i did figure out another way to do it, so thx anyway..

but onto the next thing... what is a simple formula to create multiples(etc. line numbers and knowing how to space them correctly)
like: i want the bar to be drawn at 39 if the line == 1 and 100 if its 2 and so on(random numbers)
Posted By: Riamus2

Re: inserting spaces - 11/02/08 12:51 AM

As before, you need to explain better what you want. I *think* you're talking about multiple characters repeating, such as "a" repeating 100 times (or spaces repeating that many). If so, see /help $str . If not, please explain better.

For rich edit, use DCX.
Posted By: foshizzle

Re: inserting spaces - 11/02/08 01:01 AM

not $str.. and im using picwins..
i wanted to use it for drawing text at a current position resembling different lines

ex:
draw blah on line 1(10y)
draw blah on line 2(25y)
so on so forth
... you get what i mean? yes? no? maybe so?
Posted By: starbucks_mafia

Re: inserting spaces - 11/02/08 01:49 AM

Use $width() to figure out where you need to wrap text. Use $height() to get line heights.
Posted By: foshizzle

Re: inserting spaces - 11/02/08 02:12 AM

i get that but how about the factors
and how would i break up the string of text into dif lines
Posted By: hixxy

Re: inserting spaces - 11/02/08 09:10 PM

Originally Posted By: foshizzle
i get that but how about the factors
and how would i break up the string of text into dif lines


qwerty already told you: /help $wrap
Posted By: foshizzle

Re: inserting spaces - 11/02/08 09:37 PM

that still doesnt tell me how to do factoring
Posted By: Riamus2

Re: inserting spaces - 11/02/08 10:03 PM

Factoring what?
Posted By: starbucks_mafia

Re: inserting spaces - 11/02/08 10:30 PM

Nobody knows what you mean by factoring.

Here's a simple example of how you might do it:
Code:
; Setup variables

var %text = THIS IS THE TEXT TO BE DISPLAYED
var %fontname = FONT NAME HERE
var %fontsize = FONT SIZE HERE
var %width = THIS IS THE WIDTH THE TEXT NEEDS TO FIT IN
var %window = THE PICWIN YOU WANT TO DRAW ON
var %color = A $RGB() VALUE OF THE TEXT COLOUR

; End of setup variables

var %lines = $wrap(%text, %fontname, %fontsize, %width, 0)
var %height = $height(%text, %fontname, %fontsize)
var %i = 1
while %i <= %lines {
  drawtext -r %window %color $qt(%fontname) %fontsize 0 $calc(%height * (%i -1)) $wrap(%text, %fontname, %fontsize, %width, %i)
  inc %i
}
Posted By: foshizzle

Re: inserting spaces - 12/02/08 12:53 AM

nvm

but what i was saying.. how do u create a while loop to create infanite number of lines.. and put the certain text on the certain line

what do i add to to incorporate new lines into this(¶ is a new line) -- using a string as my text..
i need to separate each line and write it to a new position but idk how to do that
Code:
   var %tex = $regsubex($hget(Note [ $+ [ $1 ] ],Text),/\—/gSi, $chr(32)),%i = 1
  $iif(%tex, drawtext -pn $1 $3 verdana 12 5 $calc(12 + 12 * %i) %tex, halt)
Posted By: Sais

Re: inserting spaces - 12/02/08 01:05 AM

In a picwin? Have you looked at the commands for picwins? At all?

And...this _inifinite_ number of lines in a while loop - you're just going to create an infinite loop, aren't you? Unless you're clever about it, you're going to lock mIRC up.

Oh. The help has the commands for picture windows:
/help Picture Windows

And more specifically for your question:
/help /drawtext

[edit] And how many questions are you trying to ask at once? [/edit]
Posted By: foshizzle

Re: inserting spaces - 12/02/08 01:06 AM

did u read any of what i had said earlier?
Posted By: Sais

Re: inserting spaces - 12/02/08 01:07 AM

All of it....before you edited it
Posted By: argv0

Re: inserting spaces - 12/02/08 01:11 AM

@ foshizzle:

It is my humble opinion that you need to stop posting on this board until you learn how to communicate your thoughts coherently and completely. Put away your keyboard, go to a book store, pick up a book on English grammar, and don't come back until you finish it.

Regards.
Posted By: foshizzle

Re: inserting spaces - 12/02/08 01:17 AM

Sais, then if you know so much, help me. Don't give me a link that does not have to do anything with what I was talking about.

is that better Argv0?
Posted By: Sais

Re: inserting spaces - 12/02/08 01:21 AM

When I answered, you had posted only:

"but what i was saying.. how do u create a while loop to create infanite number of lines.. and put the certain text on the certain line"

And that has nothing to do with the additional edit you made that I can discern.

P.S. There was never any claim of knowledge. I just tried to decipher your question as best I could, and it suggested you hadn't read the help file. (See also my comment below)
Posted By: Reaper

Re: inserting spaces - 12/02/08 01:49 AM

i dont know what you are trying to create but to me you are not making any sense. what is this script supposed to do? i mean we cant help you unless you tell us what the script is supposed to do and what you are trying to create with this script. i mean you are just asking us random questions and not telling us what you are trying to create. basically be specific in what you need help with. i dont like having to guess plus you can find most stuff in the help file. we are here to help you understand stuff in the help file. we are not here to quote you every line in the help file. basically read the help file before posting questions because you will find most your answers there. just ask specific questions about what you need.
Posted By: foshizzle

Re: inserting spaces - 12/02/08 02:19 AM

as i had said a while back, i was trying to create a custom edit text box feature...
so... im creating a little picwin with a sticky note feature in it(like a little version of notepad.exe)
but i dont know how to correctly place new lines in, i know how to space them apart but how do i separate the string into different variables or tokens and put those onto the lines(im using the paragraph (¶) symbol in my text to achieve this). how do i separate those(tokenize is an option) but then how do I put those onto separate lines...

ex: my text is blah¶blah¶blah
should look like:
Quote:

blah
blah
blah

i want each line to be set as a token or a variable... but i dont know how to do that..
Posted By: argv0

Re: inserting spaces - 12/02/08 02:30 AM

/help $gettok
Posted By: starbucks_mafia

Re: inserting spaces - 12/02/08 02:48 AM

As argv[0] said, you can use $gettok() to split that text at each pilcrow (¶ symbol) and loop through them. If each tokenised peice of text might be long then you may need an additional loop inside that one looping through $wrap() in the way I demonstrated a few posts up.
Posted By: foshizzle

Re: inserting spaces - 12/02/08 03:38 AM

i got the wrapping working.. thx a lot
but how about the custom created new lines(separate lines)
Posted By: hixxy

Re: inserting spaces - 12/02/08 10:50 PM

No sense. You are making.
Posted By: starbucks_mafia

Re: inserting spaces - 12/02/08 11:29 PM

I don't know what you mean. Adding any new lines using /drawtext is all based on the same principle I demonstrated earlier. ie. Take the height of the line and multiply it by (n - 1) where n is the line number.

If you want to overwrite lines then you simply erase the previous text using /drawrect with the background colour.

Other than that, you'll have to explain in more detail what you mean.
Posted By: foshizzle

Re: inserting spaces - 12/02/08 11:43 PM

ie: enter key
Posted By: Sais

Re: inserting spaces - 13/02/08 06:38 PM

Originally Posted By: Starbuck's Mafia
...in more detail...


(You really sound like a troll, rather than someone who can't quite express themselves. If you don't want that image, you might like to read: http://catb.org/~esr/faqs/smart-questions.html . I would really recommend it to everyone - askers and answerers alike)
Posted By: foshizzle

Re: inserting spaces - 13/02/08 08:13 PM

?, if you dont think im asking good questions, dont post anything
Posted By: starbucks_mafia

Re: inserting spaces - 13/02/08 08:22 PM

It isn't necessarily the questions you're asking, it's how you ask them. This thread is now approaching 30 posts and I'm still not sure what you're asking for. In the last post I made I asked you to be more specific and you gave me a three word response. You can't keep expecting people to bend over backwards to figure out what you're saying. In at least one post you wrote clearly and coherently so you're obviously capable of asking questions properly, but in just about every other post it almost seems like you're giving deliberately cryptic responses.

Your last post was "ie: enter key". What about the enter key is the problem? The enter key just adds a new line, we've already established how you figure out where the next line down would be, so what exactly is the problem you're having with the enter key?
Posted By: foshizzle

Re: inserting spaces - 13/02/08 10:34 PM

edit: nvm
© 2022 mIRC Discussion Forums