| 1 | // Copyright © SixtyFPS GmbH <info@slint.dev> |
| 2 | // SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0 |
| 3 | |
| 4 | component DialogBox inherits Rectangle { |
| 5 | callback show-dialog(); |
| 6 | |
| 7 | show-dialog() => { |
| 8 | dialog.show(); |
| 9 | } |
| 10 | |
| 11 | dialog := PopupWindow { } |
| 12 | } |
| 13 | |
| 14 | export component TestCase inherits Window { |
| 15 | height: 30px; |
| 16 | width: 30px; |
| 17 | dialog := DialogBox { } |
| 18 | TouchArea { |
| 19 | clicked => { |
| 20 | dialog.show-dialog(); |
| 21 | } |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | |
| 26 | /* |
| 27 | ```cpp |
| 28 | auto handle = TestCase::create(); |
| 29 | const TestCase &instance = *handle; |
| 30 | slint_testing::send_mouse_click(&instance, 5., 5.); |
| 31 | ``` |
| 32 | |
| 33 | ```rust |
| 34 | let instance = TestCase::new().unwrap(); |
| 35 | slint_testing::send_mouse_click(&instance, 5., 5.); |
| 36 | ``` |
| 37 | |
| 38 | ```js |
| 39 | var instance = new slint.TestCase(); |
| 40 | slintlib.private_api.send_mouse_click(instance, 5., 5.); |
| 41 | ``` |
| 42 | */ |
| 43 | |