diff --git a/main.dfm b/main.dfm index 9099ad7..e1d5d17 100644 --- a/main.dfm +++ b/main.dfm @@ -17,6 +17,7 @@ object mainFrm: TmainFrm Position = poDesigned OnClose = FormClose OnCloseQuery = FormCloseQuery + OnCreate = FormCreate OnKeyDown = FormKeyDown OnKeyUp = FormKeyUp OnResize = FormResize diff --git a/main.pas b/main.pas index aea74dc..10b21b7 100644 --- a/main.pas +++ b/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,17 +9684,17 @@ var begin if speedLimit < 0 then s:='' else s:=floatToStr(speedLimit); -if inputquery(LIMIT, MSG_MAX_BW+#13+MSG_EMPTY_NO_LIMIT, s) then - try - s:=trim(s); - if s = '' then setSpeedLimit(-1) - else setSpeedLimit(strToFloat(s)); - if speedLimit = 0 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; +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) + else setSpeedLimit(strToFloat(s)); + if speedLimit = 0 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; 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; diff --git a/optionsDlg.dfm b/optionsDlg.dfm index 868adbc..4cad1f0 100644 --- a/optionsDlg.dfm +++ b/optionsDlg.dfm @@ -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]