- Timestamp:
- Sep 15, 2024, 1:31:30 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/CityScreen.pas
r613 r617 1188 1188 with MainScreen.MessgExDlg do 1189 1189 begin 1190 { MessgText:=Phrases.Lookup('OUTOFCONTROL'); 1191 if C.Project and cpImp=0 then 1192 MessgText:=Format(MessgText,[Tribe[cOwner].ModelName[C.Project and cpIndex]]) 1193 else MessgText:=Format(MessgText,[Phrases.Lookup('IMPROVEMENTS',C.Project and cpIndex)]); } 1190 { MessgText := Phrases.Lookup('OUTOFCONTROL'); 1191 if C.Project and cpImp = 0 then 1192 MessgText := Format(MessgText, [Tribe[cOwner].ModelName[C.Project and cpIndex]]) 1193 else MessgText := Format(MessgText, [Phrases.Lookup('IMPROVEMENTS', 1194 C.Project and cpIndex)]); 1195 } 1194 1196 MessgText := Phrases.Lookup('NOCHANGEINANARCHY'); 1195 1197 Kind := mkOk; … … 1201 1203 begin 1202 1204 ProdHint := False; 1203 SmartUpdateContent 1205 SmartUpdateContent; 1204 1206 end; 1205 1207 ChooseProject; -
trunk/LocalPlayer/Term.pas
r616 r617 7092 7092 ShortCut := KeyToShortCut(Key, Shift); 7093 7093 7094 if BFullScreen.Test(ShortCut) then begin 7095 FullScreen := not FullScreen; 7096 SetFullScreen(FullScreen); 7097 end; 7098 7094 7099 if GameMode = cMovie then begin 7095 7100 if BScienceStat.Test(ShortCut) then MenuClick_Check(StatPopup, mScienceStat) … … 7107 7112 else if BFillMap.Test(ShortCut) then mFillMap.Click 7108 7113 else if BHelp.Test(ShortCut) then mHelp.Click; 7109 (*if Shift = [ssCtrl] then7110 case Char(Key) of7111 'A':7112 begin // auto symmetry7113 Server($7F0,Me,0,nil^);7114 MapValid:=False;7115 PaintAll;7116 end;7117 'B':7118 begin // land mass7119 dy:=0;7120 for dx:=G.lx to G.lx*(G.ly-1)-1 do7121 if MyMap[dx] and fTerrain>=fGrass then Inc(dy);7122 dy:=dy7123 end;7124 end;7125 *)7126 7114 Exit; 7127 7115 end; 7128 7116 7129 7117 if BEndTurn.Test(ShortCut) then EndTurn 7130 else if BFullScreen.Test(ShortCut) then begin7131 FullScreen := not FullScreen;7132 SetFullScreen(FullScreen);7133 end7134 7118 else if BHelp.Test(ShortCut) then mHelp.Click 7135 7119 else if BUnitStat.Test(ShortCut) then MenuClick_Check(StatPopup, mUnitStat) -
trunk/Packages/CevoComponents/DrawDlg.pas
r565 r617 25 25 procedure InitButtons; 26 26 procedure OnEraseBkgnd(var Msg: TMessage); message WM_ERASEBKGND; 27 procedure OnHitTest(var Msg: TMessage); message WM_NCHITTEST;28 27 procedure MouseDown(Button: TMouseButton; Shift: TShiftState; X, Y: Integer); 29 28 override; … … 92 91 end; 93 92 94 procedure TDrawDlg.OnHitTest(var Msg: TMessage);95 var96 I: integer;97 ControlBounds: TRect;98 Pos: TPoint;99 begin100 if BorderStyle <> TBorderStyle.bsNone then101 inherited102 else103 begin104 Pos := Point(ScaleFromNative(Integer(Msg.LParam and $ffff)),105 ScaleFromNative(Integer((Msg.LParam shr 16) and $ffff)));106 if Pos.Y >= Top + TitleHeight then107 Msg.Result := HTCLIENT108 else109 begin110 for I := 0 to ControlCount - 1 do111 if Controls[I].Visible then112 begin113 ControlBounds := Controls[I].BoundsRect;114 if (Pos.X >= Left + ControlBounds.Left) and115 (Pos.X < Left + ControlBounds.Right) and116 (Pos.Y >= Top + ControlBounds.Top) and117 (Pos.Y < Top + ControlBounds.Bottom) then118 begin119 Msg.result := HTCLIENT;120 Exit;121 end;122 end;123 Msg.Result := HTCAPTION;124 end;125 end;126 end;127 128 93 procedure TDrawDlg.MouseDown(Button: TMouseButton; Shift: TShiftState; X, 129 94 Y: Integer); … … 131 96 MousePos1: TPoint; 132 97 MousePos2: TPoint; 133 {$IFDEF UNIX}134 98 NewFormPos: TPoint; 135 {$ENDIF}136 99 begin 137 100 MousePos1 := Mouse.CursorPos; 138 101 inherited; 139 102 MousePos2 := Mouse.CursorPos; 140 {$IFDEF UNIX}141 // Only if client is not doing own mouse move handling142 103 if not Assigned(OnMouseDown) or not Assigned(OnMouseMove) or not Assigned(OnMouseUp) then begin 143 // HitTest is not supported under Linux GTK2 so use form inside move mechanizm144 104 NewFormPos := ScreenToClient(Mouse.CursorPos); 145 105 if (NewFormPos.X >= 0) and (NewFormPos.X < Width) and … … 154 114 end else MoveActive := False; 155 115 end; 156 {$ENDIF}157 116 end; 158 117 … … 163 122 inherited; 164 123 if MoveActive then begin 165 MousePos := ClientToScreen(Point(X, Y));124 MousePos := Mouse.CursorPos; 166 125 SetBounds(MoveFormPos.X + MousePos.X - MoveMousePos.X, 167 MoveFormPos.Y + MousePos.Y - MoveMousePos.Y, 168 Width, Height); 126 MoveFormPos.Y + MousePos.Y - MoveMousePos.Y, Width, Height); 169 127 end; 170 128 end; -
trunk/Packages/DpiControls/Dpi.Common.pas
r608 r617 225 225 function ScaleToNative(Value: Integer): Integer; inline; 226 226 begin 227 Result := ScreenInfo.Lookup [Value];227 Result := ScreenInfo.LookupToNative[Value]; 228 228 // Round and Trunc are fast. Ceil and Floor are slow. 229 229 // Without lookup table we would use: … … 238 238 function ScaleFromNative(Value: Integer): Integer; 239 239 begin 240 Result := Trunc(Value * ScreenInfo.FromNative); 240 Result := ScreenInfo.LookupFromNative[Value]; 241 // Round and Trunc are fast. Ceil and Floor are slow. 242 // Without lookup table we would use: 243 // Result := Floor(Value * ScreenInfo.FromNative); 241 244 end; 242 245 -
trunk/Packages/DpiControls/Dpi.Graphics.pas
r568 r617 354 354 ToNative: Double; 355 355 FromNative: Double; 356 Lookup: array[-10000..10000] of Integer; // Should be sufficient for 8K screens 356 LookupToNative: array[-10000..10000] of Integer; // Should be sufficient for 8K screens 357 LookupFromNative: array[-10000..10000] of Integer; // Should be sufficient for 8K screens 357 358 property Dpi: Integer read FDpi write SetDpi; 358 359 end; … … 1353 1354 if FDpi = AValue then Exit; 1354 1355 FDpi := AValue; 1356 1357 // Precalculate scaling coefficients 1355 1358 ToNative := ScreenInfo.Dpi / 96; 1356 1357 // Precalculate scaling coefficients1359 for I := Low(LookupToNative) to High(LookupToNative) do 1360 LookupToNative[I] := Ceil(I * ToNative); 1358 1361 FromNative := 96 / ScreenInfo.Dpi; 1359 for I := Low(Lookup ) to High(Lookup) do1360 Lookup [I] := Ceil(I * ToNative);1362 for I := Low(LookupFromNative) to High(LookupFromNative) do 1363 LookupFromNative[I] := Floor(I * FromNative); 1361 1364 end; 1362 1365
Note:
See TracChangeset
for help on using the changeset viewer.