- Location:
- /branches
- Files:
-
- 37 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
/branches/overos ¶
-
Property svn:ignore
set to
overos
lib
overos.lps
overos.res
heaptrclog.trc
overos.exe
-
Property svn:ignore
set to
-
TabularUnified /branches/overos/UFormMain.lfm ¶
r20 r30 7 7 ClientHeight = 523 8 8 ClientWidth = 758 9 DesignTimePPI = 128 9 DesignTimePPI = 120 10 OnClose = FormClose 10 11 OnResize = FormResize 11 12 OnShow = FormShow … … 21 22 OnMouseUp = Image1MouseUp 22 23 end 24 object Timer1: TTimer 25 Interval = 10 26 OnTimer = Timer1Timer 27 left = 303 28 top = 201 29 end 23 30 end -
TabularUnified /branches/overos/UFormMain.pas ¶
r20 r30 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 UWindow, USystem, UTypes, UMouse;9 Types, UWindow, USystem, UTypes, UMouse, UGraphics, UControls, UApplication; 10 10 11 11 type … … 16 16 TFormMain = class(TForm) 17 17 Image1: TImage; 18 Timer1: TTimer; 19 procedure FormClose(Sender: TObject; var CloseAction: TCloseAction); 18 20 procedure Image1MouseDown(Sender: TObject; Button: TControlsMouseButton; 19 21 Shift: TShiftState; X, Y: Integer); … … 23 25 procedure FormResize(Sender: TObject); 24 26 procedure FormShow(Sender: TObject); 27 procedure Timer1Timer(Sender: TObject); 25 28 private 26 29 27 30 public 31 App: TApplication; 28 32 System: TSystem; 29 33 end; … … 36 40 procedure DrawArea(Rect: TRectangle; Color: TColor); override; 37 41 procedure DrawText(P: TPosition; Color: TColor; Text: string); override; 42 function GetTextSize(Text: string): TSize; override; 38 43 end; 39 44 … … 66 71 procedure TCanvasScreen.DrawText(P: TPosition; Color: TColor; Text: string); 67 72 begin 73 Canvas.Brush.Style := bsClear; 68 74 Canvas.Font.Color := Color; 69 75 Canvas.TextOut(P.Left, P.Top, Text); 76 end; 77 78 function TCanvasScreen.GetTextSize(Text: string): TSize; 79 var 80 Size: Types.TSize; 81 begin 82 Size := Canvas.TextExtent(Text); 83 Result := TSize.Create(Size.cx, Size.cy); 70 84 end; 71 85 … … 85 99 end; 86 100 101 procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction); 102 begin 103 Timer1.Enabled := False; 104 App.Free; 105 System.Free; 106 end; 107 87 108 procedure TFormMain.Image1MouseMove(Sender: TObject; Shift: TShiftState; X, 88 109 Y: Integer); 89 110 begin 90 Caption := IntToStr(X) + ',' + IntToStr(Y);91 System.Mouse.Move(TPosition.Create( Mouse.CursorPos.X, Mouse.CursorPos.Y));111 //Caption := IntToStr(X) + ',' + IntToStr(Y); 112 System.Mouse.Move(TPosition.Create(X, Y)); 92 113 end; 93 114 … … 117 138 var 118 139 Window: TWindow; 140 Button: TButton; 119 141 begin 120 142 System := TSystem.Create; … … 124 146 System.Screen.Size := TSize.Create(Width, Height); 125 147 148 App := TApplication.Create; 149 126 150 Window := System.Screen.CreateWindow('Test'); 151 Window.Application := App; 127 152 128 153 Window := System.Screen.CreateWindow('Commander'); 129 Window.Rectangle.Position := TPosition.Create(100, 50); 130 Window.Rectangle.Size := TSize.Create(400, 200); 154 Window.Position := TPosition.Create(100, 50); 155 Window.Size := TSize.Create(400, 200); 156 Window.Application := App; 157 Button := TButton.Create; 158 Button.Rectangle := TRectangle.Create(TPosition.Create(10, 50), TSize.Create(100, 32)); 159 Button.ParentControl := Window; 160 Button.Title := 'Click'; 161 Button.Visible := True; 131 162 132 163 Window := System.Screen.CreateWindow('Calculator'); 133 Window.Rectangle.Position := TPosition.Create(200, 100); 134 Window.Rectangle.Size := TSize.Create(300, 200); 164 Window.Application := App; 165 Window.Position := TPosition.Create(200, 100); 166 Window.Size := TSize.Create(300, 200); 135 167 136 168 System.Screen.Paint; 137 169 end; 138 170 171 procedure TFormMain.Timer1Timer(Sender: TObject); 172 begin 173 App.ProcessMessages; 174 end; 175 139 176 end. 140 177 -
TabularUnified /branches/overos/UTypes.pas ¶
r20 r30 16 16 Height: Integer; 17 17 function Create(Width, Height: Integer): TSize; 18 class operator Add(A, B: TSize): TSize; 19 class operator Subtract(A, B: TSize): TSize; 20 class operator Equal(A, B: TSize): Boolean; 18 21 end; 19 22 … … 26 29 class operator Add(A, B: TPosition): TPosition; 27 30 class operator Subtract(A, B: TPosition): TPosition; 31 class operator Equal(A, B: TPosition): Boolean; 28 32 end; 29 33 … … 35 39 function Create(Position: TPosition; Size: TSize): TRectangle; 36 40 function Contains(Position: TPosition): Boolean; 41 class operator Equal(A, B: TRectangle): Boolean; 37 42 end; 38 43 39 TColor = Integer; 44 TMessage = class 45 Handle: TObject; 46 end; 40 47 41 48 … … 56 63 (Self.Position.Left + Self.Size.Width >= Position.Left) and 57 64 (Self.Position.Top + Self.Size.Height >= Position.Top); 65 end; 66 67 class operator TRectangle.Equal(A, B: TRectangle): Boolean; 68 begin 69 Result := (A.Position = B.Position) and (A.Size = B.Size); 58 70 end; 59 71 … … 78 90 end; 79 91 92 class operator TPosition.Equal(A, B: TPosition): Boolean; 93 begin 94 Result := (A.Left = B.Left) and (A.Top = B.Top); 95 end; 96 80 97 { TSize } 81 98 … … 86 103 end; 87 104 105 class operator TSize.Add(A, B: TSize): TSize; 106 begin 107 Result.Width := A.Width + B.Width; 108 Result.Height := A.Height + B.Height; 109 end; 110 111 class operator TSize.Subtract(A, B: TSize): TSize; 112 begin 113 Result.Width := A.Width - B.Width; 114 Result.Height := A.Height - B.Height; 115 end; 116 117 class operator TSize.Equal(A, B: TSize): Boolean; 118 begin 119 Result := (A.Width = B.Width) and (A.Height = B.Height); 120 end; 121 88 122 89 123 end. -
TabularUnified /branches/overos/UWindow.pas ¶
r20 r30 6 6 7 7 uses 8 Classes, SysUtils, fgl, UTypes, UMouse ;8 Classes, SysUtils, fgl, UTypes, UMouse, UControls, UGraphics; 9 9 10 10 type 11 { TCanvas }12 13 TCanvas = class14 procedure DrawLine(P1, P2: TPosition; Color: TColor); virtual;15 procedure DrawFrame(Rect: TRectangle; Color: TColor); virtual;16 procedure DrawArea(Rect: TRectangle; Color: TColor); virtual;17 procedure DrawText(P: TPosition; Color: TColor; Text: string); virtual;18 end;19 20 11 TScreen = class; 21 12 TWindow = class; … … 28 19 procedure DrawArea(Rect: TRectangle; Color: TColor); override; 29 20 procedure DrawText(P: TPosition; Color: TColor; Text: string); override; 30 end; 21 function GetTextSize(Text: string): TSize; override; 22 end; 23 24 TWindowSide = (wsNone, wsLeft, wsTop, wsRight, wsBottom); 25 26 { TTitleBar } 27 28 TTitleBar = class(TControl) 29 private 30 FWindow: TWindow; 31 procedure SetWindow(AValue: TWindow); 32 procedure ButtonCloseClick(Sender: TObject); 33 procedure ButtonMaximizeClick(Sender: TObject); 34 procedure ButtonMinimizeClick(Sender: TObject); 35 protected 36 procedure SetRectangle(AValue: TRectangle); override; 37 public 38 const 39 TitleHeight = 32; 40 var 41 ButtonClose: TButton; 42 ButtonMaximize: TButton; 43 ButtonMinimize: TButton; 44 constructor Create; override; 45 destructor Destroy; override; 46 property Window: TWindow read FWindow write SetWindow; 47 end; 48 49 TMessageWindow = class(TMessage); 50 TMessageWindowClose = class(TMessageWindow); 51 TMessageWindowMaximize = class(TMessageWindow); 31 52 32 53 { TWindow } 33 54 34 TWindow = class 55 TWindow = class(TControl) 35 56 private 36 F Visible: Boolean;37 procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton);38 procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton);39 procedure MouseMove(Pos: TPosition);40 procedure SetVisible(AValue: Boolean); 57 FScreen: TScreen; 58 procedure SetScreen(AValue: TScreen); 59 protected 60 procedure SetRectangle(AValue: TRectangle); override; 61 procedure SetVisible(AValue: Boolean); override; 41 62 public 42 Canvas: TCanvas; 63 const 64 BorderGrabWidth = 15; 65 var 66 TitleBar: TTitleBar; 43 67 Title: string; 44 Rectangle: TRectangle; 45 Screen: TScreen; 68 Application: TObject; // TApplication 69 procedure HandleMessage(Message: TMessage); 70 procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton); override; 71 procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton); override; 72 procedure Close; 73 procedure Maximize; 46 74 procedure Focus; 47 procedure Paint; 75 procedure Paint; override; 48 76 function Focused: Boolean; 49 property Visible: Boolean read FVisible write SetVisible; 50 constructor Create; 77 constructor Create; override; 51 78 destructor Destroy; override; 79 property Screen: TScreen read FScreen write SetScreen; 52 80 end; 53 81 … … 57 85 private 58 86 FMouse: TMouse; 87 GrabActive: Boolean; 88 GrabWindow: TWindow; 89 GrabMousePosition: TPosition; 90 GrabWindowRectangle: TRectangle; 91 GrabWindowSide: TWindowSide; 59 92 procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton); 60 93 procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton); … … 72 105 end; 73 106 74 const75 clBlack = $000000;76 clGray = $808080;77 clWhite = $ffffff;78 107 79 108 implementation 80 109 81 { TCanvas } 82 83 procedure TCanvas.DrawLine(P1, P2: TPosition; Color: TColor); 84 begin 85 end; 86 87 procedure TCanvas.DrawFrame(Rect: TRectangle; Color: TColor); 88 begin 89 with Rect do begin 90 DrawLine(Position, Position + TPosition.Create(Size.Width, 0), Color); 91 DrawLine(Position + TPosition.Create(Size.Width, 0), Position + TPosition.Create(Size.Width, Size.Height), Color); 92 DrawLine(Position + TPosition.Create(Size.Width, Size.Height), Position + TPosition.Create(0, Size.Height), Color); 93 DrawLine(Position + TPosition.Create(0, Size.Height), Position, Color); 94 end; 95 end; 96 97 procedure TCanvas.DrawArea(Rect: TRectangle; Color: TColor); 98 begin 99 end; 100 101 procedure TCanvas.DrawText(P: TPosition; Color: TColor; Text: string); 102 begin 110 uses 111 UApplication; 112 113 { TTitleBar } 114 115 procedure TTitleBar.SetWindow(AValue: TWindow); 116 begin 117 if FWindow = AValue then Exit; 118 Canvas.Free; 119 FWindow := AValue; 120 Canvas := TCanvasWindow.Create; 121 TCanvasWindow(Canvas).Window := FWindow; 122 end; 123 124 procedure TTitleBar.ButtonCloseClick(Sender: TObject); 125 begin 126 Window.Close; 127 end; 128 129 procedure TTitleBar.ButtonMaximizeClick(Sender: TObject); 130 begin 131 Window.Maximize; 132 end; 133 134 procedure TTitleBar.ButtonMinimizeClick(Sender: TObject); 135 begin 136 137 end; 138 139 procedure TTitleBar.SetRectangle(AValue: TRectangle); 140 begin 141 inherited; 142 ButtonClose.Rectangle := TRectangle.Create(TPosition.Create(Size.Width - TitleHeight, 4), 143 TSize.Create(TitleHeight - 8, TitleHeight - 8)); 144 ButtonMaximize.Rectangle := TRectangle.Create(TPosition.Create(Size.Width - 2 * TitleHeight, 4), 145 TSize.Create(TitleHeight - 8, TitleHeight - 8)); 146 ButtonMinimize.Rectangle := TRectangle.Create(TPosition.Create(Size.Width - 3 * TitleHeight, 4), 147 TSize.Create(TitleHeight - 8, TitleHeight - 8)); 148 end; 149 150 constructor TTitleBar.Create; 151 begin 152 inherited; 153 154 ButtonClose := TButton.Create; 155 ButtonClose.Title := 'X'; 156 ButtonClose.ParentControl := Self; 157 ButtonClose.OnClick := ButtonCloseClick; 158 ButtonClose.Visible := True; 159 160 ButtonMaximize := TButton.Create; 161 ButtonMaximize.Title := '^'; 162 ButtonMaximize.ParentControl := Self; 163 ButtonMaximize.OnClick := ButtonMaximizeClick; 164 ButtonMaximize.Visible := True; 165 166 ButtonMinimize := TButton.Create; 167 ButtonMinimize.Title := '_'; 168 ButtonMinimize.ParentControl := Self; 169 ButtonMinimize.OnClick := ButtonMinimizeClick; 170 ButtonMinimize.Visible := True; 171 end; 172 173 destructor TTitleBar.Destroy; 174 begin 175 ButtonClose.Free; 176 ButtonMaximize.Free; 177 ButtonMinimize.Free; 178 inherited; 103 179 end; 104 180 … … 107 183 procedure TCanvasWindow.DrawLine(P1, P2: TPosition; Color: TColor); 108 184 begin 109 Window.Screen.Canvas.DrawLine(P1 + Window.Rectangle.Position, P2 + Window.Rectangle.Position, Color); 185 if Assigned(Window) and Assigned(Window.Screen) then 186 Window.Screen.Canvas.DrawLine(P1 + Window.Position, P2 + Window.Position, Color); 110 187 end; 111 188 112 189 procedure TCanvasWindow.DrawArea(Rect: TRectangle; Color: TColor); 113 190 begin 114 Window.Screen.Canvas.DrawArea(TRectangle.Create(Rect.Position + Window.Rectangle.Position, 115 Rect.Size), Color); 191 if Assigned(Window) and Assigned(Window.Screen) then 192 Window.Screen.Canvas.DrawArea(TRectangle.Create(Rect.Position + Window.Position, 193 Rect.Size), Color); 116 194 end; 117 195 118 196 procedure TCanvasWindow.DrawText(P: TPosition; Color: TColor; Text: string); 119 197 begin 120 Window.Screen.Canvas.DrawText(P + Window.Rectangle.Position, Color, Text); 198 if Assigned(Window) and Assigned(Window.Screen) then 199 Window.Screen.Canvas.DrawText(P + Window.Position, Color, Text); 200 end; 201 202 function TCanvasWindow.GetTextSize(Text: string): TSize; 203 begin 204 if Assigned(Window) and Assigned(Window.Screen) then 205 Result := Window.Screen.Canvas.GetTextSize(Text); 121 206 end; 122 207 123 208 { TWindow } 124 209 210 procedure TWindow.SetScreen(AValue: TScreen); 211 begin 212 if FScreen = AValue then Exit; 213 if Assigned(FScreen) then 214 FScreen.Windows.Remove(Self); 215 FScreen := AValue; 216 if Assigned(FScreen) then 217 FScreen.Windows.Add(Self); 218 end; 219 220 procedure TWindow.SetRectangle(AValue: TRectangle); 221 begin 222 inherited; 223 TitleBar.Rectangle := TRectangle.Create(Position, TSize.Create(Size.Width, TitleBar.TitleHeight)); 224 end; 225 226 procedure TWindow.SetVisible(AValue: Boolean); 227 begin 228 inherited; 229 if not Visible and Assigned(Screen) then 230 Screen.Paint; 231 end; 232 233 procedure TWindow.HandleMessage(Message: TMessage); 234 begin 235 if Message is TMessageWindowClose then begin 236 Free; 237 end else 238 if Message is TMessageWindowMaximize then begin; 239 Rectangle := TRectangle.Create(TPosition.Create(0, 0), Screen.Size); 240 Paint; 241 end; 242 end; 243 125 244 procedure TWindow.MouseButtonDown(Pos: TPosition; Button: TMouseButton); 126 245 begin 127 Focus; 246 inherited; 247 TitleBar.MouseButtonDown(Pos, Button); 128 248 end; 129 249 130 250 procedure TWindow.MouseButtonUp(Pos: TPosition; Button: TMouseButton); 131 251 begin 132 133 end; 134 135 procedure TWindow.MouseMove(Pos: TPosition); 136 begin 137 138 end; 139 140 procedure TWindow.SetVisible(AValue: Boolean); 141 begin 142 if FVisible = AValue then Exit; 143 FVisible := AValue; 144 Paint; 252 inherited; 253 TitleBar.MouseButtonUp(Pos, Button); 254 end; 255 256 procedure TWindow.Close; 257 begin 258 TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowClose.Create); 259 end; 260 261 procedure TWindow.Maximize; 262 begin 263 TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowMaximize.Create); 145 264 end; 146 265 … … 154 273 155 274 procedure TWindow.Paint; 156 const 157 TitleHeight = 32; 158 begin 159 Canvas.DrawArea(TRectangle.Create(TPosition.Create(0, 0), Rectangle.Size), clGray); 160 Canvas.DrawFrame(TRectangle.Create(TPosition.Create(0, 0), Rectangle.Size), clWhite); 161 Canvas.DrawLine(TPosition.Create(0, TitleHeight), 162 TPosition.Create(Rectangle.Size.Width, TitleHeight), clWhite); 163 Canvas.DrawText(TPosition.Create(8, 4), clWhite, Title); 275 begin 276 if Visible then begin 277 Canvas.DrawArea(TRectangle.Create(TPosition.Create(0, 0), Size), clGray); 278 Canvas.DrawFrame(TRectangle.Create(TPosition.Create(0, 0), Size), clWhite); 279 Canvas.DrawLine(TPosition.Create(0, TitleBar.TitleHeight), 280 TPosition.Create(Size.Width, TitleBar.TitleHeight), clWhite); 281 Canvas.DrawText(TPosition.Create(8, 4), clWhite, Title); 282 TitleBar.Paint; 283 end; 284 inherited; 164 285 end; 165 286 … … 171 292 constructor TWindow.Create; 172 293 begin 294 inherited; 295 Canvas.Free; 173 296 Canvas := TCanvasWindow.Create; 174 297 TCanvasWindow(Canvas).Window := Self; 298 TitleBar := TTitleBar.Create; 299 TitleBar.Window := Self; 300 TitleBar.Visible := True; 175 301 end; 176 302 177 303 destructor TWindow.Destroy; 178 304 begin 179 Canvas.Free; 305 Visible := False; 306 TitleBar.Free; 307 Screen := nil; 180 308 inherited Destroy; 181 309 end; … … 190 318 for I := Windows.Count - 1 downto 0 do begin 191 319 Window := Windows[I]; 320 if TRectangle.Create(Window.Position - TPosition.Create(Window.BorderGrabWidth div 2, 0), 321 TSize.Create(Window.BorderGrabWidth, Window.Size.Height)).Contains(Pos) then begin 322 GrabMousePosition := Pos; 323 GrabWindowRectangle := Window.Rectangle; 324 GrabWindow := Window; 325 GrabWindowSide := wsLeft; 326 GrabActive := True; 327 end else 328 if TRectangle.Create(Window.Position - TPosition.Create(0, Window.BorderGrabWidth div 2), 329 TSize.Create(Window.Size.Width, Window.BorderGrabWidth)).Contains(Pos) then begin 330 GrabMousePosition := Pos; 331 GrabWindowRectangle := Window.Rectangle; 332 GrabWindow := Window; 333 GrabWindowSide := wsTop; 334 GrabActive := True; 335 end else 336 if TRectangle.Create(Window.Position + TPosition.Create(Window.Size.Width, 0) - TPosition.Create(Window.BorderGrabWidth div 2, 0), 337 TSize.Create(Window.BorderGrabWidth, Window.Size.Height)).Contains(Pos) then begin 338 GrabMousePosition := Pos; 339 GrabWindowRectangle := Window.Rectangle; 340 GrabWindow := Window; 341 GrabWindowSide := wsRight; 342 GrabActive := True; 343 end else 344 if TRectangle.Create(Window.Position + TPosition.Create(0, Window.Size.Height) - TPosition.Create(0, Window.BorderGrabWidth div 2), 345 TSize.Create(Window.Size.Width, Window.BorderGrabWidth)).Contains(Pos) then begin 346 GrabMousePosition := Pos; 347 GrabWindowRectangle := Window.Rectangle; 348 GrabWindow := Window; 349 GrabWindowSide := wsBottom; 350 GrabActive := True; 351 end else 352 if TRectangle.Create(Window.Position, TSize.Create(Window.Size.Width, Window.TitleBar.TitleHeight)).Contains(Pos) then begin 353 GrabMousePosition := Pos; 354 GrabWindowRectangle := Window.Rectangle; 355 GrabWindow := Window; 356 GrabWindowSide := wsNone; 357 GrabActive := True; 358 end; 192 359 if Window.Rectangle.Contains(Pos) then begin 193 Window.MouseButtonDown(Pos - Window.Rectangle.Position, Button); 360 Window.Focus; 361 Window.MouseButtonDown(Pos - Window.Position, Button); 194 362 Break; 195 363 end; … … 200 368 var 201 369 I: Integer; 202 begin 370 Window: TWindow; 371 begin 372 if GrabActive then begin 373 GrabActive := False; 374 GrabWindow := nil; 375 end; 203 376 for I := Windows.Count - 1 downto 0 do begin 204 if Windows[I].Rectangle.Contains(Pos) then begin 205 Windows[I].MouseButtonUp(Pos - Windows[I].Rectangle.Position, Button); 377 Window := Windows[I]; 378 if Window.Rectangle.Contains(Pos) then begin 379 Window.MouseButtonUp(Pos - Window.Position, Button); 206 380 Break; 207 381 end; … … 213 387 I: Integer; 214 388 begin 389 if GrabActive then begin 390 if GrabWindowSide = wsNone then 391 GrabWindow.Position := GrabWindowRectangle.Position + (Pos - GrabMousePosition) 392 else if GrabWindowSide = wsLeft then 393 GrabWindow.Rectangle := TRectangle.Create(GrabWindowRectangle.Position + TPosition.Create(Pos.Left - GrabMousePosition.Left, 0), 394 GrabWindowRectangle.Size - TSize.Create(Pos.Left - GrabMousePosition.Left, 0)) 395 else if GrabWindowSide = wsTop then 396 GrabWindow.Rectangle := TRectangle.Create(GrabWindowRectangle.Position + TPosition.Create(0, Pos.Top - GrabMousePosition.Top), 397 GrabWindowRectangle.Size - TSize.Create(0, Pos.Top - GrabMousePosition.Top)) 398 else if GrabWindowSide = wsRight then 399 GrabWindow.Rectangle := TRectangle.Create(GrabWindowRectangle.Position, 400 GrabWindowRectangle.Size + TSize.Create(Pos.Left - GrabMousePosition.Left, 0)) 401 else if GrabWindowSide = wsBottom then 402 GrabWindow.Rectangle := TRectangle.Create(GrabWindowRectangle.Position, 403 GrabWindowRectangle.Size + TSize.Create(0, Pos.Top - GrabMousePosition.Top)); 404 Paint; 405 end; 215 406 for I := Windows.Count - 1 downto 0 do begin 216 407 if Windows[I].Rectangle.Contains(Pos) then begin 217 Windows[I].MouseMove(Pos - Windows[I]. Rectangle.Position);408 Windows[I].MouseMove(Pos - Windows[I].Position); 218 409 Break; 219 410 end; … … 249 440 begin 250 441 Result := TWindow.Create; 251 Windows.Add(Result);252 442 Result.Screen := Self; 253 443 Result.Title := Title; … … 259 449 begin 260 450 Windows := TFPGObjectList<TWindow>.Create; 451 Windows.FreeObjects := False; 261 452 Canvas := TCanvas.Create; 262 453 end; 263 454 264 455 destructor TScreen.Destroy; 265 begin 456 var 457 I: Integer; 458 begin 459 for I := Windows.Count - 1 downto 0 do 460 Windows[I].Free; 266 461 Windows.Free; 267 462 Canvas.Free; -
TabularUnified /branches/overos/overos.lpi ¶
r20 r30 11 11 <Icon Value="0"/> 12 12 </General> 13 <BuildModes Count="1"> 14 <Item1 Name="Default" Default="True"/> 13 <BuildModes Count="2"> 14 <Item1 Name="Debug" Default="True"/> 15 <Item2 Name="Release"> 16 <CompilerOptions> 17 <Version Value="11"/> 18 <Target> 19 <Filename Value="overos"/> 20 </Target> 21 <SearchPaths> 22 <IncludeFiles Value="$(ProjOutDir)"/> 23 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 24 </SearchPaths> 25 <Parsing> 26 <SyntaxOptions> 27 <SyntaxMode Value="Delphi"/> 28 <CStyleOperator Value="False"/> 29 <AllowLabel Value="False"/> 30 <CPPInline Value="False"/> 31 </SyntaxOptions> 32 </Parsing> 33 <CodeGeneration> 34 <SmartLinkUnit Value="True"/> 35 <Optimizations> 36 <OptimizationLevel Value="3"/> 37 </Optimizations> 38 </CodeGeneration> 39 <Linking> 40 <Debugging> 41 <GenerateDebugInfo Value="False"/> 42 </Debugging> 43 <LinkSmart Value="True"/> 44 <Options> 45 <Win32> 46 <GraphicApplication Value="True"/> 47 </Win32> 48 </Options> 49 </Linking> 50 </CompilerOptions> 51 </Item2> 15 52 </BuildModes> 16 53 <PublishOptions> … … 27 64 </Item1> 28 65 </RequiredPackages> 29 <Units Count=" 6">66 <Units Count="9"> 30 67 <Unit0> 31 68 <Filename Value="overos.lpr"/> … … 55 92 <IsPartOfProject Value="True"/> 56 93 </Unit5> 94 <Unit6> 95 <Filename Value="UControls.pas"/> 96 <IsPartOfProject Value="True"/> 97 </Unit6> 98 <Unit7> 99 <Filename Value="UGraphics.pas"/> 100 <IsPartOfProject Value="True"/> 101 </Unit7> 102 <Unit8> 103 <Filename Value="UApplication.pas"/> 104 <IsPartOfProject Value="True"/> 105 </Unit8> 57 106 </Units> 58 107 </ProjectOptions> … … 64 113 <SearchPaths> 65 114 <IncludeFiles Value="$(ProjOutDir)"/> 66 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS) "/>115 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/> 67 116 </SearchPaths> 68 117 <Parsing> 69 118 <SyntaxOptions> 70 119 <SyntaxMode Value="Delphi"/> 120 <CStyleOperator Value="False"/> 121 <IncludeAssertionCode Value="True"/> 122 <AllowLabel Value="False"/> 123 <CPPInline Value="False"/> 71 124 </SyntaxOptions> 72 125 </Parsing> 126 <CodeGeneration> 127 <Checks> 128 <IOChecks Value="True"/> 129 <RangeChecks Value="True"/> 130 <OverflowChecks Value="True"/> 131 <StackChecks Value="True"/> 132 </Checks> 133 <VerifyObjMethodCallValidity Value="True"/> 134 </CodeGeneration> 73 135 <Linking> 136 <Debugging> 137 <UseHeaptrc Value="True"/> 138 </Debugging> 74 139 <Options> 75 140 <Win32> -
TabularUnified /branches/overos/overos.lpr ¶
r20 r30 8 8 {$ENDIF}{$ENDIF} 9 9 Interfaces, // this includes the LCL widgetset 10 Forms, UFormMain, UWindow, UMouse, USystem, UTypes 10 Forms, UFormMain, UWindow, UMouse, USystem, UTypes, UControls, UGraphics, 11 UApplication, SysUtils 11 12 { you can add units after this }; 12 13 13 14 {$R *.res} 14 15 16 {$if declared(UseHeapTrace)} 17 const 18 HeapTraceLog = 'heaptrclog.trc'; 19 {$ENDIF} 20 15 21 begin 22 {$if declared(UseHeapTrace)} 23 // Heap trace 24 DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 25 SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog); 26 {$ENDIF} 27 16 28 RequireDerivedFormResource:=True; 17 29 Application.Initialize;
Note:
See TracChangeset
for help on using the changeset viewer.