Changeset 10 for trunk/Forms


Ignore:
Timestamp:
Aug 29, 2016, 5:35:21 PM (8 years ago)
Author:
chronos
Message:
  • Added: Second clock task running in parallel.
  • Modified: Redraw screen only with maximum defined period. Not after each graphic operation.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r9 r10  
    5555    end
    5656  end
     57  object Timer1: TTimer
     58    Interval = 50
     59    OnTimer = Timer1Timer
     60    left = 180
     61    top = 281
     62  end
    5763end
  • trunk/Forms/UFormMain.pas

    r9 r10  
    2424    MenuItem4: TMenuItem;
    2525    PaintBox1: TPaintBox;
     26    Timer1: TTimer;
    2627    procedure AExitExecute(Sender: TObject);
    2728    procedure AFullscreenExecute(Sender: TObject);
     
    3435    procedure PaintBox1Paint(Sender: TObject);
    3536    procedure PaintBox1Resize(Sender: TObject);
     37    procedure Timer1Timer(Sender: TObject);
    3638  private
     39    RedrawPending: Boolean;
    3740    VideoDevice: TDeviceVideoBase;
    3841    SerialDevice: TBaseSerialDevice;
     
    6669var
    6770  NewApp: TApp;
     71  NewApp2: TApp;
    6872begin
    6973  PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque];
     
    9094  NewApp := TAppClock.Create;
    9195  Kernel.Apps.Add(NewApp);
     96
     97  NewApp2 := TAppClock2.Create;
     98  Kernel.Apps.Add(NewApp2);
    9299end;
    93100
     
    196203end;
    197204
     205procedure TFormMain.Timer1Timer(Sender: TObject);
     206begin
     207  if RedrawPending then begin
     208    PaintBox1.Refresh;
     209    RedrawPending := False;
     210  end;
     211end;
     212
    198213procedure TFormMain.SerialDeviceReceiveDataSync;
    199214begin
     
    214229procedure TFormMain.VideoDeviceRedrawSync;
    215230begin
    216   PaintBox1.Refresh;
     231  RedrawPending := True;
    217232end;
    218233
Note: See TracChangeset for help on using the changeset viewer.