1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- unit StandardLibsFme;
- interface
- uses
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, JimPages, JimTabs, StandardBillsFme, UtilMethods, StandardLibs;
- type
- TStandardLibsFrame = class(TFrame)
- jtsStandardLibs: TJimTabSet;
- jpStandardLibs: TJimPages;
- jpStandardLibsXm: TJimPage;
- jpStandardLibsGcl: TJimPage;
- procedure jtsStandardLibsChange(Sender: TObject; NewTab: Integer;
- var AllowChange: Boolean);
- private
- FGclBillsFrame: TStandardBillsFrame;
- FXmBillsFrame: TStandardBillsFrame;
- FStandardLibs: TStandardLibs;
- function CreateBillsFrame(AParent: TWinControl; ABillsType: TBillsType): TStandardBillsFrame;
- public
- constructor Create(AStandardLibs: TStandardLibs);
- destructor Destroy; override;
- procedure ConnectStandardLibs;
- property StandardLibs: TStandardLibs read FStandardLibs;
- property XmBillsFrame: TStandardBillsFrame read FXmBillsFrame;
- property GclBillsFrame: TStandardBillsFrame read FGclBillsFrame;
- end;
- implementation
- {$R *.dfm}
- { TFrame1 }
- procedure TStandardLibsFrame.ConnectStandardLibs;
- begin
- FXmBillsFrame.ConnectStandardLib;
- FGclBillsFrame.ConnectStandardLib;
- end;
- constructor TStandardLibsFrame.Create(AStandardLibs: TStandardLibs);
- begin
- inherited Create(nil);
- FStandardLibs := AStandardLibs;
- FXmBillsFrame := CreateBillsFrame(jpStandardLibsXm, btXm);
- FGclBillsFrame := CreateBillsFrame(jpStandardLibsGcl, btGcl);
- ConnectStandardLibs;
- end;
- function TStandardLibsFrame.CreateBillsFrame(AParent: TWinControl;
- ABillsType: TBillsType): TStandardBillsFrame;
- begin
- Result := TStandardBillsFrame.Create(FStandardLibs);
- Result.BillsType := ABillsType;
- AlignControl(Result, AParent, alClient);
- end;
- destructor TStandardLibsFrame.Destroy;
- begin
- FXmBillsFrame.Free;
- FGclBillsFrame.Free;
- inherited;
- end;
- procedure TStandardLibsFrame.jtsStandardLibsChange(Sender: TObject;
- NewTab: Integer; var AllowChange: Boolean);
- begin
- jpStandardLibs.ActivePageIndex := NewTab;
- end;
- end.
|