Combining Loadpanel with Pushpanel
Load txt file Revision
Load txt file License
Load txt file Readme
Clear File
Get URL
Reload
Requirements:
DynAPI.include('dynapi.api.*');
DynAPI.include('dynapi.event.*')
DynAPI.include('dynapi.util.thread.js');
DynAPI.include('dynapi.util.pathanim.js');
DynAPI.include('dynapi.gui.button.js');
DynAPI.include('dynapi.gui.scrollbar.js');
DynAPI.include('dynapi.gui.viewport.js');
DynAPI.include('dynapi.gui.scrollpane.js');
DynAPI.include('dynapi.gui.dynimage.js');
DynAPI.include('dynapi.gui.label.js');
DynAPI.include('dynapi.gui.loadpanel.js')
Usage:
In short this is an example of adding one object to another,
instead of adding it to DynAPI.document first.
Like this:
lp = new LoadPanel();
lp.setSize(850,200);
lp.moveTo(10,10);
scrollobj = new ScrollPane(lp) // loadpanel will be set as the content
scrollobj.setSize(600,250)
scrollobj.moveTo(20,250)
A source example:
</script>
<script language="Javascript">
var varContainer
DynAPI.onLoad = function() {
lp = new LoadPanel();
lp.setSize(850,200); // height will be overwritten by default
lp.moveTo(10,10);
//lp.setBgColor('123456');
counter = 0;
var el = new EventListener()
el.onload = function(e) {
status = 'got load event '+ counter++;
}
lp.addEventListener(el)
scrollobj = new ScrollPane(lp) // loadpanel will be set as the content
scrollobj.setSize(600,250)
scrollobj.moveTo(20,250)
//scrollobj.setBgColor('#c0c0c0')
DynAPI.document.addChild(scrollobj)
lp.setURL("../README") // load your external file here...
//document.selection.empty();
el2 = new EventListener(DynAPI.document)
el2.onmousemove = function(e) {
//if(is.ie)document.selection.empty();
}
scrollobj.addEventListener(el2)
lp.addEventListener(el2)
DynAPI.document.addEventListener(el2)
}
</script>
</head>
<body bgcolor=beige><h2>Combining Loadpanel with Pushpanel</h2>
<a href="javascript: lp.setURL('../REVISION');">Load txt file Revision</a><br>
<a href="javascript: lp.setURL('../LICENSE');">Load txt file License</a><br>
<a href="javascript: lp.setURL('../README.txt');">Load txt file Readme</a><br>
<br>
<a href="javascript: lp.clearFile();">Clear File</a><br>
<a href="javascript: alert(lp.getURL());">Get URL</a><br>
<a href="javascript: lp.reload();">Reload</a><br>