Changeset 527 for trunk


Ignore:
Timestamp:
Jan 9, 2024, 12:28:47 AM (11 months ago)
Author:
chronos
Message:
  • Fixed: Height of Message dialog was not correctly calculated.
File:
1 edited

Legend:

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

    r525 r527  
    242242  r0, r1: HRgn;
    243243begin
    244   r0 := CreateRectRgn(0, 0, ClientWidth, ClientHeight);
     244  r0 := CreateRectRgn(0, 0, Width, Height);
    245245  for i := 0 to ControlCount - 1 do
    246246    if not (Controls[i] is TArea) and Controls[i].Visible then
     
    271271procedure TBaseMessgDlg.FormPaint(Sender: TObject);
    272272var
    273   i, cix: Integer;
     273  I, cix: Integer;
    274274begin
    275275  if csDesigning in ComponentState then Exit;
    276   PaintBackground(Self, 3 + Border, 3 + Border, ClientWidth - (6 + 2 * Border),
    277     ClientHeight - (6 + 2 * Border));
    278   for i := 0 to Border do
    279     Frame(Canvas, i, i, ClientWidth - 1 - i, ClientHeight - 1 - i,
     276  PaintBackground(Self, 3 + Border, 3 + Border, Width - (6 + 2 * Border),
     277    Height - (6 + 2 * Border));
     278  for I := 0 to Border do
     279    Frame(Canvas, I, I, Width - 1 - I, Height - 1 - I,
    280280      $000000, $000000);
    281   Frame(Canvas, Border + 1, Border + 1, ClientWidth - (2 + Border),
    282     ClientHeight - (2 + Border), MainTexture.ColorBevelLight,
     281  Frame(Canvas, Border + 1, Border + 1, Width - (2 + Border),
     282    Height - (2 + Border), MainTexture.ColorBevelLight,
    283283    MainTexture.ColorBevelShade);
    284   Frame(Canvas, 2 + Border, 2 + Border, ClientWidth - (3 + Border),
    285     ClientHeight - (3 + Border), MainTexture.ColorBevelLight,
     284  Frame(Canvas, 2 + Border, 2 + Border, Width - (3 + Border),
     285    Height - (3 + Border), MainTexture.ColorBevelLight,
    286286    MainTexture.ColorBevelShade);
    287287  SplitText(False);
     
    295295var
    296296  Start, Stop, OrdinaryStop, LinesCount: Integer;
    297   s: string;
     297  S: string;
    298298begin
    299299  Start := 1;
     
    304304    while (Stop < Length(MessgText)) and (MessgText[Stop] <> '\') and
    305305      (BiColorTextWidth(Canvas, Copy(MessgText, Start, Stop - Start + 1)) <
    306       ClientWidth - 56) do
     306      Width - 56) do
    307307      Inc(Stop);
    308308    if Stop <> Length(MessgText) then
     
    310310      OrdinaryStop := Stop;
    311311      repeat
    312         dec(OrdinaryStop)
     312        Dec(OrdinaryStop)
    313313      until (MessgText[OrdinaryStop + 1] = ' ') or
    314314        (MessgText[OrdinaryStop + 1] = '\');
     
    318318    if not Preview then
    319319    begin
    320       s := Copy(MessgText, Start, Stop - Start + 1);
     320      S := Copy(MessgText, Start, Stop - Start + 1);
    321321      LoweredTextOut(Canvas, -1, MainTexture,
    322         (ClientWidth - BiColorTextWidth(Canvas, s)) div 2,
    323         19 + Border + TopSpace + LinesCount * MessageLineSpacing, s);
     322        (Width - BiColorTextWidth(Canvas, S)) div 2,
     323        19 + Border + TopSpace + LinesCount * MessageLineSpacing, S);
    324324    end;
    325325    Start := Stop + 2;
     
    332332procedure TBaseMessgDlg.CorrectHeight;
    333333var
    334   i: Integer;
    335 begin
    336   ClientHeight := 72 + Border + TopSpace + Lines * MessageLineSpacing;
    337   Top := (Screen.Height - ClientHeight) div 2;
     334  I: Integer;
     335begin
     336  Height := 72 + Border + TopSpace + Lines * MessageLineSpacing;
     337  Top := (Screen.Height - Height) div 2;
    338338  for i := 0 to ControlCount - 1 do
    339     Controls[i].Top := ClientHeight - (34 + Border);
     339    Controls[i].Top := Height - (34 + Border);
    340340end;
    341341
Note: See TracChangeset for help on using the changeset viewer.