目标:实现在FORM中添加垂直分割条
1. 新建Form: splitterForm,为其添加数据源
2. 为splitterForm的Design依次添加三个group:HeaderGroup,Splitter,LinesGroup,如图:
将HeaderGroup和Splitter设置为自动声明。
3. 在splitterForm的Methods下的classdeclaration中声明如下变量:
public class FormRun extends ObjectRun
{
SysFormSplitter_Y _formSplitterVertical;
}
4. 在splitterForm的Methods下的init方法中初始化_formSplitterVertical:
public void init()
{
;
super();
_formSplitterVertical = new SysFormSplitter_Y( Splitter, HeaderGroup, this);
}
5. override group:Splitter下的三个方法:mouseUp,mouseMove,mouseDown:
public int mouseMove(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
int ret;
;
ret = super(_x, _y, _button, _Ctrl, _Shift);
return _formSplitterVertical.mouseMove(_x,_y,_button,_Ctrl,_Shift);
}
public int mouseUp(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
int ret;
;
ret = super(_x, _y, _button, _Ctrl, _Shift);
return _formSplitterVertical.mouseUp(_x,_y,_button,_Ctrl,_Shift);
}
public int mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
int ret;
;
ret = super(_x, _y, _button, _Ctrl, _Shift);
return _formSplitterVertical.mouseDown(_x,_y,_button,_Ctrl,_Shift);
}
6. 修改group:Splitter的属性:
Width: ColumnWidth
Height:固定值,我习惯使用5
FrameType:Rised 3D
BackGroudColor:Window BackGroud
HideIfEmpty: no
AlignChild: No
OK了。
SysFormSplitter_Y 的new方法参数:
New SysFormSplitter_Y( FormGroupControl _formGroupControl,
FormControl _sizeControl,
FormRun _formRun,
int _startUpHeight = 0,
str _extraName = ‘’)