fix: layout problems with several input dialogs

This commit is contained in:
Massimo Melina 2020-05-07 14:47:33 +02:00
parent ccc87aabd1
commit 0d6e0d2f37
3 changed files with 67 additions and 21 deletions

View File

@ -17,6 +17,7 @@ object mainFrm: TmainFrm
Position = poDesigned Position = poDesigned
OnClose = FormClose OnClose = FormClose
OnCloseQuery = FormCloseQuery OnCloseQuery = FormCloseQuery
OnCreate = FormCreate
OnKeyDown = FormKeyDown OnKeyDown = FormKeyDown
OnKeyUp = FormKeyUp OnKeyUp = FormKeyUp
OnResize = FormResize OnResize = FormResize

View File

@ -917,6 +917,7 @@ type
Stage: TCustomDrawStage; var DefaultDraw: Boolean); Stage: TCustomDrawStage; var DefaultDraw: Boolean);
procedure Reverttopreviousversion1Click(Sender: TObject); procedure Reverttopreviousversion1Click(Sender: TObject);
procedure updateBtnClick(Sender: TObject); procedure updateBtnClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
private private
function searchLog(dir:integer):boolean; function searchLog(dir:integer):boolean;
function getGraphPic(cd:TconnData=NIL): ansistring; function getGraphPic(cd:TconnData=NIL): ansistring;
@ -991,6 +992,7 @@ type
function getTrayTipMsg(tpl:string=''):string; function getTrayTipMsg(tpl:string=''):string;
procedure menuDraw(sender:Tobject; cnv: Tcanvas; r:Trect; selected:boolean); procedure menuDraw(sender:Tobject; cnv: Tcanvas; r:Trect; selected:boolean);
procedure menuMeasure(sender:Tobject; cnv: Tcanvas; var w:integer; var h:integer); procedure menuMeasure(sender:Tobject; cnv: Tcanvas; var w:integer; var h:integer);
procedure wrapInputQuery(sender:Tobject);
end; // Tmainfrm end; // Tmainfrm
const const
@ -3402,7 +3404,7 @@ var
inc(idx); inc(idx);
idxS:=intToStr(idx); idxS:=intToStr(idx);
delete(result, p, length(PATTERN)-length(idxS)); delete(result, p, length(PATTERN)-length(idxS));
move(idxS[1], result[p], length(idxS)); moveChars(idxS[1], result[p], length(idxS));
until false; until false;
end; // applySequential end; // applySequential
@ -9682,7 +9684,8 @@ var
begin begin
if speedLimit < 0 then s:='' if speedLimit < 0 then s:=''
else s:=floatToStr(speedLimit); else s:=floatToStr(speedLimit);
if inputquery(LIMIT, MSG_MAX_BW+#13+MSG_EMPTY_NO_LIMIT, s) then if not inputquery(LIMIT, MSG_MAX_BW+#13+MSG_EMPTY_NO_LIMIT+#13, s) then
exit;
try try
s:=trim(s); s:=trim(s);
if s = '' then setSpeedLimit(-1) if s = '' then setSpeedLimit(-1)
@ -9691,8 +9694,7 @@ if inputquery(LIMIT, MSG_MAX_BW+#13+MSG_EMPTY_NO_LIMIT, s) then
msgDlg(ZEROMSG, MB_ICONWARNING); msgDlg(ZEROMSG, MB_ICONWARNING);
// a manual set of speedlimit voids the pause command // a manual set of speedlimit voids the pause command
Pausestreaming1.Checked:=FALSE; Pausestreaming1.Checked:=FALSE;
except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR) except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR) end;
end;
end; end;
procedure TmainFrm.Speedlimitforsingleaddress1Click(Sender: TObject); procedure TmainFrm.Speedlimitforsingleaddress1Click(Sender: TObject);
@ -10608,6 +10610,11 @@ try
finally queryingClose:=FALSE end; finally queryingClose:=FALSE end;
end; end;
procedure TmainFrm.FormCreate(Sender: TObject);
begin
screen.onActiveFormChange:=wrapInputQuery;
end;
procedure TmainFrm.Loginrealm1Click(Sender: TObject); procedure TmainFrm.Loginrealm1Click(Sender: TObject);
resourcestring resourcestring
MSG = 'The realm string is shown on the user/pass dialog of the browser.' MSG = 'The realm string is shown on the user/pass dialog of the browser.'
@ -12336,6 +12343,44 @@ if mi.Checked then
end; end;
end; end;
procedure TmainFrm.wrapInputQuery(sender:Tobject);
var
Form: TCustomForm;
Prompt: TLabel;
Edit: TEdit;
Ctrl: TControl;
I, J, ButtonTop: Integer;
begin
Form := Screen.ActiveCustomForm;
if (Form=NIL) or (Form.ClassName<>'TInputQueryForm') then
Exit;
for I := 0 to Form.ControlCount-1 do
begin
Ctrl := Form.Controls[i];
if Ctrl is TLabel then
Prompt := TLabel(Ctrl)
else if Ctrl is TEdit then
Edit := TEdit(Ctrl);
end;
Edit.SetBounds(Prompt.Left, Prompt.Top + Prompt.Height + 5, max(200, Prompt.Width), Edit.Height);
Form.ClientWidth := (Edit.Left * 2) + Edit.Width;
ButtonTop := Edit.Top + Edit.Height + 15;
J := 0;
for I := 0 to Form.ControlCount-1 do
begin
Ctrl := Form.Controls[i];
if Ctrl is TButton then
begin
Ctrl.SetBounds(Form.ClientWidth - ((Ctrl.Width + 15) * (2-J)), ButtonTop, Ctrl.Width, Ctrl.Height);
Form.ClientHeight := Ctrl.Top + Ctrl.Height + 13;
Inc(J);
end;
end;
end;
var var
dll: HMODULE; dll: HMODULE;

View File

@ -130,7 +130,7 @@ object optionsFrm: ToptionsFrm
Left = 251 Left = 251
Top = 349 Top = 349
Width = 430 Width = 430
Height = 28 Height = 17
Hint = 'You also need to right click on the folder, then restrict access' Hint = 'You also need to right click on the folder, then restrict access'
Anchors = [akLeft, akBottom] Anchors = [akLeft, akBottom]
Caption = Caption =
@ -485,15 +485,15 @@ object optionsFrm: ToptionsFrm
'n' 'n'
end end
object Label10: TLabel object Label10: TLabel
Left = 264 Left = 291
Top = 157 Top = 170
Width = 40 Width = 40
Height = 14 Height = 14
Caption = 'Preview' Caption = 'Preview'
end end
object traymsgBox: TMemo object traymsgBox: TMemo
Left = 16 Left = 16
Top = 176 Top = 192
Width = 233 Width = 233
Height = 121 Height = 121
Lines.Strings = ( Lines.Strings = (
@ -502,8 +502,8 @@ object optionsFrm: ToptionsFrm
OnChange = traymsgBoxChange OnChange = traymsgBoxChange
end end
object traypreviewBox: TMemo object traypreviewBox: TMemo
Left = 264 Left = 291
Top = 176 Top = 192
Width = 233 Width = 233
Height = 121 Height = 121
Color = clInfoBk Color = clInfoBk
@ -579,8 +579,8 @@ object optionsFrm: ToptionsFrm
object Label5: TLabel object Label5: TLabel
Left = 8 Left = 8
Top = 32 Top = 32
Width = 207 Width = 249
Height = 28 Height = 14
Caption = 'Each line is a file-mask associated with an icon' Caption = 'Each line is a file-mask associated with an icon'
WordWrap = True WordWrap = True
end end
@ -593,7 +593,7 @@ object optionsFrm: ToptionsFrm
end end
object iconMasksBox: TMemo object iconMasksBox: TMemo
Left = 8 Left = 8
Top = 48 Top = 49
Width = 225 Width = 225
Height = 245 Height = 245
Anchors = [akLeft, akTop, akBottom] Anchors = [akLeft, akTop, akBottom]