How to render child window before objects? - direct3d

I am using this example. I made a child window and I want to render it as before the objects, like a background. I am using direct3d and createwindow.

Related

MFC non-modal dialog front but not topmost

Recently I would like to bring a dialog in front of it's father window(always do, no matter its father window gets focus or not) but not topmost. In other words, I only want it cover its father window but not other applications' window.
I've tried:
// this covers other windows
SetWindowPos(&wndTopMost, rectPos.left, rectPos.top, width, height, SWP_SHOWWINDOW);
// this doesn't work
SetWindowPos(&GetParentFrame()->wndTop, rectPos.left, rectPos.top, width, height, SWP_SHOWWINDOW);
Any ideas?
Xiangguan Zheng, in your original post you stated:
I only want it cover its father window but not other applications' window.
Later in your comment you mentioned:
I want do edit the father dialog by clicking the buttons on the child dialog.
These are two completely different requirements.
If you want a second dialog to be contained in the parent dialog area, you can achieve this by setting WS_CHILD style to the second dialog and calling Create. this will show the child dialog over the top of the parent and keep it within the parent area.
to fulfill the second requirement, you will have to pass the pointer to the parent dialog as the second parameter in Create call, or pass it when the child dialog is instantiated. Either way, you will have to save that pointer in the child dialog and use it to either call the public function exposed by the parent or use the pointer to send/post messaged to the parent.

MotionLayout does not pass nested scroll up to parent

I am using 'com.android.support.constraint:constraint-layout:2.0.0-alpha5'.
I have a fragment using MotionLayout inside an activity that also carries a BottomNavigationView inside a CoordinatorLayout with a custom behaviour allowing to show and hide when the content is scrolled.
With all fragments, where there is no MotionLayout, this behaviour works perfectly. Only with the MotionLayout, which has a NestedScrollView as a child, and makes use of an onSwipe transition, this swipe seems to be consumed, and does not arrive at the activity's coordinator layout.
Is this a current limitation of how MotionLayout works, and is it possible to extend it to support my use case?

QT5: What is the Significance of a Layout's Parent?

I am attempting to write my first program using Qt5. I found a tutorial (zetcode.com/gui/qt5) with a number of examples, which all used dynamic layout creation. I'm trying to create a nested layout configuration, but I'm having a problem with specifying the parent parameter of the layout constructor. When I use the main window as the parent for the main layout and its sub-layouts, I get an error message, apparently telling me that QWidget can have only one QLayout. The window looks OK, but I haven't implemented all my functionality yet (slots and other code), so I don't know what, if anything, is broken. If I omit the parent parameter from the sub-layouts, I get no error messages and the window looks OK as well, but again I'm wondering whether this would affect my subsequent code additions.
Can anyone explain to me the significance of a layout's parent? I've noted that specification of the parent window in the layout's constructor is apparently not sufficient, because all of the examples I've seen call setLayout() at the end of the window's constructor. In particular, will my omission of a parent ever cause problems?
The "rules" are that there can be at most one top level layout on a given widget, and that widgets can be only children of other widgets, not of layouts. So what happens is that:
when you set a layout on a widget, the widget will take ownership of that layout;
when you add widgets on a layout, these widgets will be reparented to the widget the layout is/gets installed upon;
when you add a layout inside another layout, the inner layout becomes a child of the outer layout.
What you're probably seeing is a side-effect of creating a layout with a widget as parent, as in
QLayout *layout = new SomeLayout(widget);
This will try to install the layout on widget, and fail in case there's already one. The good news is, you can pretty much ignore passing parents around and rely on the system to do "the right thing". For instance:
MyWidget::MyWidget(QWidget *parent)
: QWidget(parent)
{
QHBoxLayout *mainLayout = new QHBoxLayout; // top level layout
QVBoxLayout *subLayout1 = new QVBoxLayout; // sub layout 1 stuff
QPushButton *button = new QPushButton("button");
subLayout1->addWidget(button);
// create more widgets...
mainLayout->addLayout(subLayout1);
QVBoxLayout *subLayout2 = new QVBoxLayout; // sub layout 2 stuff
QLineEdit *edit = new QLineEdit;
subLayout2->addWidget(edit);
mainLayout->addLayout(subLayout2);
setLayout(mainLayout);
}
This will correctly create a layout hierarchy and a parent/child relation so that nothing will get leaked.

Want to implement WPF iframe just like on Asp.net

I'm a newbie to WPF. I'm looking for a control that work like Asp.Net iframe in WPF. I want to have a static parent form which will call child forms and put them in this iframe. I want do it like Avast. Check the attached image. I want the parent form to occupy the gray and black area, and child form to occupy the white area. I want to call child form from the menu on the left. I want to have a child form for Status,Scan,Tools,Store, My devices,Help, Statistics and Settings.
WPF has a WebBrowser control you can use to load websites into your window.
Use Frame. It works like I-frame, but better.
To load a form just use Frame.Navigate(yourClass);

In Javafx 2, how to always draw something on top?

I am using javafx 2.2. I have an circle object which moves as the mouse moves. However, there are new objects on the scene. I want to position this object always on top of the others.
With OPENGL, you just draw this circle LAST in each frame in the rendering loop, but with JavaFX, how can this be achieved?
Most of the time just use Node.toFront()
Invoke node.toFront() on starting to drag the node.
The drawing order of a node is determined by the node's position in the node's parent's ObservableList of children. node.toFront() will move the node to the end of the parent's child list so that it will be the last thing rendered for that parent.
Beware that for some layout types (such as HBox), the order of the node in the parent's child list also determine's the nodes layout position in the list as well as the node's rendering order.
For 3D work alter z order
If you are doing 3D work, then adjusting the z-coordinate of the node can also place the node on top of other nodes.
For cross parent dragging use a stack
If you want to drag the node out of it's parent and into another parent, then you could make the root of the scene a stack, remove the node from it's initial parent, place it at the top of the scene stack, drag it to it's new parent, and on drag finished, remove the node from the scene stack and place it into the appropriate position in it's new parent's child list.

Resources