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
protected void onAddBtnClick() {
try {

View File

@ -31,6 +31,9 @@
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" />
<ColumnConstraints />
<ColumnConstraints />
<ColumnConstraints />
<ColumnConstraints />
</columnConstraints>
<rowConstraints>
<RowConstraints />
@ -42,8 +45,11 @@
<Insets left="5" />
</padding>
</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 hgrow="ALWAYS" maxWidth="14.2857142857" minWidth="14.2857142857" percentWidth="14.2857142857" />
<ColumnConstraints hgrow="ALWAYS" percentWidth="14.2857142857" />