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

    happy-agent-4114

    01/19/2023, 6:04 PM
    ok so I'm wrong bc that listener doesn't work on my local
  • h

    happy-agent-4114

    01/19/2023, 6:04 PM
    only on the builder
  • h

    happy-agent-4114

    01/19/2023, 6:06 PM
    my full new() function is
    Copy code
    hx
        public function new() {
            super();
            unitSelector.registerEvent(ItemEvent.COMPONENT_EVENT, (event:ItemEvent) -> {
                trace(event.itemIndex, event.data.checked, event.data.text, event.sourceEvent.type);
            });
            gp = {
                width:Std.int(graphDisplay.width),
                height:Std.int(graphDisplay.height),
                dateStart: new Date(2022, 10, 1, 0, 0, 0),
                dateEnd: new Date(2022, 12, 31, 11, 59, 59),
                units: [
                    A1
                ],
                params: [
                    RT
                ]
            }
    
            var metricNodesTree = unitSelector.addNode({text:"Metrics"});
            for (metric in Type.allEnums(Params)) {
                metricNodesTree.addNode({text:EnumValueTools.getName(metric), checked:(metric==RT)});
            }
            var unitNodesTree = unitSelector.addNode({text:"Units"});
            var coolTree = unitNodesTree.addNode({text:"Thermals"});
            var powrTree = unitNodesTree.addNode({text:"Power"});
            for (unit in Type.allEnums(Units)) {
                if (EnumValueTools.getIndex(unit) <= 12) {
                    coolTree.addNode({text:unitNames[EnumValueTools.getIndex(unit)], checked:(unit==A1)});
                }
                else {
                    powrTree.addNode({text:unitNames[EnumValueTools.getIndex(unit)], checked:false});
                }
            }
            loadGraph(gp);
        }
  • h

    happy-agent-4114

    01/19/2023, 6:07 PM
    is the builder using a different version of haxeui?
  • h

    happy-agent-4114

    01/19/2023, 6:08 PM
    I'm on 1.5.0 for core and html5
  • b

    bright-gpu-74537

    01/19/2023, 6:09 PM
    oh wow, yeah, you wanna upgrade to git
  • b

    bright-gpu-74537

    01/19/2023, 6:10 PM
    1.5.0 is like 4 months out of date now
  • b

    bright-gpu-74537

    01/19/2023, 6:10 PM
    and yeah, builder is on latest git..
  • h

    happy-agent-4114

    01/19/2023, 6:10 PM
    swapped both to git
  • b

    bright-gpu-74537

    01/19/2023, 6:11 PM
    ... ... ... ... all good?
  • h

    happy-agent-4114

    01/19/2023, 6:11 PM
    ok yeah lmao I was using old libs
  • h

    happy-agent-4114

    01/19/2023, 6:16 PM
    should be
  • c

    creamy-animal-95850

    01/19/2023, 8:40 PM
    heaps: any way to disable cursor changes within a component? All of my interactives are overwritten by haxeui's cursor behaviors. I see 'pointer-events:false' in core but it doesn't seem to exist in heaps
  • b

    bright-gpu-74537

    01/19/2023, 8:42 PM
    any chance of a minimal repro, not 100% sure, but smells like a haxeui-heaps bug
  • f

    full-journalist-82607

    01/19/2023, 8:53 PM
    Just found a bug and found the correction. WIth Item Renderers I was wondering why dropdowns didn't send ItemChanged events . ( In fact it send only when it was clicked but not when it was changed) https://github.com/haxeui/haxeui-core/blob/3b7ee39153b00b7279ea0c8d801728821aef3c13/haxe/ui/core/ItemRenderer.hx#L102-L109 it it's because if it's a button ( which is the case of dropdowns), it only dispatches on a CLICK event. I just removed the else
  • c

    creamy-animal-95850

    01/19/2023, 8:59 PM
    Hope this helps
  • m

    melodic-advantage-23638

    01/20/2023, 12:19 AM
    I'm (still) working on a new backend for haxeui and just a quick question. I'm looking at the heaps implementation, and in the StyleHelper.hx code which has the bulk of the logic for creating the geometry, it looks like a component can only have a background image and potentially a gradient image if there's a background color gradient, does that sound right?
  • b

    bright-gpu-74537

    01/20/2023, 7:51 AM
    yeah, background-image, and background-color (or background for gradients)
  • b

    bright-gpu-74537

    01/20/2023, 7:52 AM
    exciting stuff, i think you might be the only other person who has created a backend... certainly recently
  • b

    bright-gpu-74537

    01/20/2023, 7:53 AM
    what is this backend again? lime or raw opengl calls?
  • b

    bright-gpu-74537

    01/20/2023, 8:04 AM
    hmmm, yeah, this seems smelly.... this is somewhat related to the above... ie, without the if it will generate two events, but i guess thats preferable to this dumb "if its a button" logic
  • b

    bright-gpu-74537

    01/20/2023, 8:04 AM
    thanks ill take a look
  • b

    bright-gpu-74537

    01/20/2023, 8:53 AM
    found a fun little bug while tracking this down... if you remove a component from the screen in haxeui-heaps, it still thinks its on screen and "in bounds", so still gets mouse events 😮
  • f

    full-journalist-82607

    01/20/2023, 9:45 AM
    Is it really problematic to have two events ? I think it could be useful, for example if you want a sound effect on the clicking of a dropdown.
  • b

    bright-gpu-74537

    01/20/2023, 9:46 AM
    i think thats what im kinda settling on, they are discrete events, i mean, take the checkbox... it will dispatch two ItemEvent events, one for the click and one for the change... both are technically totally valid
  • b

    bright-gpu-74537

    01/20/2023, 9:47 AM
    (and both could be useful to the user)
  • b

    bright-gpu-74537

    01/20/2023, 9:53 AM
    one thing that might be nice though is in addition to
    ItemEvent.COMPONENT_EVENT
    we also dispatch a
    ItemEvent.COMPONENT_CHANGE_EVENT
    and a
    ItemEvent.COMPONENT_CLICK_EVENT
    (where relevant)... at least that means you can just listen for the event you care about
  • f

    full-journalist-82607

    01/20/2023, 9:54 AM
    Oh that's a good idea, so you don't need to look at the source event
  • b

    bright-gpu-74537

    01/20/2023, 9:55 AM
    i just dont like this sort of stuff:
    Copy code
    haxe
    function foo(event) {
        if (event.sourceEvent.type == "change") {
        }
    }
  • b

    bright-gpu-74537

    01/20/2023, 9:55 AM
    exactly
1...138913901391...1687Latest