https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • f

    few-pizza-8232

    11/26/2022, 10:06 PM
    Fiddled around with it a little: http://haxeui.org/builder/?7ac2f651 Couple of things I changed: - removed a couple of `verticalAlign`s,
    VBox
    ignores those - removed the
    Grid
    , that was just getting in the way, and a spare
    VBox
    that I think was intended as a spacer - if you need a grid layout in here you should add it as a child of the help
    VBox
    - added
    height="100%"
    to a few elements to help it estimate sizes. This tells it to stretch those elements to fill their containers (including the root
    VBox
    !)
  • f

    few-pizza-8232

    11/26/2022, 10:08 PM
    I also added a "helpContainer" element to ensure that the "hide help" section was always at the bottom, even when the "help" element was hidden
  • h

    hallowed-ocean-84954

    11/26/2022, 10:12 PM
    ah many thanx
  • h

    hallowed-ocean-84954

    11/26/2022, 10:12 PM
    so the basic point is that I need a wrapping vbox that never goes away ?
  • f

    few-pizza-8232

    11/26/2022, 10:19 PM
    There's a couple of ways to do it but unless you want to subclass
    VBox
    you're not going to get something that lays out bottom-to-top, I think. If you're not interested in building layouts of elements in rows and columns the
    Absolute
    container might suit your use
  • h

    hallowed-ocean-84954

    11/26/2022, 10:20 PM
    ah ok - thanx for the info - trying to patch this into the app now.
  • h

    hallowed-ocean-84954

    11/26/2022, 11:11 PM
    Ok - finally got this all working in the app - there was also a missing height="100%" in the outermost vbox (the whole UI basically) and then I have an outer columnar layout in an hbox and that needed the same. But now it all works. Many thanx again.
  • h

    hallowed-ocean-84954

    11/27/2022, 4:37 AM
    Is there a way to set a property in the XML based on a logical expression of values of other component properties ? Specifically I want to disable a checkbox based on the selected property of two others but this does not seem to work :
    Copy code
    <optionbox id="directional" componentGroup="lightGroup" text="Directional light" disabled="${useTexture.selected || rubiks.selected}" />
    I can do it in a callback in the hx file of course but just wondering if there is a purely XML way. I tried parens around the expression and so on but not finding a winner.
  • b

    bright-gpu-74537

    11/27/2022, 8:15 AM
    so thats not possible currently though i have thought a numer of times to add it... not sure how complex it would be to do that tbh
  • b

    bright-gpu-74537

    11/27/2022, 8:18 AM
    > I can do it in a callback in the hx file you could also do it in the xml file but in an event handler: http://haxeui.org/builder/?f2806d51 Its not as neat, but it'd save you having to setup a whole event handler in haxe
  • b

    bright-gpu-74537

    11/27/2022, 2:20 PM
    just a screw around but already feels like a full app (ish) 😄
  • f

    fierce-soccer-8550

    11/27/2022, 2:25 PM
    I love it. I'm messing around with some similar ideas for the website for the learning sections.
  • b

    bright-gpu-74537

    11/27/2022, 2:47 PM
    ... now i just need to refactor the whole thing, as really, this was supposed to be a PoC, but actually, i think, with a little love, it'll be good to go in core "as is"
  • h

    hallowed-ocean-84954

    11/27/2022, 3:09 PM
    thanx for this. The interdependencies are getting more complex so I think I'll use callbacks as it will be easier (ultimately) to keep it all in one place and neatly factored - or as neatly as I can make it.
  • b

    bright-gpu-74537

    11/27/2022, 3:10 PM
    yeah, fair enough... btw, you can also create functions on script also... again, its not as neat, and might be "the same" as doing it in your haxe class, but well, its an option: http://haxeui.org/builder/?7bf12c2e
  • b

    bright-gpu-74537

    11/27/2022, 3:12 PM
    (im thinking about renaming "script" to "code" or something as i kinda think "script" is misleading at this point, ie, the above will build a "foo" member function on your haxe class, callable by other haxe functions, so its not really "script"... dunno)
  • h

    hallowed-ocean-84954

    11/27/2022, 3:15 PM
    I was wondering if that was possible. I'll think about whether that is better for this case or not. You can also put CSS in there and so on. I tend to think of script in the sense normally use it in HTML files - so code is probably better in that it's more general but I'm not that worried one way or another and I'm usually happier with fewer breaking changes
  • b

    bright-gpu-74537

    11/27/2022, 3:16 PM
    well, i guess i dont me replace, i mean "as well as", and maybe issue a warning if someone uses script
  • b

    bright-gpu-74537

    11/27/2022, 3:17 PM
    the problem i have with the word "script" is, as you say, it indicates html type script which is runtime and kinda standalone... really what you are doing in haxeui is building class functions at compile time
  • h

    hallowed-ocean-84954

    11/27/2022, 3:18 PM
    yeah - makes sense
  • b

    bright-gpu-74537

    11/27/2022, 3:19 PM
    it did used to be script (hscript in fact), but its so much better now thats no longer the case 🥳
  • f

    full-journalist-82607

    11/27/2022, 3:24 PM
    Found a bug in button bar. When creating the bar dynamically ( after onReady) , http://haxeui.org/builder/?42bc6292, there's a bug when you click on the last selected button, ( it does not unelect the others) . That's because https://github.com/haxeui/haxeui-core/blob/bc7f71d3d8d5c4b37c8c1a922646e486c1681e69/haxe/ui/containers/ButtonBar.hx#L136-L144 when you add a component, it registers the internal events but only for the already added buttons, not for the new one.
  • b

    bright-gpu-74537

    11/27/2022, 3:26 PM
    so funny... i noticed the same thing today when i was using button bar for the "window list" in the window manager... i stopped using buttonbar (not for that reason)
  • b

    bright-gpu-74537

    11/27/2022, 3:27 PM
    > when you add a component, it registers the internal events but only for the already added buttons, not for the new one. that makes alot of sense... thanks, you saved me an investigation 🙂
  • f

    full-journalist-82607

    11/27/2022, 3:27 PM
    Oh, i think I may have found the solution . One moment.
  • f

    full-journalist-82607

    11/27/2022, 3:39 PM
    I thought A simple solution would be to add to the button bar builder.
    Copy code
    haxe
     
      public override function onComponentAdded(child:Component) {
        _component.registerInternalEvents(true);
        }
    But for some reason, it makes the code in my real app propblematic. I don't know yet if it's because, of my code, or another bug.
  • b

    bright-gpu-74537

    11/27/2022, 3:40 PM
    i think you are on the right track though... isnt there an event of when a component is added to a parent?
  • b

    bright-gpu-74537

    11/27/2022, 3:40 PM
    (checking)
  • b

    bright-gpu-74537

    11/27/2022, 3:41 PM
    yeah,
    UIEvent.COMPONENT_ADDED
  • b

    bright-gpu-74537

    11/27/2022, 3:42 PM
    so i guess, in the the "create" function of the builder we could add a listener for that event (
    _component.registerEvent, UIEvent.COMPONENT_ADDED, onComponentAdded
    ), and then re register the events there ... ... ... ?
1...130013011302...1687Latest