mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-08 09:20:49 +02:00
Removed global unit.
Removed and commented all references to TUnitInfo. git-svn-id: trunk@151 -
This commit is contained in:
parent
5ea2433be7
commit
e953bd0e5a
297
ide/main.pp
297
ide/main.pp
@ -30,7 +30,7 @@ interface
|
|||||||
|
|
||||||
uses
|
uses
|
||||||
Classes, LclLinux, compiler, stdctrls, forms, buttons, menus, comctrls,
|
Classes, LclLinux, compiler, stdctrls, forms, buttons, menus, comctrls,
|
||||||
Spin, project,sysutils, global,
|
Spin, project,sysutils,
|
||||||
compileroptions, Controls, graphics, extctrls, Dialogs, dlgMEssage,
|
compileroptions, Controls, graphics, extctrls, Dialogs, dlgMEssage,
|
||||||
process, idecomp, Find_dlg, FormEditor, AbstractFormEditor,
|
process, idecomp, Find_dlg, FormEditor, AbstractFormEditor,
|
||||||
CustomFormEditor,ObjectInspector, ControlSelection, PropEdits, UnitEditor,
|
CustomFormEditor,ObjectInspector, ControlSelection, PropEdits, UnitEditor,
|
||||||
@ -164,7 +164,6 @@ type
|
|||||||
fProject: TProject;
|
fProject: TProject;
|
||||||
|
|
||||||
Function CreateSeperator : TMenuItem;
|
Function CreateSeperator : TMenuItem;
|
||||||
Function ReturnActiveUnitList : TUnitInfo;
|
|
||||||
Procedure UpdateViewDialogs;
|
Procedure UpdateViewDialogs;
|
||||||
Procedure SetDefaultsForForm(aForm : TCustomForm);
|
Procedure SetDefaultsForForm(aForm : TCustomForm);
|
||||||
protected
|
protected
|
||||||
@ -183,8 +182,6 @@ type
|
|||||||
|
|
||||||
procedure LoadMainMenu;
|
procedure LoadMainMenu;
|
||||||
Procedure FormKill(Sender : TObject);
|
Procedure FormKill(Sender : TObject);
|
||||||
Procedure SetFlags(SLIst : TUnitInfo);
|
|
||||||
Procedure SetName_Form(SList : TUnitInfo);
|
|
||||||
Procedure SetDesigning(Control : TComponent; Value : Boolean);
|
Procedure SetDesigning(Control : TComponent; Value : Boolean);
|
||||||
procedure FormPaint(Sender : TObject);
|
procedure FormPaint(Sender : TObject);
|
||||||
procedure LoadResourceFromFile(Value : String);
|
procedure LoadResourceFromFile(Value : String);
|
||||||
@ -355,8 +352,6 @@ begin
|
|||||||
Notebook1.OnPageChanged := @ControlClick;
|
Notebook1.OnPageChanged := @ControlClick;
|
||||||
Notebook1.Name := 'Notebook1';
|
Notebook1.Name := 'Notebook1';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Pixmap1:=TPixMap.Create;
|
Pixmap1:=TPixMap.Create;
|
||||||
Pixmap1.TransparentColor:=clBtnFace;
|
Pixmap1.TransparentColor:=clBtnFace;
|
||||||
if not LoadResource('btn_viewunits',Pixmap1) then
|
if not LoadResource('btn_viewunits',Pixmap1) then
|
||||||
@ -397,7 +392,6 @@ begin
|
|||||||
Name := 'Speedbutton2';
|
Name := 'Speedbutton2';
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Pixmap1:=TPixMap.Create;
|
Pixmap1:=TPixMap.Create;
|
||||||
Pixmap1.TransparentColor:=clBtnFace;
|
Pixmap1.TransparentColor:=clBtnFace;
|
||||||
if not LoadResource('btn_newunit',Pixmap1) then
|
if not LoadResource('btn_newunit',Pixmap1) then
|
||||||
@ -439,8 +433,8 @@ begin
|
|||||||
Flat := true;
|
Flat := true;
|
||||||
Name := 'Speedbutton4';
|
Name := 'Speedbutton4';
|
||||||
end;
|
end;
|
||||||
//display the down arrow
|
|
||||||
|
|
||||||
|
//display the down arrow
|
||||||
Pixmap1:=TPixMap.Create;
|
Pixmap1:=TPixMap.Create;
|
||||||
Pixmap1.TransparentColor:=clBtnFace;
|
Pixmap1.TransparentColor:=clBtnFace;
|
||||||
if not LoadResource('btn_downarrow',Pixmap1) then
|
if not LoadResource('btn_downarrow',Pixmap1) then
|
||||||
@ -709,19 +703,18 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.OIOnSelectComponent(AComponent:TComponent);
|
procedure TMainIDE.OIOnSelectComponent(AComponent:TComponent);
|
||||||
var
|
var
|
||||||
Form : TCustomForm;
|
Form : TCustomForm;
|
||||||
begin
|
begin
|
||||||
Form := GetParentForm(TControl(AComponent));
|
Form := GetParentForm(TControl(AComponent));
|
||||||
//not implemented yet
|
//not implemented yet
|
||||||
TDesigner(Form.Designer).SelectOnlyThisComponent(AComponent);
|
TDesigner(Form.Designer).SelectOnlyThisComponent(AComponent);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.ToolButtonCLick(Sender : TObject);
|
Procedure TMainIDE.ToolButtonCLick(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:TOOL BUTTON CLICK!');
|
Assert(False, 'Trace:TOOL BUTTON CLICK!');
|
||||||
|
|
||||||
|
{if ComboBox1.Parent = Toolbar1 then
|
||||||
{if ComboBox1.Parent = Toolbar1 then
|
|
||||||
Begin
|
Begin
|
||||||
ComboBox1.Parent := MainIDE;
|
ComboBox1.Parent := MainIDE;
|
||||||
ComboBox1.Left := 25;
|
ComboBox1.Left := 25;
|
||||||
@ -750,19 +743,16 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.FormKill(Sender : TObject);
|
procedure TMainIDE.FormKill(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:DESTROYING FORM');
|
Assert(False, 'Trace:DESTROYING FORM');
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TMainIDE.LoadMainMenu;
|
procedure TMainIDE.LoadMainMenu;
|
||||||
var
|
var
|
||||||
|
fContext : Integer;
|
||||||
fContext : Integer;
|
R : TRect;
|
||||||
R : TRect;
|
|
||||||
begin
|
begin
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// The Menu
|
// The Menu
|
||||||
//--------------
|
//--------------
|
||||||
@ -798,11 +788,9 @@ begin
|
|||||||
mnuEnvironment.Caption := 'E&nvironment';
|
mnuEnvironment.Caption := 'E&nvironment';
|
||||||
mnuMain.Items.Add(mnuEnvironment);
|
mnuMain.Items.Add(mnuEnvironment);
|
||||||
|
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// File
|
// File
|
||||||
//--------------
|
//--------------
|
||||||
|
|
||||||
|
|
||||||
itmFileNew := TMenuItem.Create(Self);
|
itmFileNew := TMenuItem.Create(Self);
|
||||||
itmFileNew.Caption := 'New Unit';
|
itmFileNew.Caption := 'New Unit';
|
||||||
@ -835,7 +823,6 @@ begin
|
|||||||
itmFileSaveAll.Caption := 'Save All';
|
itmFileSaveAll.Caption := 'Save All';
|
||||||
mnuFile.Add(itmFileSaveAll);
|
mnuFile.Add(itmFileSaveAll);
|
||||||
|
|
||||||
|
|
||||||
itmFileClose := TMenuItem.Create(Self);
|
itmFileClose := TMenuItem.Create(Self);
|
||||||
itmFileClose.Caption := 'Close';
|
itmFileClose.Caption := 'Close';
|
||||||
itmFileClose.Enabled := False;
|
itmFileClose.Enabled := False;
|
||||||
@ -852,7 +839,6 @@ begin
|
|||||||
// Edit
|
// Edit
|
||||||
//--------------
|
//--------------
|
||||||
|
|
||||||
|
|
||||||
itmEditUndo := TMenuItem.Create(nil);
|
itmEditUndo := TMenuItem.Create(nil);
|
||||||
itmEditUndo.Caption := 'Undo';
|
itmEditUndo.Caption := 'Undo';
|
||||||
mnuEdit.Add(itmEditUndo);
|
mnuEdit.Add(itmEditUndo);
|
||||||
@ -875,10 +861,10 @@ begin
|
|||||||
itmEditPaste.Caption := 'Paste';
|
itmEditPaste.Caption := 'Paste';
|
||||||
mnuEdit.Add(itmEditPaste);
|
mnuEdit.Add(itmEditPaste);
|
||||||
|
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// Search
|
// Search
|
||||||
//--------------
|
//--------------
|
||||||
|
|
||||||
itmSearchFind := TMenuItem.Create(nil);
|
itmSearchFind := TMenuItem.Create(nil);
|
||||||
itmSearchFind.caption := 'Find';
|
itmSearchFind.caption := 'Find';
|
||||||
itmSearchFind.OnClick := @mnuSearchFindClicked;
|
itmSearchFind.OnClick := @mnuSearchFindClicked;
|
||||||
@ -889,6 +875,7 @@ begin
|
|||||||
itmSearchFindAgain.OnClick := @mnuSearchFindAgainClicked;
|
itmSearchFindAgain.OnClick := @mnuSearchFindAgainClicked;
|
||||||
itmSearchFindAgain.Enabled := False;
|
itmSearchFindAgain.Enabled := False;
|
||||||
mnuSearch.add(itmSearchFindAgain);
|
mnuSearch.add(itmSearchFindAgain);
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// View
|
// View
|
||||||
//--------------
|
//--------------
|
||||||
@ -926,7 +913,6 @@ begin
|
|||||||
itmViewColors.OnClick := @mnuViewColorClicked;
|
itmViewColors.OnClick := @mnuViewColorClicked;
|
||||||
mnuView.Add(itmViewColors);
|
mnuView.Add(itmViewColors);
|
||||||
|
|
||||||
|
|
||||||
itmViewFont := TMenuItem.Create(Self);
|
itmViewFont := TMenuItem.Create(Self);
|
||||||
itmViewFont.Caption := 'Font...';
|
itmViewFont.Caption := 'Font...';
|
||||||
itmViewFont.OnClick := @mnuViewFontClicked;
|
itmViewFont.OnClick := @mnuViewFontClicked;
|
||||||
@ -934,13 +920,11 @@ begin
|
|||||||
|
|
||||||
mnuView.Add(CreateSeperator);
|
mnuView.Add(CreateSeperator);
|
||||||
|
|
||||||
|
|
||||||
itmViewMEssage := TMenuItem.Create(Self);
|
itmViewMEssage := TMenuItem.Create(Self);
|
||||||
itmViewMessage.Caption := 'Messages';
|
itmViewMessage.Caption := 'Messages';
|
||||||
itmViewMessage.OnClick := @mnuViewMessagesClick;
|
itmViewMessage.OnClick := @mnuViewMessagesClick;
|
||||||
mnuView.Add(itmViewMessage);
|
mnuView.Add(itmViewMessage);
|
||||||
|
|
||||||
|
|
||||||
//--------------
|
//--------------
|
||||||
// Project
|
// Project
|
||||||
//--------------
|
//--------------
|
||||||
@ -997,9 +981,6 @@ begin
|
|||||||
itmEnvironmentOptions := TMenuItem.Create(nil);
|
itmEnvironmentOptions := TMenuItem.Create(nil);
|
||||||
itmEnvironmentOptions.Caption := 'Options';
|
itmEnvironmentOptions.Caption := 'Options';
|
||||||
mnuEnvironment.Add(itmEnvironmentOptions);
|
mnuEnvironment.Add(itmEnvironmentOptions);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end;
|
end;
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -1013,7 +994,6 @@ begin
|
|||||||
Result := itmSeperator;
|
Result := itmSeperator;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
procedure TMainIDE.LoadResourceFromFile(Value : String);
|
procedure TMainIDE.LoadResourceFromFile(Value : String);
|
||||||
Var
|
Var
|
||||||
Texts : String;
|
Texts : String;
|
||||||
@ -1056,16 +1036,6 @@ Begin
|
|||||||
{what now???}
|
{what now???}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TMainIDE.ReturnActiveUnitList : TUnitInfo;
|
|
||||||
var
|
|
||||||
I : Integer;
|
|
||||||
SList : TUnitInfo;
|
|
||||||
TempNum : Integer;
|
|
||||||
begin
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{Fills the View Units dialog and the View Forms dialog}
|
{Fills the View Units dialog and the View Forms dialog}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
@ -1073,10 +1043,11 @@ end;
|
|||||||
Procedure TMainIDE.UpdateViewDialogs;
|
Procedure TMainIDE.UpdateViewDialogs;
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
SList : TUnitInfo;
|
//SList : TUnitInfo;
|
||||||
Begin
|
Begin
|
||||||
ViewUnits1.Listbox1.Items.Clear;
|
ViewUnits1.Listbox1.Items.Clear;
|
||||||
ViewForms1.Listbox1.Items.Clear;
|
ViewForms1.Listbox1.Items.Clear;
|
||||||
|
{
|
||||||
For I := 0 to Project.UnitList.Count -1 do
|
For I := 0 to Project.UnitList.Count -1 do
|
||||||
Begin
|
Begin
|
||||||
SList := TUnitInfo(Project.UnitList.Items[I]);
|
SList := TUnitInfo(Project.UnitList.Items[I]);
|
||||||
@ -1084,100 +1055,38 @@ For I := 0 to Project.UnitList.Count -1 do
|
|||||||
if SList.FormName <> '' then
|
if SList.FormName <> '' then
|
||||||
ViewForms1.Listbox1.Items.Add(SList.FormName);
|
ViewForms1.Listbox1.Items.Add(SList.FormName);
|
||||||
end;
|
end;
|
||||||
|
}
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Procedure TMainIDE.SetFlags(SList : TUnitInfo);
|
|
||||||
var
|
|
||||||
Texts : String;
|
|
||||||
tempNUm1, TempNUm2 : Integer;
|
|
||||||
Begin
|
|
||||||
Assert(False, 'Trace:SList.filename = '+SList.Filename);
|
|
||||||
Texts := Uppercase(ExtractFileName(SList.Filename));
|
|
||||||
Assert(False, 'Trace:Texts := '+Texts);
|
|
||||||
tempNum1 := pos('.',Texts);
|
|
||||||
Assert(False, 'Trace:Tempnum1 = '+inttostr(tempnum1));
|
|
||||||
Texts := Copy(Texts,tempNum1+1,Length(Texts)-tempNum1);
|
|
||||||
Assert(False, 'Trace:Texts = '+Texts);
|
|
||||||
if (Texts = 'PP') or (Texts = 'PAS') then
|
|
||||||
SList.Flags := pfSource
|
|
||||||
else
|
|
||||||
if (Texts = 'LPR') or (Texts = 'DPR') then
|
|
||||||
SList.Flags := pfProject
|
|
||||||
else
|
|
||||||
SList.Flags := pfNone;
|
|
||||||
{debugging}
|
|
||||||
if SList.Flags = pfProject then
|
|
||||||
Assert(False, 'Trace:' + SLIst.FileName+' is set to pfProject')
|
|
||||||
else
|
|
||||||
if SList.Flags = pfSource then
|
|
||||||
Assert(False, 'Trace:' + SLIst.FileName+' is set to pfSource')
|
|
||||||
else
|
|
||||||
if SList.Flags = pfNone then
|
|
||||||
Assert(False, 'Trace:' + SLIst.FileName+' is set to pfNone');
|
|
||||||
|
|
||||||
end;
|
|
||||||
|
|
||||||
Procedure TMainIDE.SetName_Form(SList : TUnitInfo);
|
|
||||||
Begin
|
|
||||||
if (SList.flags = pfSource) or (SList.Flags = pfProject) then
|
|
||||||
Begin
|
|
||||||
Assert(False, 'Trace:filename is '+SList.Filename);
|
|
||||||
Assert(False, 'Trace:pos is '+inttostr(pos('.',SList.Filename)));
|
|
||||||
if pos('.',SList.Filename) > 0 then
|
|
||||||
SList.Name := Copy(ExtractFileName(SList.Filename),1,pos('.',ExtractFileName(SList.Filename))-1)
|
|
||||||
else
|
|
||||||
SList.Name := ExtractFileName(SList.Filename);
|
|
||||||
|
|
||||||
Assert(False, 'Trace:Name of new unit is '+SList.Name);
|
|
||||||
end;
|
|
||||||
|
|
||||||
if SList.flags = pfSource then
|
|
||||||
Begin
|
|
||||||
SList.FormName := ReturnFormname(SList.Source);
|
|
||||||
if SList.FormName <> '' then
|
|
||||||
SList.Flags := pfForm;
|
|
||||||
end;
|
|
||||||
Assert(False, 'Trace:Exiting SetName_Form');
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
Procedure TMainIDE.mnuToggleFormClicked(Sender : TObject);
|
Procedure TMainIDE.mnuToggleFormClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
writeln('Toggle form clicked');
|
writeln('Toggle form clicked');
|
||||||
|
|
||||||
if FCodeLastActivated then
|
if FCodeLastActivated then
|
||||||
SourceNotebook.DisplayFormforActivePage
|
SourceNotebook.DisplayFormforActivePage
|
||||||
else
|
else
|
||||||
SourceNotebook.DisplayCodeforControl(FControlLastActivated);
|
SourceNotebook.DisplayCodeforControl(FControlLastActivated);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure TMainIDE.CodeorFormActivated(Sender : TObject);
|
Procedure TMainIDE.CodeorFormActivated(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
FCodeLastActivated := (TForm(Sender) = TForm(SourceNotebook));
|
FCodeLastActivated := (TForm(Sender) = TForm(SourceNotebook));
|
||||||
if FCodeLastActivated then Writeln('TRUE') else Writeln('False');
|
if FCodeLastActivated then Writeln('TRUE') else Writeln('False');
|
||||||
|
|
||||||
FControlLastActivated := Sender;
|
FControlLastActivated := Sender;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.SetDesigning(Control : TComponent; Value : Boolean);
|
Procedure TMainIDE.SetDesigning(Control : TComponent; Value : Boolean);
|
||||||
Begin
|
Begin
|
||||||
Writeln('Setting designing');
|
Writeln('Setting designing');
|
||||||
Control.SetDesigning(Value);
|
Control.SetDesigning(Value);
|
||||||
Writeln('Set');
|
Writeln('Set');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1186,7 +1095,6 @@ Begin
|
|||||||
Result := CompilerOpts.OtherUnitFiles;
|
Result := CompilerOpts.OtherUnitFiles;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
|
|
||||||
{
|
{
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
------------------------------------------------------------------------
|
------------------------------------------------------------------------
|
||||||
@ -1275,8 +1183,7 @@ begin
|
|||||||
Writeln('*****************ERROR - Control '+'GlobalMouseSpeedButton'+inttostr(Notebook1.Pageindex)+' not found');
|
Writeln('*****************ERROR - Control '+'GlobalMouseSpeedButton'+inttostr(Notebook1.Pageindex)+' not found');
|
||||||
|
|
||||||
end;
|
end;
|
||||||
Writeln('Exiting ControlClick');
|
Writeln('Exiting ControlClick');
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -1291,6 +1198,7 @@ begin
|
|||||||
Result:=nil;
|
Result:=nil;
|
||||||
end;
|
end;
|
||||||
}
|
}
|
||||||
|
|
||||||
{procedure TMainIDE.SelectOnlyThisComponent(AComponent:TComponent);
|
{procedure TMainIDE.SelectOnlyThisComponent(AComponent:TComponent);
|
||||||
var
|
var
|
||||||
CurDesigner:TDesigner;
|
CurDesigner:TDesigner;
|
||||||
@ -1307,12 +1215,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TMainIDE.mnuNewFormClicked(Sender : TObject);
|
procedure TMainIDE.mnuNewFormClicked(Sender : TObject);
|
||||||
var
|
var
|
||||||
I,N: Integer;
|
I,N: Integer;
|
||||||
SList : TUnitInfo;
|
|
||||||
TempName : String;
|
TempName : String;
|
||||||
TempFormName : String;
|
TempFormName : String;
|
||||||
Found : Boolean;
|
Found : Boolean;
|
||||||
@ -1341,9 +1247,6 @@ begin
|
|||||||
FormEditor1.AddSelected(TComponent(CInterface.Control));
|
FormEditor1.AddSelected(TComponent(CInterface.Control));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
{----------------OpenFileDownArrowClicked--------------------------------------}
|
{----------------OpenFileDownArrowClicked--------------------------------------}
|
||||||
@ -1351,9 +1254,9 @@ end;
|
|||||||
|
|
||||||
Procedure TMainIDE.OpenFileDownArrowClicked(Sender : TObject);
|
Procedure TMainIDE.OpenFileDownArrowClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
//display the PopupMenu
|
//display the PopupMenu
|
||||||
if OpenFilePopupMenu.Items.Count > 0 then
|
if OpenFilePopupMenu.Items.Count > 0 then
|
||||||
OpenFilePopupMenu.Popup(0,0);
|
OpenFilePopupMenu.Popup(0,0);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
@ -1413,12 +1316,7 @@ end;
|
|||||||
|
|
||||||
//==============================================================================
|
//==============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Procedure TMainIDE.FileClosedEvent(Sender : TObject; Filename : String);
|
Procedure TMainIDE.FileClosedEvent(Sender : TObject; Filename : String);
|
||||||
var
|
|
||||||
MenuItem : TMenuItem;
|
|
||||||
Begin
|
Begin
|
||||||
|
|
||||||
end;
|
end;
|
||||||
@ -1470,20 +1368,19 @@ Begin
|
|||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//enable save buttons here
|
//enable save buttons here
|
||||||
SpeedButton5.Enabled := True;
|
SpeedButton5.Enabled := True;
|
||||||
SpeedButton6.Enabled := True;
|
SpeedButton6.Enabled := True;
|
||||||
RunSpeedButton.Enabled := True;
|
RunSpeedButton.Enabled := True;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.FileSavedEvent(Sender : TObject; Filename : String);
|
Procedure TMainIDE.FileSavedEvent(Sender : TObject; Filename : String);
|
||||||
var
|
var
|
||||||
MenuItem : TMenuItem;
|
MenuItem : TMenuItem;
|
||||||
Begin
|
Begin
|
||||||
//sender is the TSourceEditor
|
//sender is the TSourceEditor
|
||||||
writeln('FILESAVEDEVENT');
|
writeln('FILESAVEDEVENT');
|
||||||
If TSourceEditor(Sender).IsControlUnit then
|
If TSourceEditor(Sender).IsControlUnit then
|
||||||
begin
|
begin
|
||||||
Writeln('*****************CREATING LFM********************');
|
Writeln('*****************CREATING LFM********************');
|
||||||
// Writeln('Result = '+Inttostr(CreateLFM(TCustomForm(TSourceEditor(Sender).Control))));
|
// Writeln('Result = '+Inttostr(CreateLFM(TCustomForm(TSourceEditor(Sender).Control))));
|
||||||
@ -1500,39 +1397,27 @@ end;
|
|||||||
|
|
||||||
procedure TMainIDE.mnuQuitClicked(Sender : TObject);
|
procedure TMainIDE.mnuQuitClicked(Sender : TObject);
|
||||||
var
|
var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
SList : TUnitInfo;
|
|
||||||
begin
|
begin
|
||||||
//if there is a project loaded, check if it should be saved
|
//if there is a project loaded, check if it should be saved
|
||||||
|
Project.Free;
|
||||||
|
|
||||||
//free the unitlist objects
|
Close;
|
||||||
if Project.UnitList.Count > 0 then
|
|
||||||
For I := 0 to Project.UnitList.Count -1 do
|
|
||||||
Begin
|
|
||||||
SList := TUnitInfo(Project.UnitList.Items[I]);
|
|
||||||
SList.Destroy;
|
|
||||||
end;
|
|
||||||
|
|
||||||
Project.Free;
|
|
||||||
|
|
||||||
Close;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
procedure TMainIDE.mnuViewInspectorClicked(Sender : TObject);
|
procedure TMainIDE.mnuViewInspectorClicked(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
ObjectInspector1.Show;
|
ObjectInspector1.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
{------------------------------------------------------------------------------}
|
{------------------------------------------------------------------------------}
|
||||||
|
|
||||||
Procedure TMainIDE.mnuViewUnitsClicked(Sender : TObject);
|
Procedure TMainIDE.mnuViewUnitsClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
Writeln('View Units Clicked');
|
Writeln('View Units Clicked');
|
||||||
ViewUnits1.ShowModal;
|
ViewUnits1.ShowModal;
|
||||||
Writeln('Done with ViewUnits Clicked');
|
Writeln('Done with ViewUnits Clicked');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.mnuViewFormsClicked(Sender : TObject);
|
Procedure TMainIDE.mnuViewFormsClicked(Sender : TObject);
|
||||||
@ -1542,7 +1427,7 @@ end;
|
|||||||
|
|
||||||
Procedure TMainIDE.mnuViewCodeExplorerClick(Sender : TObject);
|
Procedure TMainIDE.mnuViewCodeExplorerClick(Sender : TObject);
|
||||||
begin
|
begin
|
||||||
SourceNotebook.Show;
|
SourceNotebook.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.mnuViewMessagesClick(Sender : TObject);
|
Procedure TMainIDE.mnuViewMessagesClick(Sender : TObject);
|
||||||
@ -1568,20 +1453,18 @@ end;
|
|||||||
|
|
||||||
Procedure TMainIDE.mnuSearchFindClicked(Sender : TObject);
|
Procedure TMainIDE.mnuSearchFindClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
itmSearchFindAgain.Enabled := True;
|
itmSearchFindAgain.Enabled := True;
|
||||||
FindDialog1.ShowModal;
|
FindDialog1.ShowModal;
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Procedure TMainIDE.mnuSearchFindAgainClicked(Sender : TObject);
|
Procedure TMainIDE.mnuSearchFindAgainClicked(Sender : TObject);
|
||||||
Begin
|
Begin
|
||||||
DoFind(itmSearchFindAgain);
|
DoFind(itmSearchFindAgain);
|
||||||
End;
|
End;
|
||||||
|
|
||||||
{------------------------------------------------------------}
|
{------------------------------------------------------------}
|
||||||
|
|
||||||
Procedure TMainIDE.mnuNewProjectClicked(Sender : TObject);
|
Procedure TMainIDE.mnuNewProjectClicked(Sender : TObject);
|
||||||
var
|
|
||||||
SList : TUnitInfo;
|
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:New Project Clicked');
|
Assert(False, 'Trace:New Project Clicked');
|
||||||
end;
|
end;
|
||||||
@ -1609,10 +1492,10 @@ if SourceNotebook.Empty then Begin
|
|||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//for now just compile the active unit;
|
//for now just compile the active unit;
|
||||||
SourceNotebook.SaveClicked(Sender);
|
SourceNotebook.SaveClicked(Sender);
|
||||||
|
|
||||||
if not(MessageDlg.Visible) then
|
if not(MessageDlg.Visible) then
|
||||||
Begin //display the dialog under the TSourceNotebook
|
Begin //display the dialog under the TSourceNotebook
|
||||||
MessageDlg.Show;
|
MessageDlg.Show;
|
||||||
MessageDlg.Top := Screen.Height - 150;
|
MessageDlg.Top := Screen.Height - 150;
|
||||||
@ -1623,12 +1506,10 @@ if not(MessageDlg.Visible) then
|
|||||||
MessageDlg.Left := SourceNotebook.Left;
|
MessageDlg.Left := SourceNotebook.Left;
|
||||||
MessageDlg.Width := SourceNotebook.Width;
|
MessageDlg.Width := SourceNotebook.Width;
|
||||||
end;
|
end;
|
||||||
MessageDlg.Clear;
|
MessageDlg.Clear;
|
||||||
Compiler1.Compile(SourceNotebook.ActiveUnitName);
|
Compiler1.Compile(SourceNotebook.ActiveUnitName);
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
Procedure TMainIDE.mnuRunProjectClicked(Sender : TObject);
|
Procedure TMainIDE.mnuRunProjectClicked(Sender : TObject);
|
||||||
var
|
var
|
||||||
Filename : String;
|
Filename : String;
|
||||||
@ -1636,7 +1517,7 @@ var
|
|||||||
TheProgram : String;
|
TheProgram : String;
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:Run Project Clicked');
|
Assert(False, 'Trace:Run Project Clicked');
|
||||||
if SourceNotebook.Empty then Begin
|
if SourceNotebook.Empty then Begin
|
||||||
Application.MessageBox('No units loaded. Load a program first!','Error',mb_OK);
|
Application.MessageBox('No units loaded. Load a program first!','Error',mb_OK);
|
||||||
Exit;
|
Exit;
|
||||||
end;
|
end;
|
||||||
@ -1670,28 +1551,25 @@ begin
|
|||||||
//frmProjectOptions.Show;
|
//frmProjectOptions.Show;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function TMainIDE.ReturnFormName(Source : TStringlist) : String;
|
Function TMainIDE.ReturnFormName(Source : TStringlist) : String;
|
||||||
Var
|
Var
|
||||||
I : Integer;
|
I : Integer;
|
||||||
Num,Num2 : Integer;
|
Num,Num2 : Integer;
|
||||||
Found : Boolean;
|
Found : Boolean;
|
||||||
Texts : String;
|
Texts : String;
|
||||||
Temp : String;
|
Temp : String;
|
||||||
Temp2 : String;
|
Temp2 : String;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
//Assert(False, 'Trace:************************************************');
|
//Assert(False, 'Trace:************************************************');
|
||||||
//Assert(False, 'Trace:************************************************');
|
//Assert(False, 'Trace:************************************************');
|
||||||
//Assert(False, 'Trace:************************************************');
|
//Assert(False, 'Trace:************************************************');
|
||||||
//Assert(False, 'Trace:************************************************');
|
//Assert(False, 'Trace:************************************************');
|
||||||
//Assert(False, 'Trace:************************************************');
|
//Assert(False, 'Trace:************************************************');
|
||||||
|
|
||||||
//move to TUnitInfo
|
//move to TUnitInfo
|
||||||
//parse file for the first class(TForm) I guess
|
//parse file for the first class(TForm) I guess
|
||||||
Found := False;
|
Found := False;
|
||||||
for I := 0 to Source.Count-1 do
|
for I := 0 to Source.Count-1 do
|
||||||
Begin
|
Begin
|
||||||
Num := pos(uppercase('class(TForm)'),uppercase(Source.Strings[I]));
|
Num := pos(uppercase('class(TForm)'),uppercase(Source.Strings[I]));
|
||||||
if Num <> 0 then
|
if Num <> 0 then
|
||||||
@ -1707,20 +1585,20 @@ for I := 0 to Source.Count-1 do
|
|||||||
if Length(Texts) <> 0 then Break;
|
if Length(Texts) <> 0 then Break;
|
||||||
end;
|
end;
|
||||||
temp := Texts;
|
temp := Texts;
|
||||||
// Assert(False, 'Trace:*******************');
|
// Assert(False, 'Trace:*******************');
|
||||||
// Assert(False, 'Trace:Temp := '+Temp);
|
// Assert(False, 'Trace:Temp := '+Temp);
|
||||||
Found := True;
|
Found := True;
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
if Found then
|
if Found then
|
||||||
Begin
|
Begin
|
||||||
{Temp now holds TFORM1 or whatever the name of the class is}
|
{Temp now holds TFORM1 or whatever the name of the class is}
|
||||||
{Search for the var statement from the I line down}
|
{Search for the var statement from the I line down}
|
||||||
Texts := '';
|
Texts := '';
|
||||||
Num := I;
|
Num := I;
|
||||||
|
|
||||||
for I := Num to Source.Count-1 do
|
for I := Num to Source.Count-1 do
|
||||||
Begin
|
Begin
|
||||||
Found := False;
|
Found := False;
|
||||||
Num := pos('VAR',uppercase(Source.Strings[I]));
|
Num := pos('VAR',uppercase(Source.Strings[I]));
|
||||||
@ -1731,17 +1609,17 @@ for I := Num to Source.Count-1 do
|
|||||||
if (Length(Temp2) = 3) then
|
if (Length(Temp2) = 3) then
|
||||||
Begin
|
Begin
|
||||||
Found := True;
|
Found := True;
|
||||||
// Assert(False, 'Trace:1');
|
// Assert(False, 'Trace:1');
|
||||||
Num := I;
|
Num := I;
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//var in the beginning of a sentence
|
//var in the beginning of a sentence
|
||||||
if (Num = 1) and ( not ( (Temp2[4] in CapLetters) or (Temp2[4] in SmallLetters) or (Temp2[4] in Numbers))) then
|
if (Num = 1) and ( not ( (Temp2[4] in CapLetters) or (Temp2[4] in SmallLetters) or (Temp2[4] in Numbers))) then
|
||||||
Begin
|
Begin
|
||||||
Found := True;
|
Found := True;
|
||||||
Num := I;
|
Num := I;
|
||||||
// Assert(False, 'Trace:2');
|
// Assert(False, 'Trace:2');
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1749,7 +1627,7 @@ for I := Num to Source.Count-1 do
|
|||||||
Begin
|
Begin
|
||||||
Found := True;
|
Found := True;
|
||||||
Num := I;
|
Num := I;
|
||||||
// Assert(False, 'Trace:3');
|
// Assert(False, 'Trace:3');
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1758,16 +1636,16 @@ for I := Num to Source.Count-1 do
|
|||||||
Begin
|
Begin
|
||||||
Found := True;
|
Found := True;
|
||||||
Num := I;
|
Num := I;
|
||||||
// Assert(False, 'Trace:4');
|
// Assert(False, 'Trace:4');
|
||||||
Break;
|
Break;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
Assert(False, 'Trace:Length of temp2 is '+inttostr(Length(Temp2)));
|
Assert(False, 'Trace:Length of temp2 is '+inttostr(Length(Temp2)));
|
||||||
|
|
||||||
if Found then
|
if Found then
|
||||||
begin
|
begin
|
||||||
for I := Num to Source.Count-1 do
|
for I := Num to Source.Count-1 do
|
||||||
Begin
|
Begin
|
||||||
@ -1792,7 +1670,7 @@ if Found then
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
result := Texts;
|
result := Texts;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Procedure TMainIDE.MessageViewDblClick(Sender : TObject);
|
Procedure TMainIDE.MessageViewDblClick(Sender : TObject);
|
||||||
@ -1810,10 +1688,13 @@ initialization
|
|||||||
end.
|
end.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{ =============================================================================
|
{ =============================================================================
|
||||||
|
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.51 2001/01/31 06:25:35 lazarus
|
||||||
|
Removed global unit.
|
||||||
|
Removed and commented all references to TUnitInfo.
|
||||||
|
|
||||||
Revision 1.50 2001/01/29 05:46:30 lazarus
|
Revision 1.50 2001/01/29 05:46:30 lazarus
|
||||||
Moved Project Options and Compiler Options menus to the Project menu.
|
Moved Project Options and Compiler Options menus to the Project menu.
|
||||||
Added Project property to TMainIDE class to allow the project to be
|
Added Project property to TMainIDE class to allow the project to be
|
||||||
|
Loading…
Reference in New Issue
Block a user