Behavior Configuration Screen
You must add the following lines in the html file that represents the start screen gadget Default.html.
System.Gadget.onSettingsClosed = SettingsClosed;
System.Gadget.settingsUI = "Setting.html
In the file that each table Setting.XAML we call the functions called to create the animation:
Code:
MouseEnter = "amarilloOn" MouseLeave = "amarilloOff" MouseLeftButtonDown = "amarilloClick" Cursor = "Hand">
The following features serve to activate animations (... On) in the event MouseEnter
// Disable (Off ..) enables the animation when it is on the table and MouseLeave
// (... Click) when clicking on the box.
// To make it easier for x: Name of the elements have the name of the color
// So that we pass as argument the name of the sender to the marker function.
negroOn function (sender, args)
(Sender.findName (negroOn "). Begin (); )
negroOff function (sender, args)
(Sender.findName (negroOff "). Begin ();)
negroClick function (sender, args)
(Marker (sender.Name, sender); )
additions and functions serves to increase the edge of the selected color box to make it faster in terms of programming, we return the StrokeThickness of all elements to 1, and then change the StrokeThickness the selected object. With the subject line seteamos color = color to the variable when executing the function associated with onSettingsClosing gadget is written in the selected color value.
Code:
function bookmark (object sender) (
sender.findName ("yellow"). StrokeThickness = "1";
sender.findName ("blue"). StrokeThickness = "1";
sender.findName ("red"). StrokeThickness = "1";
sender.findName ("black"). StrokeThickness = "1";
sender.findName ("green"). StrokeThickness = "1";
sender.findName (object). StrokeThickness = "3";
color = object;
)
When you close the window, and that pushed the OK button
Code:
System.Gadget.onSettingsClosing = function (event) (
if (event.closeAction == event.Action.commit) (
if (color! = "") (
System.Gadget.Settings.write ("color", color);
)
Event.cancelable = false;
)
)
Also remember that when you close this window, pass the values to update the value on the screen, this is where we use the following line of code:
System.Gadget.onSettingsClosed = SettingsClosed;
That is, when you close the window setting, SettingsClosed function is executed.
Finishing
After configuring the XML Manifest Gadget we only run our Gadget. I think that many users will get help from this tutorial.
Bookmarks