From e1eee5730e290a7a2dd23438ff219e867b3fe4e3 Mon Sep 17 00:00:00 2001 From: tkellner Date: Wed, 31 Oct 2012 16:37:01 +0000 Subject: Add bottom bar to Positioning git-svn-id: https://svn.iaik.tugraz.at/svn/egiz/prj/current/12PDF-OVER-4.0@12759 3a0b52a2-8410-0410-bc02-ff6273a87459 --- .../gui/composites/PositioningComposite.java | 37 +++++++++++++++++++--- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'trunk') diff --git a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java index d6efe5da..f4949c52 100644 --- a/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java +++ b/trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java @@ -35,6 +35,10 @@ import org.eclipse.swt.events.KeyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.ScrollBar; import org.slf4j.Logger; @@ -77,11 +81,34 @@ public class PositioningComposite extends StateComposite { * @param state */ public PositioningComposite(Composite parent, int style, State state) { - super(parent, style | SWT.EMBEDDED | SWT.V_SCROLL, state); - //this.setLayout(null); - this.setBounds(0, 0, 10, 10); - this.scrollbar = this.getVerticalBar(); - this.frame = SWT_AWT.new_Frame(this); + super(parent, style, state); + this.setLayout(new FormLayout()); + + Composite bottomBar = new Composite(this, SWT.NONE); + FormData fd_bottomBar = new FormData(); + fd_bottomBar.left = new FormAttachment(0); + fd_bottomBar.right = new FormAttachment(100); + fd_bottomBar.bottom = new FormAttachment(100); + bottomBar.setLayoutData(fd_bottomBar); + bottomBar.setLayout(new FormLayout()); + + Button btnSign = new Button(bottomBar, SWT.NONE); + btnSign.setText("Sign"); + FormData fd_btnSign = new FormData(); + fd_btnSign.right = new FormAttachment(100); + fd_btnSign.bottom = new FormAttachment(100); + btnSign.setLayoutData(fd_btnSign); + + Composite mainArea = new Composite(this, SWT.BORDER | SWT.EMBEDDED | SWT.V_SCROLL); + FormData fd_mainArea = new FormData(); + fd_mainArea.left = new FormAttachment(0); + fd_mainArea.right = new FormAttachment(100); + fd_mainArea.top = new FormAttachment(0); + fd_mainArea.bottom = new FormAttachment(bottomBar, -5); + mainArea.setLayoutData(fd_mainArea); + this.scrollbar = mainArea.getVerticalBar(); + + this.frame = SWT_AWT.new_Frame(mainArea); this.addKeyListener(this.keyListener); this.frame.addMouseWheelListener(this.mouseListener); this.scrollbar.addSelectionListener(this.selectionListener); -- cgit v1.2.3