Author Topic: One Window APP Concept: TNotebook, TFrames and TForms.  (Read 1849 times)


  • Jr. Member
  • **
  • Posts: 85
One Window APP Concept: TNotebook, TFrames and TForms.
« on: November 21, 2021, 08:27:04 am »

I'm trying to understand the correct way to an application with a single-window that has a "home" button to go back to the main form. Ex: Discord, Telegram, Skype etc. So, lets go:

My question is to make all Units as Frames to use in a TFrame on Main Form, or even in a TNotebook, or TForms and use it inside a TPanel, TNotebook, or other TWinControl.

I always thought that the correct way is using Form and embed it somewhere, and the Frames was only to use a set of components until I saw some thread about the use of both, but now looking at the Wiki I get more confused than before:

What can they be used for?

They are needed when you have a group of components that you want to reuse on multiple forms.

It looks like the Frames were built to reuse components in different parts of the application.
I'm not sure about the performance and memory of an application with 1000 or 2000 Frames full of components and with thousand of lines of code on each like we do with Forms.

What do you guys recommend?

Also, how is named an application like that? MDI, SDI, MFI?
Lazarus 2.0.12 r64642 FPC 3.2.0 x86_64-win64-win32/win64/Manjaro KDE 21
AMD Ryzen 3 1300X Quad-Core Processor 3.50 GHz / 8,00 GB RAM / GTX 1500 TI / 2TB M.2 NVMe


  • Hero Member
  • *****
  • Posts: 4582
Re: One Window APP Concept: TNotebook, TFrames and TForms.
« Reply #1 on: November 21, 2021, 12:44:04 pm »
Frames are a design time tool. They allow you to build a layout of controls much like a template, one that you can reuse at any time in other projects.

  In fact the IDE can remember them do to how it can locate them for later use elsewhere.

  If you drop a frame on the form it is much like doing it manually one by one except they are hosted with a Scrolling window control that you don't really see but it's there.

 The designer allows you to attach events to these controls per form or hosted window etc. In other words, if the frame is used elsewhere in your app they get different events assigned to them...

 Just think of it of a way to create a component but not in the way they get installed.

The only true wisdom is knowing you know nothing


TinyPortal © 2005-2018