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

    bright-gpu-74537

    01/02/2020, 9:49 PM
    tables are implemented @User - let me find some examples
  • b

    bright-gpu-74537

    01/02/2020, 9:50 PM
    oh, i thought there would be one here: https://github.com/haxeui/component-examples
  • b

    bright-gpu-74537

    01/02/2020, 9:50 PM
    but there isnt
  • b

    bright-gpu-74537

    01/02/2020, 9:51 PM
    https://github.com/haxeui/component-examples/blob/master/demo/assets/advanced.xml#L86-L213
  • b

    bright-gpu-74537

    01/02/2020, 9:52 PM
    thats some markup to create a table... not sure if you are using markup or not, if not it should be trivial to convert that to code
  • t

    thousands-house-41767

    01/02/2020, 10:53 PM
    Thanks
  • t

    thousands-house-41767

    01/05/2020, 5:10 PM
    Hi! 🙂
  • t

    thousands-house-41767

    01/05/2020, 5:11 PM
    Is there an explanation of how XML maps to "actual" classes?
  • b

    bright-gpu-74537

    01/05/2020, 5:36 PM
    in what sense? As in how "" maps to a haxeui component class?
  • b

    bright-gpu-74537

    01/05/2020, 5:36 PM
    or as in custom components?
  • b

    bright-gpu-74537

    01/05/2020, 5:36 PM
    though, i guess its kinda the same now i think about it 🙂
  • b

    bright-gpu-74537

    01/05/2020, 5:37 PM
    so... you can have a "module.xml"
  • b

    bright-gpu-74537

    01/05/2020, 5:37 PM
    in that you can expose packages and classes for a macro to go through and build up a component registry
  • b

    bright-gpu-74537

    01/05/2020, 5:38 PM
    these might explain:
  • b

    bright-gpu-74537

    01/05/2020, 5:38 PM
    * https://github.com/haxeui/haxeui-guides/blob/master/modules.md * https://github.com/haxeui/haxeui-guides/blob/master/custom-components.md
  • b

    bright-gpu-74537

    01/05/2020, 5:38 PM
    lemme know if thats not what you meant
  • b

    bright-gpu-74537

    01/05/2020, 5:42 PM
    if ive understood correct, this is probably the section you are looking for: https://github.com/haxeui/haxeui-guides/blob/master/modules.md#components
  • t

    thousands-house-41767

    01/06/2020, 11:25 AM
    My question was more about how attributes are mapped to an object, and children too
  • b

    bright-gpu-74537

    01/06/2020, 11:55 AM
    right, gotcha, so its basically a macro that builds code for you, doesnt really do anything else special, so if you had:
  • b

    bright-gpu-74537

    01/06/2020, 11:55 AM
    Copy code
    xml
    <vbox width="100%">
        <button text="Button" />
    </vbox>
  • b

    bright-gpu-74537

    01/06/2020, 11:56 AM
    the macro would essentially go away and create something, along the lines of:
  • b

    bright-gpu-74537

    01/06/2020, 11:57 AM
    Copy code
    haxe
    c0 = new haxe.ui.containers.VBox();
    c0.percentWidth = 100;
    
    c1 = new haxe.ui.components.Button();
    c1.text = "Button";
    
    c0.addComponent(c1);
  • b

    bright-gpu-74537

    01/06/2020, 11:57 AM
    so nothing particularly fancy happening really
  • t

    thousands-house-41767

    01/06/2020, 12:40 PM
    How does it know it has to map width to percentWidth? I mean I can guess the rule there but is it specified somewhere? 🙂
  • b

    bright-gpu-74537

    01/06/2020, 12:58 PM
    so yeah, as you would guess:
  • b

    bright-gpu-74537

    01/06/2020, 12:58 PM
    https://github.com/haxeui/haxeui-core/blob/master/haxe/ui/parsers/ui/XMLParser.hx#L184-L189
  • b

    bright-gpu-74537

    01/06/2020, 12:58 PM
    so the UI gets parsed into objects first, then those get used to "write" the code
  • b

    bright-gpu-74537

    01/06/2020, 12:59 PM
    main reason for the objects (apart from having this kinda pre processing) is because technically you can use JSON, YAML, X for UI's
  • b

    bright-gpu-74537

    01/06/2020, 12:59 PM
    YAML and JSON parsers were there originally, but i dumped them as they were drifting out of sync with the main xml one
  • b

    bright-gpu-74537

    01/06/2020, 1:00 PM
    adding them back in now would probably be fine, as i rarely make any changes to those parsers... but, honestly, im not sure how much value it would really add
1...160161162...1687Latest