Ignore:
Timestamp:
Nov 28, 2023, 3:16:24 PM (13 months ago)
Author:
chronos
Message:
  • Modified: Do not initialize all local player windows at the start of the game but later when they are really opened. This also fixes window initialization under Qt5 widgetset.
Location:
trunk/Packages/CevoComponents
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/BaseWin.pas

    r447 r460  
    1414
    1515  TBufferedDrawDlg = class(TDrawDlg)
    16   public
    17     UserLeft: Integer;
    18     UserTop: Integer;
    19     constructor Create(AOwner: TComponent); override;
    20     destructor Destroy; override;
    21     procedure FormClose(Sender: TObject; var Action: TCloseAction);
    22     procedure FormPaint(Sender: TObject);
    23     procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
    24     procedure FormDeactivate(Sender: TObject);
    25     procedure SmartUpdateContent(ImmUpdate: Boolean = False);
    26     procedure StayOnTop_Workaround;
    2716  protected
    2817    FWindowMode: TWindowMode;
     
    3423    procedure VPaint; virtual;
    3524  public
     25    UserLeft: Integer;
     26    UserTop: Integer;
    3627    UsedOffscreenWidth: Integer;
    3728    UsedOffscreenHeight: Integer;
    3829    Offscreen: TBitmap;
    3930    OffscreenUser: TForm;
     31    constructor Create(AOwner: TComponent); override;
     32    destructor Destroy; override;
     33    procedure FormClose(Sender: TObject; var Action: TCloseAction);
     34    procedure FormPaint(Sender: TObject);
     35    procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
     36    procedure FormDeactivate(Sender: TObject);
     37    procedure SmartUpdateContent(ImmUpdate: Boolean = False);
     38    procedure StayOnTop_Workaround;
    4039    property WindowMode: TWindowMode read FWindowMode;
    4140  end;
    4241
    4342  TFramedDlg = class(TBufferedDrawDlg)
    44   public
    45     constructor Create(AOwner: TComponent); override;
    46     procedure FormCreate(Sender: TObject);
    47     procedure SmartInvalidate; override;
    4843  protected
    4944    CaptionLeft: Integer;
     
    5853    procedure VPaint; override;
    5954    procedure FillOffscreen(Left, Top, Width, Height: Integer);
     55  public
     56    constructor Create(AOwner: TComponent); override;
     57    procedure FormCreate(Sender: TObject);
     58    procedure SmartInvalidate; override;
    6059  end;
    6160
     
    120119    UserTop := Top;
    121120  end;
    122   if OffscreenUser = self then
     121  if OffscreenUser = Self then
    123122    OffscreenUser := nil;
    124123end;
     
    126125procedure TBufferedDrawDlg.FormPaint(Sender: TObject);
    127126begin
    128   if OffscreenUser <> self then
     127  if OffscreenUser <> Self then
    129128    OffscreenPaint;
    130129  VPaint;
  • trunk/Packages/CevoComponents/DrawDlg.pas

    r447 r460  
    4646    Lines: Integer;
    4747    TopSpace: Integer;
    48     procedure SplitText(preview: boolean);
     48    procedure SplitText(Preview: Boolean);
    4949    procedure CorrectHeight;
    5050  end;
     
    206206procedure TDrawDlg.InitButtons;
    207207var
    208   cix: integer;
     208  cix: Integer;
    209209  // ButtonDownSound, ButtonUpSound: string;
    210210begin
     
    228228procedure TDrawDlg.SmartInvalidate;
    229229var
    230   i: integer;
     230  i: Integer;
    231231  r0, r1: HRgn;
    232232begin
     
    240240      DeleteObject(r1);
    241241    end;
    242   InvalidateRgn(Handle, r0, false);
     242  InvalidateRgn(Handle, r0, False);
    243243  DeleteObject(r0);
    244244end;
     
    260260procedure TBaseMessgDlg.FormPaint(Sender: TObject);
    261261var
    262   i, cix: integer;
     262  i, cix: Integer;
    263263begin
    264264  if csDesigning in ComponentState then Exit;
    265   PaintBackground(self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
     265  PaintBackground(Self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
    266266    ClientHeight - (6 + 2 * Border));
    267267  for i := 0 to Border do
     
    274274    ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
    275275    MainTexture.ColorBevelShade);
    276   SplitText(false);
     276  SplitText(False);
    277277
    278278  for cix := 0 to ControlCount - 1 do
     
    281281end;
    282282
    283 procedure TBaseMessgDlg.SplitText(preview: boolean);
    284 var
    285   Start, Stop, OrdinaryStop, LinesCount: integer;
     283procedure TBaseMessgDlg.SplitText(Preview: Boolean);
     284var
     285  Start, Stop, OrdinaryStop, LinesCount: Integer;
    286286  s: string;
    287287begin
     
    294294      (BiColorTextWidth(Canvas, Copy(MessgText, Start, Stop - Start + 1)) <
    295295      ClientWidth - 56) do
    296       inc(Stop);
     296      Inc(Stop);
    297297    if Stop <> Length(MessgText) then
    298298    begin
     
    303303        (MessgText[OrdinaryStop + 1] = '\');
    304304      if (OrdinaryStop + 1 - Start) * 2 >= Stop - Start then
    305         Stop := OrdinaryStop
    306     end;
    307     if not preview then
     305        Stop := OrdinaryStop;
     306    end;
     307    if not Preview then
    308308    begin
    309309      s := Copy(MessgText, Start, Stop - Start + 1);
     
    313313    end;
    314314    Start := Stop + 2;
    315     inc(LinesCount)
    316   end;
    317   if preview then
     315    inc(LinesCount);
     316  end;
     317  if Preview then
    318318    Lines := LinesCount;
    319319end;
     
    321321procedure TBaseMessgDlg.CorrectHeight;
    322322var
    323   i: integer;
     323  i: Integer;
    324324begin
    325325  ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
Note: See TracChangeset for help on using the changeset viewer.