home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip: Shareware for Win 95
/
Chip-Shareware-Win95.bin
/
ostatni
/
delphi
/
ruzne
/
zcd30120.exe
/
Demo
/
BarTest1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-01-07
|
5KB
|
179 lines
Unit Bartest1;
{
A unit for BARTEST.DPR, a testprogram for:
TzMovePanel
TzHint
The ZieglerCollection one (TM)
Version 1,01
(C) Copyright 1995,96,97 By ZieglerSoft, all rights reserved
}
Interface
uses
SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
Forms, Dialogs, ExtCtrls, Mystd, Buttons, StdCtrls;
type
TForm1 = class(TForm)
zMovePanel1: TzMovePanel;
zMovePanel2: TzMovePanel;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton12: TSpeedButton;
SpeedButton13: TSpeedButton;
Label1: TLabel;
zHint1: TzHint;
procedure Button1Click(Sender: TObject);
procedure zMovePanel1BeforeUpdate(Sender:TObject;Var X,Y,W,H:Integer);
procedure FormCreate(Sender: TObject);
procedure FormResize(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
ControlA : tPoint;
Procedure WmVScroll(Var Message:TMessage);Message wm_VScroll;
Procedure WmHScroll(Var Message:TMessage);Message wm_HScroll;
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
zMovePanel1.Top:=0;
end;
procedure TForm1.zMovePanel1BeforeUpdate(Sender: TObject;VAR X, Y, W,
H: Integer);
Var
Pw,Ph : Integer;
Tal : Integer;
DoLeft : Boolean;
DoTop : boolean;
NLeft,NTop,NHeight,NWidth:Integer;
begin
Pw:=Form1.ClientWidth;
Ph:=Form1.ClientHeight;
DoTop:=False;
DoLeft:=False;
With zMovePanel1 Do Begin
If (X>(PW Div 20)) and (Y<=1) then
DoTop:=True
Else If (Y>(PH Div 20)) and (X<=1) then
DoLeft:=True;
If Not(DoTop or DoLeft) then
If (X<2) and (H>PH div 2) then
DoLeft:=True
Else If (Y<2) and (W>PW Div 2) then
DoTop:=True;
NHeight:=0;
NWidth:=0;
If DoLeft then Begin
NLeft:=0;
NTop:=0;
NWidth:=6;
NHeight:=NHeight+3;
For Tal:=0 To ControlCount-1 Do
With Controls[Tal] Do Begin
If NHeight+Height+3<PH Then Begin
Left:=3;
Top:=NHeight;
NHeight:=NHeight+Height;
If Width>NWidth-6 then NWidth:=Width+6;
End Else Left:=0-(Width+2);
End;
Nheight:=NHeight+3;
If Nheight<PH Then NHeight:=PH;
End Else Begin
If DoTop Then Begin
NLeft:=0;
NTop:=0;
NHeight:=6;
Nwidth:=NWidth+3;
For Tal:=0 to ControlCount-1 Do
With Controls[Tal] Do Begin
If NWidth+3+Width<PW Then Begin
Top:=3;
Left:=NWidth;
NWidth:=NWidth+Width;
If Height>NHeight-6 Then NHeight:=Height+6;
End Else Top:=0-(Height+2);
End;
NWidth:=NWidth+3;
If NWidth<PW Then NWidth:=PW;
End Else Begin
{Set your normal standard here, for a floating toolbar}
NLeft:=Left;
NTop:=Top;
NWidth:=ControlA.X;
NHeight:=ControlA.Y;
For Tal:=0 to ControlCount-1 Do Controls[Tal].Top:=3;
Controls[0].Left:=3;
Controls[1].Left:=27;
Controls[2].Left:=51;
Controls[3].Left:=88;
Controls[3].Top:=9;
End;
End;
End;
X:=NLeft;
Y:=NTop;
W:=NWidth;
H:=NHeight;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
ControlA:=Point(zMovePanel1.Width,zMovePanel1.height);
end;
procedure TForm1.FormResize(Sender: TObject);
begin
zMovePanel1.DoUpdate;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
zMovePanel2.Visible:=Not(zMovePanel2.Visible);
end;
Procedure TForm1.WMVScroll;
Var
X,Y : Integer;
Begin
X:=zMovePanel1.Left;
Y:=zMovePanel1.Top;
Inherited;
zMovePanel1.Left:=X;
zMovePanel1.Top:=Y;
End;
Procedure TForm1.WMHScroll;
Var
X,Y : Integer;
Begin
X:=zMovePanel1.Left;
Y:=zMovePanel1.Top;
Inherited;
zMovePanel1.Left:=X;
zMovePanel1.Top:=Y;
End;
end.