Add exit prompt to main window, remove annoying auto-genned empty tooltips
This commit is contained in:
parent
361f341a99
commit
b019627b01
@ -177,7 +177,6 @@
|
||||
<Property name="lineWrap" type="boolean" value="true"/>
|
||||
<Property name="rows" type="int" value="2"/>
|
||||
<Property name="tabSize" type="int" value="4"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="wrapStyleWord" type="boolean" value="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
|
@ -152,7 +152,6 @@ public class Interpreter extends javax.swing.JInternalFrame {
|
||||
mainBox.setLineWrap(true);
|
||||
mainBox.setRows(2);
|
||||
mainBox.setTabSize(4);
|
||||
mainBox.setToolTipText("");
|
||||
mainBox.setWrapStyleWord(true);
|
||||
DefaultCaret caret = (DefaultCaret)mainBox.getCaret();
|
||||
caret.setUpdatePolicy(DefaultCaret.ALWAYS_UPDATE);
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
<Form version="1.9" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo">
|
||||
<Properties>
|
||||
<Property name="defaultCloseOperation" type="int" value="3"/>
|
||||
<Property name="defaultCloseOperation" type="int" value="0"/>
|
||||
<Property name="title" type="java.lang.String" value="SyMAT"/>
|
||||
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[640, 540]"/>
|
||||
|
@ -30,22 +30,16 @@ package net.apocalypselabs.symat;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.GraphicsEnvironment;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.beans.PropertyVetoException;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JInternalFrame;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.ListModel;
|
||||
import javax.swing.UIManager;
|
||||
|
||||
@ -83,6 +77,21 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
getClass().getResource("icon.png"))).getImage());
|
||||
setLocationRelativeTo(null);
|
||||
|
||||
addWindowListener(new WindowAdapter() {
|
||||
|
||||
@Override
|
||||
public void windowClosing(WindowEvent we) {
|
||||
int p = JOptionPane.showConfirmDialog(MainGUI.mainPane,
|
||||
"Are you sure you want to exit SyMAT?",
|
||||
"Exit SyMAT",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
JOptionPane.QUESTION_MESSAGE);
|
||||
if (p == JOptionPane.YES_OPTION) {
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
setButtonShortcuts();
|
||||
|
||||
// Open initial windows
|
||||
@ -272,7 +281,7 @@ public class MainGUI extends javax.swing.JFrame {
|
||||
recentFileBtn = new javax.swing.JButton();
|
||||
recentItemsTitle = new javax.swing.JLabel();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
setTitle("SyMAT");
|
||||
setMinimumSize(new java.awt.Dimension(640, 540));
|
||||
addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||
|
@ -50,7 +50,6 @@
|
||||
<Image iconType="3" name="/net/apocalypselabs/symat/splash.gif"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="<html><br><br>&nbsp;&nbsp;&nbsp;"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
<Property name="horizontalTextPosition" type="int" value="0"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
|
@ -83,7 +83,6 @@ public class SplashScreen extends javax.swing.JFrame {
|
||||
dispLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
|
||||
dispLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/net/apocalypselabs/symat/splash.gif"))); // NOI18N
|
||||
dispLabel.setText("<html><br><br> ");
|
||||
dispLabel.setToolTipText("");
|
||||
dispLabel.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
|
||||
getContentPane().add(dispLabel);
|
||||
dispLabel.setBounds(0, 0, 400, 320);
|
||||
|
Loading…
x
Reference in New Issue
Block a user