mirror of
https://github.com/rejetto/hfs2.git
synced 2025-12-19 10:03:56 +01:00
fix: layout problems with several input dialogs
This commit is contained in:
parent
ccc87aabd1
commit
0d6e0d2f37
1
main.dfm
1
main.dfm
@ -17,6 +17,7 @@ object mainFrm: TmainFrm
|
||||
Position = poDesigned
|
||||
OnClose = FormClose
|
||||
OnCloseQuery = FormCloseQuery
|
||||
OnCreate = FormCreate
|
||||
OnKeyDown = FormKeyDown
|
||||
OnKeyUp = FormKeyUp
|
||||
OnResize = FormResize
|
||||
|
||||
53
main.pas
53
main.pas
@ -917,6 +917,7 @@ type
|
||||
Stage: TCustomDrawStage; var DefaultDraw: Boolean);
|
||||
procedure Reverttopreviousversion1Click(Sender: TObject);
|
||||
procedure updateBtnClick(Sender: TObject);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
private
|
||||
function searchLog(dir:integer):boolean;
|
||||
function getGraphPic(cd:TconnData=NIL): ansistring;
|
||||
@ -991,6 +992,7 @@ type
|
||||
function getTrayTipMsg(tpl:string=''):string;
|
||||
procedure menuDraw(sender:Tobject; cnv: Tcanvas; r:Trect; selected:boolean);
|
||||
procedure menuMeasure(sender:Tobject; cnv: Tcanvas; var w:integer; var h:integer);
|
||||
procedure wrapInputQuery(sender:Tobject);
|
||||
end; // Tmainfrm
|
||||
|
||||
const
|
||||
@ -3402,7 +3404,7 @@ var
|
||||
inc(idx);
|
||||
idxS:=intToStr(idx);
|
||||
delete(result, p, length(PATTERN)-length(idxS));
|
||||
move(idxS[1], result[p], length(idxS));
|
||||
moveChars(idxS[1], result[p], length(idxS));
|
||||
until false;
|
||||
end; // applySequential
|
||||
|
||||
@ -9682,7 +9684,8 @@ var
|
||||
begin
|
||||
if speedLimit < 0 then s:=''
|
||||
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
|
||||
s:=trim(s);
|
||||
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);
|
||||
// a manual set of speedlimit voids the pause command
|
||||
Pausestreaming1.Checked:=FALSE;
|
||||
except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR)
|
||||
end;
|
||||
except msgDlg(MSG_INVALID_VALUE, MB_ICONERROR) end;
|
||||
end;
|
||||
|
||||
procedure TmainFrm.Speedlimitforsingleaddress1Click(Sender: TObject);
|
||||
@ -10608,6 +10610,11 @@ try
|
||||
finally queryingClose:=FALSE end;
|
||||
end;
|
||||
|
||||
procedure TmainFrm.FormCreate(Sender: TObject);
|
||||
begin
|
||||
screen.onActiveFormChange:=wrapInputQuery;
|
||||
end;
|
||||
|
||||
procedure TmainFrm.Loginrealm1Click(Sender: TObject);
|
||||
resourcestring
|
||||
MSG = 'The realm string is shown on the user/pass dialog of the browser.'
|
||||
@ -12336,6 +12343,44 @@ if mi.Checked then
|
||||
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
|
||||
dll: HMODULE;
|
||||
|
||||
|
||||
@ -130,7 +130,7 @@ object optionsFrm: ToptionsFrm
|
||||
Left = 251
|
||||
Top = 349
|
||||
Width = 430
|
||||
Height = 28
|
||||
Height = 17
|
||||
Hint = 'You also need to right click on the folder, then restrict access'
|
||||
Anchors = [akLeft, akBottom]
|
||||
Caption =
|
||||
@ -485,15 +485,15 @@ object optionsFrm: ToptionsFrm
|
||||
'n'
|
||||
end
|
||||
object Label10: TLabel
|
||||
Left = 264
|
||||
Top = 157
|
||||
Left = 291
|
||||
Top = 170
|
||||
Width = 40
|
||||
Height = 14
|
||||
Caption = 'Preview'
|
||||
end
|
||||
object traymsgBox: TMemo
|
||||
Left = 16
|
||||
Top = 176
|
||||
Top = 192
|
||||
Width = 233
|
||||
Height = 121
|
||||
Lines.Strings = (
|
||||
@ -502,8 +502,8 @@ object optionsFrm: ToptionsFrm
|
||||
OnChange = traymsgBoxChange
|
||||
end
|
||||
object traypreviewBox: TMemo
|
||||
Left = 264
|
||||
Top = 176
|
||||
Left = 291
|
||||
Top = 192
|
||||
Width = 233
|
||||
Height = 121
|
||||
Color = clInfoBk
|
||||
@ -579,8 +579,8 @@ object optionsFrm: ToptionsFrm
|
||||
object Label5: TLabel
|
||||
Left = 8
|
||||
Top = 32
|
||||
Width = 207
|
||||
Height = 28
|
||||
Width = 249
|
||||
Height = 14
|
||||
Caption = 'Each line is a file-mask associated with an icon'
|
||||
WordWrap = True
|
||||
end
|
||||
@ -593,7 +593,7 @@ object optionsFrm: ToptionsFrm
|
||||
end
|
||||
object iconMasksBox: TMemo
|
||||
Left = 8
|
||||
Top = 48
|
||||
Top = 49
|
||||
Width = 225
|
||||
Height = 245
|
||||
Anchors = [akLeft, akTop, akBottom]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user