diff options
author | Keith Packard <keithp@keithp.com> | 2014-06-18 16:18:05 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2014-06-18 16:18:05 -0700 |
commit | 7767a045d446ea2bc5fe1ec98d89274155f956c4 (patch) | |
tree | 4f11607ac36af605d4b0273d38fe0d23812866f8 | |
parent | d5bdb1c5974788b9569897435808fd01b04b0c4d (diff) |
macosx: Respond to apple messages in all apps
This connects the callbacks in AltosUIFrame to actually do something
useful with them.
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | altosui/AltosUI.java | 15 | ||||
-rw-r--r-- | micropeak/MicroPeak.java | 15 | ||||
-rw-r--r-- | telegps/TeleGPS.java | 24 |
3 files changed, 53 insertions, 1 deletions
diff --git a/altosui/AltosUI.java b/altosui/AltosUI.java index 1eb03805..0aa5d03c 100644 --- a/altosui/AltosUI.java +++ b/altosui/AltosUI.java @@ -99,10 +99,25 @@ public class AltosUI extends AltosUIFrame { return b; } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + process_graph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + ConfigureAltosUI(); + } + public AltosUI() { load_library(null); + register_for_macosx_events(); + AltosUIPreferences.set_component(this); pane = getContentPane(); diff --git a/micropeak/MicroPeak.java b/micropeak/MicroPeak.java index d7d393ba..8bdf4b77 100644 --- a/micropeak/MicroPeak.java +++ b/micropeak/MicroPeak.java @@ -190,10 +190,25 @@ public class MicroPeak extends MicroFrame implements ActionListener, ItemListene public void itemStateChanged(ItemEvent e) { } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + CommandGraph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + Preferences(); + } + public MicroPeak() { ++number_of_windows; + register_for_macosx_events(); + AltosUIPreferences.set_component(this); container = getContentPane(); diff --git a/telegps/TeleGPS.java b/telegps/TeleGPS.java index f765ee23..e78c2124 100644 --- a/telegps/TeleGPS.java +++ b/telegps/TeleGPS.java @@ -410,16 +410,38 @@ public class TeleGPS private JMenu make_menu(String label, String[][] items) { JMenu menu = new JMenu(label); - for (int i = 0; i < items.length; i++) + for (int i = 0; i < items.length; i++) { + if (MAC_OS_X) { + if (items[i][1].equals("exit")) + continue; + if (items[i][1].equals("preferences")) + continue; + } add_menu(menu, items[i][0], items[i][1]); + } menu_bar.add(menu); return menu; } + /* OSXAdapter interfaces */ + public void macosx_file_handler(String path) { + process_graph(new File(path)); + } + + public void macosx_quit_handler() { + System.exit(0); + } + + public void macosx_preferences_handler() { + preferences(); + } + public TeleGPS() { AltosUIPreferences.set_component(this); + register_for_macosx_events(); + reader = null; bag = getContentPane(); |