unit MainForm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, jpeg, ExtCtrls, StdCtrls;
type
TPanel =
class(ExtCtrls.TPanel)
private
{ Private-Deklarationen }
FOnMouseEnter: TNotifyEvent;
FOnMouseLeave: TNotifyEvent;
procedure CMMouseEnter(
var Message: TMessage);
message CM_MOUSEENTER;
procedure CMMouseLeave(
var Message: TMessage);
message CM_MOUSELEAVE;
protected
{ Protected-Deklarationen }
public
property Canvas;
property TabOrder;
property TabStop;
property OnMouseEnter: TNotifyEvent
read FOnMouseEnter
write FOnMouseEnter;
property OnMouseLeave: TNotifyEvent
read FOnMouseLeave
write FOnMouseLeave;
end;
TMain =
class(TForm)
imgButler: TImage;
pnLeftBar: TPanel;
pnTopBar: TPanel;
imgIcon1: TImage;
pnMain: TPanel;
Label1: TLabel;
lbDescription1: TLabel;
sbMain: TScrollBox;
Label3: TLabel;
pnMenu1: TPanel;
pnMenu2: TPanel;
imgIcon2: TImage;
lbDescription2: TLabel;
pnMenu3: TPanel;
imgIcon3: TImage;
lbDescription3: TLabel;
pnMenu4: TPanel;
imgIcon4: TImage;
lbDescription4: TLabel;
pnMenu5: TPanel;
imgIcon5: TImage;
lbDescription5: TLabel;
pnMenu6: TPanel;
imgIcon6: TImage;
lbDescription6: TLabel;
procedure FormCreate(Sender: TObject);
procedure pnMenu1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu5MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu4MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu6MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu5MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu4MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure pnMenu6MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
private
{ Private-Deklarationen }
procedure PanelMouseEnter(Sender: TObject);
procedure PanelMouseLeave(Sender: TObject);
procedure PanelMouseUp(Sender: TObject);
procedure PanelMouseDown(Sender: TObject);
public
{ Public-Deklarationen }
end;
var
Main: TMain;
implementation
{$R *.dfm}
procedure TPanel.CMMouseEnter(
var Message: TMessage);
begin
if assigned(FOnMouseEnter)
then
FOnMouseEnter(Self);
end;
procedure TPanel.CMMouseLeave(
var Message: TMessage);
begin
if assigned(FOnMouseLeave)
then
FOnMouseLeave(Self);
end;
procedure TMain.PanelMouseEnter(Sender: TObject);
begin
if Sender
is TPanel
then
begin
TPanel(Sender).BevelOuter:= bvRaised;
end;
end;
procedure TMain.PanelMouseLeave(Sender: TObject);
begin
if Sender
is TPanel
then
begin
TPanel(Sender).BevelOuter:= bvNone;
end;
end;
procedure TMain.PanelMouseDown(Sender: TObject);
begin
if Sender
is TPanel
then
begin
TPanel(Sender).BevelOuter:= bvLowered;
end;
end;
procedure TMain.PanelMouseUp(Sender: TObject);
begin
if Sender
is TPanel
then
begin
TPanel(Sender).BevelOuter:= bvNone;
end;
end;
procedure TMain.FormCreate(Sender: TObject);
begin
pnMenu1.OnMouseEnter:= PanelMouseEnter;
pnMenu1.OnMouseLeave:= PanelMouseLeave;
pnMenu2.OnMouseEnter:= PanelMouseEnter;
pnMenu2.OnMouseLeave:= PanelMouseLeave;
pnMenu3.OnMouseEnter:= PanelMouseEnter;
pnMenu3.OnMouseLeave:= PanelMouseLeave;
pnMenu4.OnMouseEnter:= PanelMouseEnter;
pnMenu4.OnMouseLeave:= PanelMouseLeave;
pnMenu5.OnMouseEnter:= PanelMouseEnter;
pnMenu5.OnMouseLeave:= PanelMouseLeave;
pnMenu6.OnMouseEnter:= PanelMouseEnter;
pnMenu6.OnMouseLeave:= PanelMouseLeave;
end;
procedure TMain.pnMenu1MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu2MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu3MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu4MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu5MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu6MouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseDown(Sender);
end;
procedure TMain.pnMenu1MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
procedure TMain.pnMenu2MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
procedure TMain.pnMenu3MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
procedure TMain.pnMenu4MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
procedure TMain.pnMenu5MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
procedure TMain.pnMenu6MouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
PanelMouseUp(Sender);
end;
end.