Friday, 21 October 2016

Form _Splitters

Form _Splitters

Example : Tutorial_from_split





Create a new form by name - pramod_Splitters

Add a new static text control  and add a new string control

set autodeclarations for both controls to Yes

Drag and drop the group control from the tutorial_form_split to the newly created form in
 between the static
 text and string edit controls

In the class declaration

public class FormRun extends ObjectRun
{
    SysFormSplitter_Y _formSplitter;
}

override init() method of the element and instantiate the sysFormSplitter_y class object

public void init()
{
    super();

     _formSplitter = new SysFormSplitter_Y(groupSplitter,StaticText,element);
}

Three important methods on the group control which will help to resize the splitters are mouseup, mousemove, mousedown

int mouseUp(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseUp(x, y, button, ctrl, shift);
}

int mouseMove(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseMove(x,y,button,ctrl,shift);
}

int mouseDown(int x, int y, int button, boolean ctrl, boolean shift)
{
    int ret;

    ret = super(x, y, button, ctrl, shift);

    Return _formSplitter.mouseDown(x, y, button, ctrl, shift);
}






No comments:

Post a Comment