summaryrefslogtreecommitdiff
path: root/trunk/pdf-over-gui
diff options
context:
space:
mode:
authorTobias Kellner <tobias.kellner@iaik.tugraz.at>2012-11-12 18:07:50 +0100
committerTobias Kellner <tobias.kellner@iaik.tugraz.at>2012-11-12 18:07:50 +0100
commit570a357f0ca04b9212884412df24b86e0ee814cd (patch)
treef006be40718ef28f7e68cc7a7c090ce50282807b /trunk/pdf-over-gui
parent1f10ba355742146f8fcc4589a694b2407e07887d (diff)
downloadpdf-over-570a357f0ca04b9212884412df24b86e0ee814cd.tar.gz
pdf-over-570a357f0ca04b9212884412df24b86e0ee814cd.tar.bz2
pdf-over-570a357f0ca04b9212884412df24b86e0ee814cd.zip
Change 'new page' button size depending on text
Diffstat (limited to 'trunk/pdf-over-gui')
-rw-r--r--trunk/pdf-over-gui/src/main/java/at/asit/pdfover/gui/composites/PositioningComposite.java18
1 files changed, 11 insertions, 7 deletions
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 50035663..363ee338 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
@@ -70,6 +70,8 @@ public class PositioningComposite extends StateComposite {
private Composite mainArea = null;
+ Composite bottomBar = null;
+
Button btnNewPage = null;
Label lblPage = null;
@@ -93,15 +95,15 @@ public class PositioningComposite extends StateComposite {
super(parent, style, state);
this.setLayout(new FormLayout());
- Composite bottomBar = new Composite(this, SWT.NONE);
+ this.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());
+ this.bottomBar.setLayoutData(fd_bottomBar);
+ this.bottomBar.setLayout(new FormLayout());
- this.btnSign = new Button(bottomBar, SWT.PUSH);
+ this.btnSign = new Button(this.bottomBar, SWT.PUSH);
this.btnSign.setText(Messages.getString("positioning.sign")); //$NON-NLS-1$
FormData fd_btnSign = new FormData();
fd_btnSign.right = new FormAttachment(100);
@@ -115,7 +117,7 @@ public class PositioningComposite extends StateComposite {
}
});
- this.btnNewPage = new Button(bottomBar, SWT.TOGGLE);
+ this.btnNewPage = new Button(this.bottomBar, SWT.TOGGLE);
this.btnNewPage.setText(Messages.getString("positioning.newPage")); //$NON-NLS-1$
FormData fd_btnNewPage = new FormData();
fd_btnNewPage.right = new FormAttachment(this.btnSign);
@@ -133,7 +135,7 @@ public class PositioningComposite extends StateComposite {
}
});
- this.lblPage = new Label(bottomBar, SWT.CENTER);
+ this.lblPage = new Label(this.bottomBar, SWT.CENTER);
FormData fd_lblPage = new FormData();
fd_lblPage.left = new FormAttachment(0);
fd_lblPage.right = new FormAttachment(this.btnNewPage, 5);
@@ -145,7 +147,7 @@ public class PositioningComposite extends StateComposite {
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);
+ fd_mainArea.bottom = new FormAttachment(this.bottomBar, -5);
this.mainArea.setLayoutData(fd_mainArea);
this.scrollbar = this.mainArea.getVerticalBar();
@@ -331,12 +333,14 @@ public class PositioningComposite extends StateComposite {
PositioningComposite.this.btnNewPage.setText(
Messages.getString("positioning.newPage")); //$NON-NLS-1$
PositioningComposite.this.btnNewPage.setSelection(false);
+ PositioningComposite.this.bottomBar.layout();
PositioningComposite.this.scrollbar.setMaximum(numPages + 1);
} else if ((previousPage <= numPages) && (currentPage > numPages)) {
// Go to new page
PositioningComposite.this.btnNewPage.setText(
Messages.getString("positioning.removeNewPage")); //$NON-NLS-1$
PositioningComposite.this.btnNewPage.setSelection(true);
+ PositioningComposite.this.bottomBar.layout();
PositioningComposite.this.scrollbar.setMaximum(numPages + 2);
}
PositioningComposite.this.scrollbar.setSelection(currentPage);