Recent

Author Topic: Lazarus MDI application.  (Read 1145 times)

BSaidus

  • Hero Member
  • *****
  • Posts: 606
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Lazarus MDI application.
« on: December 01, 2024, 02:44:23 pm »
Hello, I think there is a bug, or non finished work on MDI application in lazarus/fpc.
  for Exemple, I can not make a child (form)window in the sametime 
    Formstyle = fsMDIChild & disable the maximize button & borderstyle to BorderStyle
i.e
 This combinaison of params do not work ( it take only the first one).
 self.FormStyle := fsMDIChild;
 self.BorderStyle := bsSingle;
 self.BorderIcons := [biSystemMenu, biMinimize];

So I wonder on how to make my child form not sizable and disactivate the maximize button and letting this form to be MDIChid.

Thank you.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Lazarus MDI application.
« Reply #1 on: December 01, 2024, 04:17:03 pm »
Why not simply control the constraints in the OnConstraintResize event ?
The only true wisdom is knowing you know nothing

BSaidus

  • Hero Member
  • *****
  • Posts: 606
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Lazarus MDI application.
« Reply #2 on: December 01, 2024, 05:01:30 pm »
Why not simply control the constraints in the OnConstraintResize event ?
I did it, but the maximise button still visible, even when I use api windows to disactivate it, the MDIChild flag disapeare.
thanks.
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Lazarus MDI application.
« Reply #3 on: December 01, 2024, 05:07:17 pm »
you can make a customized window by using a TFRame.

It will require you to draw your own border etc., but You can place a TPanel at the top with your own controls and manage the sizing of the window yourself.

 the Work area, being the client can be another TPanel and so on.

 what you don't get out of this is any menus that normally get attached to the Main parent window.

 It's your choice but normally MDIchilds require those icons.
The only true wisdom is knowing you know nothing

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Lazarus MDI application.
« Reply #4 on: December 01, 2024, 05:28:08 pm »
You can try removing the "WS_MaximizeBox" using the GetWindowLongPtr and SetWindowLowPtr to change the value of the Window Style Field.

  You first need to read it and then XOR the bit out.

 jamie
The only true wisdom is knowing you know nothing

BSaidus

  • Hero Member
  • *****
  • Posts: 606
  • lazarus 1.8.4 Win8.1 / cross FreeBSD
Re: Lazarus MDI application.
« Reply #5 on: December 01, 2024, 05:38:45 pm »
You can try removing the "WS_MaximizeBox" using the GetWindowLongPtr and SetWindowLowPtr to change the value of the Window Style Field.

  You first need to read it and then XOR the bit out.

 jamie

I did it, but when using this, the form will not be mdichild
lazarus 1.8.4 Win8.1 / cross FreeBSD
dhukmucmur vernadh!

jamie

  • Hero Member
  • *****
  • Posts: 6791
Re: Lazarus MDI application.
« Reply #6 on: December 01, 2024, 05:50:53 pm »
Do remember that MDI only works with windows, I don't think other widgets support it.

So maybe consider making a custom borderless form which you can make a child of the MDI and add a TPANEL at the top for a Menu bar and another TPANEL as the client area.

 At least with that, if you wanted to, you could make an MDI app that basically cross the pond useable.


P.S.
 I suppose you could always capture the NC_Paint message and paint over the ICON since you know how to disable the max size.
 You can get the ICON info from the system to obtain the size etc.

« Last Edit: December 01, 2024, 05:53:29 pm by jamie »
The only true wisdom is knowing you know nothing

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11992
  • FPC developer.
Re: Lazarus MDI application.
« Reply #7 on: December 01, 2024, 10:39:14 pm »
Afaik with Lazarus MDI first worked with QT.  Some work was done for Win32/GDI too, but I don't know if it works.

Fred vS

  • Hero Member
  • *****
  • Posts: 3464
    • StrumPract is the musicians best friend
Re: Lazarus MDI application.
« Reply #8 on: December 02, 2024, 11:25:21 am »
For MDI application, mseide-msegui is the champion (and for many other things, if not all).  :-X
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

 

TinyPortal © 2005-2018