InputCombo : Minor bug. lazarus / 31-LCL ---------------------------------------------------------------------- magu · 2021-10-01 21:51 InputCombo is a popup dialog much like InputBox only the user is to choose from prestated options. However the LCL version has a minor bug because it has no minimum width, eg: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i InputCombo('Try', 'this is messy', ['opt 1', 'opt 2', 'opt 3']); Will not show the selection buttons (Ok and Cancel) properly because this dialog sets its width according to the options with no minimum. To work properly it needs to have a minimum width, I have fixed this by inserting the following line in the calling function (DoInputcombo in the unit inputdialog.inc) Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if W < frm.Scale96ToForm(200) then W := frm.Scale96ToForm(200); Also I would suggest removing the bevel from the ButtonPanel to keep uniformity with InputBox. ps. Don't really know how to suggest bug reports / fixes so maybe someone can handle it please pps. also this gives some visibility to the function, didn't know it existed because it's not documented with the other Input dialog options. ---------------------------------------------------------------------- wp · 2021-10-01 22:12 I think it would be better to anchor the controls and autosize this dialog - this way it will always be correct. Please check out this - it works for me, but it should be tested more: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function DoInputCombo(const ACaption, APrompt: string; const AList: TStrings; AllowInput : Boolean; Out ASelected : Integer) : String;const  CBStyles : array[Boolean] of TComboBoxStyle = (csDropDownList,csDropDown);var  W,I,Sep,Margin: Integer;  Frm: TForm;  CBSelect : TComboBox;  LPrompt: TLabel;  BP: TButtonPanel;  P: TPanel;begin  Result:='';  ASelected:=-1;  frm := TForm.Create(Application);  try    Margin:= frm.Scale96ToForm(16);    Sep := frm.Scale96ToForm(8);     frm.BorderStyle:=bsDialog;    frm.Caption:=ACaption;    frm.Position:=poScreenCenter;     // Determine needed width    W:=frm.Canvas.TextWidth(APrompt);    W:=Max(W,frm.Canvas.TextWidth(ACaption));    for I:=0 to AList.Count-1 do      W:=Max(W,frm.Canvas.TextWidth(AList[i]+'WWW')); // WWW is just some extra.     // Panel for controls    P := TPanel.Create(frm);    P.Parent := frm;    P.Align := alClient;    P.Borderspacing.Around := Margin;    P.Caption := '';    P.BevelOuter := bvNone;    P.AutoSize := true;     // Prompt    LPrompt:=TLabel.Create(frm);    LPrompt.Parent:=P; //frm;    LPrompt.Caption:=APrompt;    LPrompt.AnchorSideTop.Control := P;    LPrompt.AnchorSideLeft.Control := P;    LPrompt.AnchorSideRight.Control := P;    LPrompt.AnchorSideRight.Side := asrBottom;    LPrompt.BorderSpacing.Bottom := Sep;    LPrompt.Anchors := [akLeft, akRight, akTop];    LPrompt.WordWrap:=True;    LPrompt.AutoSize:=true;     // Selection combobox    CBSelect:=TComboBox.Create(Frm);    CBSelect.Parent:=P;    CBSelect.Style:=CBStyles[AllowInput];    CBSelect.Items.Assign(AList);    CBSelect.ItemIndex:=-1;    CBSelect.AnchorSideTop.Control := LPrompt;    CBSelect.AnchorSideTop.Side := asrBottom;    CBSelect.AnchorSideLeft.Control := P;    CBSelect.AnchorSideRight.Control := P;    CBSelect.AnchorSideRight.Side := asrBottom;    CBSelect.Anchors := [akLeft, akRight, akTop];     // Buttons    BP:=TButtonPanel.Create(Frm);    BP.Parent:=Frm;    BP.ShowButtons:=[pbOK,pbCancel];     // Autosize the form    frm.AutoSize := true;    frm.Constraints.MinWidth := W + 2*Margin;   if (frm.ShowModal=mrOk) then    begin      Result:=CBSelect.Text;    ASelected:=CBSelect.ItemIndex;    end;  finally    FreeAndNil(frm);  end;end; ---------------------------------------------------------------------- magu · 2021-10-02 08:47 This works, thanks! ---------------------------------------------------------------------- wp · 2021-10-02 11:01 Committed the change to Lazarus-main. ---------------------------------------------------------------------- jamie · 2021-10-02 12:43 Quote from: wp on October 02, 2021, 01:01:20 pmCommitted the change to Lazarus-main. I never knew that existed. I could of used that not to long ago.  it looks good with Trunk. ---------------------------------------------------------------------- wp · 2021-10-02 15:39 Quote from: magu on October 01, 2021, 11:51:26 pmDon't really know how to suggest bug reports / fixes Write a bug report on https://gitlab.com/freepascal.org/lazarus/lazarus/- /issues?sort=updated_desc for issues with LCL, IDE, debugger, ...https://gitlab.com/groups/freepascal.org/fpc/-/issues for issues with the compiler, RTL, FCL https://gitlab.com/freepascal.org/lazarus/ccr/-/issues for issues with components on CCR (Lazarus Component and Code Repository