You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

117 lines
5.3 KiB

2 months ago
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextField?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.ColumnConstraints?>
<?import javafx.scene.layout.GridPane?>
<?import javafx.scene.layout.RowConstraints?>
<?import javafx.scene.text.Font?>
<AnchorPane prefHeight="341.0" prefWidth="375.0" xmlns:fx="http://javafx.com/fxml/1" xmlns="http://javafx.com/javafx/8.0.171" fx:controller="CalculatorController">
<TextField fx:id="inputField" editable="false" layoutX="14.0" layoutY="14.0" prefHeight="80.0" prefWidth="210.0" />
<GridPane hgap="10" layoutX="20.0" layoutY="70.0" vgap="10">
<columnConstraints>
<ColumnConstraints />
</columnConstraints>
<rowConstraints>
<RowConstraints />
</rowConstraints>
</GridPane>
<Button graphicTextGap="5.0" layoutX="30.0" layoutY="100.0" onAction="#handleAddAction" prefHeight="30.0" prefWidth="30.0" text="+" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button layoutX="180.0" layoutY="250.0" onAction="#handleEqualAction" prefHeight="80.0" prefWidth="30.0" text="=" />
<Button layoutX="180.0" layoutY="150.0" onAction="#handleClearAction" prefHeight="30.0" prefWidth="30.0" text="C" />
<Button graphicTextGap="5.0" layoutX="80.0" layoutY="100.0" onAction="#handleSubtractAction" prefHeight="30.0" prefWidth="30.0" text="-" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="130.0" layoutY="150.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="9" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="80.0" layoutY="150.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="8" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="30.0" layoutY="150.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="7" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="130.0" layoutY="100.0" onAction="#handleMultiplyAction" prefHeight="30.0" prefWidth="30.0" text="*" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="130.0" layoutY="200.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="6" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="80.0" layoutY="200.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="5" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="30.0" layoutY="200.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="4" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="180.0" layoutY="100.0" onAction="#handleDivideAction" prefHeight="30.0" prefWidth="30.0" text="/" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="130.0" layoutY="250.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="3" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="80.0" layoutY="250.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="2" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="30.0" layoutY="250.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="1" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="130.0" layoutY="300.0" onAction="#handlePointAction" prefHeight="30.0" prefWidth="30.0" text="." wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button layoutX="30.0" layoutY="300.0" onAction="#handleModulusAction" prefHeight="30.0" prefWidth="30.0" text="\%" />
<Button graphicTextGap="5.0" layoutX="80.0" layoutY="300.0" onAction="#handleNumberAction" prefHeight="30.0" prefWidth="30.0" text="0" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<Button graphicTextGap="5.0" layoutX="180.0" layoutY="200.0" onAction="#handleClearsAction" prefHeight="30.0" prefWidth="30.0" text="A" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<TextField fx:id="inputField1" editable="false" layoutX="225.0" layoutY="99.0" prefHeight="230.0" prefWidth="140.0" />
<TextField fx:id="inputField2" editable="false" layoutX="230.0" layoutY="20.0" prefHeight="20.0" prefWidth="120.0" text="计算器计算记录" />
<Button graphicTextGap="5.0" layoutX="250.0" layoutY="60.0" onAction="#handleRemoveAction" text="清空记录" wrapText="true">
<font>
<Font size="15.0" />
</font>
</Button>
<!-- <View layoutX="-134.0" layoutY="-155.0" />-->
</AnchorPane>