Permalink
Browse files

Added a FAKE_WINDOWS flag for user testing.

  • Loading branch information...
1 parent b7be622 commit 06e1583ba5b753fc5c4c1e75011c0718a0e870db @calebegg calebegg committed Apr 24, 2012
Showing with 23 additions and 18 deletions.
  1. +20 −15 src/org/proofpad/Main.java
  2. +3 −3 src/org/proofpad/MenuBar.java
View
@@ -38,14 +38,17 @@
public static long startTime = System.currentTimeMillis();
public static CacheData cache;
+ public static final boolean FAKE_WINDOWS = false;
public static MenuBar menuBar;
public static void main(String[] args) throws FileNotFoundException, IOException,
ClassNotFoundException {
logtime("Starting main");
System.setProperty("apple.awt.brushMetalLook", "true");
- System.setProperty("apple.laf.useScreenMenuBar", "true");
+ if (!FAKE_WINDOWS) {
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ }
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
@@ -147,20 +150,22 @@ public void run() {
}
}
});
- menuBar = new MenuBar(null);
- app.setDefaultMenuBar(menuBar);
- PopupMenu dockMenu = new PopupMenu();
- MenuItem item = new MenuItem("New");
- item.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- IdeWindow ide = new IdeWindow();
- ide.setVisible(true);
- }
- });
- //dockMenu.add(defaultMenuBar.recentMenu);
- dockMenu.add(item);
- app.setDockMenu(dockMenu);
+ if (!FAKE_WINDOWS) {
+ menuBar = new MenuBar(null);
+ app.setDefaultMenuBar(menuBar);
+ PopupMenu dockMenu = new PopupMenu();
+ MenuItem item = new MenuItem("New");
+ item.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ IdeWindow ide = new IdeWindow();
+ ide.setVisible(true);
+ }
+ });
+ //dockMenu.add(defaultMenuBar.recentMenu);
+ dockMenu.add(item);
+ app.setDockMenu(dockMenu);
+ }
}
SwingUtilities.invokeLater(new Runnable() {
@Override
@@ -23,11 +23,11 @@
public class MenuBar extends JMenuBar {
static final int RECENT_MENU_ITEMS = 10;
- private static final boolean WIN = IdeWindow.WIN;
- private static final boolean OSX = IdeWindow.OSX;
+ private static final boolean WIN = IdeWindow.WIN || Main.FAKE_WINDOWS;
+ private static final boolean OSX = IdeWindow.OSX && !Main.FAKE_WINDOWS;
private static final boolean TITLE_CASE = !WIN;
private static final long serialVersionUID = -3469258243341307842L;
- static final int modKey = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
+ static final int modKey = Main.FAKE_WINDOWS ? KeyEvent.CTRL_DOWN_MASK : Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
public JMenuItem undo;
public JMenuItem redo;
private JMenu windowMenu;

0 comments on commit 06e1583

Please sign in to comment.