home *** CD-ROM | disk | FTP | other *** search
- import java.awt.Button;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Dimension;
- import java.awt.Event;
- import java.awt.Font;
- import java.awt.LayoutManager;
- import java.awt.Panel;
-
- public class insertToPageButtons extends Panel {
- private Font normfont = new Font("Helvetica", 0, 11);
- private Dimension panelSize;
- private insertToPage parent;
- Button b_ok;
- Button b_cancel;
- Button b_insert;
-
- private void addButtons() {
- this.b_ok = new Button("OK");
- this.b_ok.setFont(this.normfont);
- this.b_cancel = new Button("Cancel");
- this.b_cancel.setFont(this.normfont);
- this.b_insert = new Button("Insert");
- this.b_insert.setFont(this.normfont);
- ((Container)this).add(this.b_ok);
- ((Container)this).add(this.b_cancel);
- ((Container)this).add(this.b_insert);
- }
-
- private void positionButtons() {
- this.b_ok.reshape(this.panelSize.width - 105, 7, 50, 20);
- this.b_cancel.reshape(this.panelSize.width - 55, 7, 50, 20);
- this.b_insert.reshape(5, 7, 60, 20);
- }
-
- insertToPageButtons(insertToPage var1) {
- this.parent = var1;
- ((Container)this).setLayout((LayoutManager)null);
- ((Component)this).setBackground(ACutilb.windowColor);
- this.addButtons();
- }
-
- public void resize(Dimension var1) {
- this.panelSize = var1;
- this.positionButtons();
- super.resize(var1);
- }
-
- public void resize(int var1, int var2) {
- this.panelSize = new Dimension(var1, var2);
- this.positionButtons();
- super.resize(var1, var2);
- }
-
- public boolean handleEvent(Event var1) {
- if (var1.id == 1001) {
- if (var1.target == this.b_ok) {
- this.parent.saveCurrent();
- this.parent.killWindow();
- } else if (var1.target == this.b_cancel) {
- this.parent.killWindow();
- } else if (var1.target == this.b_insert) {
- this.parent.insert();
- }
- }
-
- return true;
- }
-
- public void reshape(int var1, int var2, int var3, int var4) {
- this.panelSize = new Dimension(var3, var4);
- this.positionButtons();
- super.reshape(var1, var2, var3, var4);
- }
- }
-