Skip to content
Snippets Groups Projects
Commit 2ff3cb11 authored by Harry Linrui XU's avatar Harry Linrui XU
Browse files

Implemented new button to distinguish button that returns to main menu, and...

Implemented new button to distinguish button that returns to main menu, and button that returns to start
parent 5ce58f06
No related branches found
No related tags found
1 merge request!43Merging frontend-testing into master
......@@ -36,7 +36,6 @@ import java.util.Optional;
* @since 24.3.2023
*/
public class BudgetController extends FinanceController {
private GeneralBudget general;
@FXML
......@@ -48,6 +47,8 @@ public class BudgetController extends FinanceController {
@FXML
private Button deleteBtn;
@FXML
private Button returnToMainMenuBtn;
@FXML
private Button returnBtn;
......@@ -114,8 +115,8 @@ public class BudgetController extends FinanceController {
}
if (FileHandlingBudget.isNewBudget("Budget")) {
returnBtn.setOpacity(0);
returnBtn.setDisable(true);
returnToMainMenuBtn.setOpacity(0);
returnToMainMenuBtn.setDisable(true);
daysLeftLbl.setOpacity(0);
} else {
refreshPieChart();
......@@ -300,7 +301,7 @@ public class BudgetController extends FinanceController {
public void switchScene(ActionEvent event) {
FXMLLoader loader = new FXMLLoader();
try {
if (event.getSource() == returnBtn || event.getSource() == continueBtn) {
if (event.getSource() == returnToMainMenuBtn || event.getSource() == continueBtn) {
//Adds unused categories to the table
System.out.println(general.getBudgetItems().size());
general.addUnusedCategories();
......@@ -310,6 +311,8 @@ public class BudgetController extends FinanceController {
loader.setLocation(getClass().getResource("/view/MainMenuNew.fxml"));
} else if (event.getSource() == backBtn) {
loader.setLocation(getClass().getResource("/view/dualList.fxml"));
} else if (event.getSource() == returnBtn) {
loader.setLocation(getClass().getResource("/view/FirstMenu.fxml"));
}
saveDataToFile();
Parent root = loader.load();
......
......@@ -51,11 +51,12 @@
<left>
<Pane prefWidth="175.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="returnBtn" alignment="CENTER" layoutX="-2.0" layoutY="58.0" mnemonicParsing="false" onAction="#switchScene" text="Return to Main Menu">
<Button fx:id="returnToMainMenuBtn" alignment="CENTER" layoutX="-2.0" layoutY="58.0" mnemonicParsing="false" onAction="#switchScene" text="Return to Main Menu">
<font>
<Font name="Lucida Console" size="14.0" />
</font>
</Button>
<Button fx:id="returnBtn" disable="true" layoutX="150.0" layoutY="104.0" mnemonicParsing="false" onAction="#switchScene" opacity="0.0" text="Button" />
</children>
</Pane>
</left>
......
......@@ -192,7 +192,7 @@
<RowConstraints minHeight="10.0" vgrow="SOMETIMES" />
</rowConstraints>
<children>
<Button fx:id="returnBtn" alignment="CENTER" mnemonicParsing="false" onAction="#switchScene" text="Return to Main Menu">
<Button fx:id="returnToStartMenuBtn" alignment="CENTER" mnemonicParsing="false" onAction="#switchScene" text="Return to start">
<font>
<Font size="14.0" />
</font>
......@@ -213,6 +213,7 @@
<DatePicker fx:id="date" layoutX="3.0" layoutY="32.0" prefWidth="175.0" />
</children>
</Pane>
<Button fx:id="returnBtn" disable="true" mnemonicParsing="false" onAction="#switchScene" opacity="0.0" text="Button" />
</children>
</GridPane>
</children>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment