Selecting and reading items from popup menus

General discussion about the Phantom Automation Language and related tools.

Selecting and reading items from popup menus

Postby Mark on Thu Dec 09, 2010 3:02 am

The app I am working with has many context sensitive (popup) menus, i.e. menus that get displayed at the cursor when I right-click on an item. The windows declaration recorder doesn't find them when I select the main window and they disappear when I switch windows so I cannot activate the popup and then try to record it.

With experimentation, I can get the coordinates to do a MouseClick, but I am wondering if there is a better way to deal with this. Some of these menus are nested 2 and 3 levels deep so that is a lot of coordinate calculating. It would be great to manage them like the normal menus.
Mark
 
Posts: 5
Joined: Thu Dec 09, 2010 2:48 am

Re: Selecting and reading items from popup menus

Postby john on Mon Dec 13, 2010 7:48 pm

Hello-

Yes, unfortunately WinDR cannot record popus since they don't exist when you leave an application. However, you can use the recorder to record a pop-up and get the coordinates:

SetDelay(200);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,753,236,1);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,753,236,2);
MainWin(1,"#32768").MouseClick(0,46,112,1);
MainWin(1,"#32768").MouseClick(0,46,112,2);

Be sure to record each selection of multi-tiered popups (don't 'hover' over a menu, but click it). Another option is to use the arrow keys or accelerators:

#Recorded Commands - 12/13/10 14:48:31
SetDelay(200);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,824,239,1);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").MouseClick(2,824,239,2);
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").TypeKeys("<UP>");
MainWin("PhantomTabCtrlWindow.cpp - Notepad","Notepad").MainWin(1,"Edit").TypeKeys("<ENTER>");

This avoids mouse click coordinates altogether...

-John
john
 
Posts: 27
Joined: Wed Apr 22, 2009 12:32 pm

Re: Selecting and reading items from popup menus

Postby Mark on Wed Dec 15, 2010 3:49 pm

OK. Too bad about the popups, but thanks for the suggestions on getting the coordinates.
Mark
 
Posts: 5
Joined: Thu Dec 09, 2010 2:48 am


Return to Phantom

Who is online

Users browsing this forum: No registered users and 4 guests

cron