ianharrigan / haxeui

IMPORTANT NOTE! This repository is no longer maintained. Please consider the newer version: https://github.com/haxeui/haxeui-core
http://haxeui.org/
392 stars 47 forks source link

Components goto point x = 0 y = 0 after added new one #363

Open elzone opened 7 years ago

elzone commented 7 years ago

Hello. I'm creating the app with drag n drop functionality and when i addChild to a Box container more then one all preveous components in this Box move to point 0, 0 before adding: https://yadi.sk/i/nygzlTBJwe4EQ

after adding new components: https://yadi.sk/i/MGlORqt_we4NB

please help me to solve this issue

ianharrigan commented 7 years ago

Does using and "absolute" container help? (<absolute />)

elzone commented 7 years ago

I tried Box, Absolute. all the same

here is my class code:

package app.components.modifyComponents.contentPart; import haxe.ui.toolkit.containers.Absolute; import haxe.ui.toolkit.layout.Layout; import haxe.ui.toolkit.layout.BoxLayout; import app.components.activities.FreeFlowActivity; import models.Constants; import haxe.ui.toolkit.containers.Box; class ModifyViewContentPart extends Box {

private var contentBox: Box;

public function new( )
{
    super();

    autoSize = false;
    percentWidth = 100;
    percentHeight = 100;
}

override public function initialize()
{
    super.initialize();

    contentBox = new Box();
    addChild( contentBox );
}

public function createPanel( data: Dynamic, sX: Float, sY: Float ): Void
{
    switch( data.name )
    {
        case Constants.FREE_FLOW:
            var panel: FreeFlowActivity = new FreeFlowActivity();
            contentBox.addChild( panel );
            panel.x = sX - 384 / 2;
            panel.y = sY - 256 / 2;
            panel.setButtonsVBoxPosition();

    }
}

}

elzone commented 7 years ago

Hi Ian.

Could you help me with this problem?

ianharrigan commented 7 years ago

Could you zip up your code? Or a minimal example that i could work with? Will mean i can try and work it out much faster, with less guess work.

Cheers, Ian

elzone commented 7 years ago

will prepare example today