Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUSHclient ➜ Lua ➜ Miniwindows help - First time trying this

Miniwindows help - First time trying this

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Rivius   (99 posts)  Bio
Date Mon 14 Feb 2011 06:45 PM (UTC)
Message
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?
Top

Posted by Twisol   USA  (2,257 posts)  Bio
Date Reply #1 on Mon 14 Feb 2011 11:24 PM (UTC)
Message
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.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
Top

Posted by Nick Gammon   Australia  (23,173 posts)  Bio   Forum Administrator
Date Reply #2 on Mon 14 Feb 2011 11:40 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


18,120 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.