Cannot scroll when 'OnMouseWheel' event in delphi's mdi parent form - delphi

I have the MDI form with MDI child forms.
As you know, MDI from create scrollbar when child form is beyond the area automatically.
I'd like to use this scrollbar when i do mouse wheel.

Related

MDIChild Form always behind ScrollBox

Based in this my working code, now i need of a ScrollBox component and a Image component inside he. Eg:
The problem now is the ScrollBox. The MDIChild Form always stays behind, you can test, changing ScrollBox Align (None/Client) property.
Then what is need to MDIChild Form stay above of ScrollBox?
The MDI client window that hosts the MDI child forms is the bottom most window of the MDIForm's content. You can't make MDI child forms appear on top of anything else, because literally everything else placed on the MDIForm is on top of the MDI client window and thus on top of the child forms.

Top of the Child form goes below parent form

I have a parent and child form in Delphi. Parent form contains a TControlBar and on the top of ControlBar there are two Toolbars.
On one of the toolbars there is a button which is used to open the child form.
When child form is displayed, top partion of the form goes below the control bar and top portion of the child form goes hidden below the parent form.
I think the problem is that my child form is using full part of the parent form as the display area.
To my knowledge, I think child form should use ClientWidth and ClientHeight as the display area.
ClientWidth and Clientheight is automatically set.
I want child form to use the remaining area (other then toolbar) for display purpose.
MDI child windows are children of the MDI client window, that's the window that you refer to as the 'remaining area'. Hence they cannot go above any other window parented by the form, like controlbars, toolbars, panels etc.. Additionally, MDI child windows are not constraint with the size of this MDI client window, you can think of the MDI client as an auto-scroll window. Child windows can be moved to overrun any of the edges and a scroll bar will appear to make it possible to restore a full view on them.
If I understand correctly what you want to do, you have to maximize the child windows. You can set the WindowState property of child windows to wsMaximized to that effect.

MDI interface with FireMonkey

Is it possible to create an MDI application using FireMonkey in a traditional sense of many documents forms/frames and one master form?
I'm specifically interested since there are no MDI controls on forms anymore.. Has it been replaced with something different?
EDIT: Adding to the question, when I create child forms they all showed separately in taskbar, even the OpenDialogs..
Here's one approach you can use:
1) Create your individual forms as normal, except use a TLayout, call it "LayoutMain", (aligned alClient) as the parent of all controls on that form.
2) On your "master form", when you want to bring a form instance in to behave as it would as an MDI interface, create a TLayout (call it "FormContainer" or something), place as a child of that (aligned to top) another TLayout (call it "FormHeader"), containing the individual controls for the Form Caption, the Minimize/Maximize/Close buttons and anything else you'd like on the "frame" heading. This is called a Composite.
3) Create an instance of your child form (but don't show it), then parent that instance's primary TLayout "LayoutMain" to your main form's TLayout "FormContainer".
4) On the TLayout previously mentioned (with the name "FormHeader"), give it OnMouseDown and OnMouseMove events to provide the ability to drag it around the Master Form.
When you want to maximize the child form inside the master form, you'd just set the outer TLayout "FormContainer" align property to alClient, remembering to store its original Top, Left, Width and Height values within the the form's instance so you can recall them when pressing the Restore button.
True, this is a fairly involved solution, but to the very best of my knowledge this is the only way you're going to achieve what you're trying to do with FireMonkey as it exists today (circa Update 2).
I wouldn't expect Embarcadero to provide any form of MDI emulation as part of FireMonkey "out of the box", as MDI is considered an old-fashioned approach.
The more modern solution would be to use Docking, as the RAD Studio IDE itself does. This provides the very best of both worlds, giving the user the freedom to choose what child forms they want to link into the master form, or display outside of that on their own (or any combination of docked arrangements).

Bring modeless form with WindowState=wsNormal behind MdiChild?

Is it possible to show a modeless "wsNormal" WindowsState form behind a MDIChild form? I want to create a NOTE form which is always behind other forms (but always in front of the MDI form), unless you bring it to the front. E.g when you click on it.
That's technically impossible for window that is not an child of the MDI container.
The MDI children are child windows of the MDI container which is a child of the main form. If a window is in front of the main form, then it is in front of the MDI children. If it is behind the main form, then it is behind the MDI children.
Normally no, MDI parent is the root parent of MDI childs, you're either below the MDI parent or above. But you can set the parent of your top-level form to be the MDICLIENT.
I wouldn't suggest this approach as it possibly would have complications (maybe(?) you can achieve the same effect by tweaking some other MDI client class). But if you want to try what it would look like create a new "MDI Application" project and change the code that runs from the Help->About menu item to:
procedure TMainForm.HelpAbout1Execute(Sender: TObject);
begin
// AboutBox.ShowModal;
windows.SetParent(AboutBox.Handle, ClientHandle);
AboutBox.Show;
SetWindowPos(AboutBox.Handle, HWND_BOTTOM, 0, 0, 0, 0,
SWP_NOSIZE or SWP_NOMOVE);
end;

Moving a MDI Form inside a form

hi
I have a form in which i placed another form as MDI ,on moving the MDI form (Top,Bottom,Left,Right)it goes inside the boundaries of main form so the Mdi gets hidden.
i want to restrict the MDI form to move when it touches the form boundaries.
You need to capture the OnMove event for your child forms, and in that handler you need to make sure your child form's window rect is within the parent's boundary. If not you need to adjust the location of the child form.
An example of how to do this can be found here.

Resources