Z
zpselect
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure FormCreate(Sender: TObject);
procedure vOnClick(sender: TObject);
procedure vOpen(Sender: TObject);
procedure vClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
private
PData: PNodeData;
vRzPageCotrolItem: TRzTabSheet;
vRzPageCotrol: TRzPageControl;
vRzGroup: TRzGroup;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_Mainform: Tfrm_Mainform;
implementation
{$R *.dfm}
{ Tfrm_Mainform }
procedure Tfrm_Mainform.vOnClick(sender: TObject);
begin
ShowMessage('00000');
end;
procedure Tfrm_Mainform.vOpen(Sender: TObject);
begin
// ShowMessage(vRzPageCotrol.Name);
if vRzPageCotrol.Align= alClient then
begin
vRzPageCotrol.Align:=alNone;
vRzPageCotrol.Left:=333
end
else
vRzPageCotrol.Align := alClient;
vRzPageCotrol.BringToFront;
end;
procedure Tfrm_Mainform.vClick(Sender: TObject);
begin
vRzPageCotrol.Align := alClient;
end;
procedure Tfrm_Mainform.FormCreate(Sender: TObject);
var
vBtn: TfcShapeBtn;
vRzGItem: TRzGroupItem;
vImageIndex: Integer;
begin
Master.Open;
Detail.Open;
Detail.Filtered := true;
try
Master.DisableControls;
vImageIndex := 0;
Master.First;
while not Master.Eofdo
begin
inc(vImageIndex);
vRzPageCotrol := TRzPageControl.Create(nil);
// 1.创建pagecontrol
vRzPageCotrol.Top := 128 + (vImageIndex * vImageIndex * 80);
vRzPageCotrol.Left := 200;
vRzPageCotrol.Width := 300;
vRzPageCotrol.Align := alNone;
vRzPageCotrol.Name :='page'+Master.Fieldbyname('fr_FrmName').Text;
vRzPageCotrol.Parent := Panel1;
vRzPageCotrol.OnClick:=vClick;
vRzPageCotrolItem := TRzTabSheet.Create(nil);
//2.在pagecotrol中加一个tabsheet
vRzPageCotrolItem.Caption := Master.Fieldbyname('fr_Model').Text + '流程图';
vRzPageCotrolItem.PageControl := vRzPageCotrol;
vBtn := TfcShapeBtn.Create(nil);
//3.然后在tabsheet中加一个按钮
vBtn.Left := 211;
vBtn.Top := 138 + (vImageIndex * vImageIndex * 70);
vBtn.Caption := '人事' + inttostr(vImageIndex);
vBtn.Height := 60;
vBtn.Width := 60;
vBtn.Glyph.LoadFromFile('E:/Program/HSLL/tupian/nwepritue/test.bmp');
vBtn.Parent := vRzPageCotrolItem;
vRzGroup := TRzGroup.Create(nil);
RzGroupBar1.AddGroup(vRzGroup);
vRzGroup.Hint := Master.Fieldbyname('fr_FrmName').Text;
//name
vRzGroup.Caption := Master.Fieldbyname('fr_Model').Text;
//caption
vRzGroup.OnDblClick := vOpen;
New(PData);
PData.RzPG := vRzPageCotrol;
PData.RzPGName := Master.Fieldbyname('fr_FrmName').Text;
//loadFlow();
Master.Next;
end;
finally
Master.EnableControls;
end;
end;
为何点击任一个动态创建的rzGroup都执行同一个事件?
procedure vOnClick(sender: TObject);
procedure vOpen(Sender: TObject);
procedure vClick(Sender: TObject);
procedure btnCloseClick(Sender: TObject);
private
PData: PNodeData;
vRzPageCotrolItem: TRzTabSheet;
vRzPageCotrol: TRzPageControl;
vRzGroup: TRzGroup;
{ Private declarations }
public
{ Public declarations }
end;
var
frm_Mainform: Tfrm_Mainform;
implementation
{$R *.dfm}
{ Tfrm_Mainform }
procedure Tfrm_Mainform.vOnClick(sender: TObject);
begin
ShowMessage('00000');
end;
procedure Tfrm_Mainform.vOpen(Sender: TObject);
begin
// ShowMessage(vRzPageCotrol.Name);
if vRzPageCotrol.Align= alClient then
begin
vRzPageCotrol.Align:=alNone;
vRzPageCotrol.Left:=333
end
else
vRzPageCotrol.Align := alClient;
vRzPageCotrol.BringToFront;
end;
procedure Tfrm_Mainform.vClick(Sender: TObject);
begin
vRzPageCotrol.Align := alClient;
end;
procedure Tfrm_Mainform.FormCreate(Sender: TObject);
var
vBtn: TfcShapeBtn;
vRzGItem: TRzGroupItem;
vImageIndex: Integer;
begin
Master.Open;
Detail.Open;
Detail.Filtered := true;
try
Master.DisableControls;
vImageIndex := 0;
Master.First;
while not Master.Eofdo
begin
inc(vImageIndex);
vRzPageCotrol := TRzPageControl.Create(nil);
// 1.创建pagecontrol
vRzPageCotrol.Top := 128 + (vImageIndex * vImageIndex * 80);
vRzPageCotrol.Left := 200;
vRzPageCotrol.Width := 300;
vRzPageCotrol.Align := alNone;
vRzPageCotrol.Name :='page'+Master.Fieldbyname('fr_FrmName').Text;
vRzPageCotrol.Parent := Panel1;
vRzPageCotrol.OnClick:=vClick;
vRzPageCotrolItem := TRzTabSheet.Create(nil);
//2.在pagecotrol中加一个tabsheet
vRzPageCotrolItem.Caption := Master.Fieldbyname('fr_Model').Text + '流程图';
vRzPageCotrolItem.PageControl := vRzPageCotrol;
vBtn := TfcShapeBtn.Create(nil);
//3.然后在tabsheet中加一个按钮
vBtn.Left := 211;
vBtn.Top := 138 + (vImageIndex * vImageIndex * 70);
vBtn.Caption := '人事' + inttostr(vImageIndex);
vBtn.Height := 60;
vBtn.Width := 60;
vBtn.Glyph.LoadFromFile('E:/Program/HSLL/tupian/nwepritue/test.bmp');
vBtn.Parent := vRzPageCotrolItem;
vRzGroup := TRzGroup.Create(nil);
RzGroupBar1.AddGroup(vRzGroup);
vRzGroup.Hint := Master.Fieldbyname('fr_FrmName').Text;
//name
vRzGroup.Caption := Master.Fieldbyname('fr_Model').Text;
//caption
vRzGroup.OnDblClick := vOpen;
New(PData);
PData.RzPG := vRzPageCotrol;
PData.RzPGName := Master.Fieldbyname('fr_FrmName').Text;
//loadFlow();
Master.Next;
end;
finally
Master.EnableControls;
end;
end;
为何点击任一个动态创建的rzGroup都执行同一个事件?