jPOP Framework


javascript Powered On PHP

>
Window Builder







Window builder is a simple app that puts together all the Rich User Interfaces stuff into something sort of useable. Go ahead and take the source and fiddle around with it. It could give a starting point for your own jPOP project. Here's the source for it:

//this function is at top of page, after the require('jPOP.php'); bit
function makeWindow()
{
	$title = getVal('txtTitle');
	$contents = getVal('txtContents');
	$x = getVal('txtX');
	$y = getVal('txtY');

	$win = new Window();
	$win->init($contents, $title);
	$win->doAction('setLocation', "$x, $y");
	$win->show();
}

Put this somewhere in the body of your page (actual code uses label tags in the html, they have been removed in the listing to make it clearer).

Title: <input type='textbox' id='txtTitle'/><br/><br/>
Contents: <input type='text' id='txtContents'/><br/><br/>
X: <input type='text' id='txtX' size='5' value='10'/>
Y: <input type='text' id='txtY' size='5' value='10'/><br/>

<?php
addEvent('btnSubmit', 'onClick', 'makeWindow');
?>