Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-07

Changeability of Lazarus Project1 , Unit1 and Form1 names (3) .

3 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Mehmet Erol Sanliturk

Dear Mattias ,

Giving initial names at the beginning it is not very difficult . I may think an approach as follows :

(A)

From Lazarus IDE , from "File" , when "New Form" is selected , the Lazarus may

(i) generate a name as usual ,
(ii) display a dialog box to allow the user to change this name with an editable field and generated name as default , or
(iii) the programmer only clicks ok to accept the default .

The above process may be made a procedure ,
for example "Get_Initial_Form_Name" .

(B)

From Lazarus IDE , from "File" , when "New Unit" is selected , the Lazarus may

(i) generate a name as usual ,
(ii) display a dialog box to allow the user to change this name with an editable field and generated name as default , or
(iii) the programmer only clicks ok to accept the default .

The above process may be made a procedure ,
for example "Get_Initial_Unit_Name" .

From this "Get_Initial_Form_Name" may be called .

(C)

From Lazarus IDE , from "Project" menu , when "New Project" and "Application"
from "Create a new project" dialog is selected

the Lazarus may

(i) generate a name as usual ,
(ii) display a dialog box to allow the user to change this name with an editable field and generated name as default , or
(iii) the programmer only clicks ok to accept the default ,

The above process may be made a procedure ,
for example "Get_Initial_Project_Name" .

From this "Get_Initial_Unit_Name" may be called .

The above steps may supply the initial names .

(D)

Changing of names , as you said remains a to do ,
over time it may be completed one by one .

Thank you very much ,

Mehmet Erol Sanliturk

Reply by email

Gerard N/A
to Mattias Gärtner
Mattias G?rtner wrote 8 lines
About name clashing: I agree, that the IDE should check if the file exists (unit1.pas) and automatically use the next unitname (unit2, unit3, ...). The problem is here: When you create a new project, the IDE has no directory to test, so it automatically creates project1 and unit1, because in a new project there are no name clashes. Ideas?

We could do it the way Visual Studio and the latest Delphi IDEs work. When creating a new project, you get a dialog wich prompts for the project name and project location.
The path is relative to a certain directory (by default your /home/my documents directory + /BSDprojects, IIRC), and the final directory name changes as you edit the project name. So the project "MyFirstProject" goes into "c:\documents and
settings...\BSDProjects\MyFirstProject", wich is created automatically. You can also specify a name for the directory that doesn't match the project file name..
If the directory already exists, you get a message and have to confirm that you want to use it.
That would involve adding new IDE configuration option (the base projects directory path).
I think this is a clean, practical way.

Best regards,

Gerard.

Reply by email