Jump to content

Renaming form in ObjectInspector

Recommended Posts

This is same problem from 2.x version, but it's worse now, then it was possible to fix it with editing .sfm file, now only solution is to delete form and start again :(

Anyway, just add one form to project (main), then go to File/New/New form, when prompted name it SecondForm, form is created. 

Save project, go to SecondForm, in ObjectInspector change Name to frmSecond, save and project becomes uncompilable.

Link to post
Share on other sites
  • Administrators
4 hours ago, IgorSavkic said:


Does this happen with a certain project or are you able to reproduce this from scratch with a new project? I have problems reproducing this from a new project. If it's only in a certain project, can you send the zip to jt at smartmobilestudio.com?

Link to post
Share on other sites
  • Administrators
1 hour ago, IgorSavkic said:

I'm using version 3.02.20, for me SMSUpdate says there's no development channel available so cannot try anything newer.

Anyway, try AfterRename, that is the state of the project when error starts to happen.

I couldn't reproduce this with either. What I need are clear steps to reproduce this with the BeforeRename-project. When I can do that, then I can run the IDE in Delphi to find out what goes wrong.

So, something like this:

  1. Extract BeforeRename to a new folder
  2. Start SMS ide
  3. Open BeforeRename-project
  4. ???
  5. ???
  6. ???
  7. Press enter -> Boom.
Link to post
Share on other sites
  • Administrators

I'm starting to get an idea of where the problem is. But before I can fix this, I'd like to ask you guys for your opinion on what the expected behavior should be. Because currently the renaming happens differently in the Property Inspector and Project Manager:

  • Through Project manager:
    • Form class is changed
    • Unit name is changed
    • File name is changed
  • Through Property Inspector:
    • Form class is changed
    • Unit name is NOT changed
    • File name is NOT changed

Should I make both behave the same way or do you guys see an advantage in these behaving differently? Please let me know.

Link to post
Share on other sites
  • Moderators

This behaviour is not limited to Forms but to other classes as well 

For example: Looking at the 'unit structure' tab with the SmartCL.Borders unit open, I can rename the TW3Border class to something else

For Forms I don't see any advantage of changing a form class and not change the unit and filename, but for other object classes changing the class name only is somewhat handy

(although a search and replace old/new classname will have the same effect)

Link to post
Share on other sites

> Through Project manager:  Through Property Inspector

I think SMS in this should behave as Delphi.

Project manager operates on units, so it will display unit name (for example MainForm.pas) and renaming there, renames unit.

Object/Property inspector operates on components, so changing form name just does that, changes form name and class, unit is unaffected.

For forms units I do like to have a different unit name and a different form name, for example I prefix all controls with it's type abbreviation, something like:

	FormControl: frmSettings
   		Panel: pnlMain
      		ListBox: lbItems
   		Panel: pnlRight
			ListBox: lbCategories
		Panel: pnlBottom
			Button: btnOK
			Button: btnCancel



Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...