Changeset 565 for trunk/Start.pas
- Timestamp:
- May 1, 2024, 12:08:20 PM (7 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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.