Changeset 87


Ignore:
Timestamp:
Nov 15, 2014, 10:32:26 PM (10 years ago)
Author:
chronos
Message:
  • Fixed: Allow map movement by mouse after moving cursor for at least defined number of pixels to minimalize accidental map move by clicking to map.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r86 r87  
    55  Width = 775
    66  Caption = 'xTactics'
    7   ClientHeight = 592
     7  ClientHeight = 595
    88  ClientWidth = 775
    99  Menu = MainMenu1
     
    1818  object StatusBar1: TStatusBar
    1919    Left = 0
    20     Height = 29
    21     Top = 563
     20    Height = 26
     21    Top = 569
    2222    Width = 775
    2323    Panels = <   
     
    3535  object ToolBar1: TToolBar
    3636    Left = 0
    37     Height = 563
     37    Height = 569
    3838    Top = 0
    3939    Width = 40
     
    116116  object PaintBox1: TPaintBox
    117117    Left = 40
    118     Height = 563
     118    Height = 569
    119119    Top = 0
    120120    Width = 735
    121121    Align = alClient
    122122    OnMouseDown = PaintBox1MouseDown
     123    OnMouseLeave = PaintBox1MouseLeave
    123124    OnMouseMove = PaintBox1MouseMove
    124125    OnMouseUp = PaintBox1MouseUp
    125     OnMouseLeave = PaintBox1MouseLeave
    126126    OnMouseWheelDown = PaintBox1MouseWheelDown
    127127    OnMouseWheelUp = PaintBox1MouseWheelUp
     
    198198  end
    199199  object Timer1: TTimer
    200     Interval = 10
     200    Interval = 20
    201201    OnTimer = Timer1Timer
    202202    left = 154
  • trunk/Forms/UFormMain.pas

    r86 r87  
    1111const
    1212  ZoomFactor = 1.5;
     13  MouseMinDiff = 6;
    1314
    1415type
     
    99100    MoveActive: Boolean;
    100101    RedrawPending: Boolean;
     102    Drawing: Boolean;
    101103    DrawDuration: TDateTime;
    102104    LastTimerTime: TDateTime;
     
    162164  NewCaption: string;
    163165begin
    164   if RedrawPending then begin
     166  if RedrawPending and not Drawing then begin
     167    Drawing := True;
    165168    if not Core.DevelMode then RedrawPending := False;
    166169    TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10;
     
    173176      NewCaption := Core.Game.CurrentPlayer.Name + ' - ' + STurn + ' ' + IntToStr(Core.Game.TurnCounter) + ' - ' + NewCaption;
    174177    Caption := NewCaption;
     178    Drawing := False;
    175179  end;
    176180end;
     
    221225begin
    222226  {$IFDEF Linux}
    223   PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque];
     227  //PaintBox1.ControlStyle := PaintBox1.ControlStyle + [csOpaque];
    224228  {$ENDIF}
    225229  //DoubleBuffered := True;
     
    355359  if Assigned(Core.Game.CurrentPlayer) then begin
    356360    if MoveActive then
     361    if (Abs(StartMousePoint.X - X) > MouseMinDiff) or (Abs(StartMousePoint.Y - Y) > MouseMinDiff) then
    357362    with Core.Game.CurrentPlayer do begin
    358363      if Mode = pmHuman then begin
     
    384389procedure TFormMain.PaintBox1MouseUp(Sender: TObject; Button: TMouseButton;
    385390  Shift: TShiftState; X, Y: Integer);
    386 const
    387   MouseMinDiff = 10;
    388391begin
    389392  if (Abs(StartMousePoint.X - X) < MouseMinDiff) and (Abs(StartMousePoint.Y - Y) < MouseMinDiff) then begin
  • trunk/Forms/UFormNew.lfm

    r82 r87  
    11object FormNew: TFormNew
    2   Left = 987
     2  Left = 624
    33  Height = 528
    4   Top = 500
     4  Top = 313
    55  Width = 745
    66  Caption = 'New game'
     
    5252    object TabSheet1: TTabSheet
    5353      Caption = 'Players'
    54       ClientHeight = 422
     54      ClientHeight = 425
    5555      ClientWidth = 739
    5656      object ListView1: TListView
     
    121121    object TabSheet2: TTabSheet
    122122      Caption = 'Map'
    123       ClientHeight = 422
     123      ClientHeight = 425
    124124      ClientWidth = 739
    125125      object Label1: TLabel
     
    337337    object TabSheet3: TTabSheet
    338338      Caption = 'Rules'
    339       ClientHeight = 422
     339      ClientHeight = 425
    340340      ClientWidth = 739
    341341      object RadioGroupGrowCells: TRadioGroup
     
    353353        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    354354        ChildSizing.ControlsPerLine = 1
    355         ClientHeight = 78
     355        ClientHeight = 81
    356356        ClientWidth = 308
    357357        Items.Strings = (
     
    364364      object Label6: TLabel
    365365        Left = 8
    366         Height = 25
     366        Height = 22
    367367        Top = 248
    368         Width = 129
     368        Width = 114
    369369        Caption = 'Win objective:'
    370370        ParentColor = False
     
    372372      object ComboBoxWinObjective: TComboBox
    373373        Left = 232
    374         Height = 37
     374        Height = 34
    375375        Top = 240
    376376        Width = 328
     
    399399        ChildSizing.Layout = cclLeftToRightThenTopToBottom
    400400        ChildSizing.ControlsPerLine = 1
    401         ClientHeight = 49
     401        ClientHeight = 52
    402402        ClientWidth = 301
    403403        Items.Strings = (
     
    409409      object CheckBoxFogOfWar: TCheckBox
    410410        Left = 336
    411         Height = 27
     411        Height = 24
    412412        Top = 24
    413         Width = 120
     413        Width = 106
    414414        Caption = 'Fog of war'
    415415        TabOrder = 3
  • trunk/xtactics.lpi

    r75 r87  
    111111        <HasResources Value="True"/>
    112112        <ResourceBaseClass Value="Form"/>
    113         <UnitName Value="UFormPlayer"/>
    114113      </Unit3>
    115114      <Unit4>
Note: See TracChangeset for help on using the changeset viewer.