- OpenLaszlo紹介
- プログラム構造関連
- スクリプト
- Javascript基礎
- 基礎知識
- ビュー<view>
- レイアウト
- 動かす
- 入力デバイス
- 文字
- 数値
- 日付
- オブジェクト指向
- 標準コンポーネント
- データの扱い
- データ操作(基礎)
- 応用編
–
右寄せの入力inputtextの自作クラス。とりあえず右寄せのみ。
<?xml version="1.0" encoding="UTF-8"?> <canvas proxied="false" bgcolor="0xeeeeee"> <class name="myInputtext" width="200" height="20"> <attribute name="textalign" type="string" value="right"/> <view width="${parent.width}" height="${parent.height}" bgcolor="0x000000"> <view align="center" valign="middle" width="${parent.width-2}" height="${parent.height-2}" bgcolor="0xffffff" clip="true"> <inputtext width="${parent.width+this.pad}"> <attribute name="pad" value="1000" type="number"/> <handler name="ontext"> if (classroot.textalign == "right") { var x = ((this.width-this.pad) - (this.getTextWidth()+10)); this.setAttribute("x", x); } </handler> </inputtext> </view> </view> </class> <myInputtext x="10" y="10" /> </canvas>