Create Vertical & Horizontal splitter on a Form


  • Create a Form in AOT, in form class declaration add following code
SysFormSplitter_Y               formSplitterHorizontal;
SysFormSplitter_X               formSplitterVertical;
  • Design the form with groups as shown below with properties of CtrlSplitHorizontal, CtrlSplitVertical groups.



  • On the form init method add following code
formSplitterHorizontal = new SysFormSplitter_Y(CtrlSplitHorizontal, GroupTable, this);    
formSplitterVertical = new SysFormSplitter_X(CtrlSplitVertical, GroupLineLeft, this);
  • On the CtrlSplitHorizontal override the following methods 
public int mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    super(_x, _y, _button, _Ctrl, _Shift);

    return formSplitterHorizontal.mouseDown(_x, _y, _button, _ctrl, _shift);
}

public int mouseMove(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    super(_x, _y, _button, _Ctrl, _Shift);

    return formSplitterHorizontal.mouseMove(_x, _y, _button, _ctrl, _shift);
}

public int mouseUp(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    super(_x, _y, _button, _Ctrl, _Shift);

    return formSplitterHorizontal.mouseUp(_x, _y, _button, _ctrl, _shift);
}

  • On the CtrlSplitVertical override the following methods
public int mouseDown(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    super(_x, _y, _button, _Ctrl, _Shift);

    return formSplitterVertical.mouseDown(_x, _y, _button, _ctrl, _shift);
}
public int mouseMove(int _x, int _y, int _button, boolean _Ctrl, boolean _Shift)
{
    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)
{
    super(_x, _y, _button, _Ctrl, _Shift);

    return formSplitterVertical.mouseUp(_x, _y, _button, _ctrl, _shift);
}

  • Thats it you are good to go & form will look something like below

Comments

Popular posts from this blog

Sales order invoice posting using X++ with custom SalesParmLine fields

Create a custom lookup with multiple data sources on form using X++

SalesTable2Line custom field update prompt on Sales order in AX 2012