/*
 * Focus Model Test (4) for SVGForm alpha3
 * Copyright 2008 Michael Farrell
 * http://micolous.id.au/
 */
 
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
			
function init() {
	// create menu bar
	var SFMenuBar = new SFMenuBarController();

	// title
	(new SFLabel(10, 40, "Focus Model SVGForm Test")).setFont("Calibri", "20px");
	// input box
	InputBox1 = new SFInputBox(10, 100, 400, 25, "test");
	// width info box
	InfoLabel1 = new SFLabel(10,60,"???");
	
	// handler for if the input box's contents change
	InputBox1.onValueChanged = function(me) {
		InfoLabel1.setLabel("Width is: " + me.text.getComputedTextLength() + ".");
	}
	
	// File menu (STUB)
	fileMenu = new SFMenu();
	fileMenu.addItem(new SFMenuSimpleItem("New", null));
	fileMenu.addItem(new SFMenuSimpleItem("Open...", null));
	fileMenu.addItem(new SFMenuSimpleItem("Save", null));
	fileMenu.addItem(new SFMenuSimpleItem("Save as...", null));
	
	// Edit menu (STUB)
	editMenu = new SFMenu();
	editMenu.addItem(new SFMenuSimpleItem("Undo", null));
	editMenu.addItem(new SFMenuSimpleItem("Cut", null));
	editMenu.addItem(new SFMenuSimpleItem("Copy", null));
	editMenu.addItem(new SFMenuSimpleItem("Paste", null));
	
	// View menu (STUB)
	viewMenu = new SFMenu();
	viewMenu.addItem(new SFMenuSimpleItem("Full Screen", null));
	
	// Help menu (some stubs)
	helpMenu = new SFMenu();
	helpMenu.addItem(new SFMenuSimpleItem("About...", function() {
		alert("Focus Model Test; running on SVGForm alpha3 by Michael Farrell");
	}));
	helpMenu.addItem(new SFMenuSimpleItem("Online Help", null));
	helpMenu.addItem(new SFMenuSimpleItem("Website", function() {
		document.location.href = 'http://micolous.id.au';
	}));
	
	// add menus to the bar.
	SFMenuBar.addMenu("File", fileMenu);	
	SFMenuBar.addMenu("Edit", editMenu);
	SFMenuBar.addMenu("View", viewMenu);
	SFMenuBar.addMenu("Help", helpMenu);	
}   		

// call init
init();

