Last active
June 3, 2023 13:55
-
-
Save ansisec/966eb0d34101d9d292178404271e5f0e to your computer and use it in GitHub Desktop.
Aula24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ficheiros com layout da calculadora | |
(aplicar estilo definido com gradiente aos botões correspondentes ao operador) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<?import javafx.geometry.Insets?> | |
<?import javafx.scene.control.*?> | |
<?import javafx.scene.layout.*?> | |
<?import java.net.URL?> | |
<VBox xmlns="http://javafx.com/javafx" | |
xmlns:fx="http://javafx.com/fxml" | |
fx:controller="pt.isec.pa.calculator.ui.CalculatorPane" | |
prefHeight="600.0" prefWidth="400.0" | |
fx:id="root" spacing="10"> | |
<padding><Insets top="10" bottom="10" left="10" right="10" /> </padding> | |
<TextField text="0.0" fx:id="tfDisplay" prefHeight="1000" prefWidth="1000" | |
editable="false" id="display" /> | |
<HBox prefHeight="1000" spacing="10"> | |
<Button text="AC" onAction="#onAC" prefWidth="1000" prefHeight="1000"/> | |
<Button text="\%" onAction="#onPerc" prefWidth="1000" prefHeight="1000"/> | |
<Button text="+/-" onAction="#onMinusPlus" prefWidth="1000" prefHeight="1000"/> | |
<Button text="/" onAction="#onOp" prefWidth="1000" prefHeight="1000"/> | |
</HBox> | |
<HBox prefHeight="1000" spacing="10"> | |
<Button text="7" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="8" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="9" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="*" onAction="#onOp" prefWidth="1000" prefHeight="1000" /> | |
</HBox> | |
<HBox prefHeight="1000" spacing="10"> | |
<Button text="4" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="5" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="6" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="-" onAction="#onOp" prefWidth="1000" prefHeight="1000" /> | |
</HBox> | |
<HBox prefHeight="1000" spacing="10"> | |
<Button text="1" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="2" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="3" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="+" onAction="#onOp" prefWidth="1000" prefHeight="1000" /> | |
</HBox> | |
<HBox prefHeight="1000" spacing="10"> | |
<Button text="Pi" onAction="#onPi" prefWidth="1000" prefHeight="1000" /> | |
<Button text="0" onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="." onAction="#onDigit" prefWidth="1000" prefHeight="1000"/> | |
<Button text="=" onAction="#onOp" prefWidth="1000" prefHeight="1000" /> | |
</HBox> | |
<stylesheets> | |
<URL value="@styles.css" /> | |
</stylesheets> | |
</VBox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.button { | |
-fx-font-size: 24; | |
} | |
#buttonOperator { | |
-fx-font-size: 24; | |
-fx-body-color: linear-gradient(from 0% 0% to 100% 100%,reflect,#ffa040, #a08040); | |
} | |
#display { | |
-fx-text-fill: #000000; | |
-fx-background-color: #ffe0a0; | |
-fx-font-family: 'Courier New'; | |
-fx-font-size: 28; | |
-fx-font-weight: bold; | |
-fx-alignment: center-right; | |
-fx-border-color: #e0d090; | |
-fx-padding: 10; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment