Added back, today and next button

This commit is contained in:
Marc Beyer 2021-12-20 16:56:58 +01:00
parent 50896a26ca
commit 60be6933be
2 changed files with 29 additions and 2 deletions

View File

@ -65,6 +65,27 @@ public class MainController {
} }
} }
@FXML
protected void onBackClick() {
weekOffset--;
setDates();
updateEvents();
}
@FXML
protected void onTodayClick(){
weekOffset = 0;
setDates();
updateEvents();
}
@FXML
protected void onNextClick() {
weekOffset++;
setDates();
updateEvents();
}
@FXML @FXML
protected void onAddBtnClick() { protected void onAddBtnClick() {
try { try {

View File

@ -30,7 +30,10 @@
<GridPane prefHeight="200.0" prefWidth="222.0" GridPane.columnIndex="1" GridPane.rowIndex="0"> <GridPane prefHeight="200.0" prefWidth="222.0" GridPane.columnIndex="1" GridPane.rowIndex="0">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="ALWAYS" /> <ColumnConstraints hgrow="ALWAYS" />
<ColumnConstraints /> <ColumnConstraints />
<ColumnConstraints />
<ColumnConstraints />
<ColumnConstraints />
</columnConstraints> </columnConstraints>
<rowConstraints> <rowConstraints>
<RowConstraints /> <RowConstraints />
@ -42,8 +45,11 @@
<Insets left="5" /> <Insets left="5" />
</padding> </padding>
</Label> </Label>
<Button onAction="#onBackClick" GridPane.columnIndex="1" maxHeight="1.7976931348623157E308">zurück</Button>
<Button onAction="#onTodayClick" GridPane.columnIndex="2" maxHeight="1.7976931348623157E308">heute</Button>
<Button onAction="#onNextClick" GridPane.columnIndex="3" maxHeight="1.7976931348623157E308">weiter</Button>
<GridPane fx:id="calendarGrid" gridLinesVisible="true" styleClass="gridCalendar" GridPane.columnIndex="0" GridPane.rowIndex="1"> <GridPane fx:id="calendarGrid" gridLinesVisible="true" styleClass="gridCalendar" GridPane.columnSpan="4" GridPane.columnIndex="0" GridPane.rowIndex="1">
<columnConstraints> <columnConstraints>
<ColumnConstraints hgrow="ALWAYS" maxWidth="14.2857142857" minWidth="14.2857142857" percentWidth="14.2857142857" /> <ColumnConstraints hgrow="ALWAYS" maxWidth="14.2857142857" minWidth="14.2857142857" percentWidth="14.2857142857" />
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857" /> <ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857" />