Browse Source

Merged revisions 1040,2592,3246,3297,3431-3433,3436,3443,3451,3453,3467-3468,3474,3479,3483,3495,3534,3572,3770,3776,3801,3836-3837,3879,3890,3940 via svnmerge from
http://[email protected]/svn/fpc/trunk

........
r1040 | florian | 2005-09-02 23:47:45 +0200 (Fri, 02 Sep 2005) | 2 lines

* activated resourcestrings

........
r2592 | daniel | 2006-02-15 12:36:45 +0100 (Wed, 15 Feb 2006) | 2 lines

* Rename Borland convention to CUA-91 convention.

........
r3246 | daniel | 2006-04-17 17:57:57 +0200 (Mon, 17 Apr 2006) | 2 lines

* Fix compilation.

........
r3297 | peter | 2006-04-20 13:27:53 +0200 (Thu, 20 Apr 2006) | 2 lines

* win64 compile fixes

........
r3431 | daniel | 2006-05-06 16:35:42 +0200 (Sat, 06 May 2006) | 2 lines

* Redesigned the directory option menu.

........
r3432 | daniel | 2006-05-06 18:16:25 +0200 (Sat, 06 May 2006) | 4 lines

* IDE version number to 1.0.8
- Remove giveuptimeslice from wutils (duplicate in drivers.pas)
- Remove Unix compat hack (now handled by video unit).

........
r3433 | daniel | 2006-05-06 19:36:24 +0200 (Sat, 06 May 2006) | 2 lines

* Make listbox in window list one column smaller.

........
r3436 | daniel | 2006-05-06 20:54:17 +0200 (Sat, 06 May 2006) | 2 lines

* Cosmetic arrow change

........
r3443 | daniel | 2006-05-07 00:57:20 +0200 (Sun, 07 May 2006) | 3 lines

* Video and keyboard initialization spaghetti organized and hopefully fixed.
- Remove useless function from validate.pas

........
r3451 | daniel | 2006-05-07 17:32:38 +0200 (Sun, 07 May 2006) | 2 lines

- Remove ver1_0 ifdef

........
r3453 | daniel | 2006-05-08 00:32:43 +0200 (Mon, 08 May 2006) | 3 lines

* More ver1_0 defines removed
* Update compiler options

........
r3467 | daniel | 2006-05-10 00:13:21 +0200 (Wed, 10 May 2006) | 2 lines

* Redesigned syntax tab on compiler options screen

........
r3468 | daniel | 2006-05-10 00:18:43 +0200 (Wed, 10 May 2006) | 2 lines

* Reorder options

........
r3474 | daniel | 2006-05-11 09:46:09 +0200 (Thu, 11 May 2006) | 3 lines

* If overflow checking enabled, disable it for hash calculation. IDE
now works fine if range checking and overflow checking are enabled.

........
r3479 | daniel | 2006-05-11 17:01:27 +0200 (Thu, 11 May 2006) | 2 lines

* Remove color selection and startup option menus for now.

........
r3483 | daniel | 2006-05-12 12:07:46 +0200 (Fri, 12 May 2006) | 2 lines

- Remove redundant inttohex function.

........
r3495 | daniel | 2006-05-13 19:50:29 +0200 (Sat, 13 May 2006) | 2 lines

* Val can handle hexadecimal just fine, no need for specialized routines.

........
r3534 | peter | 2006-05-14 22:27:55 +0200 (Sun, 14 May 2006) | 2 lines

* compile fixes

........
r3572 | daniel | 2006-05-18 23:35:46 +0200 (Thu, 18 May 2006) | 2 lines

* Move processor options to their own tab.

........
r3770 | daniel | 2006-06-03 13:30:54 +0200 (Sat, 03 Jun 2006) | 2 lines

* Fix display refresh command.

........
r3776 | daniel | 2006-06-03 16:35:27 +0200 (Sat, 03 Jun 2006) | 2 lines

* Update default compiler options.

........
r3801 | daniel | 2006-06-04 23:24:16 +0200 (Sun, 04 Jun 2006) | 2 lines

* Update paste command after cut/copy.

........
r3836 | daniel | 2006-06-10 17:35:34 +0200 (Sat, 10 Jun 2006) | 2 lines

* Change two precondition checks into assertions.

........
r3837 | daniel | 2006-06-10 20:48:24 +0200 (Sat, 10 Jun 2006) | 2 lines

* Some improvements regarding code readability.

........
r3879 | marco | 2006-06-16 22:04:22 +0200 (Fri, 16 Jun 2006) | 2 lines

* small fixes due to tcentre

........
r3890 | marco | 2006-06-18 15:19:28 +0200 (Sun, 18 Jun 2006) | 2 lines

* Fixes from Dave Strodtman

........
r3940 | hajny | 2006-06-25 15:56:23 +0200 (Sun, 25 Jun 2006) | 1 line

* ugly hyphenation fixed
........

git-svn-id: branches/fixes_2_0@3955 -

peter 19 years ago
parent
commit
0b12257021
28 changed files with 361 additions and 287 deletions
  1. 8 8
      ide/fp.pas
  2. 5 3
      ide/fpcalc.pas
  3. 10 6
      ide/fpcatch.pas
  4. 4 2
      ide/fpcompil.pas
  5. 26 26
      ide/fpdebug.pas
  6. 15 14
      ide/fpide.pas
  7. 1 1
      ide/fpini.pas
  8. 1 1
      ide/fpmfile.inc
  9. 12 12
      ide/fpmopts.inc
  10. 52 52
      ide/fpredir.pas
  11. 3 3
      ide/fpregs.pas
  12. 1 0
      ide/fpstre.inc
  13. 20 1
      ide/fpswitch.pas
  14. 30 30
      ide/fpusrscr.pas
  15. 1 1
      ide/fpvars.pas
  16. 4 4
      ide/fpviews.pas
  17. 4 2
      ide/globdir.inc
  18. 3 3
      ide/readme.ide
  19. 8 8
      ide/wconsole.pas
  20. 2 0
      ide/wconsts.pas
  21. 15 15
      ide/wconstse.inc
  22. 1 1
      ide/wconstsh.inc
  23. 88 59
      ide/weditor.pas
  24. 5 5
      ide/whelp.pas
  25. 23 11
      ide/whlpview.pas
  26. 12 12
      ide/winclip.pas
  27. 1 1
      ide/windebug.pas
  28. 6 6
      ide/wutils.pas

+ 8 - 8
ide/fp.pas

@@ -15,10 +15,10 @@
 program FP;
 
 {$ifdef IncRes}
-{$ifdef win32}
+{$ifdef Windows}
 {$R fpw32t.rc}
 {$R fpw32ico.rc}
-{$endif win32}
+{$endif Windows}
 {$endif IncRes}
 
 {$I globdir.inc}
@@ -31,9 +31,9 @@ program FP;
 
 uses
 {$ifndef NODEBUG}
-{$ifdef win32}
+{$ifdef Windows}
   fpcygwin,
-{$endif win32}
+{$endif Windows}
 {$endif NODEBUG}
 {$ifdef IDEHeapTrc}
   PPheap,
@@ -176,9 +176,9 @@ begin
                  ButtonCount:=0;
                end;
 {$ifdef fpc}
-          'F' :
+{          'F' :
              if Length(Param)=1 then
-               NoExtendedFrame:=true;
+               NoExtendedFrame:=true;}
 {$ifdef Unix}
           'T' :  DebuggeeTTY:=Copy(Param,2,High(Param));
 {$endif Unix}
@@ -308,10 +308,10 @@ BEGIN
   writeln(bullet+' Compiler Version '+Version_String);
 {$ifndef NODEBUG}
   writeln(bullet+' GBD Version '+GDBVersion);
- {$ifdef win32}
+ {$ifdef Windows}
    writeln(bullet+' Cygwin "',GetCygwinFullName,'" version ',GetCygwinVersionString);
    CheckCygwinVersion;
- {$endif win32}
+ {$endif Windows}
 {$endif NODEBUG}
 
   ProcessParams(true);

+ 5 - 3
ide/fpcalc.pas

@@ -111,9 +111,11 @@ uses
 {$ifdef go32v2}
   dpmiexcp,
 {$endif}
-{$ifdef win32}
-  signals,
-{$endif}
+{$ifdef windows}
+ {$ifdef HasSignal}
+    signals,
+  {$endif}
+{$endif windows}
   FPString,FPUtils,FPConst,WUtils;
 
 const

+ 10 - 6
ide/fpcatch.pas

@@ -30,9 +30,13 @@ uses
 uses
   dpmiexcp;
 {$endif}
-{$ifdef win32}
+{$ifdef Windows}
 uses
-  windows, signals;
+  windows
+  {$ifdef HasSignal}
+    ,signals
+  {$endif}
+  ;
 {$endif}
 
 {$ifdef HasSignal}
@@ -204,16 +208,16 @@ Const
   CatchSignalsEnabled : boolean = false;
 
 Procedure EnableCatchSignals;
-{$ifdef win32}
+{$ifdef Windows}
   var Mode: DWORD;
-{$endif win32}
+{$endif Windows}
 begin
   if CatchSignalsEnabled then
     exit;
-{$ifdef win32}
+{$ifdef Windows}
   if GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @Mode) then
     SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), (Mode or ENABLE_MOUSE_INPUT) and not ENABLE_PROCESSED_INPUT);
-{$endif win32}
+{$endif Windows}
 {$ifdef go32v2}
   djgpp_set_ctrl_c(false);
 {$endif go32v2}

+ 4 - 2
ide/fpcompil.pas

@@ -121,8 +121,10 @@ uses
 {$ifdef go32v2}
   dpmiexcp,
 {$endif}
-{$ifdef win32}
-  signals,
+{$ifdef Windows}
+  {$ifdef HasSignal}
+    signals,
+  {$endif}
 {$endif}
 { $ifdef HasSignal}
   fpcatch,

+ 26 - 26
ide/fpdebug.pas

@@ -21,9 +21,9 @@ end.
 interface
 {$i globdir.inc}
 uses
-{$ifdef win32}
+{$ifdef Windows}
   Windows,
-{$endif win32}
+{$endif Windows}
   Objects,Dialogs,Drivers,Views,
 {$ifndef NODEBUG}
   GDBCon,GDBInt,
@@ -40,7 +40,7 @@ type
 
      { if true the current debugger raw will stay in middle of
        editor window when debugging PM }
-     CenterDebuggerRow : boolean;
+     CenterDebuggerRow : TCentre;
      Disableallinvalidbreakpoints : boolean;
      OrigPwd,  { pwd at startup }
      LastFileName : string;
@@ -338,9 +338,9 @@ uses
 {$endif DOS}
   App,Strings,
   FVConsts,
-{$ifdef win32}
+{$ifdef Windows}
   Windebug,
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
   {$ifdef VER1_0}
     Linux,
@@ -468,20 +468,20 @@ begin
 { should we also use / chars ? }
   for i:=1 to Length(st) do
     if st[i]='\' then
-{$ifdef win32}
+{$ifdef Windows}
   { Don't touch at '\ ' used to escapes spaces in windows file names PM }
      if (i=length(st)) or (st[i+1]<>' ') then
-{$endif win32}
+{$endif Windows}
       st[i]:='/';
-{$ifdef win32}
-{ for win32 we should convert e:\ into //e/ PM }
+{$ifdef Windows}
+{ for Windows we should convert e:\ into //e/ PM }
   if (length(st)>2) and (st[2]=':') and (st[3]='/') then
     st:=CygDrivePrefix+'/'+st[1]+copy(st,3,length(st));
 { support spaces in the name by escaping them but without changing '\ ' into '\\ ' }
   for i:=Length(st) downto 1 do
     if (st[i]=' ') and ((i=1) or (st[i-1]<>'\')) then
       st:=copy(st,1,i-1)+'\'+copy(st,i,length(st));
-{$endif win32}
+{$endif Windows}
 {$ifdef go32v2}
 { for go32v2 we should convert //e/ back into e:/  PM }
   if (length(st)>3) and (st[1]='/') and (st[2]='/') and (st[4]='/') then
@@ -500,13 +500,13 @@ begin
 {$ifdef Unix}
   OSFileName:=st;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
  {$ifndef NODEBUG}
-{ for win32 we should convert /cygdrive/e/ into e:\ PM }
+{ for Windows we should convert /cygdrive/e/ into e:\ PM }
   if pos(CygDrivePrefix+'/',st)=1 then
     st:=st[Length(CygdrivePrefix)+2]+':\'+copy(st,length(CygdrivePrefix)+4,length(st));
  {$endif NODEBUG}
-{$endif win32}
+{$endif Windows}
 { support spaces in the name by escaping them but without changing '\ ' into '\\ ' }
   for i:=Length(st) downto 2 do
     if (st[i]=' ') and (st[i-1]='\') then
@@ -762,14 +762,14 @@ begin
   else
     begin
 {$endif SUPPORT_REMOTE}
-{$ifdef win32}
+{$ifdef Windows}
   { Run the debugge in another console }
   if DebuggeeTTY<>'' then
     Command('set new-console on')
   else
     Command('set new-console off');
   NoSwitch:=DebuggeeTTY<>'';
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
   { Run the debuggee in another tty }
   if DebuggeeTTY <> '' then
@@ -1262,17 +1262,17 @@ begin
      end;
   { In case we have something that the compiler touched }
   AskToReloadAllModifiedFiles;
-{$ifdef win32}
+{$ifdef Windows}
   main_pid_valid:=false;
-{$endif win32}
+{$endif Windows}
 end;
 
 
 procedure TDebugController.DoDebuggerScreen;
-{$ifdef win32}
+{$ifdef Windows}
   var
    IdeMode : DWord;
-{$endif win32}
+{$endif Windows}
 begin
   if NoSwitch then
     begin
@@ -1284,7 +1284,7 @@ begin
       Message(Application,evBroadcast,cmDebuggerStopped,pointer(ptrint(RunCount)));
       PopStatus;
     end;
-{$ifdef win32}
+{$ifdef Windows}
    if NoSwitch then
      begin
        { Ctrl-C as normal char }
@@ -1293,16 +1293,16 @@ begin
        SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode);
      end;
    ChangeDebuggeeWindowTitleTo(Stopped_State);
-{$endif win32}
+{$endif Windows}
 end;
 
 
 procedure TDebugController.DoUserScreen;
 
-{$ifdef win32}
+{$ifdef Windows}
   var
    IdeMode : DWord;
-{$endif win32}
+{$endif Windows}
 begin
   Inc(RunCount);
   if NoSwitch then
@@ -1322,7 +1322,7 @@ begin
       PushStatus(msg_runningprogram);
       IDEApp.ShowUserScreen;
     end;
-{$ifdef win32}
+{$ifdef Windows}
    if NoSwitch then
      begin
        { Ctrl-C as interrupt }
@@ -1331,7 +1331,7 @@ begin
        SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), IdeMode);
      end;
    ChangeDebuggeeWindowTitleTo(Running_State);
-{$endif win32}
+{$endif Windows}
 end;
 
 {$endif NODEBUG}
@@ -2070,7 +2070,7 @@ begin
   if W<>nil then
     begin
       W^.Select;
-      W^.Editor^.TrackCursor(true);
+      W^.Editor^.TrackCursor(do_centre);
       W^.Editor^.SetLineFlagExclusive(lfHighlightRow,P^.Breakpoint^.Line);
     end;
   if Assigned(Owner) then

+ 15 - 14
ide/fpide.pas

@@ -288,9 +288,9 @@ begin
   if (StartupOptions and soHeapMonitor)=0 then HeapView^.Hide;
   Insert(HeapView);
   Drivers.ShowMouse;
-{$ifdef win32}
-  // Win32ShowMouse;
-{$endif win32}
+{$ifdef Windows}
+  // WindowsShowMouse;
+{$endif Windows}
 end;
 
 procedure TIDEApp.InitDesktop;
@@ -913,35 +913,35 @@ begin
 {$ifndef go32v2}
   initvideo;
 {$endif ndef go32v2}
-{$ifdef win32}
+{$ifdef Windows}
   { write the empty screen to dummy console handle }
   UpdateScreen(true);
-{$endif ndef win32}
+{$endif ndef Windows}
   InitEvents;
   InitSysError;
   CurDirChanged;
-{$ifndef win32}
+{$ifndef Windows}
   Message(Application,evBroadcast,cmUpdate,nil);
-{$endif win32}
-{$ifdef win32}
-  // Win32ShowMouse;
-{$endif win32}
+{$endif Windows}
+{$ifdef Windows}
+  // WindowsShowMouse;
+{$endif Windows}
 
   if Assigned(UserScreen) then
     UserScreen^.SwitchBackToIDEScreen;
-{$ifdef win32}
+{$ifdef Windows}
   { This message was sent when the VideoBuffer was smaller
     than was the IdeApp thought => writes to random memory and random crashes... PM }
   Message(Application,evBroadcast,cmUpdate,nil);
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
   SetKnownKeys;
 {$endif Unix}
-{$ifndef win32}
+{$ifndef Windows}
 {$ifndef go32v2}
   UpdateScreen(true);
 {$endif go32v2}
-{$endif win32}
+{$endif Windows}
 end;
 
 function TIDEApp.AutoSave: boolean;
@@ -1064,6 +1064,7 @@ begin
   UpdatePrimaryFile;
   UpdateINIFile;
   Message(Application,evBroadcast,cmCommandSetChanged,nil);
+  application^.redraw;
 end;
 
 procedure TIDEApp.SourceWindowClosed;

+ 1 - 1
ide/fpini.pas

@@ -499,7 +499,7 @@ begin
   { Desktop }
   DesktopFileFlags:=INIFile^.GetIntEntry(secPreferences,ieDesktopFlags,DesktopFileFlags);
   { Debugger }
-  IniCenterDebuggerRow:=INIFile^.GetIntEntry(secPreferences,ieCenterDebuggerRow,1)<>0;
+  IniCenterDebuggerRow:=tcentre(INIFile^.GetIntEntry(secPreferences,ieCenterDebuggerRow,1));
   { Preferences }
   AutoSaveOptions:=INIFile^.GetIntEntry(secPreferences,ieAutoSave,AutoSaveOptions);
   MiscOptions:=INIFile^.GetIntEntry(secPreferences,ieMiscOptions,MiscOptions);

+ 1 - 1
ide/fpmfile.inc

@@ -95,7 +95,7 @@ begin
          GetDir(DriveNumber,StoreDir2);
 {$ifndef FPC}
          ChDir(Copy(FileDir,1,2));
-           { sets InOutRes in win32 PM }
+           { sets InOutRes in Windows PM }
 {$endif not FPC}
        end;
      if (FileDir<>'') and ExistsDir(FileDir) then

+ 12 - 12
ide/fpmopts.inc

@@ -459,7 +459,7 @@ begin
     LibLinkerSwitches^.SetCurrSel(RB2^.Value);
     OtherLinkerSwitches^.SetBooleanItem(1,CB2^.Mark(0));
     if LibLinkerSwitches^.GetCurrSelParam='X' then
-     if CompareText(TargetSwitches^.GetCurrSelParam,'win32')=0 then
+     if CompareText(TargetSwitches^.GetCurrSelParam,'Windows')=0 then
       if CompareText(AsmOutputSwitches^.GetCurrSelParam,'pecoff')<>0 then
         if ConfirmBox(
           FormatStrStr3(msg_xmustbesettoyforz_doyouwanttochangethis,
@@ -477,24 +477,24 @@ var R,R2,R3: TRect;
     D: PCenterDialog;
     RB,RB2 : PRadioButtons;
     CBStrip: PCheckBoxes;
-{$ifdef win32}
+{$ifdef Windows}
     CB2: PCheckBoxes;
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
     IL: PEditorInputLine;
 {$endif Unix}
     L,I: longint;
     Items: PSItem;
 const
-{$ifdef win32}
+{$ifdef Windows}
   OtherFieldLines = 3;
-{$else not win32}
+{$else not Windows}
 {$ifdef Unix}
   OtherFieldLines = 3;
 {$else not Unix}
   OtherFieldLines = 0;
 {$endif Unix}
-{$endif win32}
+{$endif Windows}
 begin
   R.Assign(0,0,60,2+DebugInfoSwitches^.ItemCount+1+2
       +ProfileInfoSwitches^.ItemCount+2+OtherFieldLines);
@@ -534,7 +534,7 @@ begin
     R2.Move(0,-1); R2.B.Y:=R2.A.Y+1;
     Insert(New(PLabel, Init(R2, label_debugger_profileswitches, RB2)));
 
-{$ifdef win32}
+{$ifdef Windows}
     R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
     New(CB2,Init(R2,NewSItem(label_debugger_useanotherconsole, nil)));
     Insert(CB2);
@@ -545,7 +545,7 @@ begin
     CB2^.SetData(L);
     R2.Move(0,-1);
     Insert(New(PLabel, Init(R2,label_debugger_redirection, CB2)));
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
     R2.Move(0,ProfileInfoSwitches^.ItemCount+3);
     New(IL, Init(R2, 255));
@@ -553,7 +553,7 @@ begin
     Insert(IL);
     R2.Move(0,-1);
     Insert(New(PLabel, Init(R2,label_debugger_useanothertty, IL)));
-{$endif win32}
+{$endif Windows}
   end;
   InsertButtons(D);
   RB^.Select;
@@ -562,12 +562,12 @@ begin
     DebugInfoSwitches^.SetCurrSel(RB^.Value);
     ProfileInfoSwitches^.SetCurrSel(RB2^.Value);
     OtherLinkerSwitches^.SetBooleanItem(0,CBStrip^.Mark(0));
-{$ifdef win32}
+{$ifdef Windows}
     if CB2^.value<>0 then
       DebuggeeTTY:='on'
     else
       DebuggeeTTY:='';
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
     DebuggeeTTY:=IL^.Data^;
 {$endif Unix}
@@ -1340,7 +1340,7 @@ begin
     HelpCtx:=hcMouse;
     GetExtent(R); R.Grow(-3,-2); inc(R.A.Y); R.B.Y:=R.A.Y+2;
     New(RBkb, Init(R,
-      NewSItem('~B~orland convention (Shift+Del,Ctrl+Ins,Shift+Ins)',
+      NewSItem('~C~UA-91 convention (Shift+Del,Ctrl+Ins,Shift+Ins)',
       NewSItem('~M~icrosoft convention (Ctrl+X,Ctrl+C,Ctrl+V)',
       nil))));
     RBkb^.Press(integer(EditKeys));

+ 52 - 52
ide/fpredir.pas

@@ -33,7 +33,7 @@ Interface
 {$ifdef OS2}
 {$define shell_implemented}
 {$endif}
-{$ifdef Win32}
+{$ifdef Windows}
 {$define implemented}
 {$endif}
 {$ifdef linux}
@@ -96,9 +96,9 @@ Uses
 {$ifdef netware_clib}
   nwserv,
 {$endif netware_clib}
-{$ifdef win32}
+{$ifdef Windows}
   windows,
-{$endif win32}
+{$endif Windows}
 {$ifdef unix}
   {$ifdef ver1_0}
     linux,
@@ -188,13 +188,13 @@ end;
 
 {$ifdef TP}
 
-{$ifndef win32}
+{$ifndef Windows}
 const
   UnusedHandle    = -1;
   StdInputHandle  = 0;
   StdOutputHandle = 1;
   StdErrorHandle  = 2;
-{$endif win32}
+{$endif Windows}
 
 Type
   PtrRec = packed record
@@ -280,7 +280,7 @@ end;
 
 {$endif def go32v2}
 
-{$ifdef win32}
+{$ifdef Windows}
 Function fpclose(Handle : Longint) : boolean;
 begin
   { Do we need this ?? }
@@ -391,14 +391,14 @@ function ChangeRedirOut(Const Redir : String; AppendToFile : Boolean) : Boolean;
     ChangeRedirOut:=True;
     OutRedirDisabled:=False;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     if SetStdHandle(Std_Output_Handle,FileRec(FOUT^).Handle) then
-{$else not win32}
+{$else not Windows}
     TempHOut:=fpdup(StdOutputHandle);
     fpdup2(FileRec(FOUT^).Handle,StdOutputHandle);
     if (TempHOut<>UnusedHandle) and
        (StdOutputHandle<>UnusedHandle) then
-{$endif not win32}
+{$endif not Windows}
       begin
          ChangeRedirOut:=True;
          OutRedirDisabled:=False;
@@ -424,14 +424,14 @@ function ChangeRedirIn(Const Redir : String) : Boolean;
     ChangeRedirIn:=True;
     InRedirDisabled:=False;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     if SetStdHandle(Std_Input_Handle,FileRec(FIN^).Handle) then
-{$else not win32}
+{$else not Windows}
     TempHIn:=fpdup(StdInputHandle);
     fpdup2(FileRec(FIn^).Handle,StdInputHandle);
     if (TempHIn<>UnusedHandle) and
        (StdInputHandle<>UnusedHandle) then
-{$endif not win32}
+{$endif not Windows}
       begin
          ChangeRedirIn:=True;
          InRedirDisabled:=False;
@@ -461,14 +461,14 @@ function ChangeRedirError(Const Redir : String; AppendToFile : Boolean) : Boolea
     ChangeRedirError:=True;
     ErrorRedirDisabled:=False;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     if SetStdHandle(Std_Error_Handle,FileRec(FERR^).Handle) then
-{$else not win32}
+{$else not Windows}
     TempHError:=fpdup(StdErrorHandle);
     fpdup2(FileRec(FERR^).Handle,StdErrorHandle);
     if (TempHError<>UnusedHandle) and
        (StdErrorHandle<>UnusedHandle) then
-{$endif not win32}
+{$endif not Windows}
       begin
          ChangeRedirError:=True;
          ErrorRedirDisabled:=False;
@@ -520,11 +520,11 @@ end;
     Handles^[StdOutputHandle]:=OldHandleOut;
     OldHandleOut:=StdOutputHandle;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Output_Handle,StdOutputHandle);
-{$else not win32}
+{$else not Windows}
     fpdup2(TempHOut,StdOutputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif FPC}
     Close (FOUT^);
     fpclose(TempHOut);
@@ -541,11 +541,11 @@ end;
     Handles^[StdInputHandle]:=OldHandleIn;
     OldHandleIn:=StdInputHandle;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Input_Handle,StdInputHandle);
-{$else not win32}
+{$else not Windows}
     fpdup2(TempHIn,StdInputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     Close (FIn^);
     fpclose(TempHIn);
@@ -562,11 +562,11 @@ end;
 {$ifndef FPC}
     Handles^[StdInputHandle]:=OldHandleIn;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Input_Handle,StdInputHandle);
-{$else not win32}
+{$else not Windows}
     fpdup2(TempHIn,StdInputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     InRedirDisabled:=True;
   end;
@@ -582,11 +582,11 @@ end;
     Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
     Handles^[StdInputHandle]:=Handles^[FileRec (FIn^).Handle];
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Input_Handle,FileRec(FIn^).Handle);
-{$else not win32}
+{$else not Windows}
     fpdup2(FileRec(FIn^).Handle,StdInputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     InRedirDisabled:=False;
   end;
@@ -601,11 +601,11 @@ end;
 {$ifndef FPC}
     Handles^[StdOutputHandle]:=OldHandleOut;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Output_Handle,StdOutputHandle);
-{$else not win32}
+{$else not Windows}
     fpdup2(TempHOut,StdOutputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     OutRedirDisabled:=True;
   end;
@@ -621,11 +621,11 @@ end;
     Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
     Handles^[StdOutputHandle]:=Handles^[FileRec (FOut^).Handle];
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Output_Handle,FileRec(FOut^).Handle);
-{$else not win32}
+{$else not Windows}
     fpdup2(FileRec(FOut^).Handle,StdOutputHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     OutRedirDisabled:=False;
   end;
@@ -640,11 +640,11 @@ end;
     Handles^[StdErrorHandle]:=OldHandleError;
     OldHandleError:=StdErrorHandle;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Error_Handle,StdErrorHandle);
-{$else not win32}
+{$else not Windows}
     fpdup2(TempHError,StdErrorHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     Close (FERR^);
     fpclose(TempHError);
@@ -661,11 +661,11 @@ end;
 {$ifndef FPC}
     Handles^[StdErrorHandle]:=OldHandleError;
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Error_Handle,StdErrorHandle);
-{$else not win32}
+{$else not Windows}
     {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(TempHError,StdErrorHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     ErrorRedirDisabled:=True;
   end;
@@ -681,11 +681,11 @@ end;
     Handles:=Ptr (prefseg, PWord (Ptr (prefseg, $34))^);
     Handles^[StdErrorHandle]:=Handles^[FileRec (FErr^).Handle];
 {$else}
-{$ifdef win32}
+{$ifdef Windows}
     SetStdHandle(Std_Error_Handle,FileRec(FErr^).Handle);
-{$else not win32}
+{$else not Windows}
     {$ifdef ver1_0}dup2{$else}fpdup2{$endif}(FileRec(FERR^).Handle,StdErrorHandle);
-{$endif not win32}
+{$endif not Windows}
 {$endif}
     ErrorRedirDisabled:=False;
   end;
@@ -693,10 +693,10 @@ end;
 {............................................................................}
 
 function ExecuteRedir (Const ProgName, ComLine, RedirStdIn, RedirStdOut, RedirStdErr : String) : boolean;
-{$ifdef win32}
+{$ifdef Windows}
 var
   mode : word;
-{$endif win32}
+{$endif Windows}
 Begin
   RedirErrorOut:=0; RedirErrorIn:=0; RedirErrorError:=0;
   ExecuteResult:=0;
@@ -714,12 +714,12 @@ Begin
   ExecuteRedir:=(IOStatus=0) and (RedirErrorOut=0) and
                 (RedirErrorIn=0) and (RedirErrorError=0) and
                 (ExecuteResult=0);
-{$ifdef win32}
+{$ifdef Windows}
   // reenable mouse events
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @mode);
   mode:=mode or ENABLE_MOUSE_INPUT;
   SetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), mode);
-{$endif win32}
+{$endif Windows}
 End;
 
 {............................................................................}
@@ -930,10 +930,10 @@ end;
 {............................................................................}
 
   procedure DosExecute(ProgName, ComLine : String);
-{$ifdef win32}
+{$ifdef Windows}
     var
       StoreInherit : BOOL;
-{$endif win32}
+{$endif Windows}
 
   Begin
 {$IfDef MsDos}
@@ -950,10 +950,10 @@ end;
         ExecuteResult:=((-ExecuteResult) and $ff00) shr 8;
       end;
 {$else}
-  {$ifdef win32}
+  {$ifdef Windows}
     StoreInherit:=ExecInheritsHandles;
     ExecInheritsHandles:=true;
-  {$endif win32}
+  {$endif Windows}
     DosError:=0;
     If UseComSpec then
       Dos.Exec (Getenv('COMSPEC'),'/C '+MaybeQuoted(FixPath(progname))+' '+Comline)
@@ -964,9 +964,9 @@ end;
         else
           DosError:=2;
       end;
-  {$ifdef win32}
+  {$ifdef Windows}
     ExecInheritsHandles:=StoreInherit;
-  {$endif win32}
+  {$endif Windows}
     IOStatus:=DosError;
     ExecuteResult:=DosExitCode;
 {$endif}

+ 3 - 3
ide/fpregs.pas

@@ -20,9 +20,9 @@ end.
 {$else NODEBUG}
 interface
 uses
-{$ifdef win32}
+{$ifdef Windows}
   Windows,
-{$endif win32}
+{$endif Windows}
   Objects,Dialogs,Drivers,Views,
   FPViews;
 
@@ -342,7 +342,7 @@ Const
                         rs.esp:=v
                       else if reg='ebp' then
                         rs.ebp:=v
-                      { under win32 flags are on a register named ps !! PM }
+                      { under Windows flags are on a register named ps !! PM }
                       else if (reg='eflags') or (reg='ps') then
                         rs.eflags:=v
                       else if reg='cs' then

+ 1 - 0
ide/fpstre.inc

@@ -810,6 +810,7 @@ const
       opt_objmethcallvalid = 'Object ~m~ethod call checking';
       { Code generation }
       opt_pic = '~P~osition independend code';
+      opt_smart = '~C~reate smartlinkable units';
       { Code options }
       opt_generatefastercode = 'Generate ~f~aster code';
       opt_generatesmallercode = 'Generate s~m~aller code';

+ 20 - 1
ide/fpswitch.pas

@@ -1011,6 +1011,7 @@ begin
      AddBooleanItem(opt_overflowchecking,'o',idOverflowChecks);
      AddBooleanItem(opt_objmethcallvalid,'R',idObjMethCallChecks);
      AddBooleanItem(opt_pic,'g',idNone);
+     AddBooleanItem(opt_smart,'X',idNone);
    end;
   New(OptimizingGoalSwitches,InitSelect('O'));
   with OptimizingGoalSwitches^ do
@@ -1188,7 +1189,11 @@ begin
        { 2 MB heap }
        MemorySwitches^.SetLongintItem(1,1024*1024*2);
        { goto/lable allowed }
+       SyntaxSwitches^.SetBooleanItem(1,true);
+       { inline allowed }
        SyntaxSwitches^.SetBooleanItem(3,true);
+       { Exe size complaints are louder than speed complaints: Optimize for size by default. }
+       OptimizingGoalSwitches^.SetCurrSel(1);
        case i of
           om_debug:
             begin
@@ -1200,15 +1205,29 @@ begin
                CodegenSwitches^.SetBooleanItem(2,true);
                { overflow checking }
                CodegenSwitches^.SetBooleanItem(3,true);
+               { method call checking }
+               CodegenSwitches^.SetBooleanItem(4,true);
+               { assertions on }
+               SyntaxSwitches^.SetBooleanItem(4,true);
             end;
           om_normal:
             begin
+               {Register variables.}
+               OptimizationSwitches^.SetBooleanItem(0,true);
+               {Level 1 optimizations.}
                OptimizationSwitches^.SetBooleanItem(2,true);
             end;
           om_release:
             begin
-               OptimizationSwitches^.SetBooleanItem(2,true);
+               {Register variables.}
+               OptimizationSwitches^.SetBooleanItem(0,true);
+               {Level 2 optimizations.}
                OptimizationSwitches^.SetBooleanItem(3,true);
+               {Smart linking.}
+               LibLinkerSwitches^.SetCurrSel(3);
+               CodegenSwitches^.SetBooleanItem(6,true);
+               {Strip debug info}
+               OtherLinkerSwitches^.SetBooleanItem(0,true);
             end;
        end;
        { set appriopriate default target }

+ 30 - 30
ide/fpusrscr.pas

@@ -18,9 +18,9 @@ unit FPUsrScr;
 interface
 
 uses
-{$ifdef win32}
+{$ifdef Windows}
   windows,
-{$endif win32}
+{$endif Windows}
 {$ifdef Unix}
   {$ifdef VER1_0}
     linux,
@@ -194,9 +194,9 @@ type
     end;
 {$endif}
 
-{$ifdef win32}
-    PWin32Screen = ^TWin32Screen;
-    TWin32Screen = object(TScreen)
+{$ifdef Windows}
+    PWindowsScreen = ^TWindowsScreen;
+    TWindowsScreen = object(TScreen)
       constructor Init;
       destructor  Done; virtual;
     public
@@ -975,10 +975,10 @@ end;
 {$endif}
 
 {****************************************************************************
-                                 TWin32Screen
+                                 TWindowsScreen
 ****************************************************************************}
 
-{$ifdef win32}
+{$ifdef Windows}
 
 procedure UpdateFileHandles;
 begin
@@ -990,7 +990,7 @@ begin
   {TextRec(StdErr).Handle:=StdErrorHandle;}
 end;
 
-constructor TWin32Screen.Init;
+constructor TWindowsScreen.Init;
 var
   SecurityAttr : Security_attributes;
   BigWin : Coord;
@@ -1016,9 +1016,9 @@ begin
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
   IdeMode:=ConsoleMode;
 {$ifdef debug}
-{define win32bigwin}
+{define Windowsbigwin}
 {$endif debug}
-{$ifdef win32bigwin}
+{$ifdef Windowsbigwin}
   GetConsoleScreenBufferInfo(StartScreenBufferHandle,
     @ConsoleScreenBufferInfo);
   BigWin.X:=ConsoleScreenBufferInfo.dwSize.X;
@@ -1030,7 +1030,7 @@ begin
   res:=SetConsoleScreenBufferSize(StartScreenBufferHandle,BigWin);
   if not res then
     error:=GetLastError;
-{$endif win32bigwin}
+{$endif Windowsbigwin}
   GetConsoleScreenBufferInfo(StartScreenBufferHandle,
     @ConsoleScreenBufferInfo);
   { make sure that the IDE Screen Handle has the maximum display size
@@ -1046,7 +1046,7 @@ begin
   SwitchBackToIDEScreen;
 end;
 
-destructor TWin32Screen.Done;
+destructor TWindowsScreen.Done;
 begin
   { copy the Dos buffer content into the original ScreenBuffer
     which remains the startup std_output_handle PM }
@@ -1060,7 +1060,7 @@ begin
   inherited Done;
 end;
 
-function TWin32Screen.GetWidth: integer;
+function TWindowsScreen.GetWidth: integer;
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
 begin
@@ -1069,7 +1069,7 @@ begin
   GetWidth:=ConsoleScreenBufferInfo.dwSize.X;
 end;
 
-function TWin32Screen.GetHeight: integer;
+function TWindowsScreen.GetHeight: integer;
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
 begin
@@ -1078,7 +1078,7 @@ begin
   GetHeight:=ConsoleScreenBufferInfo.dwSize.Y;
 end;
 
-function TWin32Screen.CanScroll : boolean;
+function TWindowsScreen.CanScroll : boolean;
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
   BufferLines : longint;
@@ -1092,7 +1092,7 @@ begin
   CanScroll:=(BufferLines>WindowLines);
 end;
 
-function TWin32Screen.Scroll(i : integer) : integer;
+function TWindowsScreen.Scroll(i : integer) : integer;
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
   ConsoleWindow : Small_rect;
@@ -1116,7 +1116,7 @@ begin
     Scroll:=0;
 end;
 
-procedure TWin32Screen.GetLine(Line: integer; var Text, Attr: string);
+procedure TWindowsScreen.GetLine(Line: integer; var Text, Attr: string);
 type
   CharInfoArray = Array [0..255] of Char_Info;
 var
@@ -1153,7 +1153,7 @@ begin
 end;
 
 
-procedure TWin32Screen.GetCursorPos(var P: TPoint);
+procedure TWindowsScreen.GetCursorPos(var P: TPoint);
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
 begin
@@ -1163,7 +1163,7 @@ begin
   P.Y:=ConsoleScreenBufferInfo.dwCursorPosition.Y;
 end;
 
-procedure TWin32Screen.BufferCopy(Src, Dest : THandle);
+procedure TWindowsScreen.BufferCopy(Src, Dest : THandle);
 type
   CharInfoArray = Array [0..256*255-1] of Char_Info;
 var
@@ -1243,7 +1243,7 @@ begin
   SetConsoleCursorPosition(Dest, ConsoleScreenBufferInfo.dwCursorPosition);
 end;
 
-procedure TWin32Screen.Capture;
+procedure TWindowsScreen.Capture;
 begin
   {if StartScreenBufferHandle=IdeScreenBufferHandle then
     BufferCopy(IDEScreenBufferHandle,DosScreenBufferHandle)
@@ -1252,14 +1252,14 @@ begin
   SaveConsoleScreen;
 end;
 
-procedure TWin32Screen.Restore;
+procedure TWindowsScreen.Restore;
 begin
   SwitchToConsoleScreen;
 end;
 
-{ dummy for win32 as the Buffer screen
+{ dummy for Windows as the Buffer screen
   do hold all the info }
-procedure TWin32Screen.SaveIDEScreen;
+procedure TWindowsScreen.SaveIDEScreen;
 begin
   IdeScreenMode:=ScreenMode;
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @IdeMode);
@@ -1268,9 +1268,9 @@ begin
   UpdateFileHandles;
 end;
 
-{ dummy for win32 as the Buffer screen
+{ dummy for Windows as the Buffer screen
   do hold all the info }
-procedure TWin32Screen.SaveConsoleScreen;
+procedure TWindowsScreen.SaveConsoleScreen;
 begin
   GetConsoleMode(GetStdHandle(cardinal(Std_Input_Handle)), @ConsoleMode);
   { set the dummy buffer as active already now PM }
@@ -1278,7 +1278,7 @@ begin
   UpdateFileHandles;
 end;
 
-procedure TWin32Screen.SwitchToConsoleScreen;
+procedure TWindowsScreen.SwitchToConsoleScreen;
 begin
   SetConsoleActiveScreenBuffer(DosScreenBufferHandle);
   SetStdHandle(cardinal(Std_Output_Handle),DosScreenBufferHandle);
@@ -1287,7 +1287,7 @@ begin
   IDEActive:=false;
 end;
 
-procedure TWin32Screen.SwitchBackToIDEScreen;
+procedure TWindowsScreen.SwitchBackToIDEScreen;
 var
   ConsoleScreenBufferInfo : Console_screen_buffer_info;
   WindowPos : Small_rect;
@@ -1480,8 +1480,8 @@ begin
     UserScreen:=New(PLinuxScreen, Init);
   {$else}
 
-    {$ifdef Win32}
-      UserScreen:=New(PWin32Screen, Init);
+    {$ifdef Windows}
+      UserScreen:=New(PWindowsScreen, Init);
     {$else}
       {$ifdef OS2}
         UserScreen:=New(POS2Screen, Init);
@@ -1492,7 +1492,7 @@ begin
           UserScreen:=New(PScreen, Init);
         {$endif netwlibc}
       {$endif OS2}
-    {$endif Win32}
+    {$endif Windows}
   {$endif Unix}
 {$endif Dos}
 end;

+ 1 - 1
ide/fpvars.pas

@@ -108,7 +108,7 @@ const ClipboardWindow  : PClipboardWindow = nil;
       AutoSaveOptions  : longint = asEnvironment+asDesktop;
       MiscOptions      : longint = moChangeDirOnOpen+moCloseOnGotoSource;
       EditorModified   : boolean = false;
-      IniCenterDebuggerRow : boolean = true;
+      IniCenterDebuggerRow : tcentre = do_centre;
       SleepTimeOut     : longint = trunc(10*18.2);
 {$ifdef USE_EXTERNAL_COMPILER}
       UseExternalCompiler : boolean = true;

+ 4 - 4
ide/fpviews.pas

@@ -1347,7 +1347,7 @@ begin
       if JumpPos.X<>-1 then
       begin
         SetCurPtr(JumpPos.X,JumpPos.Y);
-        TrackCursor(true);
+        TrackCursor(do_centre);
       end;
     end;
 end;
@@ -2577,7 +2577,7 @@ begin
       SetCurPtr(0,DisasLines^.IndexOf(PL));
       PL^.SetFlags(lfDebuggerRow);
       CurL:=PL;
-      TrackCursor(false);
+      TrackCursor(do_not_centre);
     end;
   GetCurrentLine:=PL;
 end;
@@ -3009,7 +3009,7 @@ begin
   if W<>nil then
     begin
       W^.Select;
-      W^.Editor^.TrackCursor(true);
+      W^.Editor^.TrackCursor(do_centre);
       W^.Editor^.SetLineFlagExclusive(lfHighlightRow,Row);
     end;
   if Assigned(Owner) then
@@ -3758,7 +3758,7 @@ begin
        with W^.Editor^ do
        begin
          SetCurPtr(CurX,CurY);
-         TrackCursor(true);
+         TrackCursor(do_centre);
        end;
     W^.HelpCtx:=hcSourceWindow;
     Desktop^.Insert(W);

+ 4 - 2
ide/globdir.inc

@@ -70,11 +70,13 @@
   {$define HasSysMsgUnit}
 {$endif}
 
-{$ifdef Win32}
+{$ifdef Windows}
   {$undef SUPPORTVESA}
   {$define SUPPORTREDIR}
   {$define WinClipSupported}
-  {$define HasSignal}
+  {$ifdef win32}
+    {$define HasSignal}
+  {$endif}
   {$define FSCaseInsensitive}
   {$define HasSysMsgUnit}
 {$endif}

+ 3 - 3
ide/readme.ide

@@ -105,9 +105,9 @@
  switches into Linux console mode and makes use of the
  /dev/vcsa* devices to display the full character set. To
  make use of this mode, you must use a VGA console font in
- codepage 437, 850, 852 etc. encoding. If your distrib-
- ution uses /etc/sysconfig/console, these are good values
- to put into that file:
+ codepage 437, 850, 852 etc. encoding. If your distribution
+ uses /etc/sysconfig/console, these are good values to put
+ into that file:
 
  CONSOLE_FONT="cp850-8x16"
  CONSOLE_SCREENMAP="8859-1_to_uni.trans"

+ 8 - 8
ide/wconsole.pas

@@ -32,9 +32,9 @@ interface
 {$ifdef UNIX}
       TermIos
 {$endif UNIX}
-{$ifdef Win32}
+{$ifdef Windows}
       dword
-{$endif Win32}
+{$endif Windows}
 {$ifdef go32v2}
       longint
 {$endif go32v2}
@@ -46,19 +46,19 @@ Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
 Procedure RestoreConsoleMode(const ConsoleMode : TConsoleMode);
 
 implementation
-{$ifdef Win32}
+{$ifdef Windows}
   uses
     windows;
-{$endif Win32}
+{$endif Windows}
 
 Procedure SaveConsoleMode(var ConsoleMode : TConsoleMode);
 Begin
 {$ifdef UNIX}
   TCGetAttr(1,ConsoleMode);
 {$endif UNIX}
-{$ifdef Win32}
+{$ifdef Windows}
   GetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
-{$endif Win32}
+{$endif Windows}
 {$ifdef go32v2}
   ConsoleMode:=0;
 {$endif go32v2}
@@ -72,9 +72,9 @@ Begin
 {$ifdef UNIX}
   TCSetAttr(1,TCSANOW,ConsoleMode);
 {$endif UNIX}
-{$ifdef Win32}
+{$ifdef Windows}
   SetConsoleMode(GetStdHandle(STD_INPUT_HANDLE),ConsoleMode);
-{$endif Win32}
+{$endif Windows}
 {$ifdef go32v2}
 {$endif go32v2}
 End;

+ 2 - 0
ide/wconsts.pas

@@ -10,6 +10,8 @@
 
  **********************************************************************}
 {$i globdir.inc}
+
+{$mode objfpc}
 unit wconsts;
 
   interface

+ 15 - 15
ide/wconstse.inc

@@ -10,7 +10,7 @@
 
  **********************************************************************}
 
-{$undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
+{ $undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
 
 {$ifdef USERESSTRINGS}
     resourcestring
@@ -38,22 +38,22 @@
     label_find_entirescope = '~E~ntire scope';
 
     dialog_replace = 'Replace';
-    label_replace_texttofind = label_find_texttofind;
+    label_replace_texttofind = '~T~ext to find';
     label_replace_newtext = '    ~N~ew text';
-    label_replace_options = label_find_options;
-    label_replace_casesensitive = label_find_casesensitive;
-    label_replace_useregexp = label_find_useregexp;
-    label_replace_wholewordsonly = label_find_wholewordsonly;
+    label_replace_options = 'Options';
+    label_replace_casesensitive = '~C~ase sensitive';
+    label_replace_useregexp = '~U~se regular expr.';
+    label_replace_wholewordsonly = '~W~hole words only';
     label_replace_promptonreplace = '~P~rompt on replace';
-    label_replace_direction = label_find_direction;
-    label_replace_forward = label_find_forward;
-    label_replace_backward = label_find_backward;
-    label_replace_scope = label_find_scope;
-    label_replace_global = label_find_global;
-    label_replace_selectedtext = label_find_selectedtext;
-    label_replace_origin = label_find_origin;
-    label_replace_fromcursor = label_find_fromcursor;
-    label_replace_entirescope = label_find_entirescope;
+    label_replace_direction = 'Direction';
+    label_replace_forward = 'Forwar~d~';
+    label_replace_backward = '~B~ackward';
+    label_replace_scope = 'Scope';
+    label_replace_global = '~G~lobal';
+    label_replace_selectedtext = '~S~elected text';
+    label_replace_origin = 'Origin';
+    label_replace_fromcursor = '~F~rom cursor';
+    label_replace_entirescope = '~E~ntire scope';
     btn_replace_changeall = 'Change ~a~ll';
 
     dialog_gotoline = 'Goto line';

+ 1 - 1
ide/wconstsh.inc

@@ -10,7 +10,7 @@
 
  **********************************************************************}
 
-{$undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
+{ $undef USERESSTRINGS} { this doesn't compile under FP!!! why? }
 
 {$ifdef USERESSTRINGS}
     resourcestring

+ 88 - 59
ide/weditor.pas

@@ -203,7 +203,10 @@ const
       TAB      = #9;
       FindStrSize = 79;
 
+
 type
+    Tcentre = (do_not_centre,do_centre);
+
     PCustomCodeEditor = ^TCustomCodeEditor;
     PEditorLineInfo = ^TEditorLineInfo;
     PFoldCollection = ^TFoldCollection;
@@ -506,7 +509,7 @@ type
       procedure   SetLineFlagExclusive(Flags: longint; LineNo: sw_integer);
       procedure   Update; virtual;
       procedure   ScrollTo(X, Y: sw_Integer);
-      procedure   TrackCursor(Center: boolean); virtual;
+      procedure   TrackCursor(centre:Tcentre); virtual;
       procedure   Lock; virtual;
       procedure   UnLock; virtual;
     public
@@ -966,6 +969,7 @@ begin
    RExpand:=S;
 end;
 
+{
 function upper(const s : string) : string;
 var
   i  : Sw_word;
@@ -977,7 +981,7 @@ begin
     upper[i]:=s[i];
   upper[0]:=s[0];
 end;
-
+}
 type TPosOfs = {$ifdef TP}longint{$endif}{$ifdef FPC}int64{$endif};
 
 function PosToOfs(const X,Y: sw_integer): TPosOfs;
@@ -1273,7 +1277,7 @@ end;
 
 function TCustomLine.GetText: string;
 begin
-  Abstract; GetText:='';
+  Abstract;GetText:='';
 end;
 
 procedure TCustomLine.SetText(const AText: string);
@@ -1485,7 +1489,9 @@ end;
 
 destructor TEditorLineInfo.Done;
 begin
-  if Format<>nil then DisposeStr(Format); Format:=nil;
+  if Format<>nil then
+    DisposeStr(Format);
+  Format:=nil;
   SetFold(nil);
   inherited Done;
 end;
@@ -1522,8 +1528,7 @@ var B: PEditorBinding;
     Count,I,Idx: sw_integer;
     L: PCustomLine;
 begin
-  if Assigned(AEditor)=false then Exit;
-
+  assert(Aeditor<>nil);
   New(B, Init(AEditor));
   Bindings^.Insert(B);
   Idx:=Bindings^.IndexOf(B);
@@ -1543,6 +1548,7 @@ var B: PEditorBinding;
     Count,I: sw_integer;
     L: PCustomLine;
 begin
+  assert(Aeditor<>nil);
   B:=SearchBinding(AEditor);
   if Assigned(B) then
   begin
@@ -3044,7 +3050,7 @@ begin
       Inc(LineDelta);
       OK:=GetLineCount<MaxLineCount;
     end;
-    if OK=false then EditorDialog(edTooManyLines,nil);
+    if not OK then EditorDialog(edTooManyLines,nil);
     { mainly to force eaMove insertion }
     if not IsClipboard then
       SetCurPtr(EPos.X,EPos.Y);
@@ -3240,7 +3246,7 @@ begin
   AdjustSelectionPos(CurPos.X,CurPos.Y,DeltaX,DeltaY);
 end;
 
-procedure TCustomCodeEditor.TrackCursor(Center: boolean);
+procedure TCustomCodeEditor.TrackCursor(centre:Tcentre);
 var D,CP: TPoint;
 begin
   D:=Delta;
@@ -3249,7 +3255,7 @@ begin
    if CP.Y>Delta.Y+Size.Y-1 then D.Y:=CP.Y-Size.Y+1;
   if CP.X<Delta.X then D.X:=CP.X else
    if CP.X>Delta.X+Size.X-1 then D.X:=CP.X-Size.X+1;
-  if {((Delta.X<>D.X) or (Delta.Y<>D.Y)) and }Center then
+  if {((Delta.X<>D.X) or (Delta.Y<>D.Y)) and }centre=do_centre then
   begin
      { loose centering for debugger PM }
      while (CP.Y-D.Y)<(Size.Y div 3) do Dec(D.Y);
@@ -3525,7 +3531,7 @@ begin
           cmWindowEnd   : WindowEnd;
           cmNewLine     : begin
                             InsertNewLine;
-                            TrackCursor(false);
+                            TrackCursor(do_not_centre);
                           end;
           cmBreakLine   : BreakLine;
           cmBackSpace   : BackSpace;
@@ -4679,7 +4685,7 @@ begin
   if JumpPos.X<>-1 then
   begin
     SetCurPtr(JumpPos.X,JumpPos.Y);
-    TrackCursor(true);
+    TrackCursor(do_centre);
   end;
 end;
 
@@ -5824,35 +5830,41 @@ end;
 {$endif WinClipSupported}
 
 function TCustomCodeEditor.ClipCopy: Boolean;
-var OK,ShowInfo: boolean;
+
+var ShowInfo,CanPaste: boolean;
+
 begin
   Lock;
   {AddGroupedAction(eaCopy);
    can we undo a copy ??
    maybe as an Undo Paste in Clipboard !! }
-  OK:=Clipboard<>nil;
-  if OK then
-    ShowInfo:=SelEnd.Y-SelStart.Y>50
-  else
-    ShowInfo:=false;
-  if ShowInfo then
-    PushInfo(msg_copyingclipboard);
-  if OK then OK:=Clipboard^.InsertFrom(@Self);
-  if ShowInfo then
-    PopInfo;
-  ClipCopy:=OK;
+  clipcopy:=false;
+  showinfo:=false;
+  if (clipboard<>nil) and (clipboard<>@self) then
+    begin
+      ShowInfo:=SelEnd.Y-SelStart.Y>50;
+      if ShowInfo then
+        PushInfo(msg_copyingclipboard);
+      clipcopy:=Clipboard^.InsertFrom(@Self);
+      if ShowInfo then
+        PopInfo;
+      {Enable paste command.}
+      CanPaste:=((Clipboard^.SelStart.X<>Clipboard^.SelEnd.X) or
+                (Clipboard^.SelStart.Y<>Clipboard^.SelEnd.Y));
+      SetCmdState(FromClipCmds,CanPaste);
+    end;
   UnLock;
 end;
 
 procedure TCustomCodeEditor.ClipCut;
 var
-  ShowInfo : boolean;
+  ShowInfo,CanPaste : boolean;
 begin
   if IsReadOnly then Exit;
   Lock;
   AddGroupedAction(eaCut);
   DontConsiderShiftState:=true;
-  if Clipboard<>nil then
+  if (clipboard<>nil) and (clipboard<>@self) then
    begin
      ShowInfo:=SelEnd.Y-SelStart.Y>50;
      if ShowInfo then
@@ -5865,6 +5877,9 @@ begin
       end;
      if ShowInfo then
        PopInfo;
+     CanPaste:=((Clipboard^.SelStart.X<>Clipboard^.SelEnd.X) or
+               (Clipboard^.SelStart.Y<>Clipboard^.SelEnd.Y));
+     SetCmdState(FromClipCmds,CanPaste);
    end;
   CloseGroupedAction(eaCut);
   UnLock;
@@ -5916,7 +5931,7 @@ begin
     begin
       Lock;
       SetCurPtr(0,StrToInt(LineNo)-1);
-      TrackCursor(true);
+      TrackCursor(do_centre);
       UnLock;
     end;
   end;
@@ -6155,7 +6170,7 @@ begin
    end
   else
    begin
-     IFindStr:=Upper(FindStr);
+     IFindStr:=upcase(FindStr);
      if SForward then
       BMFMakeTable(IFindStr,bt)
      else
@@ -6164,7 +6179,7 @@ begin
 
   inc(X,DX);
   CanExit:=false;
-  if (DoReplace=false) or ((Confirm=false) and (Owner<>nil)) then
+  if not DoReplace or (not Confirm and (Owner<>nil)) then
     Owner^.Lock;
   if InArea(X,Y) then
   repeat
@@ -6208,28 +6223,26 @@ begin
        LeftOK:=(A.X<=0) or (not( (S[A.X] in AlphaChars) or (S[A.X] in NumberChars) ));
        RightOK:=(B.X>=length(S)) or (not( (S[B.X+1] in AlphaChars) or (S[B.X+1] in NumberChars) ));
        Found:=LeftOK and RightOK;
-       if Found=false then
+       if not Found then
          begin
            CurDY:=0;
            X:=B.X+1;
          end;
      end;
 
-    if Found then
-      Inc(FoundCount);
-
     if Found then
       begin
+        Inc(FoundCount);
         Lock;
         if SForward then
          SetCurPtr(B.X,B.Y)
         else
          SetCurPtr(A.X,A.Y);
-        TrackCursor(true);
+        TrackCursor(do_centre);
         SetHighlight(A,B);
         UnLock;
         CurDY:=0;
-        if (DoReplace=false) then
+        if not DoReplace then
           begin
             CanExit:=true;
             If SForward then
@@ -6245,7 +6258,9 @@ begin
           end
         else
           begin
-            if Confirm=false then CanReplace:=true else
+            if not confirm then
+              CanReplace:=true
+            else
               begin
                 Re:=EditorDialog(edReplacePrompt,@CurPos);
                 case Re of
@@ -6371,36 +6386,49 @@ begin
   OldSStart:=SelStart;}
   CurPos.X:=X;
   CurPos.Y:=Y;
-  TrackCursor(false);
+  TrackCursor(do_not_centre);
   if not IsLineVisible(CurPos.Y) then
   begin
     F:=GetLineFold(CurPos.Y);
     if Assigned(F) then
       F^.Collapse(false);
   end;
-  if (NoSelect=false) and (ShouldExtend) then
-  begin
-    CheckSels;
-    Extended:=false;
-    if PointOfs(OldPos)=PointOfs(SelStart) then
-      begin SetSelection(CurPos,SelEnd); Extended:=true; end;
-    CheckSels;
-    if Extended=false then
-     if PointOfs(OldPos)=PointOfs(SelEnd) then
-       begin
-         if ValidBlock=false then
-           SetSelection(CurPos,CurPos);
-         SetSelection(SelStart,CurPos); Extended:=true;
-       end;
-    CheckSels;
-    if (Extended=false) then
-       if PointOfs(OldPos)<=PointOfs(CurPos)
-     then begin SetSelection(OldPos,CurPos); Extended:=true; end
-     else begin SetSelection(CurPos,OldPos); Extended:=true; end;
-    DrawView;
-  end else
-   if not IsFlagSet(efPersistentBlocks) then
-      begin HideSelect; DrawView; end;
+  if not NoSelect and ShouldExtend then
+    begin
+      CheckSels;
+      Extended:=false;
+      if PointOfs(OldPos)=PointOfs(SelStart) then
+        begin
+          SetSelection(CurPos,SelEnd);
+          Extended:=true;
+        end;
+      CheckSels;
+      if Extended=false then
+       if PointOfs(OldPos)=PointOfs(SelEnd) then
+         begin
+           if not ValidBlock then
+             SetSelection(CurPos,CurPos);
+           SetSelection(SelStart,CurPos); Extended:=true;
+         end;
+      CheckSels;
+      if not Extended then
+         if PointOfs(OldPos)<=PointOfs(CurPos) then
+           begin
+             SetSelection(OldPos,CurPos);
+             Extended:=true;
+           end
+         else
+           begin
+             SetSelection(CurPos,OldPos);
+             Extended:=true;
+           end;
+      DrawView;
+    end
+  else if not IsFlagSet(efPersistentBlocks) then
+      begin
+        HideSelect;
+        DrawView;
+      end;
 {  if PointOfs(SelStart)=PointOfs(SelEnd) then
      SetSelection(CurPos,CurPos);}
   if (GetFlags and (efHighlightColumn+efHighlightRow))<>0 then
@@ -6737,6 +6765,7 @@ end;
 destructor TEditorAction.done;
 begin
   DisposeStr(Text);
+  inherited done;
 end;
 
 

+ 5 - 5
ide/whelp.pas

@@ -18,11 +18,11 @@ unit WHelp;
 interface
 
 uses
-{$ifdef Win32}
+{$ifdef Windows}
    { placed here to avoid TRect to be found in windows unit
-     for win32 target whereas its found in objects unit for other targets PM }
+     for Windows target whereas its found in objects unit for other targets PM }
      windows,
-{$endif Win32}
+{$endif Windows}
      Objects,
      WUtils;
 
@@ -318,11 +318,11 @@ Function GetDosTicks:longint; { returns ticks at 18.2 Hz, just like DOS }
     {$endif}
   end;
 {$endif Unix}
-{$ifdef Win32}
+{$ifdef Windows}
   begin
     GetDosTicks:=(Windows.GetTickCount*5484) div 100;
   end;
-{$endif Win32}
+{$endif Windows}
 {$ifdef go32v2}
   begin
     GetDosTicks:=MemL[$40:$6c];

+ 23 - 11
ide/whlpview.pas

@@ -936,7 +936,7 @@ begin
   begin
     GetLinkBounds(Link,R);
     SetCurPtr(R.A.X,R.A.Y);
-    TrackCursor(true);
+    TrackCursor(do_centre);
     {St:=GetLinkTarget(Link);
     If St<>'' then
       SetTitle('Help '+St);}
@@ -999,7 +999,7 @@ begin
       ISwitchToTopic(FileID_,Context_,false);
       ScrollTo(Delta_.X,Delta_.Y);
       SetCurPtr(CurPos_.X,CurPos_.Y);
-      TrackCursor(false);
+      TrackCursor(do_not_centre);
       if CurLink<>CurLink_ then SetCurLink(CurLink_);
     end;
     DrawView;
@@ -1026,8 +1026,10 @@ begin
           IndexHelpTopic:=HelpTopic;
      end;
  end;
-  if Owner<>nil then Owner^.Lock;
-  SetCurPtr(0,0); TrackCursor(false);
+  if Owner<>nil then
+    Owner^.Lock;
+  SetCurPtr(0,0);
+  TrackCursor(do_not_centre);
   RenderTopic;
   BuildTopicWordList;
   Lookup('');
@@ -1105,7 +1107,7 @@ begin
       GetLinkBounds(P^.Index,R);
       SetCurPtr(R.A.X+(I-1)+length(Lookupword),R.A.Y);
       CurLink:=P^.Index; DrawView;
-      TrackCursor(true);
+      TrackCursor(do_centre);
       if Owner<>nil then Owner^.UnLock;
     end;
   end;
@@ -1160,7 +1162,7 @@ begin
             PrevTopic;
         else DontClear:=true;
         end;
-        if DontClear=false then ClearEvent(Event);
+        if not DontClear then ClearEvent(Event);
       end;
     evKeyDown :
       begin
@@ -1169,7 +1171,11 @@ begin
           kbTab :
             SelectNextLink(true);
           kbShiftTab :
-            begin NoSelect:=true; SelectNextLink(false); NoSelect:=false; end;
+            begin
+              NoSelect:=true;
+              SelectNextLink(false);
+              NoSelect:=false;
+            end;
           kbEnter :
             if CurLink<>-1 then
               SelectLink(CurLink);
@@ -1179,12 +1185,18 @@ begin
         else
           case Event.CharCode of
              #32..#255 :
-               begin NoSelect:=true; Lookup(LookupWord+Event.CharCode); NoSelect:=false; end;
-          else DontClear:=true;
+               begin
+                 NoSelect:=true;
+                 Lookup(LookupWord+Event.CharCode);
+                 NoSelect:=false;
+               end;
+          else
+            DontClear:=true;
           end;
         end;
-        TrackCursor(false);
-        if DontClear=false then ClearEvent(Event);
+        TrackCursor(do_not_centre);
+        if not DontClear then
+          ClearEvent(Event);
       end;
   end;
   inherited HandleEvent(Event);

+ 12 - 12
ide/winclip.pas

@@ -41,10 +41,10 @@ implementation
     dos;
 {$endif DOS}
 
-{$ifdef win32}
+{$ifdef Windows}
   uses
     strings,windows;
-{$endif win32}
+{$endif Windows}
 
 {$ifdef DOS}
 function WinClipboardSupported : boolean;
@@ -94,7 +94,7 @@ begin
 end;
 {$endif DOS}
 
-{$ifdef win32}
+{$ifdef Windows}
 function WinClipboardSupported : boolean;
 begin
   WinClipboardSupported:=true;
@@ -127,7 +127,7 @@ begin
   else
     InternGetDataSize:=0;
 end;
-{$endif win32}
+{$endif Windows}
 
 
 function GetTextWinClipboardSize : longint;
@@ -143,10 +143,10 @@ var
   r : Registers;
   M : MemPtr;
 {$endif DOS}
-{$ifdef win32}
+{$ifdef Windows}
   h : HGlobal;
   pp : pchar;
-{$endif win32}
+{$endif Windows}
 begin
   p:=nil;
   GetTextWinClipBoardData:=False;
@@ -169,7 +169,7 @@ begin
   RealIntr($2F,r);
   GetTextWinClipBoardData:=(r.ax<>0);
 {$endif DOS}
-{$ifdef win32}
+{$ifdef Windows}
   h:=GetClipboardData(CF_OEMTEXT);
   if h<>0 then
     begin
@@ -180,7 +180,7 @@ begin
       GlobalUnlock(h);
     end;
   GetTextWinClipBoardData:=h<>0;
-{$endif win32}
+{$endif Windows}
   CloseWinClipBoard;
 {$ifdef DOS}
   M.MoveDataFrom(l,P^);
@@ -194,11 +194,11 @@ var
   r : Registers;
   M : MemPtr;
 {$endif DOS}
-{$ifdef win32}
+{$ifdef Windows}
   h : HGlobal;
   pp : pchar;
   res : boolean;
-{$endif win32}
+{$endif Windows}
 begin
   SetTextWinClipBoardData:=False;
   if (l=0) or (l>65520) then
@@ -226,7 +226,7 @@ begin
   RealIntr($2F,r);
   FreeDosMem(M);
 {$endif DOS}
-{$ifdef win32}
+{$ifdef Windows}
   h:=GlobalAlloc(GMEM_MOVEABLE or GMEM_DDESHARE,l+1);
   pp:=pchar(GlobalLock(h));
   move(p^,pp^,l+1);
@@ -238,7 +238,7 @@ begin
   SetClipboardData(CF_TEXT,h);
   GlobalUnlock(h);
   SetTextWinClipBoardData:=res;
-{$endif win32}
+{$endif Windows}
   CloseWinClipBoard;
 end;
 

+ 1 - 1
ide/windebug.pas

@@ -2,7 +2,7 @@
     This file is part of the Free Pascal Integrated Development Environment
     Copyright (c) 2000 by Pierre Muller
 
-    Win32 specific debugger routines for the IDE
+    Windows specific debugger routines for the IDE
 
     See the file COPYING.FPC, included in this distribution,
     for details about the copyright.

+ 6 - 6
ide/wutils.pas

@@ -20,9 +20,9 @@ interface
 
 
 uses
-{$ifdef win32}
+{$ifdef Windows}
   windows,
-{$endif win32}
+{$endif Windows}
 {$ifdef netwlibc}
   libc,
 {$else}
@@ -563,7 +563,7 @@ begin
 end;
 
 function GetShortName(const n:string):string;
-{$ifdef win32}
+{$ifdef Windows}
 var
   hs,hs2 : string;
   i : longint;
@@ -574,7 +574,7 @@ var
 {$endif}
 begin
   GetShortName:=n;
-{$ifdef win32}
+{$ifdef Windows}
   hs:=n+#0;
   i:=Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2));
   if (i>0) and (i<=high(hs2)) then
@@ -591,7 +591,7 @@ begin
 end;
 
 function GetLongName(const n:string):string;
-{$ifdef win32}
+{$ifdef Windows}
 var
   hs : string;
   hs2 : Array [0..255] of char;
@@ -604,7 +604,7 @@ var
 {$endif}
 begin
   GetLongName:=n;
-{$ifdef win32}
+{$ifdef Windows}
   hs:=n+#0;
   i:=Windows.GetFullPathName(@hs[1],256,hs2,j);
   if (i>0) and (i<=high(hs)) then