Browse Source

Gabor's changes

pierre 25 years ago
parent
commit
b677fc753d
4 changed files with 89 additions and 23 deletions
  1. 12 3
      ide/text/fpide.pas
  2. 59 10
      ide/text/fpmopts.inc
  3. 6 3
      ide/text/fptools.pas
  4. 12 7
      ide/text/globdir.inc

+ 12 - 3
ide/text/fpide.pas

@@ -96,6 +96,8 @@ type
       procedure DoGrep;
       procedure DoGrep;
       procedure Preferences;
       procedure Preferences;
       procedure EditorOptions(Editor: PEditor);
       procedure EditorOptions(Editor: PEditor);
+      procedure CodeComplete;
+      procedure CodeTemplates;
       procedure BrowserOptions(Browser: PBrowserWindow);
       procedure BrowserOptions(Browser: PBrowserWindow);
       procedure DesktopOptions;
       procedure DesktopOptions;
       procedure Mouse;
       procedure Mouse;
@@ -148,7 +150,7 @@ uses
   WUtils,WHelp,WHlpView,WINI,WViews,
   WUtils,WHelp,WHlpView,WINI,WViews,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
   FPConst,FPVars,FPUtils,FPSwitch,FPIni,FPIntf,FPCompile,FPHelp,
   FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
   FPTemplt,FPCalc,FPUsrScr,FPTools,{$ifndef NODEBUG}FPDebug,{$endif}FPRedir,
-  FPDesk;
+  FPDesk,FPCodCmp,FPCodTmp;
 
 
 
 
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
 function IDEUseSyntaxHighlight(Editor: PFileEditor): boolean; {$ifndef FPC}far;{$endif}
@@ -325,11 +327,13 @@ begin
       NewSubMenu(menu_options_env, hcEnvironmentMenu, NewMenu(
       NewSubMenu(menu_options_env, hcEnvironmentMenu, NewMenu(
         NewItem(menu_options_env_preferences,'', kbNoKey, cmPreferences, hcPreferences,
         NewItem(menu_options_env_preferences,'', kbNoKey, cmPreferences, hcPreferences,
         NewItem(menu_options_env_editor,'', kbNoKey, cmEditor, hcEditor,
         NewItem(menu_options_env_editor,'', kbNoKey, cmEditor, hcEditor,
+        NewItem(menu_options_env_codecomplete,'', kbNoKey, cmCodeCompleteOptions, hcCodeCompleteOptions,
+        NewItem(menu_options_env_codetemplates,'', kbNoKey, cmCodeTemplateOptions, hcCodeTemplateOptions,
         NewItem(menu_options_env_desktop,'', kbNoKey, cmDesktopOptions, hcDesktopOptions,
         NewItem(menu_options_env_desktop,'', kbNoKey, cmDesktopOptions, hcDesktopOptions,
         NewItem(menu_options_env_mouse,'', kbNoKey, cmMouse, hcMouse,
         NewItem(menu_options_env_mouse,'', kbNoKey, cmMouse, hcMouse,
         NewItem(menu_options_env_startup,'', kbNoKey, cmStartup, hcStartup,
         NewItem(menu_options_env_startup,'', kbNoKey, cmStartup, hcStartup,
         NewItem(menu_options_env_colors,'', kbNoKey, cmColors, hcColors,
         NewItem(menu_options_env_colors,'', kbNoKey, cmColors, hcColors,
-        nil))))))),
+        nil))))))))),
       NewLine(
       NewLine(
       NewItem(menu_options_open,'', kbNoKey, cmOpenINI, hcOpenINI,
       NewItem(menu_options_open,'', kbNoKey, cmOpenINI, hcOpenINI,
       NewItem(menu_options_save,'', kbNoKey, cmSaveINI, hcSaveINI,
       NewItem(menu_options_save,'', kbNoKey, cmSaveINI, hcSaveINI,
@@ -507,6 +511,8 @@ begin
              cmPreferences   : Preferences;
              cmPreferences   : Preferences;
              cmEditor        : EditorOptions(nil);
              cmEditor        : EditorOptions(nil);
              cmEditorOptions : EditorOptions(Event.InfoPtr);
              cmEditorOptions : EditorOptions(Event.InfoPtr);
+             cmCodeTemplateOptions: CodeTemplates;
+             cmCodeCompleteOptions: CodeComplete;
              cmBrowser       : BrowserOptions(nil);
              cmBrowser       : BrowserOptions(nil);
              cmBrowserOptions : BrowserOptions(Event.InfoPtr);
              cmBrowserOptions : BrowserOptions(Event.InfoPtr);
              cmMouse         : Mouse;
              cmMouse         : Mouse;
@@ -871,7 +877,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.51  2000-01-23 21:25:17  florian
+  Revision 1.52  2000-02-07 12:02:32  pierre
+   Gabor's changes
+
+  Revision 1.51  2000/01/23 21:25:17  florian
     + start of internationalization support
     + start of internationalization support
 
 
   Revision 1.50  2000/01/08 18:26:20  florian
   Revision 1.50  2000/01/08 18:26:20  florian

+ 59 - 10
ide/text/fpmopts.inc

@@ -739,7 +739,7 @@ var D: PCenterDialog;
     IL: PIntegerLine;
     IL: PIntegerLine;
     ExtIL,TabExtIL: PInputLine;
     ExtIL,TabExtIL: PInputLine;
     TabSize: Integer;
     TabSize: Integer;
-    EFlags: Longint;
+    EFlags,EFValue: Longint;
     Title: string;
     Title: string;
 begin
 begin
   if Editor=nil then
   if Editor=nil then
@@ -752,11 +752,28 @@ begin
       TabSize:=Editor^.TabSize; EFlags:=Editor^.Flags;
       TabSize:=Editor^.TabSize; EFlags:=Editor^.Flags;
       Title:='Editor Options';
       Title:='Editor Options';
     end;
     end;
-  R.Assign(0,0,56,18);
+
+  EFValue:=0;
+  if (EFlags and efBackupFiles       )<>0 then EFValue:=EFValue or (1 shl  0);
+  if (EFlags and efInsertMode        )<>0 then EFValue:=EFValue or (1 shl  1);
+  if (EFlags and efAutoIndent        )<>0 then EFValue:=EFValue or (1 shl  2);
+  if (EFlags and efUseTabCharacters  )<>0 then EFValue:=EFValue or (1 shl  3);
+  if (EFlags and efBackSpaceUnindents)<>0 then EFValue:=EFValue or (1 shl  4);
+  if (EFlags and efPersistentBlocks  )<>0 then EFValue:=EFValue or (1 shl  5);
+  if (EFlags and efSyntaxHighlight   )<>0 then EFValue:=EFValue or (1 shl  6);
+  if (EFlags and efBlockInsCursor    )<>0 then EFValue:=EFValue or (1 shl  7);
+  if (EFlags and efVerticalBlocks    )<>0 then EFValue:=EFValue or (1 shl  8);
+  if (EFlags and efHighlightColumn   )<>0 then EFValue:=EFValue or (1 shl  9);
+  if (EFlags and efHighlightRow      )<>0 then EFValue:=EFValue or (1 shl 10);
+  if (EFlags and efAutoBrackets      )<>0 then EFValue:=EFValue or (1 shl 11);
+  if (EFlags and efKeepTrailingSpaces)<>0 then EFValue:=EFValue or (1 shl 12);
+  if (EFlags and efCodeComplete      )<>0 then EFValue:=EFValue or (1 shl 13);
+
+  R.Assign(0,0,56,19);
   New(D, Init(R, Title));
   New(D, Init(R, Title));
   with D^ do
   with D^ do
   begin
   begin
-    GetExtent(R); R.Grow(-2,-2); R.B.Y:=R.A.Y+7;
+    GetExtent(R); R.Grow(-2,-2); R.B.Y:=R.A.Y+8;
     R2.Copy(R); Inc(R2.A.Y);
     R2.Copy(R); Inc(R2.A.Y);
     New(CB, Init(R2,
     New(CB, Init(R2,
       NewSItem('Create backup ~f~iles',
       NewSItem('Create backup ~f~iles',
@@ -771,8 +788,10 @@ begin
       NewSItem('Highlight ~c~olumn',
       NewSItem('Highlight ~c~olumn',
       NewSItem('Highlight ~r~ow',
       NewSItem('Highlight ~r~ow',
       NewSItem('Aut~o~-closing brackets',
       NewSItem('Aut~o~-closing brackets',
-      nil))))))))))))));
-    CB^.Value:=EFlags;
+      NewSItem('~K~eep trailing spaces',
+      NewSItem('Co~d~eComplete enabled',
+      nil))))))))))))))));
+    CB^.Value:=EFValue;
     Insert(CB);
     Insert(CB);
     R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
     R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
     Insert(New(PLabel, Init(R2, '~E~ditor options', CB)));
     Insert(New(PLabel, Init(R2, '~E~ditor options', CB)));
@@ -806,7 +825,22 @@ begin
   CB^.Select;
   CB^.Select;
   if Desktop^.ExecView(D)=cmOK then
   if Desktop^.ExecView(D)=cmOK then
   begin
   begin
-    TabSize:=StrToInt(IL^.Data^); EFlags:=CB^.Value;
+    EFlags:=0;
+    if (CB^.Value and (1 shl  0))<>0 then EFlags:=EFlags or efBackupFiles;
+    if (CB^.Value and (1 shl  1))<>0 then EFlags:=EFlags or efInsertMode;
+    if (CB^.Value and (1 shl  2))<>0 then EFlags:=EFlags or efAutoIndent;
+    if (CB^.Value and (1 shl  3))<>0 then EFlags:=EFlags or efUseTabCharacters;
+    if (CB^.Value and (1 shl  4))<>0 then EFlags:=EFlags or efBackSpaceUnindents;
+    if (CB^.Value and (1 shl  5))<>0 then EFlags:=EFlags or efPersistentBlocks;
+    if (CB^.Value and (1 shl  6))<>0 then EFlags:=EFlags or efSyntaxHighlight;
+    if (CB^.Value and (1 shl  7))<>0 then EFlags:=EFlags or efBlockInsCursor;
+    if (CB^.Value and (1 shl  8))<>0 then EFlags:=EFlags or efVerticalBlocks;
+    if (CB^.Value and (1 shl  9))<>0 then EFlags:=EFlags or efHighlightColumn;
+    if (CB^.Value and (1 shl 10))<>0 then EFlags:=EFlags or efHighlightRow;
+    if (CB^.Value and (1 shl 11))<>0 then EFlags:=EFlags or efAutoBrackets;
+    if (CB^.Value and (1 shl 12))<>0 then EFlags:=EFlags or efKeepTrailingSpaces;
+    if (CB^.Value and (1 shl 13))<>0 then EFlags:=EFlags or efCodeComplete;
+    TabSize:=StrToInt(IL^.Data^);
     if Editor=nil then
     if Editor=nil then
        begin
        begin
          DefaultTabSize:=TabSize;
          DefaultTabSize:=TabSize;
@@ -823,6 +857,16 @@ begin
   Dispose(D, Done);
   Dispose(D, Done);
 end;
 end;
 
 
+procedure TIDEApp.CodeComplete;
+begin
+  ExecuteDialog(New(PCodeCompleteDialog, Init),nil);
+end;
+
+procedure TIDEApp.CodeTemplates;
+begin
+  ExecuteDialog(New(PCodeTemplatesDialog, Init),nil);
+end;
+
 procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
 procedure TIDEApp.BrowserOptions(Browser: PBrowserWindow);
 var D: PCenterDialog;
 var D: PCenterDialog;
     R,R2,R3 : TRect;
     R,R2,R3 : TRect;
@@ -907,11 +951,11 @@ var R: TRect;
     D: PCenterDialog;
     D: PCenterDialog;
     CB: PCheckBoxes;
     CB: PCheckBoxes;
 begin
 begin
-  R.Assign(0,0,40,10);
+  R.Assign(0,0,40,12);
   New(D, Init(R, 'Desktop Preferences'));
   New(D, Init(R, 'Desktop Preferences'));
   with D^ do
   with D^ do
   begin
   begin
-    GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+6;
+    GetExtent(R); R.Grow(-2,-2); Inc(R.A.Y); R.B.Y:=R.A.Y+8;
     New(CB, Init(R,
     New(CB, Init(R,
       NewSItem('~H~istory lists',
       NewSItem('~H~istory lists',
       NewSItem('~C~lipboard content',
       NewSItem('~C~lipboard content',
@@ -919,7 +963,9 @@ begin
       NewSItem('~B~reakpoints',
       NewSItem('~B~reakpoints',
       NewSItem('~O~pen windows',
       NewSItem('~O~pen windows',
       NewSItem('~S~ymbol information',
       NewSItem('~S~ymbol information',
-      nil))))))));
+      NewSItem('Co~d~eComplete wordlist',
+      NewSItem('Code~T~emplates',
+      nil))))))))));
     CB^.Value:=DesktopFileFlags;
     CB^.Value:=DesktopFileFlags;
     Insert(CB);
     Insert(CB);
     R.Move(0,-1); R.B.Y:=R.A.Y+1;
     R.Move(0,-1); R.B.Y:=R.A.Y+1;
@@ -1122,7 +1168,10 @@ end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.27  1999-11-10 17:18:17  pierre
+  Revision 1.28  2000-02-07 12:02:32  pierre
+   Gabor's changes
+
+  Revision 1.27  1999/11/10 17:18:17  pierre
    + new console for Win32 or other tty for linux
    + new console for Win32 or other tty for linux
 
 
   Revision 1.26  1999/10/14 10:22:50  pierre
   Revision 1.26  1999/10/14 10:22:50  pierre

+ 6 - 3
ide/text/fptools.pas

@@ -149,8 +149,8 @@ implementation
 
 
 uses Dos,
 uses Dos,
      Commands,App,MsgBox,
      Commands,App,MsgBox,
-     WINI,WEditor,
-     FPConst,FPVars,FPUtils;
+     WUtils,WINI,WEditor,
+     FPConst,FPString,FPVars,FPUtils,FPCodCmp,FPCodTmp;
 
 
 {$ifndef NOOBJREG}
 {$ifndef NOOBJREG}
 const
 const
@@ -1507,7 +1507,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.14  1999-10-27 10:43:06  pierre
+  Revision 1.15  2000-02-07 12:00:41  pierre
+   Gabor's changes
+
+  Revision 1.14  1999/10/27 10:43:06  pierre
    * avoid dispose problems for ToolMessages
    * avoid dispose problems for ToolMessages
 
 
   Revision 1.13  1999/08/03 20:22:37  peter
   Revision 1.13  1999/08/03 20:22:37  peter

+ 12 - 7
ide/text/globdir.inc

@@ -63,12 +63,6 @@
   {$endif GDB_V418}
   {$endif GDB_V418}
 {$endif}
 {$endif}
 
 
-{$ifdef GABOR}
-  {.$define NOOBJREG}
-  {$define NODEBUG}
-  {$define DEBUG}
-{$endif}
-
 { include Undo/Redo code from Visa Harvey }
 { include Undo/Redo code from Visa Harvey }
 { let everybody try it out  PM }
 { let everybody try it out  PM }
 { undo should be a bit improved - it does work only with "normal" keystorkes.
 { undo should be a bit improved - it does work only with "normal" keystorkes.
@@ -78,4 +72,15 @@
 {$define Undo}
 {$define Undo}
 {$ifdef DEBUG}
 {$ifdef DEBUG}
   {$define DebugUndo}
   {$define DebugUndo}
-{$endif DEBUG}
+{$endif DEBUG}
+
+{$ifdef FPC}
+  {$define USERESSTRINGS}
+{$endif}
+
+{$ifdef GABOR}
+  {.$define NOOBJREG}
+  {$define NODEBUG}
+  {$define DEBUG}
+  {$undef USERESSTRINGS}
+{$endif}