.... And it's rises a question if it's even worth to use frames or i can use forms instead? Why should i use frames?
It’s doable but placing a form on another form is not an easy task, let alone 5 or 6 like I do. for complex GUI interfaces, another form may be a better approach.
[/obvious statement begin]
You can put all of the classes and frame code in Main but you will end up with a big pas file that will be harder to manage. By breaking code up into modules, this helps to both reduce the main file size and allow code reusability.
[/obvious statement end]
A frame can be though as a visible component that can include several pascal components that work together or as I use them, a visible interface to my Class. For reusability (just like components), the simpler the frame, the more projects it will fit and can be dropped onto. It also can be used several times in the same project on different forms/tabs when designed correctly.
As an example, I have a frame that includes 8 check boxes that act as a GUI bits => number convertor. The labels of the check boxes can be set by the client with a CSV string during run time so each frame is custom and the concepts/process of "Bit weighted values" can be hidden from the end user.
For you, your "search frame" may include case sensitive and whole word options later. You have the choice to add GUI elements to support these options or just set these “search frame“ parameters from the client. Either way, the code to handle these new options is self contained in your frame unit and your client can remain untouched.
In my case, I will create a class for a complex hardware subsystem for other team members to use. This class handles the hardware elements and helps to simplify their GUI interface code. For standard CYA operation mode, I will include a separate debug frame that I can drop on my debug viewer that can monitor how they are using the class and verify it is working as expected and/or I can advise them on something that is not being done correctly on their side as a client. With the setting of a (frame).debug_mode=true property, this frame displays “set controls” so I can use on the Class with edge case parameters or I can use to test the hardware’s self protection controls itself by bypassing the Class's protection code.
MAS