1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial |
3 | |
4 | import { StandardButton, Button, GridBox } from "std-widgets.slint" ; |
5 | |
6 | TestCase := Dialog { |
7 | Rectangle { |
8 | background: red; |
9 | preferred-width: 600px; |
10 | preferred-height: 600px; |
11 | } |
12 | |
13 | StandardButton { kind: help; } |
14 | StandardButton { kind: ok; } |
15 | StandardButton { kind: cancel; } |
16 | StandardButton { kind: apply; } |
17 | StandardButton { kind: reset; } |
18 | StandardButton { kind: yes; } |
19 | Button { |
20 | text: "Action" ; |
21 | dialog-button-role: action; |
22 | } |
23 | } |
24 | |
25 | /* |
26 | ```rust |
27 | let instance = TestCase::new().unwrap(); |
28 | instance.on_help_clicked(|| { dbg!() }); |
29 | instance.on_cancel_clicked(|| { dbg!() }); |
30 | ``` |
31 | |
32 | ```cpp |
33 | auto handle = TestCase::create(); |
34 | const TestCase &instance = *handle; |
35 | instance.on_help_clicked([] { }); |
36 | instance.on_cancel_clicked([] { }); |
37 | ``` |
38 | |
39 | */ |
40 | |