API v10 Documentation & Development Guide
Contents
Native Widget Development (using C#/VB.Net WPF)
| Key | Details |
|---|---|
| TEST | For testing, displays a dialog box with all arguments. |
| POPMSG | For displaying a information message box with given message and a OK button. |
| POPERR | For displaying a error message box with given error message and a OK button. |
| URL | For displaying a browser with given URL, i.e. it opens web browser with given URL. |
Newgen.Base.MessagingHelper.SendMessageToNewgen("URL", "http://ftware.blogspot.com");
Newgen.Base.MessagingHelper.SendMessageToWidget("Internet", "http://ftware.blogspot.com");NOTE: In case of sending message to widget, the key is the name of widget. To receive messages to your widget, you must implement the following code in class which inherits class Newgen.Base.NewgenWidget
public override void HandleMessage(string message) { switch (message) { ... } }
HTML Widget Development (using HTML, XHTML, HTML5, ...)
$Newgen. // Any method listed below, after dot '.'
var ver = $Newgen.Version();
This will trigger the Newgen to get current version.
var ls = $Newgen.LicenseStatus();
This will trigger the Newgen to get current license status.
<button onclick="$Newgen.CloseHub()">Click here to close this hub</button>This will trigger the Newgen to close the hub.
| Key | Details |
|---|---|
| TEST | For testing, displays a dialog box with all arguments. |
| POPMSG | For displaying a information message box with given message and a OK button. |
| POPERR | For displaying a error message box with given error message and a OK button. |
| NOTE* | Although you can use the keys exposed by Native API but, they might cause errors. |
<button onclick="$Newgen.SendMessage('TEST','Hello world !')">Click here to send message to Newgen</button>This will trigger the Newgen to show a dialog box with 'Hello world !'. Here 'TEST' is key and 'Hello world !' is message content.
<button onclick="$Newgen.ASD('My HTML Widget','Hello world !', function (r) {alert('Saved !')})">This will trigger the Newgen to save 'Hello world !' to a local file. If no error occurs, a message box will show 'Saved !'.
<button onclick="$Newgen.GSD('My HTML Widget', function (r) {alert(r)})">This will trigger the Newgen to get saved data from local file. If no error occurs, a message box will show the data that was saved.
<button onclick="$Newgen.CSD('My HTML Widget', function (r) {alert(r)})">This will trigger the Newgen to clear saved data from local file. If no error occurs, a message box will show 'true'.
Packing widgets using WPE - Part of Newgen WDK
For packing widgets you must download Newgen WDK or just WPE.exe.
WPE is a command like utility for packing files into installable .nwp package (i.e. Newgen Widget Package).
Now, when you'll open WPE.exe, it'll ask you few values. You'll need to fill out all values as possible.
You can also directly send all values altogether to WPE, using Command prompt or directly integrate it into your build tool.
Format: WPE -P "Path to you widget contents" -O "Output path for packed .nwp file" -W "Name" -I "ID" -V "Version" -D "Description" -A "Author" -AW "Website"
If you can't install widget by clicking it, you'll can pass this command to Newgen.exe to do that "Newgen.exe -nwp "Path to .nwp file""
Making widgets available in Newgen Store
Newgen Store requires, that your widget must be approved first before being available for public.
You must provide correct information before uploading widget for approval. We can contact you at anytime.
Id for your widget must be unique, i.e. it should not collide with any other widget's else it'll be changed by us without any notification.
You can upload your widget (packed in .nwp) for approval from here.
Links, downloads
For any other details or query, feel free to contact.
© 2013 NS.