Changeset 30 for trunk/UFormMain.pas


Ignore:
Timestamp:
Apr 18, 2015, 6:17:34 PM (9 years ago)
Author:
chronos
Message:
  • Added: Automatic zooming to all existed map stations. This solve problem if too many stations were existed and some of them appeared behind window border.
  • Added: Much of used TCanvas functions are now available through TMetaCanvas.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UFormMain.pas

    r28 r30  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, Menus,
    9   ExtCtrls, UEngine, LCLType;
     9  ExtCtrls, UEngine, LCLType, types;
    1010
    1111type
     
    2626    procedure PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    2727      Shift: TShiftState; X, Y: Integer);
     28    procedure PaintBox1MouseWheelDown(Sender: TObject; Shift: TShiftState;
     29      MousePos: TPoint; var Handled: Boolean);
     30    procedure PaintBox1MouseWheelUp(Sender: TObject; Shift: TShiftState;
     31      MousePos: TPoint; var Handled: Boolean);
    2832    procedure PaintBox1Paint(Sender: TObject);
    2933    procedure PaintBox1Resize(Sender: TObject);
     
    6872  Randomize;
    6973  Engine.Map.Size := Point(PaintBox1.Width, PaintBox1.Height);
     74  Engine.View.DestRect := Rect(0, 0, PaintBox1.Width, PaintBox1.Height);
    7075  Engine.Reset;
    7176end;
     
    8792begin
    8893  Engine.MouseUp(Button, Point(X, Y));
     94end;
     95
     96procedure TFormMain.PaintBox1MouseWheelDown(Sender: TObject;
     97  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
     98begin
     99  Engine.View.Zoom := Engine.View.Zoom * 1.2;
     100end;
     101
     102procedure TFormMain.PaintBox1MouseWheelUp(Sender: TObject; Shift: TShiftState;
     103  MousePos: TPoint; var Handled: Boolean);
     104begin
     105  Engine.View.Zoom := Engine.View.Zoom / 1.2;
    89106end;
    90107
Note: See TracChangeset for help on using the changeset viewer.