Miniwindows help - First time trying this

Posted by Rivius on Mon 14 Feb 2011 06:45 PM — 3 posts, 19,043 views.

#0
I'm playing around with miniwindows for the first time, and I'm having a little trouble getting things going.

Right now, I just want to make the miniwindow draggable. I've tried the code below, and while I can hover and click on the title bar I made, I cannot seem to move the windows from its position.


require "movewindow"
require "display"

wdisplay = GetPluginID ()
check(WindowCreate(wdisplay, 0, 0, 300, 300, 12, 0, ColourNameToRGB("black")))
    WindowShow(wdisplay, true)
	WindowRectOp(wdisplay, 2, 0, 0, 0, 15,  ColourNameToRGB("slategray"))
	WindowRectOp(wdisplay, 1, 0, 0, 0, 0, ColourNameToRGB("slategray"))
    movewindow.add_drag_handler(wdisplay, 0, 0, 0, 15)
	WindowFont (wdisplay, "f", "Courier New", 9, true, false, false, false)


A second question. I am trying to display some ASCII art and put some numbers around it, and I was looking into the WindowText function. There seems to be a bit of an issue in drawing the ASCII art with [[my art here]] because it does not make the newline characters as I need it to.

I want to be able to do things like

((((((((---[4]====)))
((||}}[5]
==========((||))
==========

where 4 and 5 are variables. Is there an easy work around to this problem?
USA #1
Rivius said:

A second question. I am trying to display some ASCII art and put some numbers around it, and I was looking into the WindowText function. There seems to be a bit of an issue in drawing the ASCII art with [[my art here]] because it does not make the newline characters as I need it to.

I want to be able to do things like

((((((((---[4]====)))
          ((||}}[5]
==========((||))
==========


where 4 and 5 are variables. Is there an easy work around to this problem?


Yes, you need to use WindowFontInfo() to find out what the height of your font is, then add that height to WindowText's y parameter for each line.
Australia Forum Administrator #2
This describes how to drag windows around. It isn't built in, but using this module simplifies it somewhat:

http://www.gammon.com.au/forum/?id=9594

As for the ASCII art, see this:

http://www.gammon.com.au/mushclient/mw_text.htm

In particular the bit near the bottom under Hint 4.