hsplitpane.lzx
<library>
<class name="hsplitpane" defaultplacement="nonnull" width="100%" height="100%" pixellock="true" clip="false">
<attribute name="lhs_min_width" value="10
"/>
<attribute name="lhs_max_width" value="${this.width-20}"/>
<attribute name="lhs_width_start" value="180
"/>
<attribute name="bordersize" value="1
"/>
<attribute name="bordercolor" value="0x000000
" type="color"/>
<attribute name="sizer_width" value="5
"/>
<attribute name="lhs_placed" value="false
" type="boolean"/>
<attribute name="rhs_placed" value="false
" type="boolean"/>
<view width="100%" height="${parent.bordersize}" bgcolor="${parent.bordercolor}" pixellock="true"/>
<view width="100%" height="${parent.bordersize}" y="${parent.height-parent.bordersize}" bgcolor="${parent.bordercolor}" pixellock="true"/>
<view width="${parent.bordersize}" height="100%" bgcolor="${parent.bordercolor}" pixellock="true"/>
<view width="${parent.bordersize}" height="100%" x="${parent.width-parent.bordersize}" bgcolor="${parent.bordercolor}" pixellock="true"/>
<view name="split" y="${parent.bordersize}" x="$once{parent.lhs_width_start}" height="${parent.height-parent.bordersize*2}" width="${classroot.sizer_width}" bgcolor="0x999999" pixellock="true">
<view width="1" height="100%" bgcolor="0x595959" pixellock="true"/>
<view width="1" x="1" height="100%" bgcolor="0x777777" pixellock="true"/>
<view width="1" height="100%" x="${parent.width-1}" bgcolor="0x595959" pixellock="true"/>
<view width="1" height="100%" x="${parent.width-2}" bgcolor="0xffffff" pixellock="true"/>
<view name="grabber" width="100%" bgcolor="0x595959" height="28" valign="middle">
<view y="4" width="100%" height="1" bgcolor="0x777777"/>
<view y="8" width="100%" height="1" bgcolor="0x777777"/>
<view y="12" width="100%" height="1" bgcolor="0x777777"/>
<view y="16" width="100%" height="1" bgcolor="0x777777"/>
<view y="20" width="100%" height="1" bgcolor="0x777777"/>
<view y="24" width="100%" height="1" bgcolor="0x777777"/>
<handler name="onmousedown">
parent.dragger.setAttribute('applied', true);
</handler>
<handler name="onmouseup">
parent.dragger.setAttribute('applied', false);
</handler>
</view>
<dragstate name="dragger" drag_axis="x" drag_min_x="${classroot.lhs_min_width}" drag_max_x="${classroot.lhs_max_width}"/>
</view>
<view name="lhs" x="${parent.bordersize}" y="${parent.bordersize}" width="${parent.split.x-parent.bordersize}" height="${parent.height-parent.bordersize*2}" clip="false">
<simplelayout axis="x"/>
</view>
<view name="rhs" x="${parent.split.x+parent.split.width}" y="${parent.bordersize}" width="${parent.width - this.x - parent.bordersize}" height="${parent.height-parent.bordersize*2}" clip="false">
<simplelayout axis="x"/>
</view>
<method name="determinePlacement" args="aSub, placement, args">
if(!lhs_placed) {
this.lhs_placed = true;
return lhs;
} else if(!rhs_placed) {
this.rhs_placed = true;
//aSub.
return rhs;
} else {
Debug.warn("vsplitpane only support two sub views. Placing extra subviews on the right.");
return rhs;
}
</method>
</class>
</library>