mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-23 18:20:00 +02:00
MG: fixed autocreate form editing in project opts
git-svn-id: trunk@1593 -
This commit is contained in:
parent
77b21590ad
commit
d22da79b0b
@ -27,22 +27,20 @@
|
||||
|
||||
ToDo:
|
||||
- many things, search for 'ToDo'
|
||||
- Examples:
|
||||
- @ operator
|
||||
+ Func -> FuncResult Type
|
||||
OR in Delphi -> Func type
|
||||
+ @Func -> Func type
|
||||
+ @Data -> Pointer
|
||||
- 'inherited'
|
||||
- variants
|
||||
- interfaces
|
||||
- Get and Set property access parameter lists
|
||||
- ignore error after cursor position
|
||||
- predefined funcs Pred, Succ, Val, Low, High
|
||||
- find declaration in dead code
|
||||
- operator overloading
|
||||
- ppu, ppw, dcu files
|
||||
|
||||
- @ operator
|
||||
+ Func -> FuncResult Type
|
||||
OR in Delphi -> Func type
|
||||
+ @Func -> Func type
|
||||
+ @Data -> Pointer
|
||||
- 'inherited'
|
||||
- variants
|
||||
- interfaces
|
||||
- Get and Set property access parameter lists
|
||||
- ignore error after cursor position
|
||||
- predefined funcs Pred, Succ, Val, Low, High
|
||||
- find declaration in dead code
|
||||
- operator overloading
|
||||
- ppu, ppw, dcu files
|
||||
}
|
||||
unit FindDeclarationTool;
|
||||
|
||||
|
@ -800,6 +800,7 @@ var Position: integer;
|
||||
s:string;
|
||||
var MainBeginNode: TCodeTreeNode;
|
||||
begin
|
||||
BuildTree(false);
|
||||
Result:=TStringList.Create;
|
||||
MainBeginNode:=FindMainBeginEndNode;
|
||||
if MainBeginNode=nil then exit;
|
||||
@ -837,6 +838,7 @@ var Position, InsertPos, i, ColonPos, Indent: integer;
|
||||
begin
|
||||
Result:=false;
|
||||
if (List=nil) or (SourceChangeCache=nil) then exit;
|
||||
BuildTree(false);
|
||||
// first delete all CreateForm Statements
|
||||
SourceChangeCache.MainScanner:=Scanner;
|
||||
MainBeginNode:=FindMainBeginEndNode;
|
||||
|
@ -973,7 +973,10 @@ begin
|
||||
//writeln('[TOIPropertyGrid.SetBounds] ',Name,' ',aLeft,',',aTop,',',aWidth,',',aHeight,' Visible=',Visible);
|
||||
inherited SetBounds(aLeft,aTop,aWidth,aHeight);
|
||||
if Visible then begin
|
||||
SplitterX:=SplitterX;
|
||||
if (SplitterX<5) and (aWidth>20) then
|
||||
SplitterX:=100
|
||||
else
|
||||
SplitterX:=SplitterX;
|
||||
AlignEditComponents;
|
||||
end;
|
||||
end;
|
||||
|
@ -36,7 +36,8 @@ interface
|
||||
uses
|
||||
Classes, SysUtils, LCLLinux, Forms, Controls, Buttons, StdCtrls, ComCtrls,
|
||||
ExtCtrls, Menus, LResources, Graphics, Dialogs, ImgList, SynEdit, XMLCfg,
|
||||
DefineTemplates, CodeToolManager, CodeToolsOptions, CodeToolsDefPreview;
|
||||
DefineTemplates, CodeToolManager, CodeToolsOptions, CodeToolsDefPreview,
|
||||
InputFileDialog;
|
||||
|
||||
type
|
||||
TCodeToolsDefinesEditor = class(TForm)
|
||||
@ -715,9 +716,24 @@ end;
|
||||
|
||||
procedure TCodeToolsDefinesEditor.InsertDelphi5DirectoryTemplateMenuItemClick(
|
||||
Sender: TObject);
|
||||
var InputFileDlg: TInputFileDialog;
|
||||
begin
|
||||
InsertTemplate(Boss.DefinePool.CreateDelphi5DirectoryTemplate(
|
||||
SetDirSeparators('/Borland/Delphi5')));
|
||||
InputFileDlg:=GetInputFileDialog;
|
||||
with InputFileDlg do begin
|
||||
BeginUpdate;
|
||||
Caption:='Create Defines for Delphi5 Directory';
|
||||
FileCount:=1;
|
||||
FileTitles[0]:='Delphi5 directory';
|
||||
FileDescs[0]:='The Delphi5 main directory,'#13
|
||||
+'where Borland has installed all Delphi5 sources.'#13
|
||||
+'For example: C:/Programme/Borland/Delphi5';
|
||||
FileNames[0]:=SetDirSeparators('C:/Programme/Borland/Delphi5');
|
||||
FileFlags[0]:=[iftDirectory,iftNotEmpty];
|
||||
EndUpdate;
|
||||
if ShowModal=mrCancel then exit;
|
||||
InsertTemplate(Boss.DefinePool.CreateDelphi5DirectoryTemplate(
|
||||
FileNames[0]));
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TCodeToolsDefinesEditor.InsertDelphi5ProjectTemplateMenuItemClick(
|
||||
|
@ -377,7 +377,8 @@ function FilenameIsPascalSource(const Filename: string): boolean;
|
||||
var Ext: string;
|
||||
begin
|
||||
Ext:=lowercase(ExtractFileExt(Filename));
|
||||
Result:=(Ext='.pp') or (Ext='.pas') or (Ext='.dpr') or (Ext='.dpk');
|
||||
Result:=(Ext='.pp') or (Ext='.pas') or (Ext='.lpr')
|
||||
or (Ext='.dpr') or (Ext='.dpk');
|
||||
end;
|
||||
|
||||
function FilenameIsPascalUnit(const Filename: string): boolean;
|
||||
|
18
ide/main.pp
18
ide/main.pp
@ -1686,7 +1686,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuOpenClicked(Sender : TObject);
|
||||
var OpenDialog:TOpenDialog;
|
||||
var OpenDialog: TOpenDialog;
|
||||
AFilename: string;
|
||||
I : Integer;
|
||||
begin
|
||||
@ -2020,7 +2020,11 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuProjectOptionsClicked(Sender : TObject);
|
||||
var
|
||||
ActiveSrcEdit: TSourceEditor;
|
||||
ActiveUnitInfo: TUnitInfo;
|
||||
begin
|
||||
BeginCodeTool(ActiveSrcEdit, ActiveUnitInfo, false);
|
||||
if ShowProjectOptionsDialog(Project1)=mrOk then begin
|
||||
|
||||
end;
|
||||
@ -2581,9 +2585,10 @@ writeln('TMainIDE.ShowSaveFileAsDialog C ',ResourceCode<>nil);
|
||||
ResourceCode:=CodeToolBoss.FindNextResourceFile(NewSource,LinkIndex);
|
||||
|
||||
// change unitname on SourceNotebook
|
||||
SourceNoteBook.NoteBook.Pages[SourceNoteBook.NoteBook.PageIndex]:=
|
||||
CreateSrcEditPageName(NewUnitName,NewFilename,
|
||||
SourceNoteBook.NoteBook.PageIndex);
|
||||
if AnUnitInfo.EditorIndex>=0 then
|
||||
SourceNoteBook.NoteBook.Pages[AnUnitInfo.EditorIndex]:=
|
||||
CreateSrcEditPageName(NewUnitName,NewFilename,
|
||||
SourceNoteBook.NoteBook.PageIndex);
|
||||
|
||||
Result:=mrOk;
|
||||
end;
|
||||
@ -3032,7 +3037,7 @@ begin
|
||||
if NewFilename='' then
|
||||
NewFilename:='project1';
|
||||
Ext:=lowercase(ExtractFileExt(NewFilename));
|
||||
if (Ext='') or FilenameIsPascalUnit(NewFilename) or (Ext='.dpr') then
|
||||
if (Ext='') or FilenameIsPascalSource(NewFilename) then
|
||||
NewFilename:=ChangeFileExt(NewFilename,'.lpi');
|
||||
SaveDialog.FileName:=NewFilename;
|
||||
|
||||
@ -6201,6 +6206,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.272 2002/04/05 16:34:13 lazarus
|
||||
MG: fixed autocreate form editing in project opts
|
||||
|
||||
Revision 1.271 2002/04/04 17:21:17 lazarus
|
||||
MG: fixed outputfilter for linker errors
|
||||
|
||||
|
@ -92,7 +92,7 @@ begin
|
||||
try
|
||||
FileVersion:=XMLConfig.GetValue('MiscellaneousOptions/Version/Value',0);
|
||||
|
||||
if FileVersion<MiscOptsVersion then
|
||||
if (FileVersion<MiscOptsVersion) and (FileVersion<>0) then
|
||||
writeln('Note: converting old miscellaneous options ...');
|
||||
|
||||
BuildLazOpts.Load(XMLConfig,'MiscellaneousOptions/BuildLazarusOptions/');
|
||||
|
@ -1,3 +1,4 @@
|
||||
{ $Id$ }
|
||||
{
|
||||
/***************************************************************************
|
||||
project.pp - project utility class file
|
||||
@ -1353,6 +1354,9 @@ end.
|
||||
|
||||
{
|
||||
$Log$
|
||||
Revision 1.60 2002/04/05 16:34:16 lazarus
|
||||
MG: fixed autocreate form editing in project opts
|
||||
|
||||
Revision 1.59 2002/04/04 17:21:18 lazarus
|
||||
MG: fixed outputfilter for linker errors
|
||||
|
||||
|
@ -67,13 +67,13 @@ type
|
||||
procedure SetProject(AProject: TProject);
|
||||
procedure SetupApplicationPage;
|
||||
procedure SetupFormsPage;
|
||||
function GetAutoCreatedFormsList: TStrings;
|
||||
procedure FillAutoCreateFormsListbox;
|
||||
procedure FillAvailFormsListBox;
|
||||
function IndexOfAutoCreateForm(FormName: string): integer;
|
||||
function FirstAutoCreateFormSelected: integer;
|
||||
function FirstAvailFormSelected: integer;
|
||||
procedure SelectOnlyThisAutoCreateForm(Index: integer);
|
||||
function GetAutoCreatedFormsList: TStrings;
|
||||
procedure SetAutoCreateForms;
|
||||
public
|
||||
constructor Create(AOwner: TComponent); override;
|
||||
@ -378,8 +378,11 @@ function TProjectOptionsDialog.GetAutoCreatedFormsList: TStrings;
|
||||
var i, j: integer;
|
||||
begin
|
||||
if (FProject<>nil) and (FProject.MainUnit>=0) then begin
|
||||
writeln('==CCC=============================================================');
|
||||
writeln(FProject.MainUnitInfo.Source.Source);
|
||||
writeln('==DDD=============================================================');
|
||||
Result:=CodeToolBoss.ListAllCreateFormStatements(
|
||||
FProject.Units[FProject.MainUnit].Source);
|
||||
FProject.MainUnitInfo.Source);
|
||||
if Result<>nil then begin
|
||||
// shorten lines of type 'FormName:TFormName' to simply 'FormName'
|
||||
for i:=0 to Result.Count-1 do begin
|
||||
@ -391,6 +394,7 @@ begin
|
||||
Result[i]:=copy(Result[i],1,j-1);
|
||||
end;
|
||||
end;
|
||||
writeln('BBB1 ',Result[i]);
|
||||
end;
|
||||
end;
|
||||
end else begin
|
||||
@ -578,11 +582,15 @@ begin
|
||||
try
|
||||
for i:=0 to FormsAutoCreatedListBox.Items.Count-1 do begin
|
||||
NewList.Add(FormsAutoCreatedListBox.Items[i]);
|
||||
writeln('AAA3 ',i,' ',NewList[i]);
|
||||
end;
|
||||
if not CodeToolBoss.SetAllCreateFromStatements(
|
||||
Project.Units[Project.MainUnit].Source, NewList) then begin
|
||||
// ToDo: print a message
|
||||
end;
|
||||
writeln('==EEE=============================================================');
|
||||
writeln(FProject.MainUnitInfo.Source.Source);
|
||||
writeln('==FFF=============================================================');
|
||||
finally
|
||||
NewList.Free;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user