Recent

Author Topic: [Solved] Multiple files one form?  (Read 3370 times)

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
[Solved] Multiple files one form?
« on: July 15, 2015, 03:19:00 pm »
Here's a stupid question: How do I use multiple source files with a single form?

This project includes a variety of functionality and for peace of mind and keeping things sorted, I want to separate functionality into different files.

But I don't know how to go about it.

I have a tabsheet, and functionality on each sheet should be handled in a separate file.
« Last Edit: July 16, 2015, 09:08:10 pm by Trenatos »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12942
  • FPC developer.
Re: Multiple files one form?
« Reply #1 on: July 15, 2015, 04:08:23 pm »
The common way of doing this is to divide the form up into TFrames, and then combine them into a form.

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
Re: Multiple files one form?
« Reply #2 on: July 15, 2015, 04:58:09 pm »
Ok, I'll look into TFrames.

Got a link to an example that uses separate files for each frame?

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Multiple files one form?
« Reply #3 on: July 15, 2015, 06:52:49 pm »
You've clearly never used TFrames at all.

You'll discover that using the standard way to create a new frame (File->New...->Frame) the Lazarus IDE creates a new file for the frame automatically (usually named Unitnn, where nn is the next unused number of your numbered unit names - you can, of course rename it to something else).

i.e. each frame has its own unit created by the IDE (which is stored in its own file separate from other units).

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
Re: Multiple files one form?
« Reply #4 on: July 16, 2015, 05:24:37 pm »
I have never used them, no.

Looks exactly like what I need, thanks guys!

Trenatos

  • Hero Member
  • *****
  • Posts: 540
    • MarcusFernstrom.com
Re: Multiple files one form?
« Reply #5 on: July 16, 2015, 09:07:55 pm »
I just tried TFrame, and it works perfectly and does exactly what I want, thank you guys!

 

TinyPortal © 2005-2018