[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Miniwindows
. . -> [Subject]  Hotspots feature question/request
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Hotspots feature question/request

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page


Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Thu 02 Apr 2009 02:32 AM (UTC)  quote  ]

Amended on Thu 02 Apr 2009 02:36 AM (UTC) by Onoitsu2

Message
I was wondering if you had it planned to allow a list of points, i.e. a polygon to be a hotspot. As opposed to just a 4 sided container, being either a square or rectangle. Adding that as a feature would be a nice thing for those that do not wish to use standard 4 sided buttons, and providing some "feedback" when mouse-overing it, or when clicking on it, and it responding as if the triangle, pentagon, or whatever itself was the actual button as opposed to only said square or rectangle within it, leaving much of the polygon un-hotspotted.

The fact that you can draw them to begin with is a nice step towards this, but I have been looking through the source for 4.40 and have not even seen how this could be implemented, albeit I am a novice programmer, so I am probably just overlooking this like having a "bat in the cave", it is literally at the tip of your nose but you are oblivious to it.

I just think it would spice up the interface similar to that of the balloon tooltips. As well as if someone were to make a compass miniwindow plugin you could have "specialized" hotspots that only trigger in the arrows themselves say for an image similar to http://www.navis.gr/navaids/images/compass.jpg
or
http://www.edupic.net/Images/SocialStudies/compass_rose.gif

You load the image, then you can blend in over the arrows a coloring signifying it is available, and have the hotspot enabled as well.

Support for rounded edges would probably be nice, but probably is not necessary at this point unless there is a real need for it.

Again this might be more trouble than it's worth, but who knows perhaps people will be a little more artistic in their window creation.

And who knows, perhaps using a mask you could make the miniwindow itself a "fake" polygon, which would probably make a very nice looking compass window or other things as well.

[Edit: Did not see this in window creation,
Flag 4 - Transparent. If set, whenever a pixel in the contents of the window matches the BackgroundColour, it is not drawn, and the text underneath shows through. This lets you make odd-shape windows like stars or circles, by filling the outside (the part you don't want to see) with the background colour.]

-Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (19,616 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Thu 02 Apr 2009 04:52 AM (UTC)  quote  ]
Message
The problem with polygons is that they are not necessarily closed. For example you could draw an L shape which would not have an obvious inside or outside.

I suggest you make a rectangle which completely encloses the polygon (eg. the star). You only see the polygon, and the visual feedback (eg. the star changing colour) could still be done by redrawing it. The only slight problem would be that if you carefully moved the mouse into between the points, that would be considered part of the hotspot, however you would have to look pretty carefully to spot it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Reply #2 on Thu 02 Apr 2009 06:13 AM (UTC)  quote  ]
Message
Well I see in the code that there is a separate provision for open and closed polygons in the polygon functions.


  if (Close)
    dc.Polygon(&points [0], iCount); 
  else
    dc.Polyline(&points [0], iCount); 


I was not assuming it would be used for open polygons, as I can see that issue hitting a major snag, but how many people actually use open polygons?

Was just a nice "feedback" feature that would smooth the overall appearance of the client, or perhaps allow smoothing plugins to be created.

-Onoitsu2
[Go to top] top

Posted by Nick Gammon   Australia  (19,616 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 02 Apr 2009 08:13 PM (UTC)  quote  ]
Message
I don't get what the problem is here. You don't see hotspots, there are just a rectangle which detects mouse-down, mouse-up or mouse-over.

Changing the hotspot shape will not affect the "overall appearance of the client", at all.

Most GUI applications use rectangles, round rectangles, or circles for their "control" elements. A hotspot rectangle can fit on top of most of those so that they appear active when you click on them, with a pretty good fit.

Say for example you draw a 5 x 5 pixel circle (eg. some sort of button). The number of pixels that covers (ie. the area of a circle of 5 cm diameter) is 19.63 (say, 20 pixels) whereas the enclosing square would take 25 pixels. So there are 5 stray pixels at the corners where you can click, which are just outside the circle, but would activate the hotspot. Big deal. That is roughly 1 rogue pixel per corner. You would have to be very obsessive to spot that you can click on the circle, near the top-left corner, 1 pixel outside the circle, and have it activate.

In any case, a circle doesn't come into the definition of a "closed polygon" so that would not even be covered by your suggestion.

Don't worry about it. Make the buttons any shape you want, and then find a rectangle that is a reasonable fit over the top of it. If necessary (like you have an L-shaped button for some reason), put two hotspots over it, linked to the same action routines.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Onoitsu2   USA  (246 posts)  [Biography] bio
Date Reply #4 on Fri 03 Apr 2009 05:18 AM (UTC)  quote  ]
Message
Well it was not a "big deal" just sort of an idea I had. For an L shaped button 2 hotspots would work I would imagine, as for those stray pixels that allow activation, on a circle it would still work as if it were a square. Even if it is not visible there could be a visible feedback linked to it was all I was saying, like say a mouseover event.

No real problem, was just thinking it should be a fairly simple feature to impliment, or at least in theory it would be IMO, or at least since the closed polygon code is already implemented.

-Onoitsu2
[Go to top] 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.


2,255 views.

It is now over 60 days since the last post. This thread is closed.   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Web site powered by FutureQuest.Net]