| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- unit PriceMarginFme;
- interface
- uses
- ProjectGLFme, PriceMarginBillsFme, LeafXmjGlFme,
- ProjectData,
- Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
- Dialogs, ExtCtrls, JimPages, ComCtrls, ToolWin, XPMenu;
- type
- TPriceMarginFrame = class(TFrame)
- pnlTopTag: TPanel;
- tbTopTag: TToolBar;
- tobtnBills: TToolButton;
- tobtnGL: TToolButton;
- jpsPriceMargin: TJimPages;
- jpsPriceMarginBills: TJimPage;
- jpsPriceMarginGL: TJimPage;
- xpm: TXPMenu;
- tobtnLeafXmj: TToolButton;
- jpsPriceMarginLeafXmj: TJimPage;
- procedure tobtnBillsClick(Sender: TObject);
- private
- FProjectData: TProjectData;
- FProjectGLFrame: TProjectGLFrame;
- FPriceMarginBillsFrame: TPriceMarginBillsFrame;
- FLeafXmjGlFrame: TLeafXmjGlFrame;
- public
- constructor Create(AProjectData: TProjectData);
- destructor Destroy; override;
- procedure RefreshBills;
- procedure ResetViewControl;
- end;
- implementation
- uses
- UtilMethods;
- {$R *.dfm}
- { TPriceMarginFrame }
- constructor TPriceMarginFrame.Create(AProjectData: TProjectData);
- begin
- inherited Create(nil);
- FProjectData := AProjectData;
- FProjectGLFrame := TProjectGLFrame.Create(FProjectData.ProjectGLData);
- AlignControl(FProjectGLFrame, jpsPriceMarginGL, alClient);
- FPriceMarginBillsFrame := TPriceMarginBillsFrame.Create(FProjectData.PriceMarginBillsData);
- AlignControl(FPriceMarginBillsFrame, jpsPriceMarginBills, alClient);
- FLeafXmjGlFrame := TLeafXmjGlFrame.Create(FProjectData.LeafXmjGlData);
- AlignControl(FLeafXmjGlFrame, jpsPriceMarginLeafXmj, alClient);
- end;
- destructor TPriceMarginFrame.Destroy;
- begin
- FLeafXmjGlFrame.Free;
- FPriceMarginBillsFrame.Free;
- FProjectGLFrame.Free;
- inherited;
- end;
- procedure TPriceMarginFrame.RefreshBills;
- begin
- FProjectData.PriceMarginBillsData.RefreshBills;
- FProjectData.LeafXmjGlData.RefreshLeafXmj;
- end;
- procedure TPriceMarginFrame.ResetViewControl;
- begin
- FProjectGLFrame.ResetViewControl;
- FPriceMarginBillsFrame.ResetViewControl;
- FLeafXmjGlFrame.ResetViewControl;
- end;
- procedure TPriceMarginFrame.tobtnBillsClick(Sender: TObject);
- begin
- tobtnGL.Down := tobtnGL.Tag = TToolButton(Sender).Tag;
- tobtnBills.Down := tobtnBills.Tag = TToolButton(Sender).Tag;
- tobtnLeafXmj.Down := tobtnLeafXmj.Tag = TToolButton(Sender).Tag;
- jpsPriceMargin.ActivePageIndex := TToolButton(Sender).Tag;
- end;
- end.
|