MenueController

This commit is contained in:
Richard Reiswich 2023-02-06 10:01:00 +01:00
parent 58f61a71c2
commit 04285ed7b7

View File

@ -6,6 +6,10 @@ import javafx.fxml.FXML;
import javafx.scene.Node;
import javafx.scene.control.*;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
public class MenueController {
@FXML
@ -71,14 +75,26 @@ public class MenueController {
@FXML
ComboBox<String> cbPickChild;
@FXML
Button btLogin;
@FXML
Button btSaveOrder;
@FXML
ListView<String> lvFoodInfo;
public ObservableList<Node> buttons = FXCollections.observableArrayList();
public ObservableList<String> children = FXCollections.observableArrayList();
public List<Child> allChildren = AccountMgr.getAllChildrenFromParentWithId(3);
public void initialize(){
FoodPlan foodplanMon = FoodMgr.getFoodPlanById(1);
FoodPlan foodplanTue = FoodMgr.getFoodPlanById(2);
FoodPlan foodplanWed = FoodMgr.getFoodPlanById(3);
FoodPlan foodplanThu = FoodMgr.getFoodPlanById(4);
FoodPlan foodplanFri = FoodMgr.getFoodPlanById(5);
for (Child c : allChildren){
children.add(c.getFirstname());
}
cbPickChild.setItems(children);
}
public void setButtonActive(ActionEvent event) {
Button b = (Button) event.getSource();
@ -87,14 +103,7 @@ public class MenueController {
buttons = p.getChildrenUnmodifiable();
for(Node button : buttons){
System.out.println(b.getStyleClass());
/*
b.getStyleClass().remove("active");
if (button.equals(b)){
b.getStyleClass().add("active");;
}
*/
button.setDisable(button.equals(b));
}
}
}