From: Andrew G. <agi...@us...> - 2005-08-16 22:39:53
|
Update of /cvsroot/dynapi/dynapi3x/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22981 Added Files: 005.ViewPane.html 005.ViewPane.txt Log Message: ViewPane test adapted from w9.9's example --- NEW FILE --- <html> <head> <title>DynAPI Examples - ViewPane</title> <script language="JavaScript" src="../src/dynapi.js" type="text/javascript"></script> <script language="JavaScript" type="text/javascript"> dynapi.library.setPath('../src/'); dynapi.library.include('dynapi.api'); dynapi.library.include('ViewPane'); </script> <script language="JavaScript" type="text/javascript"> var html_content = new Array(); html_content[0] = '<div style="width:400; height:400; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #1</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>\n'; html_content[1] = '<div style="width:100; height:100; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #2</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[2] = '<div style="width:1000; height:100; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #3</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[3] = '<div style="width:100; height:300; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #4</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; html_content[4] = '<div style="width:200; height:160; overflow:hidden; background-color:yellow">\n' + ' <h1>Content #5</h1>\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + ' Some Text Some Text Some Text Some Text\n' + '</div>'; var vp = new Array(); vp[0] = new ViewPane(null,25,25,200,160); vp[1] = new ViewPane(null,275,25,200,160); vp[2] = new ViewPane(null,25,225,200,160); vp[3] = new ViewPane(null,275,225,200,160); vp[4] = new ViewPane(null,25,425,200,160); vp[0].setContent(new DynLayer('Test Layer1',10,10,250,250,'yellow')); vp[1].setContent(new DynLayer('Test Layer2',10,10,250,250,'yellow')); vp[2].setContent(new DynLayer('Test Layer3',10,10,250,250,'yellow')); vp[3].setContent(new DynLayer('Test Layer4',10,10,250,250,'yellow')); vp[4].setContent(new DynLayer('Test Layer5',10,10,250,250,'yellow')); changeContent(0,0); changeContent(1,1); changeContent(2,2); changeContent(3,3); changeContent(4,4); dynapi.document.addChild(vp[0]); dynapi.document.addChild(vp[1]); dynapi.document.addChild(vp[2]); dynapi.document.addChild(vp[3]); dynapi.document.addChild(vp[4]); function changeContent (vp_inx,html_inx) { vp[vp_inx||0].setContent( html_content[html_inx||0] ); }; </script> </head> <body> <script language="JavaScript" type="text/javascript"> dynapi.document.insertAllChildren(); </script> </body> </html> --- NEW FILE --- There are 5 ViewPanes. Each ViewPane contains a yellow fixed-size DIV element with some text. The DIVs are set at various sizes w.r.t. the ViewPane. ViewPane size is 200x160. <p> <i>Content #1:</i> The DIV (400x400) is wider and taller than the ViewPane. Horizontal and vertical scroolbars should be present. <p> <i>Content #2:</i> 100x100. No scrollbars. You may be able to scroll the content of the DIV by dragging the mouse around inside it - this is a browser feature. <p> <i>Content #3:</i> 300x100. Horizontal scrollbar only. <p> <i>Content #4:</i> 100x300. Vertical scrollbar only. <p> <i>Content #5:</i> 200x160. No scrollbars. |