- Timestamp:
- May 1, 2024, 12:08:20 PM (8 months ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Direct.pas
r544 r565 278 278 procedure TDirectDlg.FormPaint(Sender: TObject); 279 279 begin 280 PaintBackground(Self, 3, 3, ClientWidth - 6, ClientHeight - 6); 280 PaintBackground(Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 281 ClientWidth, ClientHeight); 281 282 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 282 283 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, -
trunk/Inp.pas
r474 r565 44 44 procedure TInputDlg.FormPaint(Sender: TObject); 45 45 begin 46 PaintBackground( Self, 3, 3, Width - 6, Height - 6);46 PaintBackground(Canvas, 3, 3, Width - 6, Height - 6, Width, Height); 47 47 Frame(Canvas, 0, 0, Width - 1, Height - 1, 0, 0); 48 48 Frame(Canvas, 1, 1, Width - 2, Height - 2, -
trunk/LocalPlayer/Battle.pas
r548 r565 229 229 FillRect(Rect(0, 0, ClientWidth, ClientHeight)); 230 230 Brush.Style := TBrushStyle.bsClear; 231 PaintBackground(Self, 3 + Border, 3 + Border, 232 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border)); 231 PaintBackground(Canvas, 3 + Border, 3 + Border, 232 ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border), 233 ClientWidth, ClientHeight); 233 234 end; 234 235 Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border), -
trunk/LocalPlayer/Rates.pas
r531 r565 21 21 procedure FormCreate(Sender: TObject); 22 22 procedure TaxLuxBtnClick(Sender: TObject); 23 protected 24 procedure OffscreenPaint; override; 23 25 public 24 procedure OffscreenPaint; override;25 26 procedure ShowNewContent(NewMode: TWindowMode); 26 27 end; … … 48 49 S, s1: string; 49 50 begin 50 if (OffscreenUser <> nil) and (OffscreenUser <> Self) then 51 OffscreenUser.Update; 52 // complete working with old owner to prevent rebound 53 OffscreenUser := Self; 51 inherited; 54 52 55 53 Fill(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight, -
trunk/LocalPlayer/Wonders.pas
r548 r565 27 27 procedure Glow(I, GlowColor: Integer); 28 28 procedure PaintBackgroundShape; 29 protected 30 procedure OffscreenPaint; override; 29 31 public 30 procedure OffscreenPaint; override;31 32 procedure ShowNewContent(NewMode: TWindowMode); 32 33 end; … … 193 194 S: string; 194 195 begin 195 if (OffscreenUser <> nil) and (OffscreenUser <> Self) then 196 OffscreenUser.Update; 197 // complete working with old owner to prevent rebound 198 OffscreenUser := Self; 196 inherited; 199 197 200 198 Fill(Offscreen.Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, -
trunk/Packages/CevoComponents/DrawDlg.pas
r554 r565 21 21 procedure DoDeactivate(Sender: TObject); 22 22 protected 23 // Defines area to grip the window for moving (from top) 23 24 TitleHeight: Integer; 24 // defines area to grip the window for moving (from top)25 25 procedure InitButtons; 26 26 procedure OnEraseBkgnd(var Msg: TMessage); message WM_ERASEBKGND; … … 237 237 procedure TDrawDlg.SmartInvalidate; 238 238 var 239 i: Integer; 240 r0, r1: HRgn; 241 begin 242 r0 := CreateRectRgn(0, 0, Width, Height); 243 for i := 0 to ControlCount - 1 do 244 if not (Controls[i] is TArea) and Controls[i].Visible then 245 begin 246 with Controls[i].BoundsRect do 247 r1 := CreateRectRgn(Left, Top, Right, Bottom); 248 CombineRgn(r0, r0, r1, RGN_DIFF); 249 DeleteObject(r1); 250 end; 251 InvalidateRgn(Handle, r0, False); 252 DeleteObject(r0); 239 I: Integer; 240 R0, R1: HRgn; 241 begin 242 R0 := CreateRectRgn(0, 0, Width, Height); 243 for I := 0 to ControlCount - 1 do 244 if not (Controls[I] is TArea) and Controls[I].Visible then begin 245 with Controls[I].BoundsRect do 246 R1 := CreateRectRgn(Left, Top, Right, Bottom); 247 CombineRgn(R0, R0, R1, RGN_DIFF); 248 DeleteObject(R1); 249 end; 250 InvalidateRgn(Handle, R0, False); 251 DeleteObject(R0); 253 252 end; 254 253 … … 272 271 begin 273 272 if csDesigning in ComponentState then Exit; 274 PaintBackground( Self, 3 + Border, 3 + Border, Width - (6 + 2 * Border),275 Height - (6 + 2 * Border) );273 PaintBackground(Canvas, 3 + Border, 3 + Border, Width - (6 + 2 * Border), 274 Height - (6 + 2 * Border), Width, Height); 276 275 for I := 0 to Border do 277 Frame(Canvas, I, I, Width - 1 - I, Height - 1 - I, 278 $000000, $000000); 276 Frame(Canvas, I, I, Width - 1 - I, Height - 1 - I, $000000, $000000); 279 277 Frame(Canvas, Border + 1, Border + 1, Width - (2 + Border), 280 278 Height - (2 + Border), MainTexture.ColorBevelLight, -
trunk/Packages/CevoComponents/ScreenTools.pas
r548 r565 75 75 procedure FillRectSeamless(Canvas: TCanvas; x0, y0, x1, y1, xOffset, yOffset: Integer; 76 76 const Texture: TBitmap); 77 procedure PaintBackground(Form: TForm; Left, Top, Width, Height: Integer); 77 procedure PaintBackground(Canvas: TCanvas; Left, Top, Width, Height, FormWidth, 78 FormHeight: Integer); 78 79 procedure Corner(Canvas: TCanvas; X, Y, Kind: Integer; T: TTexture); 79 80 procedure BiColorTextOut(Canvas: TCanvas; clMain, clBack: TColor; X, Y: Integer; S: string); … … 1202 1203 end; 1203 1204 1204 procedure PaintBackground(Form: TForm; Left, Top, Width, Height: Integer); 1205 begin 1206 Fill(Form.Canvas, Left, Top, Width, Height, (MainTexture.Width - Form.ClientWidth) div 1207 2, (MainTexture.Height - Form.ClientHeight) div 2); 1205 procedure PaintBackground(Canvas: TCanvas; Left, Top, Width, Height, FormWidth, 1206 FormHeight: Integer); 1207 begin 1208 Fill(Canvas, Left, Top, Width, Height, (MainTexture.Width - FormWidth) div 1209 2, (MainTexture.Height - FormHeight) div 2); 1208 1210 end; 1209 1211 -
trunk/Settings.lfm
r473 r565 9 9 ClientWidth = 483 10 10 Color = clBtnFace 11 Font.Color = clWindowText 12 Font.Height = -11 13 Font.Name = 'MS Sans Serif' 11 14 DesignTimePPI = 144 12 15 FormStyle = fsStayOnTop -
trunk/Settings.pas
r524 r565 203 203 procedure TSettingsDlg.FormPaint(Sender: TObject); 204 204 begin 205 PaintBackground(Self, 3, 3, ClientWidth - 6, ClientHeight - 6); 205 PaintBackground(Canvas, 3, 3, ClientWidth - 6, ClientHeight - 6, 206 ClientWidth, ClientHeight); 206 207 Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0); 207 208 Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2, -
trunk/Start.lfm
r426 r565 23 23 OnMouseMove = FormMouseMove 24 24 OnMouseUp = FormMouseUp 25 OnPaint = FormPaint26 25 OnShow = FormShow 27 26 LCLVersion = '2.0.12.0' -
trunk/Start.pas
r554 r565 6 6 uses 7 7 GameServer, Messg, ButtonBase, ButtonA, ButtonC, ButtonB, Area, Types, 8 LCLIntf, LCLType, SysUtils, Classes, 8 LCLIntf, LCLType, SysUtils, Classes, BaseWin, 9 9 Registry, DrawDlg, Generics.Collections, Protocol, MiniMap, Brain, Translator, 10 10 {$IFDEF DPI}System.UITypes, Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls, … … 42 42 { TStartDlg } 43 43 44 TStartDlg = class(T DrawDlg)44 TStartDlg = class(TBufferedDrawDlg) 45 45 PopupMenu1: TPopupMenu; 46 46 StartBtn: TButtonA; … … 62 62 procedure ListKeyPress(Sender: TObject; var Key: Char); 63 63 procedure StartBtnClick(Sender: TObject); 64 procedure FormPaint(Sender: TObject);65 64 procedure FormShow(Sender: TObject); 66 65 procedure FormHide(Sender: TObject); … … 131 130 procedure UnlistBackupFile(FileName: string); 132 131 procedure SmartInvalidate(x0, y0, x1, y1: Integer; 133 invalidateTab0: Boolean = False); overload;132 InvalidateTab0: Boolean = False); overload; 134 133 procedure LoadConfig; 135 134 procedure SaveConfig; … … 138 137 procedure UpdateInterface; 139 138 procedure ShowSettings; 139 protected 140 procedure OffscreenPaint; override; 140 141 public 141 142 EmptyPicture: TBitmap; … … 338 339 var 339 340 I: Integer; 340 r0, r1: HRgn; 341 begin 342 r0 := CreateRectRgn(x0, y0, x1, y1); 341 R0, R1: HRgn; 342 begin 343 OffscreenUser := nil; 344 R0 := CreateRectRgn(x0, y0, x1, y1); 343 345 for I := 0 to ControlCount - 1 do 344 346 if not (Controls[I] is TArea) and Controls[I].Visible then 345 347 begin 346 348 with Controls[I].BoundsRect do 347 r1 := CreateRectRgn(Left, Top, Right, Bottom);348 CombineRgn( r0, r0, r1, RGN_DIFF);349 DeleteObject( r1);350 end; 351 if not invalidateTab0 then begin352 r1 := CreateRectRgn(0, 0, 6 + 36, 3 + 38); // tab 0 icon353 CombineRgn( r0, r0, r1, RGN_DIFF);354 DeleteObject( r1);355 end; 356 InvalidateRgn(Handle, r0, False);357 DeleteObject( r0);349 R1 := CreateRectRgn(Left, Top, Right, Bottom); 350 CombineRgn(R0, R0, R1, RGN_DIFF); 351 DeleteObject(R1); 352 end; 353 if not InvalidateTab0 then begin 354 R1 := CreateRectRgn(0, 0, 6 + 36, 3 + 38); // tab 0 icon 355 CombineRgn(R0, R0, R1, RGN_DIFF); 356 DeleteObject(R1); 357 end; 358 InvalidateRgn(Handle, R0, False); 359 DeleteObject(R0); 358 360 end; 359 361 … … 536 538 procedure TStartDlg.DrawAction(Y, IconIndex: Integer; HeaderItem, TextItem: string); 537 539 begin 538 Canvas.Font.Assign(UniFont[ftCaption]); 539 Canvas.Font.Style := Canvas.Font.Style + [TFontStyle.fsUnderline]; 540 RisedTextOut(Canvas, xAction, Y - 3, Phrases2.Lookup(HeaderItem)); 541 Canvas.Font.Assign(UniFont[ftNormal]); 542 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText], 543 $000000, xAction, Y + 21, Phrases2.Lookup(TextItem)); 544 545 UnshareBitmap(DrawBuffer); 546 DrawBufferEnsureSize(50, 50); 547 BitBltCanvas(DrawBuffer.Canvas, 0, 0, 50, 50, Canvas, 548 xActionIcon - 2, Y - 2); 549 GlowFrame(DrawBuffer, 8, 8, 34, 34, $202020); 550 BitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50, 551 DrawBuffer.Canvas, 0, 0); 552 BitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas, 553 (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig); 554 RFrame(Canvas, xActionIcon - 1, Y - 1, xActionIcon + 40, Y + 40, 555 $000000, $000000); 556 end; 557 558 procedure TStartDlg.FormPaint(Sender: TObject); 540 with Offscreen do begin 541 Canvas.Font.Assign(UniFont[ftCaption]); 542 Canvas.Font.Style := Canvas.Font.Style + [TFontStyle.fsUnderline]; 543 RisedTextOut(Canvas, xAction, Y - 3, Phrases2.Lookup(HeaderItem)); 544 Canvas.Font.Assign(UniFont[ftNormal]); 545 BiColorTextOut(Canvas, Colors.Canvas.Pixels[clkAge0 - 1, cliDimmedText], 546 $000000, xAction, Y + 21, Phrases2.Lookup(TextItem)); 547 548 UnshareBitmap(DrawBuffer); 549 DrawBufferEnsureSize(50, 50); 550 BitBltCanvas(DrawBuffer.Canvas, 0, 0, 50, 50, Canvas, 551 xActionIcon - 2, Y - 2); 552 GlowFrame(DrawBuffer, 8, 8, 34, 34, $202020); 553 BitBltCanvas(Canvas, xActionIcon - 2, Y - 2, 50, 50, 554 DrawBuffer.Canvas, 0, 0); 555 BitBltCanvas(Canvas, xActionIcon, Y, 40, 40, BigImp.Canvas, 556 (IconIndex mod 7) * xSizeBig + 8, (IconIndex div 7) * ySizeBig); 557 RFrame(Canvas, xActionIcon - 1, Y - 1, xActionIcon + 40, Y + 40, 558 $000000, $000000); 559 end; 560 end; 561 562 procedure TStartDlg.OffscreenPaint; 559 563 const 560 564 TabNames: array[TStartTab] of Integer = (0, 11, 3, 4); … … 565 569 MainAction: TMainAction; 566 570 begin 567 PaintBackground(Self, 3, 3, TabOffset + 4 * TabSize - 4, TabHeight - 3); 568 PaintBackground(Self, 3, TabHeight + 3, ClientWidth - 6, 569 ClientHeight - TabHeight - 6); 571 inherited; 572 573 with Offscreen do begin 574 PaintBackground(Canvas, 3, 3, TabOffset + 4 * TabSize - 4, TabHeight - 3, 575 ClientWidth, ClientHeight); 576 PaintBackground(Canvas, 3, TabHeight + 3, ClientWidth - 6, 577 ClientHeight - TabHeight - 6, ClientWidth, ClientHeight); 570 578 with Canvas do 571 579 begin … … 626 634 if Tab = tbMain then 627 635 begin 628 PaintBackground(Self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4); 636 PaintBackground(Canvas, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4, 637 ClientWidth, ClientHeight); 629 638 Canvas.Pixels[2, TabHeight] := MainTexture.ColorBevelLight; 630 639 end 631 640 else 632 641 begin 633 PaintBackground( Self, TabOffset + 3 + Integer(Tab) * TabSize, TabHeight - 1,634 TabSize - 4, 4 );642 PaintBackground(Canvas, TabOffset + 3 + Integer(Tab) * TabSize, TabHeight - 1, 643 TabSize - 4, 4, ClientWidth, ClientHeight); 635 644 Canvas.Pixels[TabOffset + Integer(Tab) * TabSize + 2, TabHeight] := 636 645 MainTexture.ColorBevelLight; … … 904 913 y0Mini - 8, S); 905 914 end; 915 end; 916 MarkUsedOffscreen(ClientWidth, ClientHeight); 906 917 end; 907 918 … … 1438 1449 ReplayBtn.Visible := MiniMap.Mode <> mmMultiPlayer; 1439 1450 List.Invalidate; 1440 SmartInvalidate(0, 0, ClientWidth, ClientHeight, invalidateTab0);1451 SmartInvalidate(0, 0, ClientWidth, ClientHeight, InvalidateTab0); 1441 1452 end; 1442 1453
Note:
See TracChangeset
for help on using the changeset viewer.