|
|
@@ -5,7 +5,8 @@ interface
|
|
|
uses
|
|
|
LeafXmjGlDm,
|
|
|
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
|
|
- Dialogs, XPMenu, ComCtrls, ToolWin, sdGridDBA, ExtCtrls, ZJGrid;
|
|
|
+ Dialogs, XPMenu, ComCtrls, ToolWin, sdGridDBA, ExtCtrls, ZJGrid,
|
|
|
+ ActnList, dxBar;
|
|
|
|
|
|
type
|
|
|
TLeafXmjGlFrame = class(TFrame)
|
|
|
@@ -18,6 +19,16 @@ type
|
|
|
xpm: TXPMenu;
|
|
|
zgLeafXmjGL: TZJGrid;
|
|
|
saLeafXmjGL: TsdGridDBA;
|
|
|
+ dxpmLeafXmj: TdxBarPopupMenu;
|
|
|
+ alLeafXmjGl: TActionList;
|
|
|
+ actnFilterCur: TAction;
|
|
|
+ actnFilterEnd: TAction;
|
|
|
+ actnWithoutFilter: TAction;
|
|
|
+ procedure dxpmLeafXmjPopup(Sender: TObject);
|
|
|
+ procedure actnFilterCurUpdate(Sender: TObject);
|
|
|
+ procedure actnFilterCurExecute(Sender: TObject);
|
|
|
+ procedure zgLeafXmjMouseDown(Sender: TObject; Button: TMouseButton;
|
|
|
+ Shift: TShiftState; X, Y: Integer);
|
|
|
private
|
|
|
FLeafXmjGlData: TLeafXmjGlData;
|
|
|
public
|
|
|
@@ -30,7 +41,7 @@ type
|
|
|
implementation
|
|
|
|
|
|
uses
|
|
|
- ProjectData;
|
|
|
+ ProjectData, UtilMethods, MainFrm;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
@@ -55,4 +66,38 @@ begin
|
|
|
saLeafXmjGL.Columns.ColumnByName('UsedQuantity').ReadOnly := StageDataReadOnly;
|
|
|
end;
|
|
|
|
|
|
+procedure TLeafXmjGlFrame.dxpmLeafXmjPopup(Sender: TObject);
|
|
|
+begin
|
|
|
+ SetDxBtnAction(actnWithoutFilter, MainForm.dxbtnWithoutFilter);
|
|
|
+ SetDxBtnAction(actnFilterCur, MainForm.dxbtnFilterCur);
|
|
|
+ SetDxBtnAction(actnFilterEnd, MainForm.dxbtnFilterEnd);
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TLeafXmjGlFrame.actnFilterCurUpdate(Sender: TObject);
|
|
|
+begin
|
|
|
+ if TProjectData(FLeafXmjGlData.ProjectData).ProjProperties.LeafXmjGlFilterType = TAction(Sender).Tag then
|
|
|
+ begin
|
|
|
+ if TAction(Sender).ImageIndex <> 43 then
|
|
|
+ TAction(Sender).ImageIndex := 43;
|
|
|
+ end
|
|
|
+ else
|
|
|
+ begin
|
|
|
+ if TAction(Sender).ImageIndex <> -1 then
|
|
|
+ TAction(Sender).ImageIndex := -1;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TLeafXmjGlFrame.actnFilterCurExecute(Sender: TObject);
|
|
|
+begin
|
|
|
+ TProjectData(FLeafXmjGlData.ProjectData).ProjProperties.LeafXmjGlFilterType := TAction(Sender).Tag;
|
|
|
+ FLeafXmjGlData.RefreshLeafXmj;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TLeafXmjGlFrame.zgLeafXmjMouseDown(Sender: TObject;
|
|
|
+ Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
|
|
+begin
|
|
|
+ if Button = mbRight then
|
|
|
+ dxpmLeafXmj.PopupFromCursorPos;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|