mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-07 01:57:57 +02:00
IDE: show property's class, name and type in OI StatusBar.
git-svn-id: trunk@41380 -
This commit is contained in:
parent
fe0b0eb344
commit
154590fc1b
@ -21,7 +21,6 @@ object ObjectInspectorDlg: TObjectInspectorDlg
|
||||
item
|
||||
Width = 50
|
||||
end>
|
||||
SimplePanel = False
|
||||
end
|
||||
object AvailPersistentComboBox: TComboBox
|
||||
Left = 0
|
||||
|
@ -3893,7 +3893,6 @@ begin
|
||||
FComponentEditor := nil;
|
||||
|
||||
Caption := oisObjectInspector;
|
||||
StatusBar.SimpleText := oisAll;
|
||||
FilterLabel.Caption := oisBtnComponents;
|
||||
MainPopupMenu.Images := IDEImages.Images_16;
|
||||
|
||||
|
@ -20,7 +20,6 @@ resourcestring
|
||||
|
||||
// Object Inspector
|
||||
oisObjectInspector = 'Object Inspector';
|
||||
oisAll = 'All';
|
||||
oisError = 'Error';
|
||||
oisItemsSelected = '%u items selected';
|
||||
|
||||
|
@ -308,7 +308,7 @@ type
|
||||
out Chain: TCodeHelpElementChain;
|
||||
out CacheWasUsed: boolean): TCodeHelpParseResult;
|
||||
function GetHTMLHint(Code: TCodeBuffer; X, Y: integer; Options: TCodeHelpHintOptions;
|
||||
out BaseURL, HTMLHint: string;
|
||||
out BaseURL, HTMLHint, PropDetails: string;
|
||||
out CacheWasUsed: boolean): TCodeHelpParseResult;
|
||||
function GetHTMLHintForNode(CTTool: TFindDeclarationTool; CTNode: TCodeTreeNode;
|
||||
XYPos: TCodeXYPosition; Options: TCodeHelpHintOptions;
|
||||
@ -2401,18 +2401,20 @@ begin
|
||||
end;
|
||||
|
||||
function TCodeHelpManager.GetHTMLHint(Code: TCodeBuffer; X, Y: integer;
|
||||
Options: TCodeHelpHintOptions; out BaseURL, HTMLHint: string;
|
||||
Options: TCodeHelpHintOptions;
|
||||
out BaseURL, HTMLHint, PropDetails: string;
|
||||
out CacheWasUsed: boolean): TCodeHelpParseResult;
|
||||
var
|
||||
CursorPos: TCodeXYPosition;
|
||||
CTTool: TFindDeclarationTool;
|
||||
CTNode: TCodeTreeNode;
|
||||
XYPos: TCodeXYPosition;
|
||||
aTopLine: integer;
|
||||
TopLine: integer;
|
||||
begin
|
||||
Result:=chprFailed;
|
||||
BaseURL:='lazdoc://';
|
||||
HTMLHint:='';
|
||||
PropDetails:='';
|
||||
CacheWasUsed:=true;
|
||||
|
||||
CursorPos.X:=X;
|
||||
@ -2422,8 +2424,7 @@ begin
|
||||
try
|
||||
// find declaration
|
||||
if not CodeToolBoss.CurCodeTool.FindDeclaration(CursorPos,
|
||||
DefaultFindSmartHintFlags+[fsfSearchSourceName],
|
||||
CTTool,CTNode,XYPos,aTopLine)
|
||||
DefaultFindSmartHintFlags+[fsfSearchSourceName],CTTool,CTNode,XYPos,TopLine)
|
||||
then
|
||||
exit;
|
||||
if (CTNode=nil) then begin
|
||||
@ -2431,9 +2432,9 @@ begin
|
||||
debugln(['TCodeHelpManager.GetHTMLHint not a declaration']);
|
||||
exit;
|
||||
end;
|
||||
|
||||
Result:=GetHTMLHintForNode(CTTool,CTNode,XYPos,Options,BaseURL,HTMLHint,
|
||||
CacheWasUsed);
|
||||
Result:=GetHTMLHintForNode(CTTool,CTNode,XYPos,Options,BaseURL,HTMLHint,CacheWasUsed);
|
||||
// Property details are like "published property TType.PropName:Integer"
|
||||
PropDetails:=CTTool.GetSmartHint(CTNode,XYPos,false);
|
||||
except
|
||||
on E: ECodeToolError do begin
|
||||
//debugln(['TCodeHelpManager.GetHTMLHint ECodeToolError: ',E.Message]);
|
||||
@ -2447,8 +2448,7 @@ end;
|
||||
|
||||
function TCodeHelpManager.GetHTMLHintForNode(CTTool: TFindDeclarationTool;
|
||||
CTNode: TCodeTreeNode; XYPos: TCodeXYPosition; Options: TCodeHelpHintOptions;
|
||||
out BaseURL, HTMLHint: string; out CacheWasUsed: boolean
|
||||
): TCodeHelpParseResult;
|
||||
out BaseURL, HTMLHint: string; out CacheWasUsed: boolean): TCodeHelpParseResult;
|
||||
var
|
||||
aTopLine: integer;
|
||||
ListOfPCodeXYPosition: TFPList;
|
||||
|
@ -96,7 +96,7 @@ var
|
||||
HelpResult: TCodeHelpParseResult;
|
||||
Caret: TCodeXYPosition;
|
||||
CleanPos: LongInt;
|
||||
BaseDir: String;
|
||||
BaseDir, PropDetails: String;
|
||||
begin
|
||||
FBaseURL:='';
|
||||
FHTMLHint:='';
|
||||
@ -159,7 +159,7 @@ begin
|
||||
//DebugLn(['TFPDocHintProvider.DoUpdateHint ',Item.Identifier,' ',Item.Tool.MainFilename,' ',Caret.Code.Filename,' ',Caret.X,',',Caret.Y]);
|
||||
HelpResult:=CodeHelpBoss.GetHTMLHint(Caret.Code,Caret.X,Caret.Y,
|
||||
[chhoDeclarationHeader],
|
||||
FBaseURL,FHTMLHint,CacheWasUsed);
|
||||
FBaseURL,FHTMLHint,PropDetails,CacheWasUsed);
|
||||
if HelpResult<>chprSuccess then begin
|
||||
DebugLn(['TFPDocHintProvider.DoUpdateHint FAILED Identifier=',Item.Identifier]);
|
||||
exit;
|
||||
|
@ -1674,6 +1674,7 @@ var
|
||||
Code: TCodeBuffer;
|
||||
CacheWasUsed: boolean;
|
||||
HintFlags: TCodeHelpHintOptions;
|
||||
PropDetails: string;
|
||||
begin
|
||||
BaseURL:='';
|
||||
HTMLHint:='';
|
||||
@ -1684,7 +1685,7 @@ begin
|
||||
if ihmchAddFocusHint in Flags then
|
||||
Include(HintFlags,chhoShowFocusHint);
|
||||
if CodeHelpBoss.GetHTMLHint(Code,CodePos.X,CodePos.Y,
|
||||
HintFlags,BaseURL,HTMLHint,CacheWasUsed)=chprSuccess
|
||||
HintFlags,BaseURL,HTMLHint,PropDetails,CacheWasUsed)=chprSuccess
|
||||
then
|
||||
exit(shrSuccess);
|
||||
Result:=shrHelpNotFound;
|
||||
|
20
ide/main.pp
20
ide/main.pp
@ -59,7 +59,7 @@ uses
|
||||
MemCheck,
|
||||
{$ENDIF}
|
||||
// fpc packages
|
||||
Math, Classes, SysUtils, Process, AsyncProcess, TypInfo, types, AVL_Tree,
|
||||
Math, Classes, SysUtils, Process, AsyncProcess, TypInfo, types, strutils, AVL_Tree,
|
||||
// lazutils
|
||||
LazUTF8, Laz2_XMLCfg, AvgLvlTree,
|
||||
// lcl
|
||||
@ -12591,8 +12591,8 @@ var
|
||||
ARow: TOIPropertyGridRow;
|
||||
Code: TCodeBuffer;
|
||||
Caret: TPoint;
|
||||
NewTopLine: integer;
|
||||
HtmlHint, BaseURL: string;
|
||||
i: integer;
|
||||
HtmlHint, BaseURL, PropDetails: string;
|
||||
CacheWasUsed: Boolean;
|
||||
Stream: TStringStream;
|
||||
begin
|
||||
@ -12607,17 +12607,19 @@ begin
|
||||
|
||||
HtmlHint := '';
|
||||
BaseURL := '';
|
||||
PropDetails := '';
|
||||
|
||||
ARow := OI.GetActivePropertyRow;
|
||||
|
||||
if (ARow <> nil)
|
||||
and FindDeclarationOfOIProperty(OI, ARow, Code, Caret, NewTopLine) then
|
||||
and FindDeclarationOfOIProperty(OI, ARow, Code, Caret, i) then
|
||||
begin
|
||||
if CodeHelpBoss.GetHTMLHint(Code, Caret.X, Caret.Y, [],
|
||||
BaseURL, HtmlHint, CacheWasUsed) <> chprSuccess then
|
||||
BaseURL, HtmlHint, PropDetails, CacheWasUsed) <> chprSuccess then
|
||||
begin
|
||||
HtmlHint := '';
|
||||
BaseURL := '';
|
||||
PropDetails := '';
|
||||
end;
|
||||
end;
|
||||
|
||||
@ -12633,6 +12635,14 @@ begin
|
||||
Stream.Free;
|
||||
end;
|
||||
end;
|
||||
// Property details always starts with "published property". Get rid of it.
|
||||
i:=Pos(' ', PropDetails);
|
||||
if i>0 then begin
|
||||
i:=PosEx(' ', PropDetails, i+1);
|
||||
if i>0 then
|
||||
PropDetails:=Copy(PropDetails, i+1, Length(PropDetails));
|
||||
end;
|
||||
OI.StatusBar.SimpleText:=PropDetails; // Show in OI StatusBar
|
||||
end;
|
||||
|
||||
procedure TMainIDE.mnuFileClicked(Sender: TObject);
|
||||
|
Loading…
Reference in New Issue
Block a user