Browse Source

* SearchSymbol works

pierre 26 years ago
parent
commit
4d59eb41b2
1 changed files with 15 additions and 9 deletions
  1. 15 9
      ide/text/fpmsrch.inc

+ 15 - 9
ide/text/fpmsrch.inc

@@ -95,20 +95,22 @@ begin
   OpenSymbolBrowser(0,0,'Units','Global scope',nil,S,nil,nil,nil);
   OpenSymbolBrowser(0,0,'Units','Global scope',nil,S,nil,nil,nil);
 end;
 end;
 
 
-function SymbolDialog(Info: pointer): PDialog;
+function SymbolDialog(const S : string) : PDialog;
 var D: PDialog;
 var D: PDialog;
     R,R1,R2: TRect;
     R,R1,R2: TRect;
     IL: PInputLine;
     IL: PInputLine;
 begin
 begin
-  R.Assign(0,0,40,7);
+  R.Assign(0,0,40,8);
   New(D, Init(R, 'Browse Symbol'));
   New(D, Init(R, 'Browse Symbol'));
   with D^ do
   with D^ do
   begin
   begin
     Options:=Options or ofCentered;
     Options:=Options or ofCentered;
     GetExtent(R); R.Grow(-3,-2); R.B.Y:=R.A.Y+1;
     GetExtent(R); R.Grow(-3,-2); R.B.Y:=R.A.Y+1;
-    R1.Copy(R); R1.B.X:=27; R2.Copy(R); R2.A.X:=27;
-    New(IL, Init(R2,5));
+    R1.Copy(R);
+    R2.Copy(R); Inc(R2.A.Y);Inc(R2.B.Y);
+    New(IL, Init(R2,255));
     Insert(IL);
     Insert(IL);
+    IL^.SetData(S);
     Insert(New(PLabel, Init(R1, 'Enter S~y~mbol to browse', IL)));
     Insert(New(PLabel, Init(R1, 'Enter S~y~mbol to browse', IL)));
     GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
     GetExtent(R); R.Grow(-8,-1); R.A.Y:=R.B.Y-2; R.B.X:=R.A.X+10;
     Insert(New(PButton, Init(R, '~O~K', cmOK, bfDefault)));
     Insert(New(PButton, Init(R, '~O~K', cmOK, bfDefault)));
@@ -120,21 +122,25 @@ begin
 end;
 end;
 
 
 procedure TIDEApp.SearchSymbol;
 procedure TIDEApp.SearchSymbol;
-Var S : String;
-  EditorWindow: PSourceWindow;
+var
+    EditorWindow : PSourceWindow;
+    S : string;
 begin
 begin
   EditorWindow:=FirstEditorWindow;
   EditorWindow:=FirstEditorWindow;
   If assigned(EditorWindow) then
   If assigned(EditorWindow) then
-    S:=LowerCaseStr(GetEditorCurWord(EditorWindow))
+    S:=LowerCaseStr(EditorWindow^.Editor^.GetCurrentWord)
   else
   else
     S:='';
     S:='';
-  if ExecuteDialog(SymbolDialog,@S)<>cmCancel then
+  if ExecuteDialog(SymbolDialog(S),@S)<>cmCancel then
     OpenOneSymbolBrowser(S);
     OpenOneSymbolBrowser(S);
 end;
 end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  1999-06-28 19:32:22  peter
+  Revision 1.10  1999-06-29 12:49:55  pierre
+   * SearchSymbol works
+
+  Revision 1.9  1999/06/28 19:32:22  peter
     * fixes from gabor
     * fixes from gabor
 
 
   Revision 1.8  1999/06/28 12:38:19  pierre
   Revision 1.8  1999/06/28 12:38:19  pierre