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

    hallowed-ocean-84954

    12/18/2022, 7:20 PM
    Ok - it's up check in the for ReferenceLibrary* classes and in
    Assets/ui
    for the XMLs.
  • b

    bright-gpu-74537

    12/18/2022, 7:22 PM
    i honestly dont really like this
    DropDownBuilder.HANDLER_MAP.set("referenceLibraryDropdownHandler", Type.getClassName(ReferenceLibraryDropdownHandler));
    at all
  • b

    bright-gpu-74537

    12/18/2022, 7:22 PM
    cant you do it in the constructor for the class itself?
  • b

    bright-gpu-74537

    12/18/2022, 7:22 PM
    just checking color popup
  • b

    bright-gpu-74537

    12/18/2022, 7:23 PM
    https://github.com/haxeui/haxeui-core/blob/master/haxe/ui/components/popups/ColorPickerPopup.hx#L26
  • b

    bright-gpu-74537

    12/18/2022, 7:23 PM
    yeah, wouldnt something like that work?
  • b

    bright-gpu-74537

    12/18/2022, 7:23 PM
    still not a huge fan, but at least its self contained
  • h

    hallowed-ocean-84954

    12/18/2022, 7:25 PM
    I can try later to move it and see if that works better sure
  • h

    hallowed-ocean-84954

    12/18/2022, 7:25 PM
    will let you know
  • b

    bright-gpu-74537

    12/18/2022, 7:26 PM
    it should work, i mean, colorpopup uses it
  • b

    bright-gpu-74537

    12/18/2022, 7:26 PM
    but i dont really like how... "something" that whole system is... i know that at some point i wanted all that to go into the module, but never got round to it
  • h

    hallowed-ocean-84954

    12/18/2022, 9:48 PM
    I tried moving the ReferenceLibraryDropdownHandler into the ReferenceLibraryDropdown and moving the handler map update into ReferenceLibraryDropdown.new(). But that gave me the same issue I found before where :
    Copy code
    Uncaught exception: Null access .__type__
    Called from $Type.createInstance(D:\Program Files\HaxeToolkit425\haxe\std/hl/_std/Type.hx:126)
    Called from haxe.ui.components.DropDownBuilder.get_handler(haxe/ui/components/DropDown.hx:940)
    Called from haxe.ui.components.DropDownEvents.hideDropDown(haxe/ui/components/DropDown.hx:854)
    Called from haxe.ui.components.DropDownEvents.onHidden(haxe/ui/components/DropDown.hx:643)
    Called from haxe.ui.util.EventMap.invoke(haxe/ui/util/EventMap.hx:82)
    Called from haxe.ui.core.ComponentEvents.dispatch(haxe/ui/core/ComponentEvents.hx:98)
    Called from haxe.ui.core.ComponentEvents.dispatchRecursively(haxe/ui/core/ComponentEvents.hx:108)
    Called from haxe.ui.core.ComponentEvents.dispatchRecursively(haxe/ui/core/ComponentEvents.hx:110)
    Called from haxe.ui.core.Component.hide(haxe/ui/core/Component.hx:1024)
    Called from haxe.ui.core.Component.set_hidden(haxe/ui/core/Component.hx:1170)
    Called from haxe.ui.backend.ComponentImpl.set_visible(haxe/ui/backend/ComponentImpl.hx:232)
    Called from ui.$UI.__constructor__(ui/UI.hx:179)
    This is coming from the place where I am setting initial value for references.visibility to false. That piece of xml is:
    Copy code
    <vbox id="references" width="100%">
                <dropdown id="referenceDDId" text="Reference Library" type="referenceLibraryDropdownHandler" styleName="referencesBox" width="100%" />
            </vbox>
  • h

    hallowed-ocean-84954

    12/18/2022, 9:49 PM
    This feels like a circular reference. I wonder if this should be structured differently
  • h

    hallowed-ocean-84954

    12/18/2022, 9:59 PM
    I suspect making it possible to define the handler type in the module would help.
  • r

    refined-cat-44047

    12/18/2022, 10:50 PM
    I have been working on updating a legacy project from AS3 to Haxe. It was built in Flixel, and publish to Android tablets and the iPad using AIR. I wanted to change as little as possible, so update to using HaxeFlixel, and still publishing to AIR using
    lime test air -android
    . Took a little to setup, but working fine. But I just added HaxeUI for a better UI, but the button taps seem to be a bit off. In my test, I have three buttons aligned vertically. I thought only the top button was working, but that is because the hit areas seem to be much lower than they should be. I know AIR for Android is probably not a popular target, but is this a known issue? Any clues? Or anything I can do to diagnose what is going on a little better?
  • h

    hallowed-ocean-84954

    12/18/2022, 11:43 PM
    Ok, so I reimplemented this a bit to make it conform to the color-picker-popup much more closely. I had originally not fully understood how to use it as a model and used the dropdown demos. In any case, the bug above is gone. There are really three parts to a popup: 1. the DropDown subclass, 2. the DropDownHandler subcalss and 3. the DropDownView which basically adds dropdown function to whatever you want. I also inlined the XML pieces to match the color-picker-popup. Not required but it made it easier to see what I done, and it puts everything in one place. Latest code on gh in case you're interested. I guess the only thing this exercise suggests is that it is possible to get this going in a "buggie" way which requires weird registration of the handler. It would be nice if that were harder to do or spat errors.
  • b

    bright-gpu-74537

    12/19/2022, 7:16 AM
    any chance for your test app? I can try and run it this end and see if the same happens
    r
    • 2
    • 35
  • b

    bright-gpu-74537

    12/19/2022, 7:16 AM
    could be a dpi issue
  • b

    bright-gpu-74537

    12/19/2022, 7:17 AM
    nice one, ill take a look... fyi, you shouldnt have to subclass dropdown, your original method should have also worked fine, so ill check that out when i get a moment
  • f

    full-journalist-82607

    12/19/2022, 11:04 AM
    I found something interesting This works:
    Copy code
    haxe
    var a = haxe.ui.ComponentBuilder.fromString('<vbox><button text="Button" /></vbox>', "xml");
    Thids doesn't
    Copy code
    haxe
    var oo:String = '<vbox><button text="Button" /></vbox>';
    var a = haxe.ui.ComponentBuilder.fromString(oo, "xml");
    It says
    Copy code
    src/Main.hx:14: characters 45-47 : haxe.macro.Expr should be String
  • f

    full-journalist-82607

    12/19/2022, 11:12 AM
    BTW, there still are some references of Toolkit.componentFromString in haxeui core Readme
  • b

    bright-gpu-74537

    12/19/2022, 12:25 PM
    i think that make sense, i mean, when you are defining a string, that is runtime, the macros operate on expressions at compile time
  • b

    bright-gpu-74537

    12/19/2022, 12:25 PM
    though, it is confusing i agree
  • b

    bright-gpu-74537

    12/19/2022, 12:25 PM
    technically, i think you should be using the "RuntimeComponentBuilder" with the variable version
  • b

    bright-gpu-74537

    12/19/2022, 12:26 PM
    i wonder if you can like "eval" a haxe expr at compile time
  • f

    full-journalist-82607

    12/19/2022, 12:32 PM
    After posting , I thought it kind of made sense. I wanted to use it a compile time and just have the string separated to make the code clearer. I can't answer you , I'm not really got at macros ^^
  • h

    hallowed-ocean-84954

    12/19/2022, 2:55 PM
    Quick question - I tried getting a change event from one part of the UI (the configuration button group) to update the selected item in the ListView within reference library component in the dropdown. It appears that findComponent() cannot find the ListView by Id when the component is not dropped down - either that or I don't understand how findComponent works ?
  • b

    bright-gpu-74537

    12/19/2022, 3:55 PM
    so findComponent wont work to find the list of a dropown, since technically its not a child of it
  • b

    bright-gpu-74537

    12/19/2022, 3:55 PM
    cant you just do .selectedIndex or .selectedItem on the dropdown?
  • h

    hallowed-ocean-84954

    12/19/2022, 4:00 PM
    technically the dropdown only has one item
1...134113421343...1687Latest