From 01fa042d257287a85ee0983d50e9646632af9d15 Mon Sep 17 00:00:00 2001 From: anderebe <anderebe@stud.ntnu.no> Date: Thu, 23 Mar 2023 16:33:03 +0100 Subject: [PATCH] added the popup window for adding a budget item --- src/main/resources/view/addBudget.fxml | 58 ++++++++++++++++++++ src/main/resources/view/setBudgetPeriod.fxml | 47 ---------------- 2 files changed, 58 insertions(+), 47 deletions(-) create mode 100644 src/main/resources/view/addBudget.fxml delete mode 100644 src/main/resources/view/setBudgetPeriod.fxml diff --git a/src/main/resources/view/addBudget.fxml b/src/main/resources/view/addBudget.fxml new file mode 100644 index 00000000..7dbedf0e --- /dev/null +++ b/src/main/resources/view/addBudget.fxml @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<?import javafx.scene.control.Button?> +<?import javafx.scene.control.ComboBox?> +<?import javafx.scene.control.Label?> +<?import javafx.scene.control.TextField?> +<?import javafx.scene.layout.AnchorPane?> +<?import javafx.scene.layout.ColumnConstraints?> +<?import javafx.scene.layout.GridPane?> +<?import javafx.scene.layout.HBox?> +<?import javafx.scene.layout.RowConstraints?> +<?import javafx.scene.layout.VBox?> +<?import javafx.scene.text.Text?> + + +<AnchorPane prefHeight="150.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/19" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.BudgetController"> + <children> + <GridPane prefHeight="400.0" prefWidth="600.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0"> + <columnConstraints> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="0.0" prefWidth="0.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="180.0" minWidth="10.0" prefWidth="150.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="180.0" minWidth="10.0" prefWidth="150.0" /> + <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> + <ColumnConstraints hgrow="SOMETIMES" maxWidth="10.0" minWidth="10.0" prefWidth="0.0" /> + </columnConstraints> + <rowConstraints> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> + </rowConstraints> + <children> + <VBox alignment="CENTER" GridPane.columnIndex="1" GridPane.valignment="CENTER"> + <children> + <Label text="Label" /> + <ComboBox fx:id="categoryVariable" maxWidth="150.0" prefWidth="150.0" /> + </children> + </VBox> + <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="2"> + <children> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Amount" /> + <TextField fx:id="amountVariable" maxWidth="150.0" /> + </children> + </VBox> + <VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0" GridPane.columnIndex="3"> + <children> + <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Description" /> + <TextField fx:id="descriptionVariable" /> + </children> + </VBox> + <HBox alignment="CENTER" prefHeight="100.0" prefWidth="200.0" spacing="15.0" GridPane.columnIndex="3" GridPane.rowIndex="1"> + <children> + <Button mnemonicParsing="false" onAction="#closeButton" text="Button" /> + <Button mnemonicParsing="false" onAction="#addBudget" text="Button" /> + </children> + </HBox> + </children> + </GridPane> + </children> +</AnchorPane> diff --git a/src/main/resources/view/setBudgetPeriod.fxml b/src/main/resources/view/setBudgetPeriod.fxml deleted file mode 100644 index ad3a7803..00000000 --- a/src/main/resources/view/setBudgetPeriod.fxml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<?import javafx.geometry.*?> -<?import javafx.scene.control.*?> -<?import javafx.scene.layout.*?> - -<GridPane hgap="10.0" prefWidth="442.0" vgap="10.0" xmlns="http://javafx.com/javafx/17.0.2-ea" xmlns:fx="http://javafx.com/fxml/1" fx:controller="no.ntnu.idatt1002.demo.controller.SceneController"> - <columnConstraints> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" minWidth="10.0" prefWidth="100.0" /> - <ColumnConstraints hgrow="SOMETIMES" maxWidth="95.0" minWidth="10.0" prefWidth="51.0" /> - <ColumnConstraints halignment="CENTER" hgrow="SOMETIMES" maxWidth="189.0" minWidth="10.0" prefWidth="149.0" /> - </columnConstraints> - <rowConstraints> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> - <RowConstraints minHeight="10.0" prefHeight="30.0" vgrow="SOMETIMES" /> - </rowConstraints> - <padding> - <Insets bottom="10.0" left="10.0" top="20.0" /> - </padding> - <children> - <Label text="Budget Period:" /> - <Label text="Start Date:" GridPane.rowIndex="1" /> - <Label text="End Date:" GridPane.rowIndex="2" /> - <HBox alignment="CENTER" fillHeight="false" prefHeight="30.0" prefWidth="154.0" GridPane.columnIndex="3" GridPane.columnSpan="2147483647" GridPane.halignment="CENTER" GridPane.rowIndex="2" GridPane.rowSpan="2147483647"> - <GridPane.margin> - <Insets /> - </GridPane.margin> - <children> - <Button mnemonicParsing="false" onAction="#closeButton" prefHeight="25.0" prefWidth="60.0" text="Cancel" /> - <Button mnemonicParsing="false" onAction="#closeButton" prefHeight="25.0" prefWidth="60.0" text="Add" /> - </children> - <opaqueInsets> - <Insets /> - </opaqueInsets> - </HBox> - <DatePicker prefWidth="150.0" showWeekNumbers="true" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="1" /> - <DatePicker prefWidth="150.0" showWeekNumbers="true" GridPane.columnIndex="1" GridPane.columnSpan="2" GridPane.rowIndex="2" /> - <HBox prefHeight="100.0" prefWidth="200.0" GridPane.columnIndex="1" GridPane.columnSpan="2"> - <children> - <TextField prefWidth="125.0" promptText="Title" /> - <Button mnemonicParsing="false" prefWidth="25.0" text="?" /> - </children> - </HBox> - </children> -</GridPane> -- GitLab