Docking windows from script

Kool IM in the Sidewinder Viewer

With the latest release of the Sidewinder Viewer, it is now possible to dock many windows to a single edge of the display. The requirement for this change really became apparent with the increased control over renderer objects from script, that was introduced in an earlier build of version 2.0.4. One of the things that this enables us to do is extend the Kool IM Sample so that individual message windows themselves may be slid on to and off from the display as necessary.

A fairly rudimentary implementation of this can be achieved by simply adding a new variable to the script and using that to iterate through a set of positions along one edge of the screen. So the handler for the new window event would be changed as follows:

function handleEvent(event)
{
	var message = new Renderer(
		{
			Type: "xhtml",
			Style: 0x00000040|0x00000800|0x00001000|0x00400000|0x20000000,
			Width: 298,
			Height: 298,
			Edge: "left",
			PositionY: messageCount++ % 6 * 100,
			AutoHide: true,
			Title: "Sidewinder: Message"
		} );
	message.Create();
	message.Show();

	event.parameter.objectValue = message.GetRenderingImplementation();
}

Of course, the above approach breaks down because it uses hard-coded values to make assumptions about the dimensions of the display. However, that issue should be fixed shortly, as we continue to make our script API more powerful.

Kool IM in the Sidewinder Viewer