mIRC Homepage
Posted By: Lpfix5 draw commands question?? - 30/04/08 05:11 PM
So lets create my picture window 400x400 sizable

/window -pd +bs @test -1 -1 400 400

lets create a rectangle

/drawrect @test 15 1 1 1 120 14

now the questions

A) /drawfill -ihnrs @ <color> <color> <x y> [filename] [<x y>...]
So I assume /drawfill @ 15 2 2 would work but it doesnt, its not correct length so I used /drawfill @ 15 3 2 2 its correct length but fills up the whole window instead of just the rectangle

So my question is how do I fill just the rectangle

B) /drawtext @test 4 8 arial Hi there it is ok so text goes perfectly inside my rectangle however I can't select the text with my mouse.

What im trying to accomplish here is a way where I can make a dialog looking thing out of @window where I can alter text or use it has a list

and finally

C) I noticed once when I had a script downloaded awhile back that it had a picture window mp3 script where the DIR was loaded into the picture window has a valid list, where I could select mp3's within the list and it would notice the actually click, I have been trying to mess around with picture windows without any good documentation on how to go about really making everything work as one would assume.

P.S. the mp3 script I had back then had everything from play/stop/pause/skip to dir list to minimize the list to maximizing it, to having a bar scroll across the screen has the song played and reached the end till it was done.

Not that I want to create a mp3 window but If I knew how to have fields made, then text edited when I needed it for example like send a command /aline 8 @test NEW DATA and it would change it as if it i did , DID -ra $dname 1 NEW DATA with a dialog

If anyone has good MIRC picture window documentation and no where I could get it please let me know or if they could tell me a few examples that I could work around it would be great too.

Thanks in advance for help.
Posted By: hixxy Re: draw commands question?? - 30/04/08 07:00 PM
1. /drawfill does the same as the paint bucket tool in paint, ie. if the coordinates you specify are red then all red pixels in that area will be replaced with the colour you specified. Look at /drawrect with the -f switch to draw a solid rectangle.

2. You'd have to code your own selection routine by storing the coordinates and details (font, fontsize, bold?) of the text you draw, and then respond to mouse events and whatnot. Fairly complicated.

3. Well-made scripts (argh amp is a brilliant example) will make it seem like actual windows controls are being used, however when using picture windows you have to draw everything yourself, and if you want the display to change when you receive mouse events then you have to redraw the new effects yourself. Nothing is done for you, it's all custom drawing.
Posted By: Lpfix5 Re: draw commands question?? - 01/05/08 12:51 PM
Um im aware of that its all manual work but im determine to spend a few hours a day to create what I have in my mind.

See like notice how "argh amp" has the playlist (LIST) this is what I want to create with a function load within the list and that it doesnt surface it

I found what I needed here Listbox Tut
Posted By: hixxy Re: draw commands question?? - 01/05/08 10:12 PM
Jynx made a good effort, but the listbox that tutorial shows you isn't the best, for example the scrollbar thumb doesn't change size as you fill the box with data or remove data from the box, and it has no up/down arrows.

It's good as a basic tutorial but to create a decent functioning listbox, you'll need to put in more effort than that. I would also think about writing some kind of control that can be used in any window as many times as you like, because if you then decide you want another listbox you're going to have to duplicate a lot of code.

Not trying to put a damper on things but it's a simple thing to do, at all.
Posted By: Lpfix5 Re: draw commands question?? - 01/05/08 11:27 PM
Loading jpg's apparently requires less then 2k of code to a picture window while create a simple routine of multi use listbox requires nearly 12k of code lol
Posted By: foshizzle Re: draw commands question?? - 04/05/08 01:38 PM
the way i do it for this situation, is i drawfill the color of the rect i want, then i draw the rect, then drawfill the outside again with white so all you see is the rect

this will show the black outline, but u can draw over with another rect or drawreplace
Code:
//window -pkodCfB +nt @PicWin -1 -1 300 300 | drawfill @PicWin 4 1 0 0 | drawrect @PicWin 1 1 10 10 280 280 | drawfill @PicWin 0 1 0 0
Posted By: Lpfix5 Re: draw commands question?? - 05/05/08 01:07 AM
The snipplet you wrote pulls up a picture window named PicWin and its all black without anything inside
Posted By: Wims Re: draw commands question?? - 05/05/08 05:29 PM
It's probably because your font is black by defaut, add a drawrect -fn that fill your window with white and it should works but anyway, his "snippet" only draw a rectangle, make a engine in order to draw and *act* with your listbox isn't as easy as this smirk
Posted By: foshizzle Re: draw commands question?? - 05/05/08 08:13 PM
but its not hard :P
Posted By: Lpfix5 Re: draw commands question?? - 06/05/08 01:23 PM
Well im always up for learning the curves smile
Posted By: foshizzle Re: draw commands question?? - 06/05/08 07:21 PM
just experiment with it, and with the -s switch..
Posted By: Lpfix5 Re: draw commands question?? - 06/05/08 07:42 PM
As always if I didn't experiment with the dialogs when I knew nothing about them I wouldn't be where I am today, now i just look @ dialogs and laugh
Posted By: foshizzle Re: draw commands question?? - 08/05/08 02:50 AM
lol, picwins are de way to go smile

try lookin at picwin.tk for some inspiration smile
© mIRC Discussion Forums