PDA

View Full Version : Doc Bug?


jedimaster
08-01-2003, 04:49 AM
I'm following the Understanding Views doc, and I'm at the point where I have my button bar gray, valigned, etc. One little thing I noticed. In the screen shots, the left most button is spaced 5 pixels away from the left side. When I display it though, the first button is immidiately aligned to the left border.

This is the code being used:

<canvas>
<include href="redmond/" />
<window x="20" y="20" width="200" height="250"
title="Boring Window" resizable="true">
<simplelayout axis="y" spacing="10" />
<view bgcolor="#bdbdbd"
width="parent.width"
height="this.buttons.refButton.height + 8">
<view name="buttons" valign="middle">
<simplelayout axis="x" spacing="5" />
<button name="refButton">1</button>
<button>2</button>
<button>3</button>
</view>
</view>
<text>Here is some text.</text>
<text>I could ramble for hours.</text>
<button x="(immediateparent.width / 2) - (this.width / 2)"
onclick="this.setAttribute('width', this.getAttribute('width') + 10);">
My Butt
</button>
</window>
</canvas>

antun
08-01-2003, 08:02 AM
I think this is a bug with the screenshot. Well noticed!

-Antun

jedimaster
08-01-2003, 08:04 AM
As a general question, is there an easy way to pad inside a view? Ie, leftMargin=10 or something like that. I probably need to RTFM. :)

antun
08-01-2003, 08:12 AM
There aren't any padding/margin properties as such - usually I would encase the stuff to be padded in a view (that way any layouts on it would remain in place), and move that view to the left or right.

You could also do a constraint on it to get the padding you want:

<view width="parent.x-4" align="center" />

... would get you a view that had left and right margins of 2px.


I probably need to RTFM.


Don't be silly - ask away all you want!

-Antun