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

    bright-gpu-74537

    12/22/2022, 9:30 AM
    yeah, ive fixed it all now, just making toggle dispatch clicks too... will commit shortly
  • b

    bright-gpu-74537

    12/22/2022, 9:33 AM
    btw, that autoDispatch is just so the behaviour knows to dispatch an event when its value changes, ie, when you call
    .selected
    , the other issues were related to linking up native events and mapping them to haxeui events
  • b

    bright-gpu-74537

    12/22/2022, 9:36 AM
    that feels better
  • f

    full-journalist-82607

    12/22/2022, 9:37 AM
    Interesting, between the events elements , the handler elements, and the autotdispatch, I admit I don't understand much haha. Great Work !
  • b

    bright-gpu-74537

    12/22/2022, 9:38 AM
    alright, pushed
  • b

    bright-gpu-74537

    12/22/2022, 9:39 AM
    yeah, the native stuff can get complex, for sure... iirc the autodispatch is just a lazy shortcut i added to save myself from having to dispatch the event manually in code
  • b

    bright-gpu-74537

    12/22/2022, 9:39 AM
    its only used in hxwidgets i think
  • f

    full-journalist-82607

    12/22/2022, 9:39 AM
    What's the use of
    Copy code
    <event id="change" native="EventType.TOGGLEBUTTON" class="haxe.ui.events.UIEvent" />
    ?
  • b

    bright-gpu-74537

    12/22/2022, 9:41 AM
    so this basically says, when the user (you) request to add a haxeui "change" event (UIEvent.CHANGE), rather than having to map that manually, we'll map it to a wx TOGGLEBUTTON listener, and when it gets dispatch, well create a UIEvent and dispatch that to haxeui listeners
  • b

    bright-gpu-74537

    12/22/2022, 9:42 AM
    this drives that, essentially:
    Copy code
    haxe
            var native:String = nativeConfigQuery('component[id={className}].event[id={param1}].@native', type);
            if (native != null) {
                var eventType = EventTypeParser.fromString(native);
                if (eventType != 0) {
                    if (_eventMap.exists(type) == false) {
                        _eventMap.set(type, listener);
                        window.bind(eventType, __onEvent);
                    }
                    return;
                }
            }
  • f

    full-journalist-82607

    12/22/2022, 9:42 AM
    Okay, I was suddenly confused. lol . I though it was both in the dispatched event in the handleer, but that's the click. Okay, makes sense 🙂
  • b

    bright-gpu-74537

    12/22/2022, 9:43 AM
    again, mostly all of this is shortcuts, it used to all be done in code, especially during the PoC stage, but mapping things gets old real fast 🙂
  • f

    full-journalist-82607

    12/22/2022, 9:46 AM
    Yeah, it's a great system for all the boiler plate code. Plus just by looking at native.xml, it's really easier to see what features are implemented or not.
  • b

    bright-gpu-74537

    12/22/2022, 9:47 AM
    yeah, when done purely in code (no config) it gets overwhelming fast, and as you say, tough to see whats doing what... although, saying that, i was just adding to the Toggle entry and not understanding why it wasnt working, so there is always room for dumbness and looking with your eyes closed 😄
  • f

    full-journalist-82607

    12/22/2022, 9:50 AM
    Haha, it happens to the best of us.
  • h

    hallowed-ocean-84954

    12/23/2022, 4:32 AM
    And just when you thought it was safe he's back with another question 🙂 I am creating a point-light component to house the controls of a point light. This means it will include instances of my labelled-slider and other components. So it extends VBox and it renders fine. What I cannot get to work is in my main UI.hx class I added a member variable
    Copy code
    @:bind(uiPointLight2)
        public var pointLight2(default, null):PointLight;
    and I get
    Copy code
    haxeui-core/git/haxe/ui/macros/Macros.hx:356: characters 21-66 : haxe.ui.util.Variant should be ui.PointLight
    Source/ui/UI.hx:20: lines 20-420 : ... Defined in this class
    The class is listed in module.xml. This happens on html5 and hl. So question, am I not able to define a field in the UI class for the component as a whole - can I only bind to HaxeUI types ? or am I as usual missing something ?
  • b

    bright-gpu-74537

    12/23/2022, 7:52 AM
    hmmm, i would have expected that to work... ill check it out...
  • f

    full-journalist-82607

    12/23/2022, 2:11 PM
    Hmm, continuing to make my app in hxWidgets. I have multiple problems with dialogs. The main one , is that you create a Dialog Base and have a width for it ( by code or xml or whatever) , it makes it crash. ( and autosizes doesn't really work)
    Copy code
    haxe
    var dialog = new haxe.ui.containers.dialogs.Dialog();
            dialog.text = "Dialog";
            dialog.width =400;
            dialog.showDialog();
    I have with gdb #0 0x0000555555d93eef in bool hx::TestLessEq(Dynamic const&, Dynamic const&) () #1 0x0000555555ec9350 in haxe::ui::core::ComponentBounds_obj::set_percentWidth(Dynamic) () I think it has to do wth https://github.com/haxeui/haxeui-hxwidgets/blob/87a2062859753d8354bf533bf1f0595a24392a11/haxe/ui/backend/DialogBase.hx#L118
  • b

    bright-gpu-74537

    12/23/2022, 2:20 PM
    that DialogBase shouldnt be used
  • b

    bright-gpu-74537

    12/23/2022, 2:21 PM
    it should pick up the one from haxeui-hxwidgets... two secs... i wonder if ive broken this recently too :/
  • b

    bright-gpu-74537

    12/23/2022, 2:21 PM
    defo used to work
  • b

    bright-gpu-74537

    12/23/2022, 2:24 PM
    ... yup... crash
  • b

    bright-gpu-74537

    12/23/2022, 2:25 PM
    i bet its that recent change where how i changed how native classes were looked up... :/
  • b

    bright-gpu-74537

    12/23/2022, 2:25 PM
    hmmm, nope
  • b

    bright-gpu-74537

    12/23/2022, 2:33 PM
    OK, it happens when a dialog doent have any buttons
  • f

    full-journalist-82607

    12/23/2022, 2:34 PM
    Hmm, I think in my original app I had some buttons, and it crashed too
  • b

    bright-gpu-74537

    12/23/2022, 2:35 PM
    there seems to be issues with using the buttons too... and something strange happening with the size
  • b

    bright-gpu-74537

    12/23/2022, 2:35 PM
    obviously havent used native dialogs in a while, need to give them the "once over" - bear with me
  • b

    bright-gpu-74537

    12/23/2022, 2:35 PM
    not having dialog buttons should crash the app anyway, so that needs to be fixed regardless
  • f

    full-journalist-82607

    12/23/2022, 2:42 PM
    No problem. Yeah I had clicking on the button crashes ,it was maybe with normal messages boxes (which do appear correctly). There was also that an onClosed event that weren't always called . ( I was able to add them to normal dialogs, but with messages boxes it still didn't work). Yeah, wxwidgets is quite finnicky 🙂
1...134913501351...1687Latest