Changes in / [20:30]


Ignore:
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
  • TabularUnified /branches/overos/UFormMain.lfm

    r20 r30  
    77  ClientHeight = 523
    88  ClientWidth = 758
    9   DesignTimePPI = 128
     9  DesignTimePPI = 120
     10  OnClose = FormClose
    1011  OnResize = FormResize
    1112  OnShow = FormShow
     
    2122    OnMouseUp = Image1MouseUp
    2223  end
     24  object Timer1: TTimer
     25    Interval = 10
     26    OnTimer = Timer1Timer
     27    left = 303
     28    top = 201
     29  end
    2330end
  • TabularUnified /branches/overos/UFormMain.pas

    r20 r30  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   UWindow, USystem, UTypes, UMouse;
     9  Types, UWindow, USystem, UTypes, UMouse, UGraphics, UControls, UApplication;
    1010
    1111type
     
    1616  TFormMain = class(TForm)
    1717    Image1: TImage;
     18    Timer1: TTimer;
     19    procedure FormClose(Sender: TObject; var CloseAction: TCloseAction);
    1820    procedure Image1MouseDown(Sender: TObject; Button: TControlsMouseButton;
    1921      Shift: TShiftState; X, Y: Integer);
     
    2325    procedure FormResize(Sender: TObject);
    2426    procedure FormShow(Sender: TObject);
     27    procedure Timer1Timer(Sender: TObject);
    2528  private
    2629
    2730  public
     31    App: TApplication;
    2832    System: TSystem;
    2933  end;
     
    3640    procedure DrawArea(Rect: TRectangle; Color: TColor); override;
    3741    procedure DrawText(P: TPosition; Color: TColor; Text: string); override;
     42    function GetTextSize(Text: string): TSize; override;
    3843  end;
    3944
     
    6671procedure TCanvasScreen.DrawText(P: TPosition; Color: TColor; Text: string);
    6772begin
     73  Canvas.Brush.Style := bsClear;
    6874  Canvas.Font.Color := Color;
    6975  Canvas.TextOut(P.Left, P.Top, Text);
     76end;
     77
     78function TCanvasScreen.GetTextSize(Text: string): TSize;
     79var
     80  Size: Types.TSize;
     81begin
     82  Size := Canvas.TextExtent(Text);
     83  Result := TSize.Create(Size.cx, Size.cy);
    7084end;
    7185
     
    8599end;
    86100
     101procedure TFormMain.FormClose(Sender: TObject; var CloseAction: TCloseAction);
     102begin
     103  Timer1.Enabled := False;
     104  App.Free;
     105  System.Free;
     106end;
     107
    87108procedure TFormMain.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
    88109  Y: Integer);
    89110begin
    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));
    92113end;
    93114
     
    117138var
    118139  Window: TWindow;
     140  Button: TButton;
    119141begin
    120142  System := TSystem.Create;
     
    124146  System.Screen.Size := TSize.Create(Width, Height);
    125147
     148  App := TApplication.Create;
     149
    126150  Window := System.Screen.CreateWindow('Test');
     151  Window.Application := App;
    127152
    128153  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;
    131162
    132163  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);
    135167
    136168  System.Screen.Paint;
    137169end;
    138170
     171procedure TFormMain.Timer1Timer(Sender: TObject);
     172begin
     173  App.ProcessMessages;
     174end;
     175
    139176end.
    140177
  • TabularUnified /branches/overos/UTypes.pas

    r20 r30  
    1616    Height: Integer;
    1717    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;
    1821  end;
    1922
     
    2629    class operator Add(A, B: TPosition): TPosition;
    2730    class operator Subtract(A, B: TPosition): TPosition;
     31    class operator Equal(A, B: TPosition): Boolean;
    2832  end;
    2933
     
    3539    function Create(Position: TPosition; Size: TSize): TRectangle;
    3640    function Contains(Position: TPosition): Boolean;
     41    class operator Equal(A, B: TRectangle): Boolean;
    3742  end;
    3843
    39   TColor = Integer;
     44  TMessage = class
     45    Handle: TObject;
     46  end;
    4047
    4148
     
    5663    (Self.Position.Left + Self.Size.Width >= Position.Left) and
    5764    (Self.Position.Top + Self.Size.Height >= Position.Top);
     65end;
     66
     67class operator TRectangle.Equal(A, B: TRectangle): Boolean;
     68begin
     69  Result := (A.Position = B.Position) and (A.Size = B.Size);
    5870end;
    5971
     
    7890end;
    7991
     92class operator TPosition.Equal(A, B: TPosition): Boolean;
     93begin
     94  Result := (A.Left = B.Left) and (A.Top = B.Top);
     95end;
     96
    8097{ TSize }
    8198
     
    86103end;
    87104
     105class operator TSize.Add(A, B: TSize): TSize;
     106begin
     107  Result.Width := A.Width + B.Width;
     108  Result.Height := A.Height + B.Height;
     109end;
     110
     111class operator TSize.Subtract(A, B: TSize): TSize;
     112begin
     113  Result.Width := A.Width - B.Width;
     114  Result.Height := A.Height - B.Height;
     115end;
     116
     117class operator TSize.Equal(A, B: TSize): Boolean;
     118begin
     119  Result := (A.Width = B.Width) and (A.Height = B.Height);
     120end;
     121
    88122
    89123end.
  • TabularUnified /branches/overos/UWindow.pas

    r20 r30  
    66
    77uses
    8   Classes, SysUtils, fgl, UTypes, UMouse;
     8  Classes, SysUtils, fgl, UTypes, UMouse, UControls, UGraphics;
    99
    1010type
    11   { TCanvas }
    12 
    13   TCanvas = class
    14     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 
    2011  TScreen = class;
    2112  TWindow = class;
     
    2819    procedure DrawArea(Rect: TRectangle; Color: TColor); override;
    2920    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);
    3152
    3253  { TWindow }
    3354
    34   TWindow = class
     55  TWindow = class(TControl)
    3556  private
    36     FVisible: 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;
    4162  public
    42     Canvas: TCanvas;
     63  const
     64    BorderGrabWidth = 15;
     65  var
     66    TitleBar: TTitleBar;
    4367    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;
    4674    procedure Focus;
    47     procedure Paint;
     75    procedure Paint; override;
    4876    function Focused: Boolean;
    49     property Visible: Boolean read FVisible write SetVisible;
    50     constructor Create;
     77    constructor Create; override;
    5178    destructor Destroy; override;
     79    property Screen: TScreen read FScreen write SetScreen;
    5280  end;
    5381
     
    5785  private
    5886    FMouse: TMouse;
     87    GrabActive: Boolean;
     88    GrabWindow: TWindow;
     89    GrabMousePosition: TPosition;
     90    GrabWindowRectangle: TRectangle;
     91    GrabWindowSide: TWindowSide;
    5992    procedure MouseButtonDown(Pos: TPosition; Button: TMouseButton);
    6093    procedure MouseButtonUp(Pos: TPosition; Button: TMouseButton);
     
    72105  end;
    73106
    74 const
    75   clBlack = $000000;
    76   clGray = $808080;
    77   clWhite = $ffffff;
    78107
    79108implementation
    80109
    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
     110uses
     111  UApplication;
     112
     113{ TTitleBar }
     114
     115procedure TTitleBar.SetWindow(AValue: TWindow);
     116begin
     117  if FWindow = AValue then Exit;
     118  Canvas.Free;
     119  FWindow := AValue;
     120  Canvas := TCanvasWindow.Create;
     121  TCanvasWindow(Canvas).Window := FWindow;
     122end;
     123
     124procedure TTitleBar.ButtonCloseClick(Sender: TObject);
     125begin
     126  Window.Close;
     127end;
     128
     129procedure TTitleBar.ButtonMaximizeClick(Sender: TObject);
     130begin
     131  Window.Maximize;
     132end;
     133
     134procedure TTitleBar.ButtonMinimizeClick(Sender: TObject);
     135begin
     136
     137end;
     138
     139procedure TTitleBar.SetRectangle(AValue: TRectangle);
     140begin
     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));
     148end;
     149
     150constructor TTitleBar.Create;
     151begin
     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;
     171end;
     172
     173destructor TTitleBar.Destroy;
     174begin
     175  ButtonClose.Free;
     176  ButtonMaximize.Free;
     177  ButtonMinimize.Free;
     178  inherited;
    103179end;
    104180
     
    107183procedure TCanvasWindow.DrawLine(P1, P2: TPosition; Color: TColor);
    108184begin
    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);
    110187end;
    111188
    112189procedure TCanvasWindow.DrawArea(Rect: TRectangle; Color: TColor);
    113190begin
    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);
    116194end;
    117195
    118196procedure TCanvasWindow.DrawText(P: TPosition; Color: TColor; Text: string);
    119197begin
    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);
     200end;
     201
     202function TCanvasWindow.GetTextSize(Text: string): TSize;
     203begin
     204  if Assigned(Window) and Assigned(Window.Screen) then
     205    Result := Window.Screen.Canvas.GetTextSize(Text);
    121206end;
    122207
    123208{ TWindow }
    124209
     210procedure TWindow.SetScreen(AValue: TScreen);
     211begin
     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);
     218end;
     219
     220procedure TWindow.SetRectangle(AValue: TRectangle);
     221begin
     222  inherited;
     223  TitleBar.Rectangle := TRectangle.Create(Position, TSize.Create(Size.Width, TitleBar.TitleHeight));
     224end;
     225
     226procedure TWindow.SetVisible(AValue: Boolean);
     227begin
     228  inherited;
     229  if not Visible and Assigned(Screen) then
     230    Screen.Paint;
     231end;
     232
     233procedure TWindow.HandleMessage(Message: TMessage);
     234begin
     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;
     242end;
     243
    125244procedure TWindow.MouseButtonDown(Pos: TPosition; Button: TMouseButton);
    126245begin
    127   Focus;
     246  inherited;
     247  TitleBar.MouseButtonDown(Pos, Button);
    128248end;
    129249
    130250procedure TWindow.MouseButtonUp(Pos: TPosition; Button: TMouseButton);
    131251begin
    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);
     254end;
     255
     256procedure TWindow.Close;
     257begin
     258  TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowClose.Create);
     259end;
     260
     261procedure TWindow.Maximize;
     262begin
     263  TApplication(Application).MessageQueue.PostMessage(Self, TMessageWindowMaximize.Create);
    145264end;
    146265
     
    154273
    155274procedure 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);
     275begin
     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;
    164285end;
    165286
     
    171292constructor TWindow.Create;
    172293begin
     294  inherited;
     295  Canvas.Free;
    173296  Canvas := TCanvasWindow.Create;
    174297  TCanvasWindow(Canvas).Window := Self;
     298  TitleBar := TTitleBar.Create;
     299  TitleBar.Window := Self;
     300  TitleBar.Visible := True;
    175301end;
    176302
    177303destructor TWindow.Destroy;
    178304begin
    179   Canvas.Free;
     305  Visible := False;
     306  TitleBar.Free;
     307  Screen := nil;
    180308  inherited Destroy;
    181309end;
     
    190318  for I := Windows.Count - 1 downto 0 do begin
    191319    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;
    192359    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);
    194362      Break;
    195363    end;
     
    200368var
    201369  I: Integer;
    202 begin
     370  Window: TWindow;
     371begin
     372  if GrabActive then begin
     373    GrabActive := False;
     374    GrabWindow := nil;
     375  end;
    203376  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);
    206380      Break;
    207381    end;
     
    213387  I: Integer;
    214388begin
     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;
    215406  for I := Windows.Count - 1 downto 0 do begin
    216407    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);
    218409      Break;
    219410    end;
     
    249440begin
    250441  Result := TWindow.Create;
    251   Windows.Add(Result);
    252442  Result.Screen := Self;
    253443  Result.Title := Title;
     
    259449begin
    260450  Windows := TFPGObjectList<TWindow>.Create;
     451  Windows.FreeObjects := False;
    261452  Canvas := TCanvas.Create;
    262453end;
    263454
    264455destructor TScreen.Destroy;
    265 begin
     456var
     457  I: Integer;
     458begin
     459  for I := Windows.Count - 1 downto 0 do
     460    Windows[I].Free;
    266461  Windows.Free;
    267462  Canvas.Free;
  • TabularUnified /branches/overos/overos.lpi

    r20 r30  
    1111      <Icon Value="0"/>
    1212    </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>
    1552    </BuildModes>
    1653    <PublishOptions>
     
    2764      </Item1>
    2865    </RequiredPackages>
    29     <Units Count="6">
     66    <Units Count="9">
    3067      <Unit0>
    3168        <Filename Value="overos.lpr"/>
     
    5592        <IsPartOfProject Value="True"/>
    5693      </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>
    57106    </Units>
    58107  </ProjectOptions>
     
    64113    <SearchPaths>
    65114      <IncludeFiles Value="$(ProjOutDir)"/>
    66       <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/>
     115      <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)-$(BuildMode)"/>
    67116    </SearchPaths>
    68117    <Parsing>
    69118      <SyntaxOptions>
    70119        <SyntaxMode Value="Delphi"/>
     120        <CStyleOperator Value="False"/>
     121        <IncludeAssertionCode Value="True"/>
     122        <AllowLabel Value="False"/>
     123        <CPPInline Value="False"/>
    71124      </SyntaxOptions>
    72125    </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>
    73135    <Linking>
     136      <Debugging>
     137        <UseHeaptrc Value="True"/>
     138      </Debugging>
    74139      <Options>
    75140        <Win32>
  • TabularUnified /branches/overos/overos.lpr

    r20 r30  
    88  {$ENDIF}{$ENDIF}
    99  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
    1112  { you can add units after this };
    1213
    1314{$R *.res}
    1415
     16{$if declared(UseHeapTrace)}
     17const
     18  HeapTraceLog = 'heaptrclog.trc';
     19{$ENDIF}
     20
    1521begin
     22  {$if declared(UseHeapTrace)}
     23  // Heap trace
     24  DeleteFile(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     25  SetHeapTraceOutput(ExtractFilePath(ParamStr(0)) + HeapTraceLog);
     26  {$ENDIF}
     27
    1628  RequireDerivedFormResource:=True;
    1729  Application.Initialize;
Note: See TracChangeset for help on using the changeset viewer.