Compartilhar via


System.Gadget.onSettingsClosed event

[The Windows Gadget Platform/Sidebar is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. ]

Event fired when the gadget Settings dialog is closed.

Syntax

iRetVal = 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("Canceled");
    }
}

Requirements

Minimum supported client
Windows Vista [desktop apps only]
Minimum supported server
Windows Server 2008 [desktop apps only]
End of client support
Windows 7
End of server support
Windows Server 2008
IDL
Sidebar.idl
DLL
Sidebar.Exe (version 1.00 or later)

See also

System.Gadget