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

    bright-gpu-74537

    12/01/2022, 11:37 AM
    feels like a typo / completion "accept" tbh
  • i

    icy-zebra-52882

    12/01/2022, 11:37 AM
    it just feels like a weird approach
  • i

    icy-zebra-52882

    12/01/2022, 11:38 AM
    a bit further up, near the start of the handler, you have a bunch of handler code that calls Reflect and attempts to find out which button was pressed that way:
    Copy code
    haxe
    if (event.type == "pointerdown") { // handle right button mouse events better
        var which:Int = Reflect.field(event, "which");
        switch (which) {
            case 1: type = MouseEvent.MOUSE_DOWN;
            case 2: type = MouseEvent.MOUSE_DOWN; // should be mouse middle, but there is no haxe equiv (yet);
            case 3: type = MouseEvent.RIGHT_MOUSE_DOWN;
        }
    } else if (event.type == "pointerup") { // handle right button mouse events better
        var which:Int = Reflect.field(event, "which");
        switch (which) {
            case 1: type = MouseEvent.MOUSE_UP;
            case 2: type = MouseEvent.MOUSE_UP; // should be mouse middle, but there is no haxe equiv (yet);
            case 3: type = MouseEvent.RIGHT_MOUSE_UP;
        }
    }
  • b

    bright-gpu-74537

    12/01/2022, 11:39 AM
    i think this is because different browsers have different different "things" in the event
  • b

    bright-gpu-74537

    12/01/2022, 11:40 AM
    obviously all this stuff as to work cross browser (ie, not just chrome), but sounds like your PR will bring things more "together" anyway?
  • a

    ambitious-knife-25690

    12/01/2022, 11:40 AM
    for the
    image
    component, can i pass a kha
    Image
    to it by reference?
  • i

    icy-zebra-52882

    12/01/2022, 11:42 AM
    I'm pretty sure PE usage, at least as far as which button gets reported for each button press, has been standardised for a long time, but I can change it in my dev branch and see how it plays
  • b

    bright-gpu-74537

    12/01/2022, 11:42 AM
    https://github.com/haxeui/haxeui-kha/blob/master/haxe/ui/backend/ImageData.hx should be able to yeah
  • b

    bright-gpu-74537

    12/01/2022, 11:42 AM
    button.icon = khaImage image.resource = khaImge etc etc
  • b

    bright-gpu-74537

    12/01/2022, 11:43 AM
    defo need to test the PR out alot before i merge... component explorer is a good test since its basically everything... but im not going to be able to get round to it till later tonight
  • i

    icy-zebra-52882

    12/01/2022, 11:43 AM
    that's fair
  • i

    icy-zebra-52882

    12/01/2022, 11:44 AM
    another question: do you expect middle-click to trigger click events like a left-click would?
  • b

    bright-gpu-74537

    12/01/2022, 11:44 AM
    i mean... probably? I dont really have a preference, there is no support for middle click on haxeui (as of yet), so it doesnt really matter that much... even just eating the event is probably fine
  • i

    icy-zebra-52882

    12/01/2022, 11:45 AM
    I just wondered because almost all desktop browsers have an "autoscroll" option for scrolling on web pages, triggered by middle-click
  • b

    bright-gpu-74537

    12/01/2022, 11:46 AM
    i doubt that would work with haxeui though... mebbe it would...
  • i

    icy-zebra-52882

    12/01/2022, 11:49 AM
    another oddity from that previous block of code is that you can use touch-style scrolling (click-and-drag) with a mouse, but only with left- and middle-click, whereas pressing the right-mouse button immediately sends a click event
  • b

    bright-gpu-74537

    12/01/2022, 11:50 AM
    that might be to send a click event for context menus... not sure... 100% want to keep touch style scrolling though... even on desktop
  • b

    bright-gpu-74537

    12/01/2022, 11:50 AM
    ill take a look at the PR later and review the existing code
  • i

    icy-zebra-52882

    12/01/2022, 12:08 PM
    seems that
    MouseEvent.buttons
    lets you get all of the buttons currently held on a pointer device, rather than just the one being pressed/released, so that makes sense at least
  • i

    icy-zebra-52882

    12/01/2022, 1:26 PM
    made one more change in local branch that I'm not sure will impact anything, but it's possibly a haxeUI design decision
  • i

    icy-zebra-52882

    12/01/2022, 1:27 PM
    basically it replaces the previously mentioned code block with just checking the pointer event's reported button press (either left or right click) and setting the haxeUI event type to either
    MOUSE_DOWN
    or
    RIGHT_MOUSE_DOWN
  • i

    icy-zebra-52882

    12/01/2022, 1:28 PM
    the reason it makes an impact is because it doesn't check for middle-click, or the optional back and forward buttons on some mice
  • i

    icy-zebra-52882

    12/01/2022, 1:29 PM
    unless there's an outcry of people who specifically use middle-click-and-drag, I don't think it makes a real difference
  • b

    bright-gpu-74537

    12/01/2022, 2:15 PM
    > an outcry of people who specifically use middle-click-and-drag doubt there will be / is - im guess no one even knows what middle mouse button is, essentially, mapped to left
  • b

    bright-gpu-74537

    12/01/2022, 2:15 PM
    (i didnt even know about it / remember 🙂 )
  • c

    curved-appointment-82072

    12/01/2022, 2:16 PM
    Hi there! I am fetching LDAP data in my app. I want to display the thumbnailPhoto (JPEG). But can't seem to find the way in haxe-ui using the IMAGE component. How should I do? From haxePHP I can display the thumbnail with :
    Copy code
    haxe 
    var  imageString = Base64.encode( Bytes.ofString( MY_JPEG_STRING));
    Lib.println('<img src="data:image/jpeg;base64,${imageString}"/>');
  • b

    bright-gpu-74537

    12/01/2022, 2:17 PM
    which backend?
  • c

    curved-appointment-82072

    12/01/2022, 2:17 PM
    Js
  • b

    bright-gpu-74537

    12/01/2022, 2:17 PM
    haxeui-html5? Or like haxeui-openfl targeting js?
  • c

    curved-appointment-82072

    12/01/2022, 2:17 PM
    Html5
1...131213131314...1687Latest