Changeset 474 for trunk/Inp.pas


Ignore:
Timestamp:
Dec 4, 2023, 7:18:18 PM (5 months ago)
Author:
chronos
Message:
  • Fixed: More high dpi related fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Inp.pas

    r471 r474  
    55
    66uses
    7   ScreenTools, LCLIntf, LCLType, SysUtils, Classes, DrawDlg, ButtonA, StdCtrls,
    8   {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, System.UITypes{$ELSE}
    9   Graphics, Controls, Forms{$ENDIF};
     7  ScreenTools, LCLIntf, LCLType, SysUtils, Classes, DrawDlg, ButtonA,
     8  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.StdCtrls, System.UITypes{$ELSE}
     9  Graphics, Controls, Forms, StdCtrls{$ENDIF};
    1010
    1111type
    1212  TInputDlg = class(TDrawDlg)
    13     OKBtn: TButtonA;
    14     EInput: TEdit;
    15     procedure OKBtnClick(Sender: TObject);
     13    ButtonOk: TButtonA;
     14    EditInput: TEdit;
     15    procedure ButtonOkClick(Sender: TObject);
    1616    procedure FormPaint(Sender: TObject);
    1717    procedure FormCreate(Sender: TObject);
     
    4444procedure TInputDlg.FormPaint(Sender: TObject);
    4545begin
    46   PaintBackground(self, 3, 3, ClientWidth - 6, ClientHeight - 6);
    47   Frame(Canvas, 0, 0, ClientWidth - 1, ClientHeight - 1, 0, 0);
    48   Frame(Canvas, 1, 1, ClientWidth - 2, ClientHeight - 2,
     46  PaintBackground(Self, 3, 3, Width - 6, Height - 6);
     47  Frame(Canvas, 0, 0, Width - 1, Height - 1, 0, 0);
     48  Frame(Canvas, 1, 1, Width - 2, Height - 2,
    4949    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    50   Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,
     50  Frame(Canvas, 2, 2, Width - 3, Height - 3,
    5151    MainTexture.ColorBevelLight, MainTexture.ColorBevelShade);
    52   EditFrame(Canvas, EInput.BoundsRect, MainTexture);
    53   BtnFrame(Canvas, OKBtn.BoundsRect, MainTexture);
    54   RisedTextOut(Canvas, (ClientWidth - BiColorTextWidth(Canvas, Caption)) div 2,
     52  EditFrame(Canvas, EditInput.BoundsRect, MainTexture);
     53  BtnFrame(Canvas, ButtonOk.BoundsRect, MainTexture);
     54  RisedTextOut(Canvas, (Width - BiColorTextWidth(Canvas, Caption)) div 2,
    5555    9, Caption);
    56   { Corner(canvas,1,1,0,MainTexture);
    57     Corner(Canvas,ClientWidth-9,1,1,MainTexture);
    58     Corner(Canvas,1,ClientHeight-9,2,MainTexture);
    59     Corner(Canvas,ClientWidth-9,ClientHeight-9,3,MainTexture); }
     56  { Corner(canvas, 1, 1, 0, MainTexture);
     57    Corner(Canvas, Width - 9, 1, 1, MainTexture);
     58    Corner(Canvas, 1, Height - 9, 2, MainTexture);
     59    Corner(Canvas, Width - 9, Height - 9, 3, MainTexture); }
    6060end;
    6161
    62 procedure TInputDlg.OKBtnClick(Sender: TObject);
     62procedure TInputDlg.ButtonOkClick(Sender: TObject);
    6363begin
    64   if EInput.Text = '' then
     64  if EditInput.Text = '' then
    6565    ModalResult := mrCancel
    6666  else
     
    7070procedure TInputDlg.EInputKeyPress(Sender: TObject; var Key: Char);
    7171begin
    72   if (Key = #13) and (EInput.Text <> '') then
     72  if (Key = #13) and (EditInput.Text <> '') then
    7373  begin
    7474    Key := #0;
     
    8484procedure TInputDlg.FormShow(Sender: TObject);
    8585begin
    86   OKBtn.Caption := Phrases.Lookup('BTN_OK');
    87   EInput.Font.Color := MainTexture.ColorMark;
    88   EInput.SelStart := 0;
    89   EInput.SelLength := Length(EInput.Text);
     86  ButtonOk.Caption := Phrases.Lookup('BTN_OK');
     87  EditInput.Font.Color := MainTexture.ColorMark;
     88  EditInput.SelStart := 0;
     89  EditInput.SelLength := Length(EditInput.Text);
    9090  if Center then
    9191    CenterToRect(Rect(0, 0, Screen.Width, Screen.Height));
Note: See TracChangeset for help on using the changeset viewer.