Child components


#1

Hello I’ve built a little gui thingy which has a structure like this:

  1. maincomponent – has children:
    2. object-bin window
    3. event lane ( 4 of them )
    4. control buttons
    5. songpointer window — positioned on top and painted on the same position the 4 event lanes

when I work these components individually they work fine, all dragging and dropping OK, the control works fine.
when I put each of them as child components I had to make some opaque so they would be painted OK
I take it 1. is the parent and 2-5 are the children components - ie. they are all equal in priority (for refreshing the paint() methods)
It doesnt pick up the songpointer’s priority though (because the event lanes have to be allwaysOnTop(true) ). I’ve tried putting the code so it does the songponter first then put the 4eventlanes alwaysOnTop(true) positioned over the songpointer widow, but logicaly it seems to be the same thing and shows the songpointer window OK but I cant use it (the event lanes take priority).

Is there a way to change the priority of the compents, I’ve tried going like this:

  1. maincomponent : has children
    2. object bin window
    4. control buttons
    5. songpointer : has children
    3. event lanes (4 of them). — painted within the songpointer component’s position

This seems to work ok at first, but because the songpointer is the parent of the 4 eventlanes, when I use the songpointer methods it gives me 4 individual songpointers inside the eventlanes! :x no good for me (I just want one songpointer and 4 event lanes lol). Is there a way to tell the event lanes to chill and let the songpointer do its thing (ie be transparent and allwaysOnTop(true) ) but still have the eventlanes allwaysOnTop as well?
The event lanes and the songpointer are both draganddrop targets. If this is confusing, OK I will try to look at doing the songpointer control and paint different so it’s well outside and away from anything to do with the event lanes. Its the listbox effect of the songpointer not working( on the first try above) which is the problem. I’ll experiment - are there ways to change the priority of the components listeners and refreshing so they aren’t all clahing like this? Sorry for rambling but I’m distracted atm. Thanks chaps.


#2

Agh! Too confusing! Very hard to tell what you’re trying to do, but maybe when you say “priority” you mean “z-order”? Have you looked at all the methods like Component::toFront(), Component::toBehind(), etc?


#3

you got it there mate — z-order – will be on that right away
also,
"“Component::toFront(), Component::toBehind(), etc?”"
that’s gonna be exactly what I need. lol. thanks for fitting in the missing pieces - will get back to you and let you know how it’s going!
Peace. J.