| 
		
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I'd like to be able to middle click a macro in the "Open Items" list to move it to the secondary editor.I was looking for a way to do a 'middle-click' event on win("Open items" "SysTreeView32" "qm") and do a 'men' command but the recorder can't pull up the menu number and the best I could do for the mouse click was a filter function but it still closes the macro rather than performing the macro.
 
 is it possible to re-map that function?
 
 thanks.
 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		My suggestion - use double right click trigger 
Macro  
Trigger ##Rh1 0x9 /QM /FF_qm_mouse_is_on_open_items   wait 1 -WC "+#32768" ;;wait for first menu destroyedwait 1 WV "+#32768" ;;wait for next menu
 key r ;;Move to Right
 err+
Function FF_qm_mouse_is_on_open_items ;/function# iid FILTER&f
 
 if(!f.hwnd2) ret
 if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
----------
 
Middle click with filter function should not close item if Eat checked.
 
Menu id is
 men 33293 id(2213 _hwndqm) ;;Move to Right
It can be recorded from menubar. It moves current item, not item from mouse. You would have to lef at first.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		wow...i'm having terrible luck with this.neither is working for me.
 
 i created a macro with that trigger and a new filter function with that code but when i double-right-click nothing happens.  i even added a quick "out" to see if the ff was even getting triggered but nothing doin.
 
 
 on the middle click i tried it with 'eat' checked with 'when released' both checked and unchecked and it failed as well.  is there something weird that i'm overlooking here? :?:
 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		In Properties of FF, must be checked 'this function is FF'.
 Try in empty qml file.
 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I got my middle-click to work with this code.  but it only works when the left side editor is in focus or when you click on the macro name in the 'Open Items' the first time that macro is brought into the 'Open Items' list. 
shouldn't it work 'all' the time? 
thanks!
 
Function FF_QM_Open_items function# iid FILTER&fif(!f.hwnd2) ret
 if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		My macro is only for right click trigger. If using middle click, your macro must rightclick to show menu.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I think it's conflicting with some of my other macs and filter functions that use QM and middle click. 
do i take these two and combine them into one with an integer'd case statement?
 
Function FF_QM_menu_File2 if(GetWinId(f.hwnd2)!=2202) ret
 int+ g_qm_menu_iid
 TVHITTESTINFO ht
 GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
 SendMessage f.hwnd2 TVM_HITTEST 0 &ht
 if(ht.hItem)
 ,TVITEM ti.hItem=ht.hItem
 ,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
 ,g_qm_menu_iid=ti.lParam
 else g_qm_menu_iid=0
 ;out g_qm_menu_iid
 
 ret iid
Function FF_QM_Open_items ;/function# iid FILTER&f
 if(!f.hwnd2) ret
 if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 ;if(wintest(f.hwnd "Open items" "SysTreeView32" "qm")) ret iid
 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		BTW:is there a way i can call that new little floating toolbar with the button to move the newly opened macro to the secondary editor?
	 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		>do i take these two and combine them into one with an integer'd case statement? 
yes. Or FFs can return -2 when they don't return iid, but it is more overhead because two FFs called for single event.
 
------------
 
bug: context menu appears again if mouse is still there. Esc will help. 
Macro  
Trigger #Mh1 0x8 /QM /FF_qm_mouse_is_on_open_items   rigwait 1 WV "+#32768" ;;wait for menu
 key r Z ;;Move to Right
 err+
------------
 
The button does 
men 33293 id(2213 _hwndqm) ;;Move to Right 
or 
men 33294 id(2213 _hwndqm) ;;Move to Bottom 
depending on where secondary editor is. 
The toolbar cannot be opened from a macro.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		Ah...now i see why mine didn't work when I hadn't selected something.  You HAVE to have a macro selected in order for the menu option to work on something. 
now I'm using this to move things to the right.
 
Macro  
Trigger #Mh1 0x8 /QM /FF_QM_Open_items   spelef
 men 33293 id(2213 _hwndqm) ;;Move to Right
thanks for your help Gintaras!
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I've just about got this licked but I need a hand with this last part. 
When I mid-click on the 'open items' it sends the macro under it to the 2ndy editor.  when i click in the 'list of items' frame it should start a pop up menu.  but the second part isn't working.  from the 'outs' I see that it's getting into the right section of code but it doesn't start it.  
 
can you tell me where i'm going wrong here?
 
thanks.
 
Function FF_QM_Open_items function# iid FILTER&f
 if(!f.hwnd2) ret
 ;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 ;out
 if(f.hwnd=_hwndqm)
 ,_i=GetWinId(f.hwnd2)
 ,if _i=2212
 ,,out _i
 ,,ret iid
 ,,end
 ,if _i=2202
 ,,_s.time("%c")
 ,,_s.from("2202 started " _s)
 ,,out _s
 ,,int+ g_qm_menu_iid
 ,,TVHITTESTINFO ht
 ,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
 ,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
 ,,if(ht.hItem)
 ,,,TVITEM ti.hItem=ht.hItem
 ,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
 ,,,g_qm_menu_iid=ti.lParam
 ,,else g_qm_menu_iid=0
 ,,;out g_qm_menu_iid
 ,,ret iid
 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		wait...I got it to work by setting the pou-up to run 'when released' but when i mid-click it 'closes' the macro i'm over which 'de-selects' it which makes it 'select' the previous macro, which is then acted upon by the pop-up menu.
 any thoughts on how i can prevent that?
 
 thanks.
 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		If Eat checked, should not close because QM then does not receive middle click message. Works for me. 
Macro  
Trigger #M //FF_QM_Open_items   
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I've got 'eat' checked but it's still close it.  for instance, when i have a macro opened in the 2ndy editor and then mid-click it 'closes' and reverts to the previous selected macro.  it doesn't do that for you?
	 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		Here the item remains open and yellow or blue.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		yes, i'm seeing that when i put it by itself in a fresh qml.  i can also get it to do that if i call the pop-up menu from the filter function and ret the iid but the pop-up menu goes away in a blink rather than staying there.  but, if i don't call the pop-up in the FF and just ret the iid it performs the other mid-click of moving it to the 2ndy editor.  here's my code for the FF. 
have i got something in the wrong place?
 
Function FF_QM_Open_items function# iid FILTER&f
 if(!f.hwnd2) ret
 ;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 ;out
 if(f.hwnd=_hwndqm)
 ,_i=GetWinId(f.hwnd2)
 ,if _i=2212
 ,,out _i
 ,,ret iid
 ,,end
 ,if _i=2202
 ,,_s.time("%c")
 ,,_s.from("2202 started " _s)
 ,,out _s
 ,,int+ g_qm_menu_iid
 ,,TVHITTESTINFO ht
 ,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
 ,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
 ,,if(ht.hItem)
 ,,,TVITEM ti.hItem=ht.hItem
 ,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
 ,,,g_qm_menu_iid=ti.lParam
 ,,else g_qm_menu_iid=0
 ,,;out g_qm_menu_iid
 ,,;mac "Menu QM menu File-ken"
 ,,ret iid
thanks.
	 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		If using mac, don't ret iid, because it launches the macro again. 
Do you have more middle click triggers?
 Quote:it performs the other mid-click of moving it to the 2ndy editor 
?  Do you have double middle click triggers? Then single click probably will not work.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		yeah, i've got one that opens a pop-up when the 'item list' mid-click happens the other is in 'open items' which moves it to the 2ndy editor.  that's what i'm trying to do with the if clause but i'm kind of confused on how the whole FF works.  would it be better to scrap the FF and go with a regular function and call each from there?
 thanks.
 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		Without filter function you will disable middle click in all QM windows. 
Two macros can have this single FF. One runs when clicked in main list, other when in open items.
 
Make sure you don't have double middle click triggers.
 
------
 Quote:but i'm kind of confused on how the whole FF works 
FF runs on middle button down. If FF returns idd or macro name, that macro will run. If FF returns 0, nothing will run. If -1, nothing will run, and the middle click will not be passed to the window. If -2, the macro will not run, but if there are more macros that have the same trigger, they will run.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		ok, got it to work now. 
used 'ret' rather than 'mac' to start the macro along with the macros being 'eat' and 'when released' checked.
 
Function FF_QM_Open_items function# iid FILTER&f
 if(!f.hwnd2) ret
 ;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 ;out
 if(f.hwnd=_hwndqm)
 ,_i=GetWinId(f.hwnd2)
 ,if _i=2212
 ,,out _i
 ,,ret "Move Mac to 2ndy Editor"
 ,,;ret iid
 ,,;end
 ,if _i=2202
 ,,_s.time("%c")
 ,,_s.from("2202 started " _s)
 ,,out _s
 ,,int+ g_qm_menu_iid
 ,,TVHITTESTINFO ht
 ,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
 ,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
 ,,if(ht.hItem)
 ,,,TVITEM ti.hItem=ht.hItem
 ,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
 ,,,g_qm_menu_iid=ti.lParam
 ,,else g_qm_menu_iid=0
 ,,;out g_qm_menu_iid
 ,,ret "Menu QM menu File-ken"
 ,,
 ,,;ret iid
THANKS.
	 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		did not work because returned iid of first macro in both cases.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		ahhh....now i get it.thanks for all your help!
 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		I put this notice here for better history but this stopped working in 2.3.3.2 (I didn't test with 2.3.3.1).  Are the FF working somewhat differently? 
Function FF_QM_Open_items function# iid FILTER&f
 if(!f.hwnd2) ret
 ;if(f.hwnd=_hwndqm and GetWinId(f.hwnd2)=2212) ret iid
 ;out
 if(f.hwnd=_hwndqm)
 ,_i=GetWinId(f.hwnd2)
 ,if _i=2212
 ,,ret "Move Mac to 2ndy Editor"
 ,if _i=2202
 ,,;_s.time("%c")
 ,,;_s.from("2202 started " _s)
 ,,;out _s
 ,,int+ g_qm_menu_iid
 ,,TVHITTESTINFO ht
 ,,GetCursorPos &ht.pt; ScreenToClient f.hwnd2 &ht.pt
 ,,SendMessage f.hwnd2 TVM_HITTEST 0 &ht
 ,,if(ht.hItem)
 ,,,TVITEM ti.hItem=ht.hItem
 ,,,SendMessage f.hwnd2 TVM_GETITEM 0 &ti
 ,,,g_qm_menu_iid=ti.lParam
 ,,else g_qm_menu_iid=0
 ,,;out g_qm_menu_iid
 ,,ret "Menu QM menu File-ken"
 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		it looks like the FF isn't initiating.
	 
	
	
	
		
	Posts: 1,769Threads: 410
 Joined: Feb 2003
 
	
	
		YOu know what...I just switched it to use double left which is much better.
	 
	
	
	
		
	Posts: 12,239Threads: 144
 Joined: Dec 2002
 
	
	
		Anyway, it was a bug, and some other triggers also may not work. 
Fixed in 2.3.3.3.
http://{deleted post} |