Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiline statictext names #100

Closed
joonaspaakko opened this issue Sep 11, 2022 Discussed in #99 · 2 comments
Closed

Multiline statictext names #100

joonaspaakko opened this issue Sep 11, 2022 Discussed in #99 · 2 comments
Labels
.BUG Something isn't working

Comments

@joonaspaakko
Copy link
Owner

Discussed in #99

Originally posted by softhorizons August 25, 2022
The editor automatically splits multiline statictext into multiple statictext's inside a group, something like:

var staticTextOneTwo = grpMain.add("group"); 
    staticTextOneTwo.add("statictext", undefined, "One line", {name: "staticTextOneTwo"}); 
    staticTextOneTwo.add("statictext", undefined, "followed by another", {name: "staticTextOneTwo"}); 

However

  • the group isn't named
  • the individual statictext's have the same name

This makes it very inconvenient to access the auto-generated group and sub-elements. You really want to access the group as control.grpMain.staticTextOneTwo. I find myself manually creating a group of single-line statictext's to work around this.

It would be great if the editor emitted:

var staticTextOneTwo = grpMain.add("group", undefined, {name: "staticTextOneTwo"}); 
    staticTextOneTwo.add("statictext", undefined, "One line", {name: "statictext1"}); 
    staticTextOneTwo.add("statictext", undefined, "followed by another", {name: "statictext2"}); 

Though really, it might be cleaner to not emit names at all for the single-line statictexts since it makes more sense to access them as ...staticTextOneTwo.children[0, 1, ...]. How about it?

@joonaspaakko joonaspaakko added the .BUG Something isn't working label Sep 11, 2022
@joonaspaakko
Copy link
Owner Author

joonaspaakko commented Sep 11, 2022

Now on export the multiline staticText item's parent group gets the item name and the child text items are unnamed.

I'm not sure if it would get a lot of use but I also added a helper function for fetching the text itemName.getText().

CleanShot 2022-09-12 at 00 44 11@2x

@softhorizons
Copy link

Beautiful! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.BUG Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants