mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-20 14:06:02 +02:00
LCL: InputQuery: High-DPI. By AlexeyT. Issue #32717
git-svn-id: trunk@56533 -
This commit is contained in:
parent
7faf1426f1
commit
c7bbe3c423
@ -384,7 +384,7 @@ var
|
|||||||
FLabels: array of TPanel;
|
FLabels: array of TPanel;
|
||||||
FButtons: TButtonPanel;
|
FButtons: TButtonPanel;
|
||||||
FForm: TDummyForInput;
|
FForm: TDummyForInput;
|
||||||
Len, i: integer;
|
Len, NSpacing, NEditWidth, i: integer;
|
||||||
begin
|
begin
|
||||||
Result:= false;
|
Result:= false;
|
||||||
if Length(APrompts)<1 then
|
if Length(APrompts)<1 then
|
||||||
@ -398,13 +398,18 @@ begin
|
|||||||
SetLength(FEdits, Len);
|
SetLength(FEdits, Len);
|
||||||
|
|
||||||
FForm:= TDummyForInput.CreateNew(nil);
|
FForm:= TDummyForInput.CreateNew(nil);
|
||||||
FForm.Width:= 600;
|
FForm.Width:= FForm.Scale96ToForm(600);
|
||||||
FForm.Height:= 400;
|
FForm.Height:= FForm.Scale96ToForm(400);
|
||||||
FForm.BorderStyle:= bsDialog;
|
FForm.BorderStyle:= bsDialog;
|
||||||
FForm.Position:= poScreenCenter;
|
FForm.Position:= poScreenCenter;
|
||||||
FForm.Caption:= ACaption;
|
FForm.Caption:= ACaption;
|
||||||
FForm.FOnCloseEvent:= ACloseEvent;
|
FForm.FOnCloseEvent:= ACloseEvent;
|
||||||
|
|
||||||
|
NSpacing:= FForm.Scale96ToForm(cInputQuerySpacingSize);
|
||||||
|
NEditWidth:= Max(
|
||||||
|
FForm.Scale96ToForm(cInputQueryEditSizePixels),
|
||||||
|
_InputQueryActiveMonitor.Width * cInputQueryEditSizePercents div 100);
|
||||||
|
|
||||||
FButtons:= TButtonPanel.Create(FForm);
|
FButtons:= TButtonPanel.Create(FForm);
|
||||||
FButtons.Parent:= FForm;
|
FButtons.Parent:= FForm;
|
||||||
FButtons.ShowButtons:= [pbOK, pbCancel];
|
FButtons.ShowButtons:= [pbOK, pbCancel];
|
||||||
@ -420,7 +425,7 @@ begin
|
|||||||
FPanels[i].BevelInner:= bvNone;
|
FPanels[i].BevelInner:= bvNone;
|
||||||
FPanels[i].BevelOuter:= bvNone;
|
FPanels[i].BevelOuter:= bvNone;
|
||||||
FPanels[i].AutoSize:= true;
|
FPanels[i].AutoSize:= true;
|
||||||
FPanels[i].BorderSpacing.Around:= cInputQuerySpacingSize;
|
FPanels[i].BorderSpacing.Around:= NSpacing;
|
||||||
|
|
||||||
//fix order of panels
|
//fix order of panels
|
||||||
if i>0 then
|
if i>0 then
|
||||||
@ -429,9 +434,7 @@ begin
|
|||||||
FEdits[i]:= TEdit.Create(FForm);
|
FEdits[i]:= TEdit.Create(FForm);
|
||||||
FEdits[i].Parent:= FPanels[i];
|
FEdits[i].Parent:= FPanels[i];
|
||||||
FEdits[i].Align:= alRight;
|
FEdits[i].Align:= alRight;
|
||||||
FEdits[i].Width:= Max(
|
FEdits[i].Width:= NEditWidth;
|
||||||
cInputQueryEditSizePixels,
|
|
||||||
_InputQueryActiveMonitor.Width * cInputQueryEditSizePercents div 100);
|
|
||||||
FEdits[i].Text:= AValues[i];
|
FEdits[i].Text:= AValues[i];
|
||||||
|
|
||||||
FLabels[i]:= TPanel.Create(FForm);
|
FLabels[i]:= TPanel.Create(FForm);
|
||||||
@ -441,7 +444,7 @@ begin
|
|||||||
FLabels[i].BevelOuter:= bvNone;
|
FLabels[i].BevelOuter:= bvNone;
|
||||||
if i<Length(APrompts) then
|
if i<Length(APrompts) then
|
||||||
FLabels[i].Caption:= APrompts[i];
|
FLabels[i].Caption:= APrompts[i];
|
||||||
FLabels[i].BorderSpacing.Right:= cInputQuerySpacingSize;
|
FLabels[i].BorderSpacing.Right:= NSpacing;
|
||||||
FLabels[i].Width:= FLabels[i].Canvas.TextWidth(FLabels[i].Caption);
|
FLabels[i].Width:= FLabels[i].Canvas.TextWidth(FLabels[i].Caption);
|
||||||
|
|
||||||
FEdits[i].Left:= FForm.Width; // place edits to right
|
FEdits[i].Left:= FForm.Width; // place edits to right
|
||||||
|
Loading…
Reference in New Issue
Block a user