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// Make sure that we generate the correct code to call a built-in member function through a parent.
5
6export component TestCase inherits Window {
7 width: 100phx;
8 height: 100phx;
9
10 out property<bool> selection-set;
11
12 input := TextInput {
13 text: "Hello World";
14 if (true): TouchArea {
15 clicked => {
16 input.select-all();
17 root.selection-set = input.anchor-position-byte-offset == 0 && input.cursor-position-byte-offset == 11;
18 }
19 }
20 }
21}
22
23/*
24
25```cpp
26auto handle = TestCase::create();
27const TestCase &instance = *handle;
28assert(!instance.get_selection_set());
29slint_testing::send_mouse_click(&instance, 5., 5.);
30assert(instance.get_selection_set());
31```
32
33```rust
34let instance = TestCase::new().unwrap();
35assert!(!instance.get_selection_set());
36slint_testing::send_mouse_click(&instance, 5., 5.);
37assert!(instance.get_selection_set());
38```
39
40```js
41var instance = new slint.TestCase();
42assert(!instance.selection_set);
43slintlib.private_api.send_mouse_click(instance, 5., 5.);
44assert(instance.selection_set);
45```
46*/
47