PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: James Fuller on February 12, 2010, 07:59:11 AM

Title: Rename a Form
Post by: James Fuller on February 12, 2010, 07:59:11 AM

If I rename a form in the properties window will it change the name in all the code or do I have to do a find/replace action in the code window?

I did a search but couldn't figure out how to bring up the particular topic I wanted to view?

James
Title: Re: Rename a Form
Post by: Paul Squires on February 12, 2010, 08:51:27 AM
Renaming a form will not automatically change the name of all existing message handlers that exist in your code. This feature has been on the wish list for a while now... I just haven't implemented code for it yet.  :)
Title: Re: Rename a Form
Post by: Eddy Van Esch on October 23, 2013, 03:36:22 PM
Hi Paul,

I would like to pick up this thread again.
I have a project with multiple forms in full development. I need to rearrange and change some forms. In the process I would like to change the name of a form. Say I want to change the name of form TBMAIN into TBSTART
I was thinking. If I :
- do a Search and Replace from within FireFly changing TBMAIN into TBSTART in the "Entire Project". This will take care of all the handles, callback function names of the form and the controls.
- change the filename of the form TBMAIN.frm into TBSTART.frm
- in the *.ffp file do a Search and Replace changing TBMAIN into TBSTART.

Would that work or would that break some of FF's under-the-hood stuff for this project?

Kind regards

Title: Re: Rename a Form
Post by: Paul Squires on October 23, 2013, 05:51:39 PM
Hi Eddy - that process should work fine. BTW, FireFly does change the message handler names when the Form name changes. That was implemented some time ago (version 3.08, June 8, 2010).

Title: Re: Rename a Form
Post by: Eddy Van Esch on October 23, 2013, 05:59:35 PM
Thanks, Paul.
Quote from: TechSupport on October 23, 2013, 05:51:39 PM
FireFly does change the message handler names when the Form name changes.
But I assume that FF does not change the calls to those message handlers or control handles?
As in:

sTxt = FF_ListBox_GetText( HWND_TBMAIN_LISTBOXOUTPUT, i )
PostMessage HWND_TBMAIN, %WM_USER_SETFOCUS, HWND_TBMAIN_LISTBOXOUTPUT, 0

Kind regards
Title: Re: Rename a Form
Post by: Paul Squires on October 24, 2013, 08:25:30 AM
Hi Eddy, yes, you are correct. FF does not change those types of calls. It only changes the message handler itself.
Title: Re: Rename a Form
Post by: Eddy Van Esch on October 24, 2013, 08:43:38 AM
Thanks for confirming, Paul!

Kind regards