Changeset 38
- Timestamp:
- Jun 30, 2023, 3:36:57 PM (18 months ago)
- Location:
- branches/overos
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/overos/UApplication.pas
r24 r38 1 1 unit UApplication; 2 3 {$mode delphi}4 2 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, fgl, UTypes, UWindow;6 Classes, SysUtils, Generics.Collections, UTypes, UWindow; 9 7 10 8 type … … 13 11 14 12 TMessageQueue = class 15 Messages: T FPGObjectList<TMessage>;13 Messages: TObjectList<TMessage>; 16 14 procedure PostMessage(Handle: TObject; Message: TMessage); 17 15 constructor Create; … … 28 26 destructor Destroy; override; 29 27 end; 28 30 29 31 30 implementation … … 53 52 destructor TApplication.Destroy; 54 53 begin 55 MessageQueue.Free;56 inherited Destroy;54 FreeAndNil(MessageQueue); 55 inherited; 57 56 end; 58 57 … … 67 66 constructor TMessageQueue.Create; 68 67 begin 69 Messages := T FPGObjectList<TMessage>.Create;70 Messages. FreeObjects := False;68 Messages := TObjectList<TMessage>.Create; 69 Messages.OwnsObjects := False; 71 70 end; 72 71 … … 77 76 for I := 0 to Messages.Count - 1 do 78 77 Messages[I].Free; 79 Messages.Free;80 inherited Destroy;78 FreeAndNil(Messages); 79 inherited; 81 80 end; 82 81 83 82 end. 84 83 85 -
branches/overos/UControls.pas
r22 r38 1 1 unit UControls; 2 2 3 {$mode delphi}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, UTypes, UGraphics, fgl, UMouse;6 Classes, SysUtils, UTypes, UGraphics, Generics.Collections, UMouse; 9 7 10 8 type … … 28 26 public 29 27 Canvas: TCanvas; 30 Controls: T FPGObjectList<TControl>;28 Controls: TObjectList<TControl>; 31 29 procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton); virtual; 32 30 procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton); virtual; … … 91 89 end; 92 90 91 93 92 implementation 94 93 … … 214 213 constructor TControl.Create; 215 214 begin 216 Controls := T FPGObjectList<TControl>.Create;217 Controls. FreeObjects := False;215 Controls := TObjectList<TControl>.Create; 216 Controls.OwnsObjects := False; 218 217 Canvas := TCanvasControl.Create; 219 218 TCanvasControl(Canvas).Control := Self; … … 227 226 Controls[I].Free; 228 227 ParentControl := nil; 229 Canvas.Free;230 Controls.Free;231 inherited Destroy;228 FreeAndNil(Canvas); 229 FreeAndNil(Controls); 230 inherited; 232 231 end; 233 232 -
branches/overos/UFormMain.lfm
r24 r38 1 1 object FormMain: TFormMain 2 2 Left = 403 3 Height = 5233 Height = 628 4 4 Top = 253 5 Width = 7585 Width = 910 6 6 Caption = 'OverOS' 7 ClientHeight = 5238 ClientWidth = 7589 DesignTimePPI = 1 207 ClientHeight = 628 8 ClientWidth = 910 9 DesignTimePPI = 144 10 10 OnClose = FormClose 11 11 OnResize = FormResize 12 12 OnShow = FormShow 13 LCLVersion = ' 1.8.2.0'13 LCLVersion = '2.2.6.0' 14 14 object Image1: TImage 15 15 Left = 0 16 Height = 52316 Height = 628 17 17 Top = 0 18 Width = 75818 Width = 910 19 19 Align = alClient 20 20 OnMouseDown = Image1MouseDown … … 25 25 Interval = 10 26 26 OnTimer = Timer1Timer 27 left = 30328 top = 20127 Left = 364 28 Top = 241 29 29 end 30 30 end -
branches/overos/UFormMain.pas
r24 r38 1 1 unit UFormMain; 2 3 {$mode objfpc}{$H+}4 2 5 3 interface … … 102 100 begin 103 101 Timer1.Enabled := False; 104 App.Free;105 System.Free;102 FreeAndNil(App); 103 FreeAndNil(System); 106 104 end; 107 105 -
branches/overos/UGraphics.pas
r22 r38 1 1 unit UGraphics; 2 3 {$mode delphi}4 2 5 3 interface … … 25 23 clGray = $808080; 26 24 clWhite = $ffffff; 25 27 26 28 27 implementation -
branches/overos/UMouse.pas
r20 r38 1 1 unit UMouse; 2 3 {$mode objfpc}{$H+}4 2 5 3 interface -
branches/overos/USystem.pas
r20 r38 1 1 unit USystem; 2 3 {$mode delphi}{$H+}4 2 5 3 interface … … 32 30 destructor TSystem.Destroy; 33 31 begin 34 Screen.Free;35 Mouse.Free;36 inherited Destroy;32 FreeAndNil(Screen); 33 FreeAndNil(Mouse); 34 inherited; 37 35 end; 38 36 -
branches/overos/UTypes.pas
r33 r38 1 1 unit UTypes; 2 3 {$mode delphi}{$H+}4 2 5 3 interface -
branches/overos/UWindow.pas
r24 r38 1 1 unit UWindow; 2 2 3 {$mode delphi}{$H+}4 5 3 interface 6 4 7 5 uses 8 Classes, SysUtils, fgl, UTypes, UMouse, UControls, UGraphics;6 Classes, SysUtils, Generics.Collections, UTypes, UMouse, UControls, UGraphics; 9 7 10 8 type … … 96 94 public 97 95 Canvas: TCanvas; 98 Windows: T FPGObjectList<TWindow>;96 Windows: TObjectList<TWindow>; 99 97 Size: TSize; 100 98 procedure Paint; … … 116 114 begin 117 115 if FWindow = AValue then Exit; 118 Canvas.Free;116 FreeAndNil(Canvas); 119 117 FWindow := AValue; 120 118 Canvas := TCanvasWindow.Create; … … 173 171 destructor TTitleBar.Destroy; 174 172 begin 175 ButtonClose.Free;176 ButtonMaximize.Free;177 ButtonMinimize.Free;173 FreeAndNil(ButtonClose); 174 FreeAndNil(ButtonMaximize); 175 FreeAndNil(ButtonMinimize); 178 176 inherited; 179 177 end; … … 293 291 begin 294 292 inherited; 295 Canvas.Free;293 FreeAndNil(Canvas); 296 294 Canvas := TCanvasWindow.Create; 297 295 TCanvasWindow(Canvas).Window := Self; … … 304 302 begin 305 303 Visible := False; 306 TitleBar.Free;304 FreeAndNil(TitleBar); 307 305 Screen := nil; 308 inherited Destroy;306 inherited; 309 307 end; 310 308 … … 448 446 constructor TScreen.Create; 449 447 begin 450 Windows := T FPGObjectList<TWindow>.Create;451 Windows. FreeObjects := False;448 Windows := TObjectList<TWindow>.Create; 449 Windows.OwnsObjects := False; 452 450 Canvas := TCanvas.Create; 453 451 end; … … 459 457 for I := Windows.Count - 1 downto 0 do 460 458 Windows[I].Free; 461 Windows.Free;462 Canvas.Free;463 inherited Destroy;459 FreeAndNil(Windows); 460 FreeAndNil(Canvas); 461 inherited; 464 462 end; 465 463 -
branches/overos/overos.lpi
r33 r38 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <Version Value="1 1"/>4 <Version Value="12"/> 5 5 <General> 6 <Flags> 7 <CompatibilityMode Value="True"/> 8 </Flags> 6 9 <SessionStorage Value="InProjectDir"/> 7 <MainUnit Value="0"/>8 10 <Title Value="overos"/> 9 11 <ResourceType Value="res"/> … … 136 138 <Linking> 137 139 <Debugging> 140 <DebugInfoType Value="dsDwarf2Set"/> 138 141 <UseHeaptrc Value="True"/> 139 142 </Debugging>
Note:
See TracChangeset
for help on using the changeset viewer.