 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Wed Jan 12, 2005 5:04 am Post subject: AHK Pie menus |
|
|
Like I don't have enough to do... I was thinking of hacking out some pie menus in AHK. Basically, when you click with a hotkey, it will pull up a menu where you clicked. Instead of being a list, the options will be in circle. An option could either start a program or expand to another menu. I'm wondering if someone already has some kind of menu app put to together so I don't have to start from scratch.
Tom |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Wed Jan 12, 2005 6:06 am Post subject: |
|
|
Radial menus are still too conceptual for there to be an app, at least from a quick Google (hopefully Wonder BoBo can help us out here), the only thing I know of is the Firefox plugin. I'm really interested in this project though; would you mind a co-coder? If you'd like to work together on this, post whatever code (or concept) you have already. If not, that's cool, but beware: my curiousity might overload and I might start tinkering!  |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Wed Jan 12, 2005 9:39 am Post subject: |
|
|
Maybe a quik check of that source can help
| Quote: | Frequently asked questions
Is the extension open source?
Yes. The RadialContext menu is available under a BSD license. If you installed it, you already have the sources on your hard disk.
[radialthinking]
|
|
|
| Back to top |
|
 |
Looq Guest
|
Posted: Sun Jan 16, 2005 4:20 pm Post subject: |
|
|
Hiya! A radial menu is exactly what i'm looking for as well. I'm mainly looking to replace the important menus in photoshop and illustrator so i can run them full screen and just toggle a key to select what i need without having to remember every single hotkey. It'd also be nice to be able to have the start menu catagorically organized like that too. Maya also has a nice marking menu....like a pie nemu, but you drag and relase this arrow pointer. Object dock also has this circular memu and that expands and rotates (http://www.stardock.com/products/objectdock/).
Here's some pie menu links YOU WANT!! :p
here's an activex plugin with source code & interesting links:
http://catalog.com/hopkins/piemenus/index.html
do a find for "marking menu" ..you'll see it's actually pretty funny:
http://slashdot.org/article.pl?sid=00/06/21/0046236&mode=thread/
http://www.art.net/~hopkins/Don/piemenus/index.html
yeah this is obvious, but it worked for me
http://www.google.com/search?num=100&hl=en&lr=&q=%22pie+menu%22%2Bsource+code&btnG=Search
I'm really pretty new to coding mostly. I'm more of an artist then a programmer atm. But if you need some help I'm here.
Oh , btw incase anybody has trouble finding the source it'd be in
c:\documents and settings\[user]\application data\mozilla\firefox\extensions ....and then find the folder with radialcontext.jar. The main pie menu code is in content\radialcontext\rcmMenu.js. The code actually doesn't look all that bad (as in me being able to understand it.) Reminds me a lot of actionscript..err.....javascript...ah i'll shut up now.
Anyway, keep up the good work.  |
|
| Back to top |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 133 Location: Darmstadt, Germany
|
Posted: Mon Jan 31, 2005 12:07 am Post subject: |
|
|
Hi!
I also thought of radial menus the last days. But I would really love to see a rm made in AHK since all other products I found in the web are either not working Windows-wide or are too limited in configuration.
Based on the Google search Looq provided, I found this page which shows concepts quite fine:
http://doc.trolltech.com/qq/qq11-piemenu.html
Maybe we can build something similar by utilizing SplashImage and transparent GIF images?
Iīm very new to AHK programming but have experience in programming at all, so I hope being able to add some lines and thoughts to an AHK community project.
Regards,
Rob |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 31, 2005 12:43 am Post subject: |
|
|
Guess, it would help to have something like an "image map" functionality in AHK ...  |
|
| Back to top |
|
 |
jonny
Joined: 13 Nov 2004 Posts: 2951 Location: Minnesota
|
Posted: Mon Jan 31, 2005 2:34 am Post subject: |
|
|
| Seeing as the goal is configurability (any other goal would be nonsensical for a general-purpose menu app), I think gif's with SplashImage would be extremely hard to implement. It brings the depth of configuration to, like, the position on the screen and the fade-in rate. Whoop-dee-do. |
|
| Back to top |
|
 |
3tones
Joined: 14 Dec 2004 Posts: 45 Location: Minneapolis, MN
|
Posted: Mon Jan 31, 2005 4:40 am Post subject: |
|
|
I played with this a little bit, but didn't get very far. Things have been too busy. What I envisioned wouldn't be that "flashy" due to AHK's limitations. Basically, it would go something like this:
Establish the options to display
-probably just text to keep things simple at first
-8 or less options per menu
-clicking on one of the text items could run arbitrary code, or invoke another menu
Add text to the gui
-get in general position with sin/cos functions, dividing the cicle up by the number of options
-use a static radius for the time being
-position based upper left for now
Reposition Text
-go through each text item and center it to it's upper left coodinate (once the text is added to the gui, it has coodinates and size to center on)
Make the window with no title bar and sides
-invoke with hotkey and place at current cursor
things to think about:
-making the code modular enough to support arbitrary number of options in the menu
-finding a way to define the menu in a simple way to customize, yet easy to write the code around
-dealing with multiple menus in the same script
I've looked at the websites listed in previous posts - specifically http://www.piemenus.com/ . The ActiveX pie menus are great and definitly what I envisioned, but they are limited to the browser. Looking at the XML and code may help to "port" it to AHK since they have done most of the work already. Using that code as a framework might be the way to go. If someone wants to get the ball rolling and write something, go for it. Just post here with your progress and what you've got going so we can all provide input and code as needed.
I second the image map idea... that was my first thought. Chris? Any input?
Tom |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 31, 2005 8:01 am Post subject: |
|
|
| Quote: | | The ActiveX pie menus are great and definitly what I envisioned, but they are limited to the browser | Interesting. But, what about HTA ? Well, you need the browser components as the runtime environment. But the HyperTextApplication isn't depending on an open browser window, correct ?
My main concern would be how to link AHK to such a "Frontend" ?
Using files, environment vars, the clipboard, ... ? |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Mon Jan 31, 2005 8:40 am Post subject: |
|
|
AFAIK that ImageMap concept is also available within CHM-Manuals eg. to create "Hotspots" on a given screenshot which are linked to a specific section of the manual ... maybe that can be adopted ?
Braindump
| Code: | | GUI, Area1, vMyVar, X1Y1, X2Y2, X3Y3[, Coord4, Coord5, ...] |
|
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Mon Jan 31, 2005 12:42 pm Post subject: |
|
|
| 3tones wrote: | | I second the image map idea... that was my first thought. |
| BoBo wrote: | | GUI, Area1, vMyVar, X1Y1, X2Y2, X3Y3[, Coord4, Coord5, ...] |
You could simulate image map behavior. Here is an example (you'll have to substitute an image of your own for in the first line): | Code: | Gui, add, picture, gPicClick, CD Eject with fading icon.bmp
Gui, show
return
PicClick:
MouseGetPos, GuiX, GuiY, GuiWin, GuiCtrl
; Convert coordinates to those relative to the picture itself:
ControlGetPos, CtrlX, CtrlY,,, %GuiCtrl%, ahk_id %GuiWin%.
ClickX := GuiX - CtrlX
ClickY := GuiY - CtrlY
MsgBox You clicked the picture at its internal coordinates %ClickX%,%ClickY%
return
GuiClose:
ExitApp | If the above seems inadequate or overly complicated, I can add built-in image maps to the to-do list as a relatively low priority. |
|
| Back to top |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 133 Location: Darmstadt, Germany
|
Posted: Thu Feb 03, 2005 12:57 am Post subject: |
|
|
I tried to get around that by adding different pictures at the appropriate positions and make their border color transparent.
Unfortunately, if a picture lies above another, its transparent portion makes also the underlying picture transparent where it should not be. I am not sure if this is a bug or I am doing something wrong. This is the relevant portion:
| Code: | Gui, Color, FF00FF
DetectHiddenWindows on
WinWait, %A_ScriptName%
WinSet, TransColor, FF00FF
Gui, Add, Picture, x25 y0, %imgPath%\ring_01_north.gif
Gui, Add, Picture, x25 y70, %imgPath%\ring_01_south.gif
Gui, Add, Picture, x0 y25, %imgPath%\ring_01_west.gif
Gui, Add, Picture, x70 y25, %imgPath%\ring_01_east.gif
Gui, Show
|
If you want I can link to a small screenshot of this. |
|
| Back to top |
|
 |
BoBo Guest
|
Posted: Thu Feb 03, 2005 12:09 pm Post subject: |
|
|
My testing result.
GUI background set transparent
Non Hotspot area of the image set to be transparent as well.
As you can see the "overlapping" (transparent) area of image "blue" covers the non-transparent part of image red. Based on the standard behaviour a mouse click done on this area will act on the level below the GUI instead as expected on the level of image "red".
Its easy to identify.
If Notepad is behind the GUI, the mouse cursor if set at the transparent area which covers the red Hotspot, will remain as IBaem and won't change to become an Arrow.
| Code: | __ Image Blue
__ Image Red
__ GUI
__ Desktop |
Image: .gif
Hotspot: red
NonHotspor: silver
Scale: 25x25 p
Thoughts ? |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Thu Feb 03, 2005 12:41 pm Post subject: |
|
|
| RobOtter wrote: | | if a picture lies above another, its transparent portion makes also the underlying picture transparent where it should not be. I am not sure if this is a bug or I am doing something wrong. | Everything looks okay in that example, and I don't see a way to fix this in the code. So this is probably normal behavior.
BoBo, although you explained the behavior well, I'm at a loss for anything to say about it. Hopefully others will be of more help. |
|
| Back to top |
|
 |
RobOtter
Joined: 30 Jan 2005 Posts: 133 Location: Darmstadt, Germany
|
Posted: Thu Feb 03, 2005 1:21 pm Post subject: |
|
|
I havenīt had a look at the AHK source code, but it seems to me like you first stack images one over the other and compute transparency in the end for the resulting over-all picture. This leads to the effect that while stacking, the transparent color is NOT treated as "not there" and will of course overwrite the underlying pixels.
IMHO you would have to compute transparency for the color of each picture at the time when it is added so that it does not overwrite pixels. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|