* * *

Author Topic: Problems with application design in a single window  (Read 958 times)

iversen

  • New member
  • *
  • Posts: 6
Problems with application design in a single window
« on: March 06, 2018, 10:47:20 am »
Good Morning,
I write because although I have been using Lazarus for some time, there is one thing I have not done correctly:
I come from Delphi, where the forms of my project were nested in the main form. Here I find that by default it does not work like this, but that the forms are "free" and open in different windows, which I do not end up liking.
There is an option that solves this a bit, put the forms inside a panel and "open them in the following way":

if not assigned(Camaras) then
begin
  Camaras:= tCamaras.Create(application);
  Camaras.Parent:=panel1;
  Camaras.Show;
end
else
  Camaras.Show;

With the properties of the form "Camaras":
Align : alNone
BorderStyle: bsSizeable
FormStyle: fsNormal
WindowState: wsMaximized

Apparently the result is the desired one, however, a part of the form is not functional:
I can not write or modify the values of the text fields: Edit, MaskEdit, Memo...
However the rest of operability if it works.

How could I solve it? Do you think that my way of wanting to design the applications is not correct?
I am open to all kinds of suggestions, that improve my way of presenting the applications, since I recognize that it may be that it is vitiated by the way I worked in my previous job with Delphi and maybe it is limiting me to better solutions.

A greeting and thanks a lot.

iversen

  • New member
  • *
  • Posts: 6
Re: Problems with application design in a single window
« Reply #1 on: March 07, 2018, 06:17:47 pm »
Finally solved with page control (MultiDoc Component is another nice solution).

Best Regards

jamie

  • Hero Member
  • *****
  • Posts: 709
Re: Problems with application design in a single window
« Reply #2 on: March 17, 2018, 01:11:17 am »
I have done the same and had issues with the standard froms not behaving correctly..

 What you are after is the old style MDI interface. (multiple document interface)

 What I did was use the WINDOWS.SetParent function instead of using the Parent Property
because it seems the form has not yet gotten a handle, in other words it's coming in late.

 Also, I had to fix the part where you minimize the forms to the bottom, if you change the
Panel size while the forms are minimized, they will not follow if you enlarge the panel, I had to
correct that in the Panel.OnSize event.

 But all in all I have a MDI looking app  :D

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus