mIRC Home    About    Download    Register    News    Help

Print Thread
#198542 30/04/08 05:11 PM
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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.


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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

Last edited by Lpfix5; 01/05/08 12:58 PM.

Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
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.

Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
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

Last edited by foshizzle; 04/05/08 01:41 PM.

This is not the signature you are looking for
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
The snipplet you wrote pulls up a picture window named PicWin and its all black without anything inside


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
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

Last edited by Wims; 05/05/08 05:31 PM.

#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
but its not hard :P


This is not the signature you are looking for
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
Well im always up for learning the curves smile


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
just experiment with it, and with the -s switch..


This is not the signature you are looking for
Joined: Aug 2005
Posts: 1,052
L
Lpfix5 Offline OP
Hoopy frood
OP Offline
Hoopy frood
L
Joined: Aug 2005
Posts: 1,052
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


Code:
if $reality > $fiction { set %sanity Sane }
Else { echo -a *voices* }
Joined: Aug 2007
Posts: 334
Pan-dimensional mouse
Offline
Pan-dimensional mouse
Joined: Aug 2007
Posts: 334
lol, picwins are de way to go smile

try lookin at picwin.tk for some inspiration smile


This is not the signature you are looking for

Link Copied to Clipboard