Is there any way to create the calculator tool in application bar?
Is there any way to create the calculator tool in application bar like alarm & event tool in application bar?
I tried in the following way:
1.Created windows application for the calculator in functional str.
2.Created the web behaviour tool & provided the object/aspect path(like ao://object guid:Aspect guid
3.Then in workplace str i have created the tool collection & added the web behaviour tool.
4.In the application bar i have checked the "new tool collection" & checked my "calc tool collection.
5.Then once i opened my workplace am able to see that button in the aplication bar but when i click on the button its opening the config view of the windows application instead calculator...So what i understand is it possible to create verbs to open the same.
If so please help me to create the same.
Voted best answer
If you just want to call Windows application by clicking a button in application bar then all you need is to use "Shell.Run" call in the code of IAfwHTMLTool:
<ABB:Tool
type="button"
id="btnCalc"
title="Windows Calculator"
btnClick()"
Image="#resource#(Icon)">
</ABB:Tool>
<script defer>
function btnClick()
{
try
{
var helper = new ActiveXObject("ABB.AfwFocusManager.1");
var shell = helper.CreateObjectForScripting("WScript.Shell");
shell.Run("calc.exe");
}
catch(e) { alert("Failed to launch Calculator"); }
}
</script>
Note that it works only if the same application installed on all nodes using the same location path (like calc.exe in Windows\system32).
Answers
This query does not fall within the regular scope of support (that I need to adhere to when attending to my "regular duties").
It sounds like the "Config View" becomes selected by default (just as when eg adding an aspect link from a faceplate to a file viewer aspect) - you may need to select the "Main View" (which is possible but not default in the faceplate configuration) but I'm not sure about how that is done here in this case.
I'm out of office until Monday - I'll try to check then and revert.
/Stefan
Create the Windows application in FS and then browse the application location on "Windows Application" Ex: C:\Windows\System32\calc.exe.
Then create a "Verb Button" and browse the "Verbs" on verb reference and select the aspect "Open".
Now you verb button will display the actual windows application, instead of the config view.
Hi Linkinx64,
I have tried with the blog what you have posted but this time whenever i click on the calc button in the application bar at that time it's throwing the pop up message with script error.
Source:
by Linkinx64 Rank: 58 on 8/29/2013 5:37:21 AM | Like (0) | Report
Sorry, function must be called "btnCalc()" not "btnClick()".
Add new comment