You can use inline.js to include support for relative layers... the
following example has a normal table with a relatively positioned div in one
of the cells - then you just do something like layer1 =
this.document.getAll()['layer1'] to reference the layer and add what you
want...

hope this helps

<html>
<head>
<title>DynAPI Distribution: Scrollpane in table Example</title>
<script language="Javascript" src="../src/dynapi.js"></script>
<script language="Javascript">
DynAPI.setLibraryPath('../src/lib/')
DynAPI.include('dynapi.api.*')
DynAPI.include('dynapi.event.*')
DynAPI.include('dynapi.util.thread.js');
DynAPI.include('dynapi.util.pathanim.js');
DynAPI.include('dynapi.gui.dynimage.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.label.js');
DynAPI.include('dynapi.ext.inline.js')
</script>
<script language="Javascript">

DynAPI.onLoad=function() {
        label1 = new Label('<table border=1><tr><td width=160 height=160>label 1
alk jskj slkj k dkjkj dk skslkdjf lskd f</td></tr></table>')
        label1.setWrap(false)
        label1.setPadding(5)
        label1.setBgColor('cyan')
        label1.setSize(160,160)

        var layer1 = this.document.getAll()['layer1']

        scrollobj = new ScrollPane(label1)
        scrollobj.setSize(150,150);
        scrollobj.setBgColor('#c0c0c0');

        layer1.setBgColor('#FBF9DB')
        layer1.addChild(scrollobj);
        }
</script>
</head>

<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellpadding="3">
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>A normal cell</td>
    <td>and another</td>
    <td>and another</td>
  </tr>
  <tr>
    <td>and another</td>
    <td>and another</td>
    <td>
      <div id="layer1" style="position:relative; width:150px; height:150px;
z-index:1; left: 0px; top: 0px"></div>
    </td>
  </tr>
</table>
</body>
</html>

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Mark
Fletcher
Sent: 15 May 2001 11:29
To: [EMAIL PROTECTED]
Subject: [Dynapi-Help] Positioning DynAPI Layers within Table Cells


Hi,

Apologies if my previous mail was unclear... reading over it again I found
that it didnt really express the problem.

Ive been looking over the DynAPI API documentation, Ive been looking over
the functions

moveTo(), setX, setY etc... is my understanding correct that these functions
use the top left hand corner of the canvas as the origin for positioning? Is
there any other way to set an alternative origin ie, for example, if I have
a table whose properties change from page to page, I would like to include a
scrolling pane within a table cell. Is there anyway to set the position of
the scrolling pane relative to the table cell?

Cheers,

Mark

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help


_______________________________________________
Dynapi-Help mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dynapi-help

Reply via email to