Changeset 174


Ignore:
Timestamp:
Jun 16, 2019, 11:29:21 AM (5 years ago)
Author:
chronos
Message:
  • Fixed: Disable MoveAction for TDrawDlg instances after visible change.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Nego.pas

    r57 r174  
    1515type
    1616  THistory = record
    17     n: integer;
    18     Text: array [0 .. MaxHistory - 1] of ansistring;
    19   end;
    20 
    21   TCommandAllowedEnum = scDipNoticeStart .. scDipBreakStart;
     17    n: Integer;
     18    Text: array[0 .. MaxHistory - 1] of ansistring;
     19  end;
     20
     21  TCommandAllowedEnum = scDipNoticeStart..scDipBreakStart;
    2222
    2323  { TNegoDlg }
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r168 r174  
    1515  public
    1616    constructor Create(AOwner: TComponent); override;
     17    destructor Destroy; override;
    1718    procedure SmartInvalidate; virtual;
    1819  private
     
    2021    MoveMousePos: TPoint;
    2122    MoveActive: Boolean;
     23    procedure VisibleChangedHandler(Sender: TObject);
    2224  protected
    2325    TitleHeight: Integer;
     
    6769  inherited;
    6870  TitleHeight := 0;
     71  MoveActive := False;
     72  AddHandlerOnVisibleChanged(VisibleChangedHandler);
     73end;
     74
     75destructor TDrawDlg.Destroy;
     76begin
     77  RemoveHandlerOnVisibleChanging(VisibleChangedHandler);
     78  inherited Destroy;
    6979end;
    7080
     
    111121var
    112122  MousePosNew: TPoint;
     123  NewFormPos: TPoint;
    113124begin
    114125  inherited;
    115126  {$IFDEF LINUX}
    116127  // HitTest is not supported under Linux GTK2 so use form inside move mechanizm
    117   MoveMousePos := ClientToScreen(Point(X, Y));
    118   MoveFormPos := Point(Left, Top);
    119   MousePosNew := Mouse.CursorPos;
    120   // Activate move only if mouse position was not changed during inherited call
    121   if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin
    122     MoveActive := True;
    123   end;
     128  NewFormPos := ScreenToClient(Mouse.CursorPos);
     129  if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and
     130    (NewFormPos.Y >= 0) and (NewFormPos.Y < Height) then begin
     131    MoveMousePos := ClientToScreen(Point(X, Y));
     132    MoveFormPos := Point(Left, Top);
     133    MousePosNew := Mouse.CursorPos;
     134    // Activate move only if mouse position was not changed during inherited call
     135    if (MousePosNew.X = MoveMousePos.X) and (MousePosNew.Y = MoveMousePos.Y) then begin
     136      MoveActive := True;
     137    end;
     138  end else MoveActive := False;
    124139  {$ENDIF}
    125140end;
     
    149164  MoveActive := False;
    150165  inherited;
     166end;
     167
     168procedure TDrawDlg.VisibleChangedHandler(Sender: TObject);
     169begin
     170  MoveActive := False;
    151171end;
    152172
  • trunk/Packages/CevoComponents/Sound.pas

    r173 r174  
    9999  {$ENDIF}
    100100  {$IFDEF LINUX}
    101   {$IFNDEF WINDOWS}
    102101  FreeAndNil(SoundPlayerSyncProcess);
    103102  FreeAndNil(SoundPlayerAsyncProcess);
    104   {$ENDIF}
    105103  {$ENDIF}
    106104  inherited Destroy;
  • trunk/Packages/CevoComponents/StringTables.pas

    r128 r174  
    1717    destructor Destroy; override;
    1818    function LoadFromFile(const FileName: String): boolean;
    19     function GetHandle(const Item: AnsiString): integer;
     19    function GetHandle(const Item: string): integer;
    2020    function LookupByHandle(Handle: integer; Index: integer = -1): string;
    2121    function Lookup(const Item: string; Index: integer = -1): string;
     
    5555end;
    5656
    57 function TStringTable.GetHandle(const Item: AnsiString): integer;
     57function TStringTable.GetHandle(const Item: string): integer;
    5858var
    5959  I: Integer;
Note: See TracChangeset for help on using the changeset viewer.