resizing a child in a composite widget

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

resizing a child in a composite widget

Postby Girish » Wed Jun 09, 2010 12:52 am

I,ve a widget Figure whose layout manger is XYLayout
it is a composite of label and the controlFigure(control figure is textbox/textArea/dropdown or so controlFigure = new Figure();)
controlFigure's layout manager is ToolBarLayout

Code: Select all
private void createControl(String displayName) {
setLayoutManager(new XYLayout());
setPreferredSize(100, 19);
setOpaque(false);

label = new Label();
label.setFont(ResourceUtil
.getFont(WindowDesignerConstants.FIELD_LABEL_FONT));

label.setLabelAlignment(PositionConstants.LEFT);

if(!isFullHeight())
add(label);

Label labelTip = new Label();
label.setToolTip(labelTip);

tooltip = new Label();
setToolTip(tooltip);

controlFigure = new Figure();
ToolbarLayout controllayout = new ToolbarLayout(false);
controllayout.setSpacing(WindowDesignerConstants.FIELD_HPADD ING + 5);
controllayout.setStretchMinorAxis(true);
controllayout.setMinorAlignment(ToolbarLayout.ALIGN_BOTTOMRI GHT);
controlFigure.setLayoutManager(controllayout);
controlFigure.setOpaque(true);
if (hasLabel && !fullHeight)
controlFigure.setPreferredSize(getBounds().width
//- label.getBounds().width
- 2*WindowDesignerConstants.FIELD_HPADDING,
getBounds().height -label.getBounds().height
- 3 * WindowDesignerConstants.FIELD_VPADDING);

this.add(controlFigure);
createControlFigure(displayName);
imageFigure = new ImageFigure();
imageFigure.setImage(ImageManager.getImage("LOV"));
add(imageFigure);
}

public void createControlFigure(String displayName) {
controlFigure.setBorder(new LineBorder(1));
controlFigure.setBackgroundColor(WindowDesignerConstants.HEA DER_COLOR);
Label name = new Label(displayName);
name.setFont(ResourceUtil
.getFont(WindowDesignerConstants.FIELD_WIDGET_FONT));
controlFigure.add(name);
name.setPreferredSize(controlFigure.getPreferredSize());
}
public IFigure getControlFigure() {
return controlFigure;
}


I'm able to select the entire widget and resize using mouse
but i want to select only the controlfigure inside the composite and to resize it using mouse

can anybody suggest me in achieving this
Girish
 
Posts: 1
Joined: Wed Jun 09, 2010 12:43 am

Re: resizing a child in a composite widget

Postby Konstantin.Scheglov » Wed Jun 09, 2010 12:57 am

SWT Designer does not support editing Draw2D/GEF figures, it supports SWT/JFace/RCP.
Konstantin.Scheglov
Moderator
 
Posts: 186
Joined: Tue Oct 18, 2005 8:11 pm
Location: Russian Federation, Lipetsk


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 2 guests