System.Gadget.onSettingsClosed Event

Event fired when the gadget Settings dialog is closed.

Syntax

retVal = System.Gadget.onSettingsClosed(
  handler
)

Parameters

handler

The name of the function to call when the event is fired.

Note   The function takes a parameter of type System.Gadget.Settings.ClosingEvent.

Remarks

Invoking the OK or Cancel button of the Settings dialog will close the dialog and fire this event.

Examples

The following example demonstrates how to use the onSettingsClosed event to read values from controls in the Settings dialog.

var userEntry = "";

System.Gadget.onSettingsClosed = SettingsClosed;

// --------------------------------------------------------------------
// Handle the Settings dialog closed event.
// event = System.Gadget.Settings.ClosingEvent argument.
// --------------------------------------------------------------------
function SettingsClosed(event)
{
    // User hit OK on the settings page.
    if (event.closeAction == event.Action.commit)
    {
        userEntry = 
            System.Gadget.Settings.readString("settingsUserEntry");
        SetContentText(userEntry);
    }
    // User hit Cancel on the settings page.
    else if (event.closeAction == event.Action.cancel)
    {
        SetContentText("Cancelled");
    }
}

Requirements

Minimum supported clientWindows Vista
Minimum supported serverWindows Server 2008
IDLSidebar.idl
DLLSidebar.Exe version 1.00 or later

See Also

System.Gadget

 

 

Send comments about this topic to Microsoft

Build date: 2/24/2010

Build type: SDK

Community Additions

Show: