Silver Black 23 Posted January 28, 2019 Is there a quick and clean way to creatro auto-snapping forms (that stick to each others) without using subclassing? I've found a way but only with subclassing and I'd like to know if new Rio 10.3 VLC could allow something like that and not to screen borders only. Share this post Link to post
PeterBelow 238 Posted January 28, 2019 What is build into the VCL is the drag and dock support also used by the RAD Studio IDE, the "snap to border" functionality is something different. If none of these two features match your need you have to build you own, which you seem to have done now. Do you know you can use inheritance with forms as well? Build a base form class with the functionality you need, add it to any new project you need this functionality in and then create new forms in the designer by using File -> New -> Others, and pick the base class from the "inheritable items" section. Just changing the ancestor class from TFrom to your base class in the editor does not work directly, since forms have associated DFM files. You would also need to edit the DFM file as text and change the first "object" to "inherited" for this to work. Share this post Link to post
dummzeuch 1505 Posted January 28, 2019 (edited) 38 minutes ago, PeterBelow said: What is build into the VCL is the drag and dock support also used by the RAD Studio IDE Unfortunately not. It's the very basic (and buggy) docking support that was used in Delphi 7 and earlier. The new one is much better but sadly not part of the standard VCL. (I filed a bug report on that already.) Edited January 28, 2019 by dummzeuch Share this post Link to post
Silver Black 23 Posted January 29, 2019 10 hours ago, PeterBelow said: What is build into the VCL is the drag and dock support also used by the RAD Studio IDE, the "snap to border" functionality is something different. If none of these two features match your need you have to build you own, which you seem to have done now. Do you know you can use inheritance with forms as well? Build a base form class with the functionality you need, add it to any new project you need this functionality in and then create new forms in the designer by using File -> New -> Others, and pick the base class from the "inheritable items" section. Just changing the ancestor class from TFrom to your base class in the editor does not work directly, since forms have associated DFM files. You would also need to edit the DFM file as text and change the first "object" to "inherited" for this to work. Thanks,, but I didn't ask about how to inherit a form functionality to a new form, but HOW to implement that functionality! For now I can do that with subclassing, I just wondered if there is a more hi-level method. Share this post Link to post