mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-11 20:59:10 +02:00
added unit info to View menu
git-svn-id: trunk@5856 -
This commit is contained in:
parent
79e0b3d2d1
commit
631040fd94
@ -151,9 +151,10 @@ const
|
||||
ecViewUnits = ecUserFirst + 309;
|
||||
ecViewForms = ecUserFirst + 310;
|
||||
ecViewUnitDependencies = ecUserFirst + 311;
|
||||
ecToggleLocals = ecUserFirst + 312;
|
||||
ecToggleCallStack = ecUserFirst + 313;
|
||||
ecToggleSearchResults = ecUserFirst + 314;
|
||||
ecViewUnitInfo = ecUserFirst + 312;
|
||||
ecToggleLocals = ecUserFirst + 313;
|
||||
ecToggleCallStack = ecUserFirst + 314;
|
||||
ecToggleSearchResults = ecUserFirst + 315;
|
||||
|
||||
// sourcenotebook commands
|
||||
ecNextEditor = ecUserFirst + 330;
|
||||
@ -620,6 +621,7 @@ begin
|
||||
ecViewUnits: SetResult(VK_F12,[ssCtrl],VK_UNKNOWN,[]);
|
||||
ecViewForms: SetResult(VK_F12,[ssShift],VK_UNKNOWN,[]);
|
||||
ecViewUnitDependencies: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
ecViewUnitInfo: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
ecJumpToEditor: SetResult(VK_UNKNOWN,[],VK_UNKNOWN,[]);
|
||||
ecToggleFormUnit: SetResult(VK_F12,[],VK_UNKNOWN,[]);
|
||||
|
||||
@ -1150,6 +1152,7 @@ begin
|
||||
ecViewUnits : Result:= srkmecViewUnits;
|
||||
ecViewForms : Result:= srkmecViewForms;
|
||||
ecViewUnitDependencies : Result:= srkmecViewUnitDependencies;
|
||||
ecViewUnitInfo : Result:= srkmecViewUnitInfo;
|
||||
|
||||
// codetools
|
||||
ecWordCompletion : Result:= srkmecWordCompletion;
|
||||
@ -2024,6 +2027,7 @@ begin
|
||||
AddDefault(C,'View Units',ecViewUnits);
|
||||
AddDefault(C,'View Forms',ecViewForms);
|
||||
AddDefault(C,'View Unit Dependencies',ecViewUnitDependencies);
|
||||
AddDefault(C,'View Unit Info',ecViewUnitInfo);
|
||||
AddDefault(C,'Focus to source editor',ecJumpToEditor);
|
||||
AddDefault(C,'Toggle between Unit and Form',ecToggleFormUnit);
|
||||
|
||||
|
@ -178,6 +178,7 @@ resourcestring
|
||||
lisMenuViewUnits = 'Units...';
|
||||
lisMenuViewForms = 'Forms...';
|
||||
lisMenuViewUnitDependencies = 'View Unit Dependencies';
|
||||
lisMenuViewUnitInfo = 'View Unit Information';
|
||||
lisMenuViewToggleFormUnit = 'Toggle form/unit view';
|
||||
lisMenuViewMessages = 'Messages';
|
||||
lisMenuViewSearchResults = 'Search Results';
|
||||
@ -1237,7 +1238,8 @@ resourcestring
|
||||
srkmecViewUnits = 'View units';
|
||||
srkmecViewForms = 'View forms';
|
||||
srkmecViewUnitDependencies = 'View unit dependencies';
|
||||
|
||||
srkmecViewUnitInfo = 'View unit information';
|
||||
|
||||
// codetools
|
||||
srkmecWordCompletion = 'Word completion';
|
||||
srkmecCompletecode = 'Complete code';
|
||||
|
60
ide/main.pp
60
ide/main.pp
@ -189,6 +189,7 @@ type
|
||||
procedure mnuViewUnitsClicked(Sender : TObject);
|
||||
procedure mnuViewFormsClicked(Sender : TObject);
|
||||
procedure mnuViewUnitDependenciesClicked(Sender : TObject);
|
||||
procedure mnuViewUnitInfoClicked(Sender : TObject);
|
||||
procedure mnuViewCodeExplorerClick(Sender : TObject);
|
||||
procedure mnuViewMessagesClick(Sender : TObject);
|
||||
procedure mnuViewSearchResultsClick(Sender : TObject);
|
||||
@ -544,6 +545,7 @@ type
|
||||
function DoRevertMainUnit: TModalResult;
|
||||
function DoViewUnitsAndForms(OnlyForms: boolean): TModalResult;
|
||||
procedure DoViewUnitDependencies;
|
||||
procedure DoViewUnitInfo;
|
||||
procedure DoShowCodeExplorer;
|
||||
|
||||
// project(s)
|
||||
@ -1611,6 +1613,7 @@ begin
|
||||
itmViewUnits.OnClick := @mnuViewUnitsClicked;
|
||||
itmViewForms.OnClick := @mnuViewFormsClicked;
|
||||
itmViewUnitDependencies.OnClick := @mnuViewUnitDependenciesClicked;
|
||||
itmViewUnitInfo.OnClick := @mnuViewUnitInfoClicked;
|
||||
itmViewToggleFormUnit.OnClick := @mnuToggleFormUnitClicked;
|
||||
itmViewMessage.OnClick := @mnuViewMessagesClick;
|
||||
itmViewSearchResults.OnClick := @mnuViewSearchResultsClick;
|
||||
@ -2103,29 +2106,8 @@ begin
|
||||
end;
|
||||
|
||||
procedure TMainIDE.OnSrcNoteBookShowUnitInfo(Sender: TObject);
|
||||
var ActiveSrcEdit:TSourceEditor;
|
||||
ActiveUnitInfo:TUnitInfo;
|
||||
ShortUnitName, AFilename, FileDir: string;
|
||||
ClearIncludedByFile: boolean;
|
||||
begin
|
||||
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
|
||||
if (ActiveSrcEdit=nil) or (ActiveUnitInfo=nil) then exit;
|
||||
ShortUnitName:=ActiveSrcEdit.PageName;
|
||||
AFilename:=ActiveUnitInfo.Filename;
|
||||
FileDir:=ExtractFilePath(AFilename);
|
||||
ShowUnitInfoDlg(ShortUnitName,
|
||||
LazSyntaxHighlighterNames[ActiveUnitInfo.SyntaxHighlighter],
|
||||
ActiveUnitInfo.IsPartOfProject, length(ActiveSrcEdit.Source.Text),
|
||||
ActiveSrcEdit.Source.Count,
|
||||
Project1.RemoveProjectPathFromFilename(AFilename),
|
||||
Project1.RemoveProjectPathFromFilename(ActiveUnitInfo.Source.LastIncludedByFile),
|
||||
ClearIncludedByFile,
|
||||
TrimSearchPath(CodeToolBoss.GetUnitPathForDirectory(FileDir),FileDir),
|
||||
TrimSearchPath(CodeToolBoss.GetIncludePathForDirectory(FileDir),FileDir),
|
||||
TrimSearchPath(CodeToolBoss.GetSrcPathForDirectory(FileDir),FileDir)
|
||||
);
|
||||
if ClearIncludedByFile then
|
||||
ActiveUnitInfo.Source.LastIncludedByFile:='';
|
||||
DoViewUnitInfo;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------}
|
||||
@ -2368,6 +2350,11 @@ begin
|
||||
DoViewUnitDependencies;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuViewUnitInfoClicked(Sender: TObject);
|
||||
begin
|
||||
DoViewUnitInfo;
|
||||
end;
|
||||
|
||||
Procedure TMainIDE.mnuViewCodeExplorerClick(Sender : TObject);
|
||||
begin
|
||||
DoShowCodeExplorer;
|
||||
@ -4971,6 +4958,32 @@ begin
|
||||
UnitDependenciesView.ShowOnTop;
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoViewUnitInfo;
|
||||
var ActiveSrcEdit:TSourceEditor;
|
||||
ActiveUnitInfo:TUnitInfo;
|
||||
ShortUnitName, AFilename, FileDir: string;
|
||||
ClearIncludedByFile: boolean;
|
||||
begin
|
||||
GetCurrentUnit(ActiveSrcEdit,ActiveUnitInfo);
|
||||
if (ActiveSrcEdit=nil) or (ActiveUnitInfo=nil) then exit;
|
||||
ShortUnitName:=ActiveSrcEdit.PageName;
|
||||
AFilename:=ActiveUnitInfo.Filename;
|
||||
FileDir:=ExtractFilePath(AFilename);
|
||||
ShowUnitInfoDlg(ShortUnitName,
|
||||
LazSyntaxHighlighterNames[ActiveUnitInfo.SyntaxHighlighter],
|
||||
ActiveUnitInfo.IsPartOfProject, length(ActiveSrcEdit.Source.Text),
|
||||
ActiveSrcEdit.Source.Count,
|
||||
Project1.RemoveProjectPathFromFilename(AFilename),
|
||||
Project1.RemoveProjectPathFromFilename(ActiveUnitInfo.Source.LastIncludedByFile),
|
||||
ClearIncludedByFile,
|
||||
TrimSearchPath(CodeToolBoss.GetUnitPathForDirectory(FileDir),FileDir),
|
||||
TrimSearchPath(CodeToolBoss.GetIncludePathForDirectory(FileDir),FileDir),
|
||||
TrimSearchPath(CodeToolBoss.GetSrcPathForDirectory(FileDir),FileDir)
|
||||
);
|
||||
if ClearIncludedByFile then
|
||||
ActiveUnitInfo.Source.LastIncludedByFile:='';
|
||||
end;
|
||||
|
||||
procedure TMainIDE.DoShowCodeExplorer;
|
||||
begin
|
||||
if CodeExplorerView=nil then begin
|
||||
@ -10581,6 +10594,9 @@ end.
|
||||
|
||||
{ =============================================================================
|
||||
$Log$
|
||||
Revision 1.759 2004/08/25 22:22:39 mattias
|
||||
added unit info to View menu
|
||||
|
||||
Revision 1.758 2004/08/23 17:05:21 mattias
|
||||
implemented help jump for messages and classes
|
||||
|
||||
|
@ -163,19 +163,20 @@ type
|
||||
// view menu
|
||||
itmViewInspector: TMenuItem;
|
||||
itmViewSourceEditor: TMenuItem;
|
||||
itmViewUnits : TMenuItem;
|
||||
itmViewCodeExplorer : TMenuItem;
|
||||
itmViewUnits : TMenuItem;
|
||||
itmViewForms : TMenuItem;
|
||||
itmViewUnitDependencies : TMenuItem;
|
||||
itmViewUnitInfo: TMenuItem;
|
||||
itmViewMessage : TMenuItem;
|
||||
itmViewSearchResults : TMenuItem;
|
||||
itmViewToggleFormUnit: TMenuItem;
|
||||
itmViewDebugWindows: TMenuItem;
|
||||
itmViewWatches: TMenuItem;
|
||||
itmViewBreakpoints: TMenuItem;
|
||||
itmViewLocals: TMenuItem;
|
||||
itmViewCallStack: TMenuItem;
|
||||
itmViewDebugOutput: TMenuItem;
|
||||
itmViewToggleFormUnit: TMenuItem;
|
||||
|
||||
// project menu
|
||||
itmProjectNew: TMenuItem;
|
||||
|
@ -556,6 +556,7 @@ begin
|
||||
CreateMenuItem(ParentMI,itmViewUnits,'itmViewUnits',lisMenuViewUnits);
|
||||
CreateMenuItem(ParentMI,itmViewForms,'itmViewForms',lisMenuViewForms);
|
||||
CreateMenuItem(ParentMI,itmViewUnitDependencies,'itmViewUnitDependencies',lisMenuViewUnitDependencies);
|
||||
CreateMenuItem(ParentMI,itmViewUnitInfo,'itmViewUnitInfo',lisMenuViewUnitInfo);
|
||||
ParentMI.Add(CreateMenuSeparator);
|
||||
|
||||
CreateMenuItem(ParentMI,itmViewToggleFormUnit,'itmViewToggleFormUnit',lisMenuViewToggleFormUnit);
|
||||
@ -813,6 +814,7 @@ begin
|
||||
itmViewUnits.ShortCut:=CommandToShortCut(ecViewUnits);
|
||||
itmViewCodeExplorer.ShortCut:=CommandToShortCut(ecToggleCodeExpl);
|
||||
itmViewUnitDependencies.ShortCut:=CommandToShortCut(ecViewUnitDependencies);
|
||||
itmViewUnitInfo.ShortCut:=CommandToShortCut(ecViewUnitInfo);
|
||||
itmViewForms.ShortCut:=CommandToShortCut(ecViewForms);
|
||||
itmViewToggleFormUnit.ShortCut:=CommandToShortCut(ecToggleFormUnit);
|
||||
itmViewMessage.ShortCut:=CommandToShortCut(ecToggleMessages);
|
||||
|
@ -2114,22 +2114,24 @@ begin
|
||||
if (Shift = []) and ((Key = VK_RETURN) or (Key = VK_ESCAPE)) then
|
||||
begin
|
||||
Form := GetParentForm(Self);
|
||||
case Key of
|
||||
VK_RETURN:
|
||||
begin
|
||||
if Form.DefaultControl <> nil then
|
||||
if Form<>nil then begin
|
||||
case Key of
|
||||
VK_RETURN:
|
||||
begin
|
||||
Form.DefaultControl.ExecuteDefaultAction;
|
||||
Key := VK_UNKNOWN;
|
||||
if Form.DefaultControl <> nil then
|
||||
begin
|
||||
Form.DefaultControl.ExecuteDefaultAction;
|
||||
Key := VK_UNKNOWN;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
VK_ESCAPE:
|
||||
begin
|
||||
if Form.CancelControl <> nil then
|
||||
|
||||
VK_ESCAPE:
|
||||
begin
|
||||
Form.CancelControl.ExecuteCancelAction;
|
||||
Key := VK_UNKNOWN;
|
||||
if Form.CancelControl <> nil then
|
||||
begin
|
||||
Form.CancelControl.ExecuteCancelAction;
|
||||
Key := VK_UNKNOWN;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
@ -3825,6 +3827,9 @@ end;
|
||||
{ =============================================================================
|
||||
|
||||
$Log$
|
||||
Revision 1.265 2004/08/25 22:22:39 mattias
|
||||
added unit info to View menu
|
||||
|
||||
Revision 1.264 2004/08/18 22:56:11 mattias
|
||||
implemented basic manual docking
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user