Skip to content

Commit

Permalink
Merge pull request logisim-evolution#1928 from aplq/dev3
Browse files Browse the repository at this point in the history
Fixed window close button on some FPGA windows
  • Loading branch information
BFH-ktt1 authored Jan 18, 2024
2 parents bb5ece3 + 1edf0da commit f67c21c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.event.ActionListener;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.util.ArrayList;
import java.util.HashMap;
import javax.swing.BorderFactory;
Expand Down Expand Up @@ -712,6 +714,13 @@ else if (cnt < nrOfPins.get(INPUT_ID) + nrOfPins.get(OUTPUT_ID))
CancelButton.addActionListener(actionListener);
gbc.gridx = 0;
contents.add(CancelButton, gbc);
// FIXME: Find better solution to handle window close button
selWindow.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
CancelButton.doClick();
}
});
selWindow.add(new JScrollPane(contents));
selWindow.pack();
selWindow.setLocationRelativeTo(IOcomps.getParentFrame());
Expand Down Expand Up @@ -1087,6 +1096,13 @@ public static void getFpgaInformation(Frame panel, BoardInformation TheBoard) {
gbc.gridy = 2;
gbc.fill = GridBagConstraints.HORIZONTAL;
selWindow.add(cancelButton, gbc);
// FIXME: Find better solution to handle window close button
selWindow.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
cancelButton.doClick();
}
});

final var saveButton = new JButton(S.get("FpgaBoardDone"));
saveButton.addActionListener(actionListener);
Expand Down

0 comments on commit f67c21c

Please sign in to comment.