summaryrefslogtreecommitdiff
path: root/altosui
diff options
context:
space:
mode:
Diffstat (limited to 'altosui')
-rw-r--r--altosui/AltosConfigureUI.java31
-rw-r--r--altosui/AltosUI.java13
2 files changed, 36 insertions, 8 deletions
diff --git a/altosui/AltosConfigureUI.java b/altosui/AltosConfigureUI.java
index 392d7199..fad23f59 100644
--- a/altosui/AltosConfigureUI.java
+++ b/altosui/AltosConfigureUI.java
@@ -31,6 +31,7 @@ public class AltosConfigureUI
AltosVoice voice;
public JTextField callsign_value;
+ public JComboBox position_value;
/* DocumentListener interface methods */
public void insertUpdate(DocumentEvent e) {
@@ -111,6 +112,36 @@ public class AltosConfigureUI
row++;
}
+ final static String[] position_names = {
+ "Top left",
+ "Top",
+ "Top right",
+ "Left",
+ "Center",
+ "Right",
+ "Bottom left",
+ "Bottom",
+ "Bottom right",
+ };
+
+ public void add_position() {
+ pane.add(new JLabel ("Menu position"), constraints(0, 1));
+
+ position_value = new JComboBox (position_names);
+ position_value.setMaximumRowCount(position_names.length);
+ int position = AltosUIPreferences.position();
+ position_value.setSelectedIndex(position);
+ position_value.addActionListener(new ActionListener() {
+ public void actionPerformed(ActionEvent e) {
+ int position = position_value.getSelectedIndex();
+ AltosUIPreferences.set_position(position);
+ }
+ });
+ pane.add(position_value, constraints(1, 2, GridBagConstraints.BOTH));
+ position_value.setToolTipText("Position of main AltosUI window");
+ row++;
+ }
+
public AltosConfigureUI(JFrame owner, AltosVoice voice) {
super(owner);
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java
index d630ceec..0efe27a0 100644
--- a/altosui/AltosUI.java
+++ b/altosui/AltosUI.java
@@ -224,14 +224,6 @@ public class AltosUI extends AltosUIFrame {
doLayout();
validate();
- setVisible(true);
-
- Insets i = getInsets();
- Dimension ps = rootPane.getPreferredSize();
- ps.width += i.left + i.right;
- ps.height += i.top + i.bottom;
- setPreferredSize(ps);
- setSize(ps);
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
addWindowListener(new WindowAdapter() {
@Override
@@ -239,6 +231,11 @@ public class AltosUI extends AltosUIFrame {
System.exit(0);
}
});
+
+ setLocationByPlatform(false);
+
+ /* Insets aren't set before the window is visible */
+ setVisible(true);
}
private void ConnectToDevice() {