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

    bright-gpu-74537

    01/29/2023, 10:21 PM
    right, then i think you can just add a right click event on the treeview, no?
  • b

    bright-gpu-74537

    01/29/2023, 10:22 PM
    i mean, it will (ab)use the context menu, but chances are, it'll be a right click
  • c

    clever-yak-82528

    01/29/2023, 10:22 PM
    i did this and it doesn't work
  • b

    bright-gpu-74537

    01/29/2023, 10:22 PM
    maybe RIGHT_CLICK?
  • c

    clever-yak-82528

    01/29/2023, 10:22 PM
    ill try that in a second after this debug build
  • f

    full-journalist-82607

    01/29/2023, 10:24 PM
    I know that in the wxwidgets treectrl example , it supports a context menu. But they may have done a tricklike having a context menu on the whole tree control, and then check the selected node
  • c

    clever-yak-82528

    01/29/2023, 10:24 PM
    i can just do that if need be
  • b

    bright-gpu-74537

    01/29/2023, 10:25 PM
    you defo should be able to show a context menu on a node, i know you can do that with composites... and if you cant do that in native, its just because of something in haxeui-hxwidgets... wx itself will certainly allow that
  • c

    clever-yak-82528

    01/29/2023, 10:27 PM
    just implemented LZ77 decompression
  • b

    bright-gpu-74537

    01/29/2023, 10:28 PM
    what is your app?
  • c

    clever-yak-82528

    01/29/2023, 10:28 PM
    parser and eventually editor for the wii's opening.bnr format
  • b

    bright-gpu-74537

    01/29/2023, 10:28 PM
    (you've probably told me before, but ive forgotten :/ )
  • f

    full-journalist-82607

    01/29/2023, 10:31 PM
    That's the code they used in the example
    Copy code
    cc
    void MyTreeCtrl::OnItemRClick(wxTreeEvent& event)
    {
        wxTreeItemId itemId = event.GetItem();
        wxCHECK_RET( itemId.IsOk(), "should have a valid item" );
    
        MyTreeItemData *item = (MyTreeItemData *)GetItemData(itemId);
    
        wxLogMessage("Item \"%s\" right clicked", item ? item->GetDesc() : wxString("unknown"));
    
        event.Skip();
    }
  • b

    bright-gpu-74537

    01/29/2023, 10:35 PM
    not sure it applies, haxeui treeview is mapped to wxDataViewTreeCtrl
  • b

    bright-gpu-74537

    01/29/2023, 10:35 PM
    but either way, im sure wxDataViewTreeCtrl allows right clicks
  • b

    bright-gpu-74537

    01/29/2023, 10:35 PM
    maybe haxeui-hxwidgets isnt exposing it correctly
  • b

    bright-gpu-74537

    01/29/2023, 10:37 PM
    looks like its
    wxEVT_DATAVIEW_ITEM_CONTEXT_MENU
  • b

    bright-gpu-74537

    01/29/2023, 10:45 PM
    alright, this should work now... latest haxeui-hxwidgets and hxWidgets (needed to expose a new event type)
  • b

    bright-gpu-74537

    01/29/2023, 10:46 PM
    Copy code
    haxe
            tv1.registerEvent(MouseEvent.RIGHT_CLICK, function(_) {
                var menu = new Menu();
    
                var item = new MenuItem();
                item.text = "Item 1";
                menu.addComponent(item);
    
                var item = new MenuItem();
                item.text = "Item 2";
                menu.addComponent(item);
    
                var item = new MenuItem();
                item.text = "Item 3";
                menu.addComponent(item);
    
                Screen.instance.addComponent(menu);
            });
  • c

    clever-yak-82528

    01/29/2023, 10:47 PM
    yeet
  • c

    clever-yak-82528

    01/29/2023, 11:13 PM
    one thing ive always wondered
  • c

    clever-yak-82528

    01/29/2023, 11:13 PM
    how does haxeui native actually work?
  • c

    clever-yak-82528

    01/29/2023, 11:14 PM
    because it's all styled with css and stuff but it certainly isn't electron
  • c

    clever-yak-82528

    01/29/2023, 11:14 PM
    so do you parse all the css and turn it into e.g. wxwidgets equivalents?
  • e

    elegant-twilight-61392

    01/29/2023, 11:16 PM
    the haxe ui components map to wxwidgets things, and then to apply styling it just changes the corresponding style options on the widgets
  • c

    clever-yak-82528

    01/29/2023, 11:18 PM
    hmm
  • b

    brave-kangaroo-30399

    01/30/2023, 12:41 AM
    With the heaps backend, is there a best component that I can have "control" over externally, ie apply shaders, animate the image, etc?
  • a

    ambitious-knife-25690

    01/30/2023, 12:55 AM
    I don't know what you can do with a h2d.Object
  • a

    ambitious-knife-25690

    01/30/2023, 12:55 AM
    but all haxeui components are made on that
  • a

    ambitious-knife-25690

    01/30/2023, 12:55 AM
    so whatever you can do with that datatype in heaps, you can apply to all haxeui components
1...144614471448...1687Latest