+ private void addAllWidgets() {
+
+ // Add the menus
+ addFileMenu();
+ addEditMenu();
+ addWindowMenu();
+ addHelpMenu();
+
+ final DesktopDemo desktop = new DesktopDemo(this);
+ setDesktop(desktop);
+
+ desktop.addButton(i18n.getString("removeHatch"), 2, 5,
+ new TAction() {
+ public void DO() {
+ desktop.drawHatch = false;
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("showHatch"), 2, 8,
+ new TAction() {
+ public void DO() {
+ desktop.drawHatch = true;
+ }
+ }
+ );
+
+ final TWindow windowA = addWindow(i18n.getString("windowATitle"),
+ 25, 14);
+ final TWindow windowB = addWindow(i18n.getString("windowBTitle"),
+ 25, 14);
+ windowA.addButton(i18n.getString("showWindowB"), 2, 2,
+ new TAction() {
+ public void DO() {
+ windowB.show();
+ }
+ }
+ );
+ windowA.addButton(i18n.getString("hideWindowB"), 2, 4,
+ new TAction() {
+ public void DO() {
+ windowB.hide();
+ }
+ }
+ );
+ windowA.addButton(i18n.getString("maximizeWindowB"), 2, 6,
+ new TAction() {
+ public void DO() {
+ windowB.maximize();
+ }
+ }
+ );
+ windowA.addButton(i18n.getString("restoreWindowB"), 2, 8,
+ new TAction() {
+ public void DO() {
+ windowB.restore();
+ }
+ }
+ );
+ windowB.addButton(i18n.getString("showWindowA"), 2, 2,
+ new TAction() {
+ public void DO() {
+ windowA.show();
+ }
+ }
+ );
+ windowB.addButton(i18n.getString("hideWindowA"), 2, 4,
+ new TAction() {
+ public void DO() {
+ windowA.hide();
+ }
+ }
+ );
+ windowB.addButton(i18n.getString("maximizeWindowA"), 2, 6,
+ new TAction() {
+ public void DO() {
+ windowA.maximize();
+ }
+ }
+ );
+ windowB.addButton(i18n.getString("restoreWindowA"), 2, 8,
+ new TAction() {
+ public void DO() {
+ windowA.restore();
+ }
+ }
+ );
+
+ desktop.addButton(i18n.getString("showWindowB"), 25, 2,
+ new TAction() {
+ public void DO() {
+ windowB.show();
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("hideWindowB"), 25, 5,
+ new TAction() {
+ public void DO() {
+ windowB.hide();
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("showWindowA"), 25, 8,
+ new TAction() {
+ public void DO() {
+ windowA.show();
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("hideWindowA"), 25, 11,
+ new TAction() {
+ public void DO() {
+ windowA.hide();
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("createWindowC"), 25, 15,
+ new TAction() {
+ public void DO() {
+ final TWindow windowC = desktop.getApplication().addWindow(
+ i18n.getString("windowCTitle"), 30, 20,
+ TWindow.NOCLOSEBOX);
+ windowC.addButton(i18n.getString("closeMe"), 5, 5,
+ new TAction() {
+ public void DO() {
+ windowC.close();
+ }
+ }
+ );
+ }
+ }
+ );
+
+ desktop.addButton(i18n.getString("enableFFM"), 25, 18,
+ new TAction() {
+ public void DO() {
+ DesktopDemoApplication.this.setFocusFollowsMouse(true);
+ }
+ }
+ );
+ desktop.addButton(i18n.getString("disableFFM"), 25, 21,
+ new TAction() {
+ public void DO() {
+ DesktopDemoApplication.this.setFocusFollowsMouse(false);
+ }
+ }
+ );