Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Click Left Mouse Button on Record selected via KeyDown
#1
Greetings,

My program selects a record grid in a CRM software that is not editable.
I need to scroll down using the keyboard down key and the whole record gets selected.
Now I need the mouse to double click the selected record to open it in a separate form.
The return key does not work on this.

Kindly advise.
Best Regards,
Philip
#2
Need to find coordinates of the selected record?
Probably it looks differently than other records. Try dialog "find image".
Also try accessible object functions. If records are accessible objects, the selected record should have different state.
#3
The whole record grid is an accessible object; however, the individual records are not.
What I need to accomplish here is to find and obtian all product description that involves a 'Value'. If value is '0.00' then goto next record and this needs to go on ofr as many records as is there in the record grid.


Kindly see the attached screen shots:


Attached Files Image(s)
       
Best Regards,
Philip
#4
Try "get array" in dialog "window text". Array elements will contain text and coordinates, and can contain even text colors if need.

Quote:Now I need the mouse to double click the selected record to open it in a separate form.
The return key does not work on this.
try
key M
It should show a context menu.
#5
Ok will try...

In the meanwhile below is the code I just finish while you were on it...
Could you advise if the check I am doing on cost is correct?
Is that the way to check if an option as cost valued above zero?

Macro Get Cost Options
Code:
Copy      Help
,int onceFlag=0
,
,;repFindOptions
,'D; 0.25 ;; Skip first line as it is vehicle base price
,
,scan "color:0xFF9933" child("" "KCMLGridPad_32" w3 0x0 "id=100" 2) 0 1|2|16
,dou; 1
,
,int w5=win("Vehicle Specification Line Detail" "KCMLMasterForm_32")
,Acc a2.Find(w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004)
,
,int cost=a2.Value
,Acc a5.Find(w5 "TEXT" "" "class=KCMLEdit32[]xy=256 40[]state=0x100040 0x20000040" 0x1004)
,str costOptionName=a5.Value
,if cost<>"0.00"
,,act w1
,,if onceFlag=0
,,,'R(#14)
,,,onceFlag=1
,,key (costOptionName)
,,'R
,,key (cost)
,
,int w4=win("Vehicle Specification Line Detail" "KCMLMasterForm_32")
,Acc a6.Find(w4 "PUSHBUTTON" "Cancel" "class=KCMLButton_32[]id=2[]xy=603 63" 0x1005)
,a6.Mouse(1); 0.5
,goto repFindOptions
Best Regards,
Philip
#6
if val(cost 2)
#7
So is the below usage correct?

Macro Get Cost Options
Code:
Copy      Help
,if val(cost 2)=0.00
Best Regards,
Philip
#8
if val(cost 2)
is the same as
if val(cost 2)!=0
#9
I am somehow not able to get the below code to work; it does not enter the condition when true:

Macro Get Cost Options
Code:
Copy      Help
,if val(strCost 2)!=0
,,mes "in now"
,,act w1
,,if onceFlag=0
,,,'R(#14)
,,,onceFlag=1
,,key (costOptionName)
,,'R
,,key (cost)
Best Regards,
Philip
#10
put this before to see what is in the variable
Code:
Copy      Help
,out F"''{strCost}''"

to test
Macro Macro2475
Code:
Copy      Help
str strCost="1.00"
if val(strCost 2)!=0
,mes "in now"
#11
I believe the error is in the below code:
I am supposed to obtain the invoice value in this manner.
But after I tested for the value output, it just gives me zero even for a higher value.

Macro Get Cost Options
Code:
Copy      Help
,int w5=win("Vehicle Specification Line Detail" "KCMLMasterForm_32")
,Acc a2.Find(w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004)
,
,double cost=a2.Value
,out cost
,str strCost=cost
Best Regards,
Philip
#12
Maybe the text is not in value, but in name or description or nowhere. You can see it in dialog "Find accessible object".

out a2.Value
out a2.Name
out a2.Description
#13
You forgot to convert string (a2.Value) to number.
double cost=val(a2.Value 2)
#14
Just tried that. Still gives me a zero value

Macro Get Cost Options
Code:
Copy      Help
,;repFindOptions
,'D; 0.25 ;; Skip first line as it is vehicle base price
,
,scan "color:0xFF9933" child("" "KCMLGridPad_32" w3 0x0 "id=100" 2) 0 1|2|16
,dou; 1
,
,int w5=win("Vehicle Specification Line Detail" "KCMLMasterForm_32")
,Acc a2.Find(w5 "CLIENT" "" "class=KCMLDBEdit_32[]id=26722[]xy=451 264" 0x1004)
,
,double cost=val(a2.Value 2)
,out cost
,str strCost=cost
,
,Acc a5.Find(w5 "TEXT" "" "class=KCMLEdit32[]xy=256 40[]state=0x100040 0x20000040" 0x1004)
,int checkOption = StrCompare(a5.Value costOptionName)
,if  checkOption=0 ;;If the option selected currently is the same as before then exit loop
,,out a5.Value
,,out costOptionName
,,int w6=win("Vehicle Specification Line Detail" "KCMLMasterForm_32")
,,Acc a7.Find(w6 "PUSHBUTTON" "Cancel" "class=KCMLButton_32[]id=2[]xy=603 63" 0x1005)
,,a7.Mouse(1); 0.5
,,continue
,costOptionName=a5.Value
,,out F"''{strCost}''"
,if val(strCost 2)!=0
,,mes "in now"
,,act w1
,,if onceFlag=0
,,,'R(#14)
,,,onceFlag=1
,,key (costOptionName)
,,'R
,,key (cost)
Best Regards,
Philip
#15
Got it Gintaras,

It was a2.Name not value...

Thanks for the pointers
Best Regards,
Philip


Forum Jump:


Users browsing this thread: 1 Guest(s)