| 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 | |
| 5 | export component A inherits Window { |
| 6 | mb := MenuBar { |
| 7 | property <int> sub-menu: 45; |
| 8 | // ^error{Cannot re-define internal property 'sub-menu} |
| 9 | |
| 10 | property <int> entries: 0; |
| 11 | // ^error{Cannot re-define internal property 'entries'} |
| 12 | } |
| 13 | MenuBar { |
| 14 | // ^error{Only one MenuBar is allowed in a Window} |
| 15 | } |
| 16 | |
| 17 | Rectangle { |
| 18 | x: 45px; |
| 19 | } |
| 20 | Rectangle { |
| 21 | x: mb.absolute-position.x; |
| 22 | // ^error{Element 'MenuBar' does not have a property 'absolute-position'} |
| 23 | y: mb.height; |
| 24 | // ^error{Element 'MenuBar' does not have a property 'height'} |
| 25 | init => { |
| 26 | mb.focus(); |
| 27 | // ^error{Element 'MenuBar' does not have a property 'focus'} |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | |
| 33 | |
| 34 | |
| 35 | |
| 36 | // TESTS TODO |
| 37 | // - test that setting the window height sets it to the window height plus that of the menubar |