 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Thu Feb 05, 2009 9:16 pm Post subject: |
|
|
| Drugwash wrote: | | I've spent $2 on this beer and you just make its effect vanish. |
Ooops, sorry.
| Drugwash wrote: | | Menus should be navigable through keyboard too |
Yeah, they are, that's a built-in feature provided by the DllCall, I think - at least it's not something I've added, but it is supported. Both up/down to select, left/right to open a submenu, and enter to make a selection.
| Drugwash wrote: | | We can't be human enough unless we think about any and all possibilities, beyond our own selfish needs. |
I couldn't agree more, and thank you for making suggestions, since there are many things that I will overlook and I'm glad there are other people out there "looking" with me.
| Drugwash wrote: | | I wonder if standard menu items (that may be ignored by the script) could automatically be replaced by custom items, keeping the original functionality (and possibly adding custom features). |
In order to not have AHK rebuilding menus on me, the "standard menu items" are added in by the script. Menu_Standard and Menu_NoStandard make no call to Menu,, Standard or Menu,, NoStandard. Instead, they just add or remove the items (which Chris nicely make have menu ids that remain a constant.), so, yes, it is very easy to "customize" the "standard menu", what did you have in mind?
| Drugwash wrote: | | I'm not sure about drag'n'drop in menus. Seems like an overkill to me but I may also overlook something. |
Well, for the bookmarks manager I'm developing, I thought (when I first started the project) that it would be really cool for two things. 1) Drag/drop support - both for the Menu and the gui that is used to organize the bookmarks. The feature (opt-in in the program) would allow reordering the bookmarks without having to do so in the GUI. and 2) The ability to move menu items around without having to recreate the menu each time (that's solved thanks to this library).
Also, I plan to figure out how to add drag/drop to TreeView and ListView so that I have them there as well - there will be libraries for that posted when I get to that and figure it out. So, that's more something I thought would be cool, and wanted more than something "practical". Now, I think it might be practical to add the gLabel like Gui controls have to menus / menu items. Again, that's just something I threw out there because I want it, not that it will have any use to anyone else.
| Drugwash wrote: | | Isn't anyone else here interested in this work besides me? |
I'm sure they're there - lurking in the shadows and corners of the web waiting to pounce on unsuspecting code...
Update:
You're probably right. I'm going to instead start working on adding drap/drop support to ListView/TreeView which I need as well as others probably want. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Thu Feb 05, 2009 9:40 pm Post subject: |
|
|
| Quote: | | In order to not have AHK rebuilding menus on me, the "standard menu items" are added in by the script. | Unless I'm too drunk to reason, this seems to dissolve the clouds I had around having both standard and non-standard menu items.
Drag'n'drop in LV/TV would be a dream come true. One of my scripts dedicated to MIM has been put on hold because of this; I'm a freakin' perfectionist and want all or nothing. Just clear one thing up for me, please: will this be only inside the control or will it alllow D'n'D between controls? I mean, will I be able to drag a file from anywhere in the system to a LV/TV or only move items inside the same control?
Oh and if you need D'n'D in menus, don't just abandon the idea just because I doubted it; I may always be wrong and am not ashamed to admit it if so.  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Thu Feb 05, 2009 9:50 pm Post subject: |
|
|
| Drugwash wrote: | | Unless I'm too drunk to reason, this seems to dissolve the clouds I had around having both standard and non-standard menu items. |
Excuse my ignorance, but what was the original question / request, or did you already figure it out?
| Drugwash wrote: | | Will this be only inside the control or will it alllow D'n'D between controls? I mean, will I be able to drag a file from anywhere in the system to a LV/TV or only move items inside the same control? |
Well, the former I believe is already implemented via GuiDropFiles unless I misunderstood something. Based on this belief, my attention is for the later. However, like anything, I'm willing to expand the library to accomadate anything the user throws at me, as long as it "hits me" how to implement it.
| Drugwash wrote: | | Oh and if you need D'n'D in menus, don't just abandon the idea just because I doubted it |
No, no, I'm not abandoning it, but I'm going to work on the LV/TV drag/drop first because I need that as well as I think it would provide more use to others. I'll get back to D&D in Menus after that - since that's more "optional". I NEED D&D for TV/LV because I too am a perfectionist and want all or nothing, and I hope I can have all  _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Thu Feb 05, 2009 10:33 pm Post subject: |
|
|
| Quote: | | Well, the former I believe is already implemented via GuiDropFiles | Well, when I say "anywhere" that also includes another LV/TV in the same window. To the point, I have an AHK window with 2 ListViews and I want to be able to drag an item from one LV to the other (assign an image file to an item). So if that's not yet possible, it's your job to make it come true.
| Quote: | | [...] what was the original question / request [...] | To have the standard AHK menu items inherit custom features through this script and be called just as the custom ones are. Since I've seen icons and checkbox space for standard menu items, I assume this has already been covered. And I still got some beer left.  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Thu Feb 05, 2009 10:50 pm Post subject: |
|
|
| Drugwash wrote: | | I have an AHK window with 2 ListViews and I want to be able to drag an item from one LV to the other (assign an image file to an item). |
Provided I can add drag/drop it won't require much more effort to drag an item to another LV. What do you mean by "assign an image file to an item"? Is this something you want me to add, or something else? I already thought about doing what I did to the menu items and to the same to the LV/TV - allow associating values with them - I need that for my code. However, unlike Menu which requires the objects for full functionality, unless its required, for LV/TVs it would be opt-in (i.e. created as needed). However, it's not that much of a big deal to call the libraries function instead of ListViews, so we'll see what I need. Since I plan to allow associating items with a LV/TV item, I'm going to wrap the LV/TV functions and the user would call them instead.
The hardest part, sadly, for this, is having some "marker" in the ListView to show the insertion point. I asked on the forums a while back how to add a separator, since I've seen Opera use them, but got no response. So, it might, sadly, take more time to "show" the drag/drop than to enable drag/drop.
| Drugwash wrote: | | So if that's not yet possible, it's your job to make it come true. |
I'm glad you have such faith in me, I won't let you down.
| Drugwash wrote: | | Since I've seen icons and checkbox space for standard menu items, I assume this has already been covered. |
Yeah, the menu doesn't differentiate between "standard menu" and non-standard - either way they are an entry - it is AHK that treats them differently. Also, the icon functionality is added by Lexikos via his Menu Icon library, so he deserves all credit for that, so send a big shout out to him when you get the chance. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Thu Feb 05, 2009 11:24 pm Post subject: |
|
|
I'd praise Lexikos alright if he weren't forking the AHK code to Unicode with no regard to poor 9x users.
Just kiddin'... I know that's the way things go whether some like it or not. And Lexikos is undoubtedly of great value for the AHK community so he always got my unconditional respect.
| Quote: | | What do you mean by "assign an image file to an item"? | It's what my script has to do: create an initialization file that maps image files to specific codes (emoticon codes for Miranda IM).
The user has to drag an icon from one LV to the other to assign an image file to a specific emoticon code. I can provide the current code if you want, for testing purposes.
What would we do if we didn't have faith in each-other?  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Thu Feb 05, 2009 11:31 pm Post subject: |
|
|
| Drugwash wrote: | | can provide the current code if you want, for testing purposes. |
No, no, my mind can't take that right now... I've got something that tells me where the mouse is, but I'm having problems getting the item UNDER the mouse. I'm going to post on the forum, but these specific questions usually don't get answered because ppl don't usually mess with this stuff. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Fri Feb 06, 2009 12:00 am Post subject: |
|
|
For me it's beer. What's yours?
Don't worry, everything comes in good time.  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Fri Feb 06, 2009 12:01 am Post subject: |
|
|
Anime  _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Drugwash
Joined: 08 Sep 2008 Posts: 608 Location: Ploiesti, RO
|
Posted: Fri Feb 06, 2009 12:20 am Post subject: |
|
|
I could never figure that out.
Been searching for Gunslinger girl (both series) recently. I'm open to anything, generally. Isn't this a bit off-topic?  |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Fri Feb 06, 2009 12:26 am Post subject: |
|
|
Yeah, probably  _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
leuallen Guest
|
Posted: Sat Feb 14, 2009 6:22 am Post subject: Menu wrapper library |
|
|
Hi, can a third person squeeze in here?
I've been working on a project involving Adobe Lightroom and have run into numerous problems/roadblocks. One of them is menus. Some of Lightrooms commands are accessible only from the menu - no hotkeys or reliable icons. By reliable icons I mean they are on toolbars that may or may not be visible so it is difficult to pixel check their state.
I have done some digging in to menus to the point where I can determine if a menu item is checked/enabled or not. But I cannot check or enable it yet. The big problem I have at present and one which makes my use of menus to check the state of a menu item is that the menu items are not updated until the menu is displayed. For example, two menu items called Library and Develop. If the Library state is active and the menu has been shown (updated), then when I check its state it indicates checked. If I click on a toolbar icon to change to Develop and then check Library's state it still shows checked, which is incorrect. In other words, clicking on the Develop icon does not change the menu state. If the menu is displayed, it displays with the correct menu item checked, and my check is now successful.
Is there a way of updating the menu, without showing it, before I check on the menu items state? Also, is there a way of checking/unchecking the menu items? I ask before I take another sidetrip and delve into your menu library. If I could reliably read and change the state of menu items it would make things much easier, rather than chasing those silly icons.
My background is with a higher level language, AutoLisp (very experienced) and some Delphi. I am not used to or proficient in delving into Windows. I worked mainly inside one app with an API designed to manipulate it so I have trouble with trying to manipulate Lightroom externally.
On a side note involving ListViews. Lightroom ListViews hide the text and I sure would like to get it. I have researched and it seems like a no go. I can get the count and other parameters but not the text.
Also, Lightroom does not allow a persistent mouse move. By that I mean that I can go to coordinates and click there but I can not go to coordinates and leave the cursor at that position. Lightroom always returns the cursor to the original position after the move.
The ListView and mouse problems are related. I would like to move the cursor to the first item in the list view and then be able to move the cursor up/down/select the list with the arrow keys.
Any light you can shed on above problems would be greatly appreciated.
Thanks,
Larry |
|
| Back to top |
|
 |
animeaime
Joined: 04 Nov 2008 Posts: 1046
|
Posted: Sat Feb 14, 2009 7:16 am Post subject: |
|
|
Well, this menu library is designed specifically to work with AHK menus (not external menus). I'm not sure what use, if any, this library would be when dealing with external menus (maybe the menu api functions...)
| leuallen wrote: | | One of [the roadblocks] is menus |
I'm not sure I understand the problem at this point. What is it that you are trying to do, but can't?
Are you using the menu API (found here), or using another method to interact with Lightroom's menus? Specifically, are you using GetMenuItemInfo and the fState member of the MenuItemInfo struture to see if the menu item is checked (use bit-flag MFS_CHECKED = 8). If so, and this method is unreliable, then it might be because Lightroom doesn't update the menu until it's displayed. If this is the case, then it becomes problematic, because then the "update" functionality is most likely hard-coded and not menu API based.
| leuallen wrote: | | But I cannot check or enable it yet. |
Check out the CheckMenuItem function and the EnableMenuItem function
| leuallen wrote: | | Lightroom ListViews hide the text and I sure would like to get it. |
Have you tried using ControlGet - cmd List?
| leuallen wrote: | | Also, Lightroom does not allow a persistent mouse move |
I'm not sure I understand this. Do you mean that whenever you move the mouse, it moves it back to where it was? Since this cannot be the case - else the mouse would be useless, I'm not sure what happens that shouldn't happen.
Hopefully, you can shed some light on my confusion and bring me up to speed on what methodology you have tried. _________________ As always, if you have any further questions, don't hesitate to ask.
Add OOP to your scripts via the Class Library. Check out my scripts. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 4471 Location: Qld, Australia
|
Posted: Sat Feb 14, 2009 10:39 am Post subject: |
|
|
| Drugwash wrote: | | DllCallDebugger should simply show a message box whenever the result of a DllCall is non-zero (which is usually a sign of something going wrong) | Correction: DllCallDebugger shows a message when DllCall sets ErrorLevel to a non-zero value, which always indicates that something is wrong. In the case of "An" ErrorLevels, it does not necessarily indicate the function failed.
| Quote: | | I believe the function should be called after each DllCall | If you mean DllCallDebugger, it must be called before DllCall. It need only be called once for the duration of the script. With the current beta of AutoHotkey, DebugBif supersedes DllCallDebugger.
| animeaime wrote: | | Hold on...-4.... that means you don't have the function in the dll...hmmm... | -4 can also mean you've passed DllCall a NULL pointer or empty variable - e.g. you've cached the address of the function in variable, but passed varaible to DllCall.
| animeaime wrote: | | Also, if drag/drop can be done, there would be a "start drag" and "end drag" event. | Built-in reordering functionality would be nice, but the minimum required of the Menu API would be to provide mouse button-down and -up events.
| animeaime wrote: | | Drugwash wrote: | | Menus should be navigable through keyboard too |
Yeah, they are, that's a built-in feature provided by the DllCall, | It is a built-in feature of standard menus within Windows, and should work as long as the window which owns the menu is active (OwnerDrawnMenuMsgWin if MI_ShowMenu is used).
| animeaime wrote: | | The hardest part, sadly, for this, is having some "marker" in the ListView to show the insertion point. | LVM_SETINSERTMARK, perhaps? Also, list of ListView messages.
| Quote: | | Also, the icon functionality is added by Lexikos via his Menu Icon library, | Btw, the next release of AutoHotkey_L will have built-in support for menu icons via:
Menu, MenuName, Icon, MenuItemName, FileName [, IconNumber, Width, Height]
Menu, MenuName, NoIcon, MenuItemName
The only restriction is that FileName cannot be purely numeric ("123" with no extension) if MenuName is "Tray".
If we can decide on a clean, intuitive and flexible way to associate data with menu items, I may also add that.
I thought of overloading the Pn (thread priority) parameter of the Add sub-command with something like Dn (D for data, n=integer), but if there was a clean way to allow arbitrary text (without requiring the script to deal with memory management), it would be more ideal.
Now that I think of it, probably only more advanced scripts would use this, so a pointer or other integer would suffice. Menu wrappers such as animeaime's could make it easier to store strings, and the built-in implementation would be simpler since it needn't be concerned with memory management. Smaller code is always a bonus, even more so when it comes time for Chris to consider officially integrating it.
It would also need something like A_ThisMenuItemData. I'm not sure how the data of a given item could be retrieved if the item's subroutine isn't running, given that there otherwise isn't any need to retrieve data from the menu. If the data was stored in AutoHotkey's UserMenuItem structure and associated with the Win32 menu handle/item, I guess that problem would be solved.
What do you think?
| Drugwash wrote: | I'd praise Lexikos alright if he weren't forking the AHK code to Unicode with no regard to poor 9x users.  | I haven't even begun working on a Unicode build, and when I do I intend to maintain both ANSI and Unicode. Additionally, I believe Unicode is supported on 9x via the Microsoft Layer for Unicode. That said, I probably won't support 9x (for the Unicode build) if it would take much additional time.  |
|
| Back to top |
|
 |
leuallen Guest
|
Posted: Sat Feb 14, 2009 3:00 pm Post subject: Menu wrapper library |
|
|
Hi,
I was afraid that your menu api would pertain only to AHK menus, so it is currently of no use to me.
| Quote: | | I'm not sure I understand the problem at this point. What is it that you are trying to do, but can't? |
I would like to reliably get the state and be able to change the state of the menu items.
| Quote: | | Are you using the menu API (found here) |
I am using the API functions. I can get the checked state because I was able to model the function after someones existing function. I don't quite understand the CheckMenuItem function yet so I cannot check the menu items. Not too hep on structures or the API.
The method is unreliable because Lightroom does not update the menu until it is displayed. I was hoping there was an API function that would refresh the menu. I hope it is not hard coded.
| Quote: | leuallen wrote:
Lightroom ListViews hide the text and I sure would like to get it.
Have you tried using ControlGet - cmd List?
|
Yes, that is what I used. It returns the count, size, etc, but not the text. In the documentation it states that some programs do this. I have searched for workarounds but there don't seem to be any.
| Quote: | | I'm not sure I understand this. Do you mean that whenever you move the mouse, it moves it back to where it was? Since this cannot be the case - else the mouse would be useless, I'm not sure what happens that shouldn't happen. |
Yes, that is what I mean. You cannot programically move the mouse to a point and have it persist. Yes it is the case, the mouse is of course functional but exhibits this behaviour. Lightroom detects any attempt to move the mouse by a function call (movemouse or DLL call) and returns the mouse to the original position. You can move the mouse and click but it returns. A real bummer.
Lightroom uses a lot of toggles so I need to know the present state if I want to turn on/off.
Thanks for taking your time to answer me.
Larry |
|
| 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
|