LazStats: Remove toolbar from DistribUnit (there is one inherited from TChartFrame). Some cosmetics

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@7676 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2020-09-20 20:22:00 +00:00
parent 76c351c7d9
commit db7a9b2fdb
3 changed files with 101 additions and 112 deletions

View File

@ -5,9 +5,11 @@ unit Utils;
interface
uses
Classes, SysUtils, StdCtrls, Dialogs,
Classes, SysUtils, StdCtrls, ComCtrls, Dialogs,
Globals;
procedure AddButtonToToolbar(AToolButton: TToolButton; AToolBar: TToolBar);
function AnySelected(AListbox: TListBox): Boolean;
procedure ErrorMsg(const AMsg: String);
@ -25,6 +27,20 @@ function IndexOfString(L: StrDyneVec; s: String): Integer;
implementation
// https://stackoverflow.com/questions/4093595/create-ttoolbutton-runtime
procedure AddButtonToToolbar(AToolButton: TToolButton; AToolBar: TToolBar);
var
lastBtnIdx: integer;
begin
lastBtnIdx := AToolBar.ButtonCount - 1;
if lastBtnIdx > -1 then
AToolButton.Left := AToolBar.Buttons[lastBtnIdx].Left + AToolBar.Buttons[lastBtnIdx].Width
else
AToolButton.Left := 0;
AToolButton.Parent := AToolBar;
end;
function AnySelected(AListBox: TListBox): Boolean;
var
i: Integer;