Changeset 474 for trunk/Inp.pas
- Timestamp:
- Dec 4, 2023, 7:18:18 PM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Inp.pas
r471 r474 5 5 6 6 uses 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}; 10 10 11 11 type 12 12 TInputDlg = class(TDrawDlg) 13 OKBtn: TButtonA;14 E Input: TEdit;15 procedure OKBtnClick(Sender: TObject);13 ButtonOk: TButtonA; 14 EditInput: TEdit; 15 procedure ButtonOkClick(Sender: TObject); 16 16 procedure FormPaint(Sender: TObject); 17 17 procedure FormCreate(Sender: TObject); … … 44 44 procedure TInputDlg.FormPaint(Sender: TObject); 45 45 begin 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, 49 49 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 50 Frame(Canvas, 2, 2, ClientWidth - 3, ClientHeight - 3,50 Frame(Canvas, 2, 2, Width - 3, Height - 3, 51 51 MainTexture.ColorBevelLight, MainTexture.ColorBevelShade); 52 EditFrame(Canvas, E Input.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, 55 55 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); } 60 60 end; 61 61 62 procedure TInputDlg. OKBtnClick(Sender: TObject);62 procedure TInputDlg.ButtonOkClick(Sender: TObject); 63 63 begin 64 if E Input.Text = '' then64 if EditInput.Text = '' then 65 65 ModalResult := mrCancel 66 66 else … … 70 70 procedure TInputDlg.EInputKeyPress(Sender: TObject; var Key: Char); 71 71 begin 72 if (Key = #13) and (E Input.Text <> '') then72 if (Key = #13) and (EditInput.Text <> '') then 73 73 begin 74 74 Key := #0; … … 84 84 procedure TInputDlg.FormShow(Sender: TObject); 85 85 begin 86 OKBtn.Caption := Phrases.Lookup('BTN_OK');87 E Input.Font.Color := MainTexture.ColorMark;88 E Input.SelStart := 0;89 E Input.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); 90 90 if Center then 91 91 CenterToRect(Rect(0, 0, Screen.Width, Screen.Height));
Note:
See TracChangeset
for help on using the changeset viewer.