1
0
lazarus-tutorials/statusbar_demo/statusbar_form.pas

52 lines
941 B
ObjectPascal
Raw Normal View History

2021-10-08 17:15:28 -04:00
unit statusbar_form;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, ComCtrls, StdCtrls,
Spin, ButtonPanel, ExtCtrls, Buttons;
type
{ TForm1 }
TForm1 = class(TForm)
Bevel1: TBevel;
BitBtn1: TBitBtn;
ButtonPanel1: TButtonPanel;
CheckBox1: TCheckBox;
Edit1: TEdit;
Label1: TLabel;
ProgressBar1: TProgressBar;
SpinEdit1: TSpinEdit;
statusbar: TStatusBar;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var ctrl: TControl;
begin
statusBar.Panels[0].Text := Sender.ClassName;
ctrl := TControl(Sender);
statusBar.Panels[1].Text := ctrl.Name;
statusBar.Panels[2].Text := Format('Top: %d', [ctrl.Top]);
statusBar.Panels[3].Text := Format('Left: %d', [ctrl.Left]);
end;
end.