LazStats: Use TAChart in ABCNestedUnit. Add data file ABCNested.laz from OpenStat demos. Some refactoring. New procedure in Utils: AddComboboxToToolbar.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7864 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-11-12 18:31:56 +00:00
parent 92ac9ce5a8
commit aed12b6bbd
7 changed files with 834 additions and 195 deletions

View File

@ -5,7 +5,7 @@ unit Utils;
interface
uses
Classes, SysUtils, Graphics, Controls, StdCtrls, ComCtrls, Dialogs, Forms,
Classes, SysUtils, Graphics, Controls, StdCtrls, ExtCtrls, ComCtrls, Dialogs, Forms,
Globals;
type
@ -14,6 +14,8 @@ type
procedure InitForm(AForm: TForm);
procedure AddButtonToToolbar(AToolButton: TToolButton; AToolBar: TToolBar);
procedure AddComboboxToToolbar(AToolBar: TToolbar; ACaption: String;
out ACombobox: TCombobox);
procedure InitToolbar(AToolbar: TToolbar; APosition: TToolbarPosition);
function AnySelected(AListbox: TListBox): Boolean;
@ -44,6 +46,48 @@ begin
end;
procedure AddComboboxToToolbar(AToolbar: TToolbar; ACaption: String;
out AComboBox: TComboBox);
var
panel: TPanel;
lbl: TLabel = nil;
begin
panel := TPanel.Create(AToolbar);
if ACaption <> '' then
begin
lbl := TLabel.Create(panel);
lbl.Parent := panel;
lbl.Caption := ACaption;
end;
ACombobox := TCombobox.Create(panel);
ACombobox.Parent := panel;
ACombobox.Style := csDropdownList;
ACombobox.DropdownCount := 24;
ACombobox.Items.Clear;
ACombobox.Constraints.MinWidth := 300;
if lbl <> nil then
begin
lbl.AnchorSideLeft.Side := asrTop;
lbl.AnchorSideLeft.Control := panel;
lbl.AnchorSideTop.Side := asrCenter;
lbl.AnchorSideTop.Control := ACombobox;
end;
ACombobox.AnchorSideLeft.Control := lbl;
ACombobox.AnchorSideLeft.Side := asrBottom;
ACombobox.BorderSpacing.Left := 6;
ACombobox.BorderSpacing.Around := 2;
panel.Parent := AToolbar;
panel.AutoSize := true;
panel.BevelInner := bvNone;
panel.BevelOuter := bvNone;
panel.Left := 0;
end;
procedure InitForm(AForm: TForm);
begin
AForm.Width := AForm.Scale96ToFont(DEFAULT_WIDTH);