Best component for a draggable window

Hi,

I need to make a floating window that i can drag around, close and resize.
What is the best component to use for that?

I tested the Dialog component with modal=false but it’s behavior is very strange.
I’ve also tried the new sidebar but it’s not draggable.

-John

Whats wrong with dialog and modal = false?

  1. I cant seem to change its position after it’s created.
    By this I mean it’s X and Y through code. It always seem to default to the middle of the screen.
  2. Dragging the window around stops at the edges of the app screen size and doesn’t allow part of the window to go outside the screen boundaries.
  3. Resizing the app screen doesn’t update the area in which i can drag the window.
  4. Can i make this resizable, like be able to drag corners of the window to change its size of it or is there a better component with that function.

EDIT: I found the .centerDialog = false which fixes #1

FYI, forgot to mention but im going to make some updates to dialogs to address some of this (#2 especially, dunno when that one wormed its way on :smiley: )

1 Like

Awesome! :smiley:

#3 is also really annoying because I can’t drag the window around after I maximize the app.

I made a quick video to show the issue.

Heh heh, fair enough, so not only is it screen constrained - its not working on “live” values of those constraints… i think ill fix that first, then remove the constraint altogether (or make it optional, default=false)

OK, #2 and #3 should be fixed now and in git… ill have a play with #4 later… i actually need to also, i was planning on just rolling out my own as i have before, but i guess if at least another person could use it, then it makes sense to get something in core.

Cheers,
Ian

1 Like

Works great!
Thank you so much.

Being able to resize the window is not a big deal, I could add a grid size option or something.

Hey, so unrelated to anything here, but is there any chance you could pull latest haxeui-core and let me know if somethings new is broken, ive made a change and im not 100% convinced its a good change, so am asking project owners to let me know if ive knackered something! :confused:

I’m getting lots of Unknown identifier : _topLevelComponents errors.

EDIT: I had to add private var _topLevelComponents:Array<Component> = []; back to ScreenBase.hx

EDIT2: Whatever the change was it broke all toggleable buttons.

I’m getting lots of Unknown identifier : _topLevelComponents

You’ll need latest haxeui-openfl too

EDIT2: Whatever the change was it broke all toggleable buttons.

hmmm, right :frowning:

Seems like I need to use onChange now instead of onClick.

hmmm, right, thats a better event to use anyway, but still, it shouldnt have broken in the first place, lemme investigate

What exactly should I be looking at?

Everything seems to be working like before after making those changes.

buttons and such not working, like the toggles you found…

Found something else but it might have been there before.

Property grid dropdowns don’t close when interacting with other elements on the property grid.

EDIT: Just checked the component explorer examples and it happens there too so it was already an existing issue.

Ive reverted the change… can you pull again? Everything should be back to normal now

The change wasnt sitting right with me, and the fact that i would have had to work around the toggle buttons made my mind up… even though change is the better event, click should have worked fine and indicated a deeper issue - so the change is gone

PS: you shouldnt need _topLevelComponents either, you might need to pull latest haxeui-openfl… i ditched that a while ago since there was another array already there (rootComponents)

That should also be fixed if you pull again, looks like i introduced that fairly recently in another change

Ive reverted the change… can you pull again? Everything should be back to normal now

Toggle works with onClick again.

PS: you shouldnt need _topLevelComponents either, you might need to pull latest haxeui-openfl… i ditched that a while ago since there was another array already there (rootComponents)

Yeah, I pulled the latest haxeui-openfl. I haven’t been updating it.

That should also be fixed if you pull again, looks like i introduced that fairly recently in another change

That partially solves the issue.
It closes when you select an int or string type property but not when you select another dropdown. It also doesn’t go away when you scroll the list with both the scrollbar and hold mouse to drag list.

oh yeah… :confused:

These must have been there for a while

EDIT: yikes, nothing to with property grid, and issue with scroll view: Builder - HaxeUI

must have been there forever