/*
WARNING: Before executing this script assign the View Class Name in the main inspector to SAI_Web_View

This is an example script that loads content into a web view. All native controls (text fields, buttons, sliders, pop up buttons, etc.) for every inspector editor in Graph Builder are made with an Adapter and corresponding script. There are literally hundreds of scripts that execute when you work the Graph Builder user interface. In general, such scripts give essentially untethered access to the Cocoa and Cocoa Touch frameworks. As a result of this complexity, adapters are only supported on a contract basis.
*/

/* Declarations */


@@class() String:Object

@@method(public, class) (id)alloc;
@@method(public, instance) (id)init;
@@method(public, instance) (id)value;
@@method(public, instance) (void)appendCString:(const char *)aCString;
@@method(public, instance) (void)release;

@@end

@@class() Adapter:Object

@@method(public, class) (id)stored;
@@method(public, instance) (unsigned)executionCount;
@@method(public, instance) (id)value;
@@method(public, instance) (void)SAI_update_to_string:(const char *)aString;

@@end

/* Execution block */

{
id myAdapter;
id myString;
unsigned executionCount;

myAdapter = [Adapter stored];

executionCount = [myAdapter executionCount];

if(executionCount == 1U)
{
myString = [[String alloc] init];

[myString appendCString:"<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n<html>\n<head>\n<title>HTML Adapter</title>\n<META HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=utf-8\">\n<style>\n.BodyNormal {FONT-FAMILY:Verdana, Arial, Helvetica; FONT-SIZE: 9pt; COLOR: black; text-decoration: none}\n</style>\n</head>\n<body bgcolor=\"#FFFFFF\" class=\"BodyNormal\">\n<p>\n<center>\n<table border=\"0\" cellpadding=\"5\" cellspacing=\"1\" width=\"90%\" class=\"BodyNormal\">\n<tr>\n<td align=center valign=top nowrap bgcolor=\"#DDDDDD\"><b>Item</b></td><td align=center valign=top bgcolor=\"#DDDDDD\"><b>Description</b></td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Adapter</td><td align=left valign=top bgcolor=\"#DDDDDD\">This is an example adapter to a Web View.</td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Utility</td><td align=left valign=top bgcolor=\"#DDDDDD\">Drag and drop or copy this adapter to a graphic view and look at its settings and program to determine how to use it.</td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Flexibility</td><td align=left valign=top bgcolor=\"#DDDDDD\">Adapters can adapt any Cocoa view object.</td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Difficult</td><td align=left valign=top bgcolor=\"#DDDDDD\">Because adapters connect two disparate systems with their own design criterion they can be somewhat difficult to work with; however the utility outweighs this issue for very advanced uses.</td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Help</td><td align=left valign=top bgcolor=\"#DDDDDD\">Adapters are not a novice feature by any means, rather they are hardcore programming. Support for adapters are only provided on a contract basis.</td>\n</tr>\n<tr>\n<td align=left valign=top nowrap bgcolor=\"#CCCCCC\">Resources</td><td align=left valign=top bgcolor=\"#DDDDDD\">Email <a href=\"mailto:support@vvi.com\">support@vvi.com</a> for contracting information or visit <a href=\"http://www.vvi.com\" target=\"_new\">www.vvi.com</a> for additional information.</td>\n</tr>\n</table>\n</center>\n\n</body>\n</html>"];

[[myAdapter value] SAI_update_to_string:[myString value]];

[myString release];
}

}
