generated from OBJNULL/Dockerized-Rust
Compare commits
2 commits
c3fd6dea17
...
7489515962
Author | SHA1 | Date | |
---|---|---|---|
7489515962 | |||
1bdeaa8cd7 |
1 changed files with 12 additions and 4 deletions
|
@ -1,6 +1,12 @@
|
||||||
import { DatePickerPopup, Button, VerticalBox, HorizontalBox, ComboBox } from "std-widgets.slint";
|
import { DatePickerPopup, Button, VerticalBox, HorizontalBox, ComboBox } from "std-widgets.slint";
|
||||||
import { Calculation } from "calculation.slint";
|
import { Calculation } from "calculation.slint";
|
||||||
|
|
||||||
|
export struct CalcResult {
|
||||||
|
message: string,
|
||||||
|
start: int,
|
||||||
|
end: int,
|
||||||
|
}
|
||||||
|
|
||||||
export component Prorater inherits Window {
|
export component Prorater inherits Window {
|
||||||
title: "Auto Spa Express - Prorater";
|
title: "Auto Spa Express - Prorater";
|
||||||
width: 1024px;
|
width: 1024px;
|
||||||
|
@ -10,8 +16,8 @@ export component Prorater inherits Window {
|
||||||
out property <string> last_billing: "NULL";
|
out property <string> last_billing: "NULL";
|
||||||
out property <string> current_membership;
|
out property <string> current_membership;
|
||||||
out property <string> new_membership;
|
out property <string> new_membership;
|
||||||
property <string> calculate_msg: "NULL";
|
property <CalcResult> calculation_result;
|
||||||
callback on_calculate() -> string;
|
callback on_calculate() -> CalcResult;
|
||||||
|
|
||||||
VerticalBox {
|
VerticalBox {
|
||||||
Image {
|
Image {
|
||||||
|
@ -75,7 +81,7 @@ export component Prorater inherits Window {
|
||||||
Button {
|
Button {
|
||||||
text: "Calculate";
|
text: "Calculate";
|
||||||
clicked => {
|
clicked => {
|
||||||
calculate_msg = on_calculate();
|
calculation_result = on_calculate();
|
||||||
calculation.show();
|
calculation.show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -105,7 +111,9 @@ export component Prorater inherits Window {
|
||||||
}
|
}
|
||||||
|
|
||||||
calculation := Calculation {
|
calculation := Calculation {
|
||||||
message: calculate_msg;
|
message: calculation_result.message;
|
||||||
|
start: calculation_result.start;
|
||||||
|
end: calculation_result.end;
|
||||||
x: (root.width - self.width) / 2;
|
x: (root.width - self.width) / 2;
|
||||||
y: (root.height - self.height) / 2;
|
y: (root.height - self.height) / 2;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue