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

    square-analyst-80883

    05/23/2020, 9:07 AM
    @User cool, had no idea there was a server for it.
  • c

    clever-oil-61353

    05/23/2020, 9:07 AM
    i have been lurking in there here and there
  • c

    clever-oil-61353

    05/23/2020, 7:19 PM
    Good morning.
  • b

    bitter-family-72722

    05/23/2020, 7:26 PM
    good evening
  • c

    clever-oil-61353

    05/23/2020, 7:49 PM
    how ya doing Gama?
  • m

    most-caravan-45834

    05/23/2020, 9:04 PM
    I'm attempting to create a modal dialog with a property grid inside, and I want to save the property grid content to my model when I dismiss the dialog with by clicking apply. I've used the dialog example no haxeui.org
    Copy code
    haxe
    package editor;
    
    import haxe.ui.containers.properties.Property;
    import haxe.ui.containers.properties.PropertyGrid;
    import haxe.ui.containers.dialogs.Dialog;
    import haxe.ui.containers.dialogs.Dialog.DialogEvent;
    
    @:build(haxe.ui.macros.ComponentMacros.build("assets/editor/xml/map_properties.xml"))
    class MapProperties extends Dialog
    {
        var mapIdProperty: Property;
    
        public function new()
        {
            super();
    
            title = "Map Properties";
            buttons = DialogButton.CANCEL | DialogButton.APPLY;
    
            onDialogClosed = onClose;
        }
    
        function onClose(e: DialogEvent)
        {
            mapIdProperty = findComponent("map_id", Property, true);
    
            trace(mapIdProperty);
    
            trace(mapIdProperty.value);
        }
    }
  • c

    clever-oil-61353

    05/23/2020, 9:09 PM
    keep in mind i don't really know anything about that particular area.... but..... seems instead of onDialogClosed = onClose; ..... I would do something with the Apply to save info, then tell it to close after the task is done...... but.... my stumbling block is that I do tend to over complicate how I see things. Even so, its what i would try.
  • c

    clever-oil-61353

    05/23/2020, 9:10 PM
    That why you will see me asking questions that to anyone else would appear so simple to understand..... i am, my own brick wall.
  • c

    clever-oil-61353

    05/23/2020, 9:12 PM
    Anyone else have some ideas/suggestions?
  • m

    most-caravan-45834

    05/23/2020, 9:14 PM
    But mapIdProperty is always null. What am I doing wrong?
  • m

    most-caravan-45834

    05/23/2020, 9:14 PM
    sorry I forgot to send the this last part
  • c

    clever-oil-61353

    05/23/2020, 9:19 PM
    always null...... hmmmm, i think i may have idea for that, seems similar to an issue i was having that Ian helped me with.
  • c

    clever-oil-61353

    05/23/2020, 9:19 PM
    let me find it real quick.
  • c

    clever-oil-61353

    05/23/2020, 9:22 PM
    yeah, this here, when i kept getting a null return in similar fashion......
  • c

    clever-oil-61353

    05/23/2020, 9:22 PM
    https://discordapp.com/channels/162395145352904705/565569107701923852/712205701711134742
  • c

    clever-oil-61353

    05/23/2020, 9:22 PM
    its up above a few scrolls..... in this chat
  • c

    clever-oil-61353

    05/23/2020, 9:23 PM
    that particular solution made the differene, that may help you.
  • c

    clever-oil-61353

    05/23/2020, 9:24 PM
    above it you will see the code i was having the issue with and such.
  • m

    most-caravan-45834

    05/23/2020, 9:25 PM
    Checking it out
  • m

    most-caravan-45834

    05/23/2020, 9:26 PM
    I'm probably getting this line wrong:
    Copy code
    haxe
    mapIdProperty = findComponent("map_id", Property, true);
  • m

    most-caravan-45834

    05/23/2020, 9:26 PM
    by assuming content of "assets/editor/xml/map_properties.xml" is under the Dialog hierarchy
  • m

    most-caravan-45834

    05/23/2020, 9:26 PM
    it might not be
  • c

    clever-oil-61353

    05/23/2020, 9:27 PM
    mapIdProperty.findComponent("map_id", MenuBar).onMenuSelected = function(e) { MenuBar should be where the component or whatnot that holds map_id switch (e.menuItem.id) { case "displayAbout":
  • c

    clever-oil-61353

    05/23/2020, 9:28 PM
    of course a change to the switch and case for your needs.
  • c

    clever-oil-61353

    05/23/2020, 9:30 PM
    or, the way you have it and change Property to something else.....
  • c

    clever-oil-61353

    05/23/2020, 9:31 PM
    mind if i see the xml?
  • m

    most-caravan-45834

    05/23/2020, 9:33 PM
    Copy code
    xml
    <?xml version="1.0" encoding="utf-8" ?>
    <vbox>
        <property-grid width="250" height="300">
            <property-group text="Primary Group">
                <property id="map_id" label="ID" value="" />
            </property-group>
        </property-grid>
    </vbox>
  • c

    clever-oil-61353

    05/23/2020, 9:34 PM
    i'm thinking you should give property-group and id.... and search property group for the map_id keeping that same setup you have
  • m

    most-caravan-45834

    05/23/2020, 9:35 PM
    Yeap
  • m

    most-caravan-45834

    05/23/2020, 9:35 PM
    fixed it
1...226227228...1687Latest