summaryrefslogtreecommitdiff
path: root/altosui/AltosConfigureUI.java
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2013-01-20 15:42:05 -0800
committerKeith Packard <keithp@keithp.com>2013-01-20 15:45:16 -0800
commit3454592169dcb61b81de9af2b631b87e7dd86231 (patch)
treef0c164421914de1363d09c464200d55c82325364 /altosui/AltosConfigureUI.java
parentcf03ab3383b679e6617e8ab7004be91e5a727562 (diff)
altosui: Make initial AltOS window position configurable
Give the user a choice of nine locations on the screen Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigureUI.java')
-rw-r--r--altosui/AltosConfigureUI.java31
1 files changed, 31 insertions, 0 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);